Git Product home page Git Product logo

vlrggapi's Introduction

vlrggapi

An Unofficial REST API for vlr.gg, a site for Valorant Esports match and news coverage.

Built by Andre Saddler

Current Endpoints

All endpoints are relative to https://vlrggapi.vercel.app.

/news

  • Method: GET
  • Description: Fetches the latest news articles related to Valorant Esports.
  • Response Example:
{
  "data": {
    "status": 200,
    "segments": [
      {
        "title": "Riot introduces changes to Premier, adds new Invite Division",
        "description": "Riot looks to streamline Premier promotions and Challengers qualification with upcoming changes.",
        "date": "April 23, 2024",
        "author": "thothgow",
        "url_path": "https://vlr.gg/336099/riot-introduces-changes-to-premier-adds-new-invite-division"
      },
      {
        "title": "jakee announces competitive retirement",
        "description": "From Collegiate to the Tier 1 stage, the Controller main had seen it all.",
        "date": "April 21, 2024",
        "author": "ChickenJoe",
        "url_path": "https://vlr.gg/334341/jakee-announces-competitive-retirement"
      }
    ]
  }
}

/stats/{region}/{timespan}

  • Method: GET

  • Description: Fetches player statistics for a specific region and timespan.

  • Parameters:

    • region: Region shortnames (e.g., "na" for North America).
    • timespan: Time span in days (e.g., "30" for the last 30 days).
  • Response Example:

{
  "data": {
    "status": 200,
    "segments": [
      {
        "player": "corey",
        "org": "TTR",
        "rating": "1.18",
        "average_combat_score": "235.2",
        "kill_deaths": "1.19",
        "kill_assists_survived_traded": "72%",
        "average_damage_per_round": "158.4",
        "kills_per_round": "0.81",
        "assists_per_round": "0.29",
        "first_kills_per_round": "0.19",
        "first_deaths_per_round": "0.13",
        "headshot_percentage": "26%",
        "clutch_success_percentage": "28%"
      },
      {
        "player": "wedid",
        "org": "TTR",
        "rating": "1.15",
        "average_combat_score": "216.1",
        "kill_deaths": "1.11",
        "kill_assists_survived_traded": "72%",
        "average_damage_per_round": "141.0",
        "kills_per_round": "0.76",
        "assists_per_round": "0.39",
        "first_kills_per_round": "0.07",
        "first_deaths_per_round": "0.10",
        "headshot_percentage": "32%",
        "clutch_success_percentage": "19%"
      }
    ]
  }
}

/rankings/{region}

  • Method: GET
  • Description: Fetches rankings for a specific region.
  • Parameters:
    • region: Region shortnames (e.g., "na" for North America).
  • Response Example:
{
  "status": 200,
  "data": [
    {
      "rank": "1",
      "team": "M80",
      "country": "Canada",
      "last_played": "4d ago",
      "last_played_team": "vs. Turtle Tr",
      "last_played_team_logo": "//owcdn.net/img/63d552c5dd028.png",
      "record": "4-1",
      "earnings": "$104,850",
      "logo": "//owcdn.net/img/63d91e60a84bc.png"
    },
    {
      "rank": "2",
      "team": "Sentinels",
      "country": "United States",
      "last_played": "22h ago",
      "last_played_team": "vs. Evil Geniuses",
      "last_played_team_logo": "//owcdn.net/img/62a409ad29351.png",
      "record": "7-3",
      "earnings": "$295,500",
      "logo": "//owcdn.net/img/62875027c8e06.png"
    }
  ]
}

