Disc0rd API Documentation

NOTICE: I just want to make it clear that while it probably won't, the API could change. I'll do my best to update this page if I do change it, and also provide legacy APIs when I do change it.

URL Scheme

All API URLs begin with /api/. It's pretty simple. Some special routes like /video (redirects to a random video) and the legacy /json.html (just returns a list of filenames) are exceptions.

Responses

Responses are always encoded as JSON and return the type application/json. Except for the exceptions listed above, all endpoints will return a field named status. It will be either success or error. In the case of error, an extra field named error will be provided containing an error message.

Video Endpoints

All videos are served from the static.termer.net domain. Videos used to be served from discord.xyz but have been moved over to another system hosted on that domain. All the old https://disc0rd.xyz/video/<FILENAME> links still work, they just redirect to static.termer.net now.

GET /api/videos

Returns an array of videos.

Parameters:
offset (optional): Integer at least 0, the offset of results. Defaults to 0.
limit (optional): Integer between 0 and 100, the amount of results to return. Defaults to 100.

Example response:

{
    "status": "success",
    "videos": [
        {
            "id": "tqt7qxdy5v",
            "name": "Luigi, don't be a dinophobe",
            "filename": "luigi_dont_be_a_dinophobe.mp4",
            "created_on": "2020-07-27T17:39:05.949127Z",
            "size": 920566,
            "hash": "gNE+MHXaDVs630sym1VJoOZBb4cThwECwH7z4tv3TeQ=",
            "url": "https://static.termer.net/download/tqt7qxdy5v/luigi_dont_be_a_dinophobe.mp4"
        }
    ]
}
            

GET /api/videos/search

Returns an array of videos based on the specified search term.

Parameters:
offset (optional): Integer at least 0, the offset of results. Defaults to 0.
limit (optional): Integer between 0 and 100, the amount of results to return. Defaults to 100.
order (optional): Integer between 0 and 5, the order to return results. Defaults to 0. (0 = Creation date, newest to oldest, 1 = Creation date, oldest to newest, 2 = Name alphabetically, ascending, 3 = Name alphabetically descending, 4 = Size, largest to smallest, 5 = Size, smallest to largest)
query (optional): String, the search query. Can be empty to return everything. Defaults to empty.

Example response:

{
    "status": "success",
    "videos": [
        {
            "id": "tqt7qxdy5v",
            "name": "Luigi, don't be a dinophobe",
            "filename": "luigi_dont_be_a_dinophobe.mp4",
            "created_on": "2020-07-27T17:39:05.949127Z",
            "size": 920566,
            "hash": "gNE+MHXaDVs630sym1VJoOZBb4cThwECwH7z4tv3TeQ=",
            "url": "https://static.termer.net/download/tqt7qxdy5v/luigi_dont_be_a_dinophobe.mp4"
        }
    ]
}