The pointercrate API

This is the documentation for the pointercrate application programming interface (short: API). If you dont know what an API is or have no idea how you even got to this page, this link takes you back to the demonlist. If you rather want to read source code of the implementation directly, head over to the github repository instead. It also contains the markdown files these documentation pages are generated from, so if you find any error here feel free to submit a pull request!

The API can be used to retrieve data about the demonlist and is internally used to manage it. All endpoints described here are located under https://pointercrate.com/api/v1/ unless a different api version is explicitly provided, in which case the v1 part of the URL needs to be amended. Currently, there are only a few endpoints using a v2 scheme.

It is always good practice setting the Accept header in requests to application/json (or at least give application/json a higher preference than text/html), so that in case of errors, you receive a JSON response instead of the HTML error page.

All HTTP traffic is automatically redirected to HTTPS. All requests to URLs without a trailing slash are automatically redirected to URLs with one.

Errors

In case of a client or server error, the API returns an error response. Errors that are specific to a given endpoint are always listed in that endpoint’s documentation. Following is an exhaustive list of errors that can occur at any endpoint in the API. Note that the errors with status code 500 INTERNAL SERVER ERROR should (obviously) not occur and are only listed for completeness sake. An complete list of all errors can be found at the bottom on this page.

Status code Error code Description Data
40040002A header in the request was malformed and couldn’t be processedheader: The name of the malformed header
40540500405 METHOD NOT ALLOWED errorallowed_methods: A list of allowed HTTP methods
40940900409 CONFLICT error-
41241200If-Match header doesn’t match current state-
41841800No If-Match header was provided-
50050000Unexpected server error-
50350300Endpoint down for maintenance-

In the case that you do not receive any response at all, or receive an Apache/Nginx error page you can assume that the pointercrate server crashed and couldn’t recover. If this is the case all hope is lost.

409 versus 412

The cases in which a 409 CONFLICT error or a 412 PRECONDITION FAILED error is returned are very similar. In fact, handling for both errors should probably be identical.

Both cases need to be handled the same way: re-GET the object to retrieve its updated ETag and retry the request.

Authentication

Basic

Some endpoints in the API require HTTP Basic Authentication. Since all communication is enforced via HTTPS, this is OK.

Access tokens

Pointercrate requires a valid access token for most endpoints. Tokens are JSON Web Tokens and are retrieved via the login endpoint.

When required, set the Authorization header to: Bearer <access token>.

Cookies

Authentication via cookies is theoretically possible but not usable for API access. Attempts will result in a 401 UNAUTHORIZED.

Permissions

Different endpoints require different permissions. Permissions are stored as a bitmask, and higher permissions imply lower ones transitively.

Permission Bit Description Implies Assigns
LIST_HELPER0x2Reviewing recordsNoneNone
LIST_MODERATOR0x4Moderating the demonlistLIST_HELPERNone
LIST_ADMINISTRATOR0x8Administrating the demonlistLIST_MODERATORLIST_HELPER, LIST_MODERATOR
MODERATOR0x2000User list accessNoneNone
ADMINISTRATOR0x4000User managementMODERATORLIST_ADMINISTRATOR

Pagination and Filtering

Some endpoints support pagination due to large result sets. Pagination is handled via query parameters such as limit, after, and before.

Pagination Query Parameters

Parameter Description Default
limitMaximum objects to return (1–100)50
afterID of last object from previous pagenull
beforeID of first object from next pagenull

Filtering

Example: /api/v1/records/?after=200&limit=10&status=APPROVED&progress__lt=100

External Videos

Pointercrate accepts videos from specific hosts and normalizes URLs into a single format per host.

Accepted Video Hosts

Host Normalized URL
YouTubehttps://www.youtube.com/watch?v={id}
Twitchhttps://www.twitch.tv/videos/{id}
Everyplayhttps://everyplay.com/videos/{id}
Vimeohttps://vimeo.com/{id}
Bilibilihttps://www.bilibili.com/video/{id}

List of Errors

The API aims to provide detailed errors wherever possible. Generic errors should be rare. Suggestions for better error communication are welcome via GitHub issues.

Status code Error code Description Data
40040000A generic 400 BAD REQUEST error-
40040001Provided video or channel URL was malformed-
40040002A header in the request was malformed and couldn’t be processedheader: The name of the malformed header
40140100A generic 401 UNAUTHORIZED error-
40340300A generic 403 FORBIDDEN error-
40340301You do not have the permissions required to perform this requestrequired: Permission bitmasks
40340302Attempt to delete your own account via administrative endpoints-
40340303Attempt to modify your own account via administrative endpoints-
40340304You have been banned from submitting records-
40340305Attempt to assign non-assignable permissionsnon_assignable: Permission bitmasks
40340306The claim you are trying to modify is unverified-
40340307Attempt to geolocate through a VPN was detected-
40340308Not authorized to submit a record for this player-
40440400A generic 404 NOT FOUND error-
40440401Referenced object could not be founddepends on endpoint
40540500405 METHOD NOT ALLOWED errorallowed_methods
40940900409 CONFLICT error-
40940902Username already in use-
40940905Player already registered as a creator-
40940906Duplicate video when patching recordid: Record ID
40940907Subnation set without nation-
40940908Conflicting verified user claims during mergeplayer1, player2
41141100411 LENGTH REQUIRED error-
41241200412 PRECONDITION FAILED-
41341300413 PAYLOAD TOO LARGE-
41541500415 UNSUPPORTED MEDIA TYPEexpected: application/json
42242200A generic 422 UNPROCESSABLE ENTITY error-
42242202Username too short or not trimmed-
42242204Password too short-
42242207Invalid pagination limit-
42242212Record requirement out of bounds-
42242213Demon added out-of-boundsmaximal
42242215Invalid record progressrequirement
42242217Duplicate record submissionstatus, existing
42242218Record holder is banned-
42242219Legacy demon record submitted-
42242220Non-100% record on extended list-
42242222Invalid URL protocol-
42242223Authentication info in URL-
42242224Unsupported video host-
42242225Video URL format mismatchexpected
42242226YouTube URL expected-
42242227Pagination after < before-
42242228Ambiguous demon namedemons
42242229Mutually exclusive fields used-
42242230Record note is empty-
42242231Player already has verified claim-
42242232Missing raw footage-
42242233Invalid raw footage URL-
42242234Password change not supported-
42242235Invalid Geometry Dash level ID-
42842800Missing If-Match header-
42942900Rate limitedremaining
50050000Unexpected server state-
50050003Database access error-
50050004Database timeout-
50050005Database connection failure-
50350301Server in maintenance mode-