Skip to content

API (Saint)

The Holy Constituency of the Summer Triangle edited this page Mar 13, 2020 · 5 revisions

Since CSV dumps aren't a thing yet you can use the Saint private1 API to get cutoff information.

To retrieve basic info for the current event:

GET /api/private/saint/[sid]/current/setup.json

{
    "result": {
        "event_id": 30007,
        "start_time": "2020-01-22T06:00:00",
        "end_time": "2020-01-31T06:00:00",
        "result_time": "2020-01-31T09:00:00",
        "title_image": "https://tirofinale.kirara.ca/i/557a21/v1WbFPCgEa166Q.png"
    }
}

where sid is a server ID. The available server IDs are "jp" and "en".

You can also substitute "current" for an event ID to get the same information for that event.

To get tier information for an event:

GET /api/private/saint/[sid]/[eid]/tiers.json?back=1

{
    "result": {
        "is_new": true,
        "datasets": {
            "points.1000": [
                [
                    1579674545.991459,
                    22068
                ],
                ...
            ],
            "points.3000": [
                [
                    1579674545.991459,
                    8323
                ],
                ...
            ],
        }
    }
}

where sid is a server ID and eid is an event ID. Unlike the setup API, there is no magic value to request the current event.

You can specify either ?back=[hours] or ?after=[timestamp] to control the data you get back. If after is specified, the server only returns data observed after that time, and is_new will be false. If back is specified, or neither is specified, the server returns the last N hours worth of data. The default is 24 hours. If the timestamp you provide for ?after is too far away from the current time, it is treated as back=24 and the is_new flag will be set to true to indicate this.

Note: responses from a ?back request may be stale for performance reasons. If you intend to get the latest status, make a secondary ?after request to ensure the data is up to date.

1: In this case, private means that functionality and shape of the API may change at any time.

Clone this wiki locally