speedruncomorg / api

REST API Documentation for speedrun.com
346 stars 36 forks source link

[UX] Creation of a documentation for this splendid API #31

Open DarckCrystale opened 8 years ago

DarckCrystale commented 8 years ago

Description:

It would be nice to have some documentation explaining with details how to use the API.

Example:

To see the list of all runs: http://www.speedrun.com/api/v1/runs/ Will return:

{
    "data": [{
            "id": "1wzpqgyq",
            "weblink": "http://www.speedrun.com/run/1wzpqgyq",
            "game": "nj1ne1p4",
            "level": null,
            "category": "prklq2n9",
            "videos": {
                "links": [{
                        "uri": "https://www.youtube.com/watch?v=KKjPMD0aHaY"
                    }]
            },
            "comment": "bad RNG on frigate otherwise pretty solid",
            "status": {
                "status": "verified",
                "examiner": null,
                "verify-date": null
            },
            "players": [{
                    "rel": "user",
                    "id": "v48grxpr",
                    "uri": "http://www.speedrun.com/api/v1/users/v48grxpr"
                }],
            "date": "2013-06-10",
            "submitted": null,
            "times": {
                "primary": "PT21M52S",
                "primary_t": 1312,
                "realtime": "PT21M52S",
                "realtime_t": 1312,
                "realtime_noloads": null,
                "realtime_noloads_t": 0,
                "ingame": null,
                "ingame_t": 0
            },
            "system": {
                "platform": "ow31ev96",
                "emulated": false,
                "region": "pr184lqn"
            },
            "splits": null,
            "values": {},
            "links": [{
                    "rel": "self",
                    "uri": "http://www.speedrun.com/api/v1/runs/1wzpqgyq"
                }, {
                    "rel": "game",
                    "uri": "http://www.speedrun.com/api/v1/games/nj1ne1p4"
                }, {
                    "rel": "category",
                    "uri": "http://www.speedrun.com/api/v1/categories/prklq2n9"
                }, {
                    "rel": "platform",
                    "uri": "http://www.speedrun.com/api/v1/platforms/ow31ev96"
                }, {
                    "rel": "region",
                    "uri": "http://www.speedrun.com/api/v1/regions/pr184lqn"
                }]
        }, {
            ...
        }],
    "pagination": {
        "offset": 0,
        "max": 20,
        "size": 20,
        "links": [{
                "rel": "next",
                "uri": "http://www.speedrun.com/api/v1/runs?offset=20"
            }]
    }
}

For each function and valid url. It could be placed in a doc.md, like the readme and the information about connection.

Thx!

sgt-kabukiman commented 8 years ago

You mean https://github.com/speedruncom/api/tree/master/version1#examples ?

DarckCrystale commented 8 years ago

I'm sorry, I did not see it! Thanks :3 Maybe you could add in the Readme.md at https://github.com/speedruncom/api#versions a note to specify that the link point also to the documentation?