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 leaderboards the Leaderboard API key, for MMR the MMR category API key, etc.

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

Display Apikey

info

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

Example using cURL to send a player score:

curl -X POST                                                    \
-H "x-gr-apikey: c0b96e9906264d739e66fe97c94b11db" \
-H "Content-Type: application/json" \
-d '{"score":32427,"username":"ProGamer","userid":"12345"}' \
api.gamerank.io/leaderboard/score

If this 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 sending a score through the Send score endpoint, GameRank will generate a random one and returns it in the HTTP response.

danger

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

Features