NAV
bash javascript

Info

Welcome to the generated API reference. Get Postman Collection

This documentation is generated automatically.

Introduction

We provide a simple REST API to integrate KeyJoker into your business or application.

This API reference provides information on available endpoints and how to interact with them.

Here are some use cases for the KeyJoker API:

API Access

Please note that you need to get whitelisted to use our API. You can write an email to [email protected] to apply for API access.

Errors

All responses that have an HTTP status code that is not in the 200 range are error responses.

Error responses always contain an error message.

Account

API endpoints for managing your own account.

Show account


Requires authentication This endpoint shows your account details, including your current credits balance.

Example request:

curl -X GET -G "https://www.keyjoker.com/api/account" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://www.keyjoker.com/api/account");

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "id": 1,
        "name": "Gaben",
        "email": "[email protected]",
        "credits": 9959130
    }
}

HTTP Request

GET api/account

Games

API endpoints for information about available games.

List games


Requires authentication This endpoint lists all games that currently have available keys.

Example request:

curl -X GET -G "https://www.keyjoker.com/api/games" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://www.keyjoker.com/api/games");

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": [
        {
            "id": 5,
            "platform": "Steam",
            "game_id": "885620",
            "name": "In The Fighting",
            "slug": "in-the-fightning",
            "image_url": "https:\/\/www.keyjoker.com\/storage\/images\/games\/Or4Q4cyFo5FCes77XbRgRc6LWBXqmTwIHMwLGwie.jpeg",
            "url_external": "https:\/\/store.steampowered.com\/app\/885620",
            "url_internal": "https:\/\/www.keyjoker.com\/giveaways\/in-the-fightning",
            "description": "In the game \"In battle\" your country will protect the way from enemy ships. At your disposal are several types of cannons, for which a number of forts are assigned.",
            "flags": [],
            "stock": 133
        },
        {
            "id": 8,
            "platform": "Steam",
            "game_id": "932940",
            "name": "Seems good archery game",
            "slug": "seems-good-archery-game-932940",
            "image_url": "https:\/\/www.keyjoker.com\/storage\/images\/games\/50554159a0fed3bbfd0f07689b803033.jpeg",
            "url_external": "https:\/\/store.steampowered.com\/app\/932940",
            "url_internal": "https:\/\/www.keyjoker.com\/giveaways\/seems-good-archery-game-932940",
            "description": "Seems good archery game - is simple archery game. You need eliminate all balloons and don't let run out...",
            "flags": [
                {
                    "id": 3,
                    "game_id": 8,
                    "name": "Steam Achievements",
                    "description": "This game has Steam achievements.",
                    "icon": "https:\/\/www.keyjoker.com\/images\/misc\/icon_steam_achievements.png"
                }
            ],
            "stock": 162
        }
    ]
}

HTTP Request

GET api/games

Keys

API endpoints for information about unlocked keys.

List keys


Requires authentication This endpoint lists all keys that you have unlocked so far.

Example request:

curl -X GET -G "https://www.keyjoker.com/api/keys" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://www.keyjoker.com/api/keys");

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": [
        {
            "id": 347,
            "key": "MH2CV-D8MDF-5FZ50",
            "game": {
                "id": 6,
                "platform": "Steam",
                "game_id": "879440",
                "name": "80's style",
                "slug": "80s-style",
                "image_url": "https:\/\/www.keyjoker.com\/storage\/images\/games\/6nSltO7nh1fuQGirebzAT6y1gdW7bOnPHaV9DHOf.jpeg",
                "url_external": "https:\/\/store.steampowered.com\/app\/879440",
                "url_internal": "https:\/\/www.keyjoker.com\/giveaways\/80s-style",
                "description": "The 80's are coming back! Before the first game consoles and computers appeared, children all over the world spent hours or even days behind slot machines, planting tons of trivia. Therefore, for those who are nostalgic for those times, we created this game."
            },
            "unlocked_at": 1561917680
        },
        {
            "id": 324,
            "key": "7D0FG-7G026-9KCFJ",
            "game": {
                "id": 5,
                "platform": "Steam",
                "game_id": "885620",
                "name": "In The Fighting",
                "slug": "in-the-fightning",
                "image_url": "https:\/\/www.keyjoker.com\/storage\/images\/games\/Or4Q4cyFo5FCes77XbRgRc6LWBXqmTwIHMwLGwie.jpeg",
                "url_external": "https:\/\/store.steampowered.com\/app\/885620",
                "url_internal": "https:\/\/www.keyjoker.com\/giveaways\/in-the-fightning",
                "description": "In the game \"In battle\" your country will protect the way from enemy ships. At your disposal are several types of cannons, for which a number of forts are assigned."
            },
            "unlocked_at": 1566124337
        }
    ]
}

HTTP Request

GET api/keys

Transactions

API endpoints for managing transactions.

Create transaction


Requires authentication This endpoint allows users to transfer their KeyJoker credits to another user.

Example request:

curl -X POST "https://www.keyjoker.com/api/transactions" \
    -H "Authorization: Bearer {token}" \
    -H "Content-Type: application/json" \
    -d '{"steamid":76561197972450702,"amount":50000}'
const url = new URL("https://www.keyjoker.com/api/transactions");

let headers = {
    "Authorization": "Bearer {token}",
    "Content-Type": "application/json",
    "Accept": "application/json",
}

let body = {
    "steamid": 76561197972450702,
    "amount": 50000
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (201):

{
    "data": {
        "id": 3137498,
        "type": "User Transaction",
        "amount": -50000
    }
}

Example response (404):

{
    "error": "The user was not found."
}

HTTP Request

POST api/transactions

Body Parameters

Parameter Type Status Description
steamid integer required The steamid64 of the recipient user.
amount integer required The amount of credits to transfer.

Users

API endpoints for managing users.

Show user


Requires authentication This endpoint shows a single user for the provided steamid64.

Example request:

curl -X GET -G "https://www.keyjoker.com/api/users/{steamid}" \
    -H "Authorization: Bearer {token}"
const url = new URL("https://www.keyjoker.com/api/users/{steamid}");

let headers = {
    "Authorization": "Bearer {token}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "data": {
        "id": 734821,
        "name": "Gaben"
    }
}

Example response (404):

{
    "error": "The user was not found."
}

HTTP Request

GET api/users/{steamid}