Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update leaderboard.md - add variables section #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 13 additions & 3 deletions version1/leaderboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ Query Parameter | Type | Description
``date`` | string | [ISO 8601 date string](https://en.wikipedia.org/wiki/ISO_8601#Dates); when given, only returns runs done before or on this date
``var-___`` | string | additional custom variable values (see below)

To filter by custom variables, name the query string parameter ``var-[variable ID here]`` and use the
value ID as the value (for example, ``?var-m5ly6jn4=p12z471x``).

##### Example Requests

* [**GET /api/v1/leaderboards/xldev513/category/rklg3rdn**](https://www.speedrun.com/api/v1/leaderboards/xldev513/category/rklg3rdn)
Expand Down Expand Up @@ -145,3 +142,16 @@ as expected and redirect to the ID-based URLs).
"data": <leaderboard>
}
```

### Specifying custom variables

Subcategories will return the fastest times only within parameters of the request. This means that if the subcategory is **not** specified as a variable in the request, only fastest time for the player across **all** variable options will be returned.

To filter by custom variables, name the query string parameter ``var-[variable ID here]`` and use the
value ID as the value (for example, ``?var-m5ly6jn4=p12z471x``, where ``m5ly6jn4`` is the variable ID and ``p12z471x`` is the variable value).

##### Example Requests

* [**GET /api/v1/leaderboards/4pdv9k1w/category/rklx4wkn?var-6wl339l1=45lmxy1v&var-32lgg3lp=45lmdylv**](https://www.speedrun.com/api/v1/leaderboards/4pdv9k1w/category/rklx4wkn?var-6wl339l1=45lmxy1v&var-32lgg3lp=45lmdylv)
will return the "Any%" leaderboard for GTA Vice City Chaos%, filtered by Version (1.02) and Difficulty (Easy).