Leaguepedia | League of Legends Esports Wiki
Advertisement
Leaguepedia | League of Legends Esports Wiki

Introduction[]

After Riot deprecated web match history, we archived all of the ACS jsons whose corresponding web MH URLs were in our system. This page documents how to retrieve them.

Parameter names[]

We already have internal IDs for every game that we refer to as GameId in our database tables. Therefore, we refer to ACS/v4 IDs as "Riot Platform Game IDs" to ensure there's no ambiguity at all. If you're using our API, you will encounter the following fields:

  • MatchId - Leaguepedia's key for a unique match (BO1, BO2, BO3, BO5)
  • GameId - Leaguepedia's key for a unique game
  • RiotPlatformGameId - the ID you have been using to interact with ACS, the v4 API, etc

What about gameHash?[]

While this string was needed to access ACS, it's not required in order to uniquely identify a game. Therefore, we DID import it, and you CAN still find it in our [MatchScheduleGame] table as RiotGameHash, in case you want to use the wiki to find ACS urls until ACS is sunset. However, it's NOT part of our naming scheme.

Json locations[]

You can find jsons at the following locations:

  • V4 data:<RiotPlatformGameId>
  • V4 data:<RiotPlatformGameId>/Timeline

For example:

Note that the wiki is space/underscore agnostic (for page titles!!! not for Cargo!!!), so the following is also valid:

Accessing the Leaguepedia API[]

Main article: Help:Leaguepedia API

The endpoint is https://lol.fandom.com/api.php, so an example action looks like https://lol.fandom.com/api.php?action=cargoquery (plus the extra params), and to sandbox you can visit Special:ApiSandbox. Please note, all queries executed there are actually executed; if you have write permissions to this wiki, please do not use the edit - or delete - actions lightly!

Locating a Riot Platform Game Id[]

As mentioned before, you can query [MatchScheduleGame] to locate a RiotPlatformGameId (from now on referred to as RPGId). For more information about querying our Cargo tables, see Help:Leaguepedia API. Here's an example query:

https://lol.fandom.com/api.php?action=cargoquery&format=json&limit=max&tables=MatchScheduleGame%3DMSG%2C%20MatchSchedule%3DMS&fields=RiotPlatformGameId%2C%20Blue%2C%20Red&where=MSG.OverviewPage%3D'LCS%2F2021%20Season%2FChampionship'&join_on=MSG.MatchId%3DMS.MatchId&order_by=MS.DateTime_UTC%20ASC

{
	"action": "cargoquery",
	"limit": "max",
	"tables": "MatchScheduleGame=MSG, MatchSchedule=MS",
	"fields": "RiotPlatformGameId, Blue, Red",
	"where": "MSG.OverviewPage='LCS/2021 Season/Championship'",
	"join_on": "MSG.MatchId=MS.MatchId",
	"order_by": "MS.DateTime_UTC ASC"
}

And here's a snippet of the response you would get:

{
    "limits": {
        "cargoquery": 500
    },
    "cargoquery": [
        {
            "title": {
                "RiotPlatformGameId": "ESPORTSTMNT03_2055040",
                "Blue": "Dignitas",
                "Red": "Evil Geniuses.NA"
            }
        },
        {
            "title": {
                "RiotPlatformGameId": "ESPORTSTMNT03_2054997",
                "Blue": "Evil Geniuses.NA",
                "Red": "Dignitas"
            }
        },
    ]
}

Note that the format is slightly weird - each item of the response is wrapped in this "title" container. That's not something I have control over, we're piggybacking on the built-in Cargo API (not the Rust package manager) and it's just formatted this way.

Getting game data from RPGId[]

Once you have the RPGId, you will want to fetch game data from it. This is NOT done via a Cargo query, instead you use the query method of the MediaWiki API. Here's an example query:

https://lol.fandom.com/api.php?action=query&format=json&prop=revisions&titles=V4%20data%3ABR1%201926164473%2FTimeline%7CV4%20data%3ABR1%201926164473&rvprop=content&rvslots=main

{
	"action": "query",
	"format": "json",
	"prop": "revisions",
	"titles": "V4 data:BR1 1926164473/Timeline|V4 data:BR1 1926164473",
	"rvprop": "content",
	"rvslots": "main"
}

And here's a curtailed snippet of the response, you can see that the page content is available as the ["*"] parameter, and also the jsons have a lot of escaping:

{
    "batchcomplete": "",
    "query": {
        "pages": {
            "592455": {
                "pageid": 592455,
                "ns": 10028,
                "title": "V4 data:BR1 1926164473",
                "revisions": [
                    {
                        "slots": {
                            "main": {
                                "contentmodel": "json",
                                "contentformat": "application/json",
                                "*": "{\n    \"gameId\": 1926164473,\n"
                            }
                        }
                    }
                ]
            },
            "592456": {
                "pageid": 592456,
                "ns": 10028,
                "title": "V4 data:BR1 1926164473/Timeline",
                "revisions": [
                    {
                        "slots": {
                            "main": {
                                "contentmodel": "json",
                                "contentformat": "application/json",
                                "*": "{\n    \"gameId\": 1926164473,\n    \"platformId\": \"BR1\",\n"
                            }
                        }
                    }
                ]
            }
        }
    }
}

The response is keyed by page id, which is not a value that you will know at the time of querying; therefore, you will have to iterate through all keys and compare title to what you are looking for and see if it happens to match. Again, sorry, I didn't design this thing.

Library support[]

My library mwrogue provides a simple method get_v4_data_and_timeline on an EsportsClient that will return the data & timeline of a game when supplied the RPGId. It's still up to you to find the RPGId, and if you want to query multiple RPGIds at once (which is supported by the API, separate them with a | in your request), that's also up to you; however, for simple use cases this is equivalent to being able to query ACS for a single game.

Advertisement