/match

  • Method: GET
  • Description: Fetches matches based on the query parameter provided.
  • Query Parameters:
    • q: Type of matches to fetch ("upcoming", "live_score", "results").
  • Response Example for q=upcoming:
{
  "data": {
    "status": 200,
    "segments": [
      {
        "team1": "G2 Esports",
        "team2": "Leviatán",
        "flag1": "flag_us",
        "flag2": "flag_cl",
        "time_until_match": "51m from now",
        "match_series": "Regular Season: Week 3",
        "match_event": "Champions Tour 2024: Americas Stage 1",
        "unix_timestamp": "2024-04-24 21:00:00",
        "match_page": "https://www.vlr.gg/314642/g2-esports-vs-leviat-n-champions-tour-2024-americas-stage-1-w3"
      }
    ]
  }
}
  • Response Example for q=live_score:
{
  "data": {
    "status": 200,
    "segments": [
      {
        "team1": "Team 1 Name",
        "team2": "Team 2 Name",
        "flag1": "Country Flag of Team 1",
        "flag2": "Country Flag of Team 2",
        "score1": "Team 1 Score",
        "score2": "Team 2 Score",
        "team1_round_ct": "Team 1 CT-side rounds",
        "team1_round_t": "Team 1 T-side rounds",
        "team2_round_ct": "Team 2 CT-side rounds",
        "team2_round_t": "Team 2 T-side rounds",
        "map_number": "Current map number in the series",
        "current_map": "Current map being played",
        "time_until_match": "LIVE",
        "match_event": "Event name",
        "match_series": "Match series",
        "unix_timestamp": "Match start time in UNIX timestamp",
        "match_page": "URL to the match page"
      }
    ]
  }
}
  • Response Example for q=results:
{
  "data": {
    "status": 200,
    "segments": [
      {
        "team1": "Team Vitality",
        "team2": "Gentle Mates",
        "score1": "0",
        "score2": "2",
        "flag1": "flag_eu",
        "flag2": "flag_fr",
        "time_completed": "2h 44m ago",
        "round_info": "Regular Season-Week 4",
        "tournament_name": "Champions Tour 2024: EMEA Stage 1",
        "match_page": "/318931/team-vitality-vs-gentle-mates-champions-tour-2024-emea-stage-1-w4",
        "tournament_icon": "https://owcdn.net/img/65ab59620a233.png"
      }
    ]
  }
}

/health

  • Method: GET
  • Description: Returns the health status of the API.
  • Response: Healthy: OK

Installation

Source

git clone https://github.com/axsddlr/vlrggapi/
cd vlrggapi
pip3 install -r requirements.txt

Usage

python3 main.py

Built With

Contributing

Feel free to submit a pull request or an issue!

License

The MIT License (MIT)

vlrggapi's People

Contributors

apoullet avatar axsddlr avatar chefski avatar fraecar avatar heismauri avatar matthewfritsch avatar officialtomj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vlrggapi's Issues

statistic players information not good

Hello, I wanted the statistics players of Europe but when I check the information, that was not good because vlr.gg add a new column (rating) and that's not be change since 2022 in the repository github
image
I propose this to change this
before :

       `color_sq = [stats.text() for stats in item.css("td.mod-color-sq")]
        acs = color_sq[0]
        kd = color_sq[1]
        kast = color_sq[2]
        adr = color_sq[3]
        kpr = color_sq[4]
        apr = color_sq[5]
        fkpr = color_sq[6]
        fdpr = color_sq[7]
        hs = color_sq[8]
        cl = color_sq[9]

        result.append(
            {
                "player": player_name,
                "org": org,
                "average_combat_score": acs,
                "kill_deaths": kd,
                "kill_assists_survived_traded": kast,
                "average_damage_per_round": adr,
                "kills_per_round": kpr,
                "assists_per_round": apr,
                "first_kills_per_round": fkpr,
                "first_deaths_per_round": fdpr,
                "headshot_percentage": hs,
                "clutch_success_percentage": cl,
            }
        )`

after :

      ` color_sq = [stats.text() for stats in item.css("td.mod-color-sq")]
        rat = color_sq[0]
        acs = color_sq[1]
        kd = color_sq[2]
        kast = color_sq[3]
        adr = color_sq[4]
        kpr = color_sq[5]
        apr = color_sq[6]
        fkpr = color_sq[7]
        fdpr = color_sq[8]
        hs = color_sq[9]
        cl = color_sq[10]

        result.append(
            {
                "player": player_name,
                "org": org,
                "rating": rat,
                "average_combat_score": acs,
                "kill_deaths": kd,
                "kill_assists_survived_traded": kast,
                "average_damage_per_round": adr,
                "kills_per_round": kpr,
                "assists_per_round": apr,
                "first_kills_per_round": fkpr,
                "first_deaths_per_round": fdpr,
                "headshot_percentage": hs,
                "clutch_success_percentage": cl,
            }
        )`

Player Stats

Hi, I noticed an issue when getting the player stats, the values are corresponding to the incorrect title and that the clutch success% is missing, when comparing the values
from the response and on vlr.
image
vlr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.