Skip to main content

Getting Started

The most basic but also the most powerful way of using GameRank, the HTTPs REST API gives you access to all GameRank features through HTTP calls.

Basics

API key header

Every HTTP call must include an API key in the adequate HTTP header. For scoreboards and timeboards the Leaderboard API key, for MMR the MMR category API key, etc.

The API key is available in the administration page, example for a scoreboard:

Display Apikey

info

This API key must be set in the x-gr-apikey HTTP header.

Example using cURL to send a player score:

curl --request POST                                                 \
--header "x-gr-apikey: c0b96e9906264d739e66fe97c94b11db" \
--header "Content-Type: application/json" \
--data '{"score":32427,"username":"ProGamer","userid":"12345"}' \
https://api.gamerank.io/scoreboard/submit

If the API Key header is not set or set with an invalid API key, an HTTP 404 Not Found response status code is returned.

Response

Success

On success, an HTTP 200 OK response is returned.

Errors

Errors types will be represented by the HTTP response status code.

A JSON object will be part of the response with an error field containing a short description with more information.

User IDs

In order to identify your players through multiple scores, you can provide an user unique identifier.

info

The valid format for an user ID is ASCII alpha-numerical characters only: [a-zA-Z0-9]*

If you don't provide an ID when submitting a score through the Submit score endpoint, GameRank will generate a random one and returns it in the HTTP response. The same is true for the Submit time endpoint.

danger

This user unique identifier should not contain any personal information about the user, any GameRank account not respecting this will be banned.

Features