# ChainCade API

### Welcome to the ChainCade API documentation.&#x20;

This API provides developers with access to player and statistical data for the ChainCade platform. Here, you will find information about available endpoints, their use, and the structure of their responses.

### Base URL All API routes should start with the following base URL:

<https://api.chaincade.com>

### Endpoints

<mark style="color:blue;">`GET`</mark> `https://api.chaincade.com/players`

This endpoint retrieves an array of all players with a ChainCade account.

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}

{% tab title="500: Internal Server Error " %}

{% endtab %}
{% endtabs %}

The response of the 'users' endpoint will be an array of player objects, each having the following structure:

```json
{
"address": "0x23ea7c29f51222a5997ea3892a3d9f04b57898ae",
"displayName": "Neytiri",
"rank": "Meta Lord",
"rankId": 7,
"accountAge": 447,
"isFounder": true,
"totalTickets": 1004905,
"xp": 10150571
}
```

<mark style="color:blue;">`GET`</mark> `https://api.chaincade.com/stats`

This endpoint retrieves important statistics for the ChainCade platform.

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}

{% tab title="500: Internal Server Error " %}

{% endtab %}
{% endtabs %}

The response of the 'stats' endpoint will be a single JSON object containing the following fields:

```json
{
"totalPlayers": 2570,
"avgAccountAge": 38.14241245136187,
"numOfFounders": 78,
"avgPlayerLevel": 2.451750972762646,
"totalXP": 160953876,
"totalTickets": 22607436,
"topXPEarners": [ // Top 3 XP earners as player objects ],
"topRankers": [ // Top 3 rankers as player objects ],
"topTicketEarners": [ // Top 3 ticket earners as player objects ] 
}
```

<mark style="color:blue;">`GET`</mark> `https://api.chaincade.com/player/walletaddress`

This endpoint retrieves a player by their wallet address.

#### Path Parameters

| Name                                            | Type   | Description            |
| ----------------------------------------------- | ------ | ---------------------- |
| walletaddress<mark style="color:red;">\*</mark> | String | Players wallet address |

{% tabs %}
{% tab title="200: OK " %}

{% endtab %}

{% tab title="500: Internal Server Error " %}

{% endtab %}
{% endtabs %}

The response will be a single JSON object representing the player with the following fields:

```json
{ 
"address": "0x98c072c4f65307aa5caa78305eec9445f5263aff", 
"displayName": "Lazy", 
"rank": "Captain", 
"rankId": 4, 
"accountAge": 461, 
"isFounder": true, 
"totalTickets": 59183, 
"xp": 2323948 
}
```

### Usage&#x20;

All requests to the ChainCade API are GET requests. To access the API, simply send an HTTP GET request to the desired endpoint.

For example, to get all players, you would send a request to <https://api.chaincade.com/players>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chaincade.gitbook.io/chaincade/welcome-to-the-retroverse/the-ecosystem/chaincade-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
