Skip to content

Latest commit

 

History

History
154 lines (111 loc) · 2.53 KB

README.md

File metadata and controls

154 lines (111 loc) · 2.53 KB

Documentation

Base endpoint: profile.pancakeswap.com/api

All endpoints supports Cross-Origin Resource Sharing (CORS).

Miscellaneous

1. Version

Return the current API version.

Usage :

$ curl -X GET https://profile.pancakeswap.com/api/version

Response :

{
    "version": "1.0.0"
}

Profile

1. Users

GET /users/{address}

Return user information, and leaderboard statistics about latest trading competition.

Usage :

$ curl -X GET https://profile.pancakeswap.com/api/users/0x000000000000000000000000000000000000dEaD

Response :

{
    "adress": "<string>",
    "username": "<string>",
    "leaderboard": {
        "global": "<integer>",
        "team": "<integer>",
        "volume": "<float>",
        "next_rank": "<float>"
    },
    "created_at": "<string>",
    "updated_at": "<string|null>"
}

POST /users/register

Create a user, with an address and username, both confirmed by signature request.

Usage :

$ curl -X POST -d '{"address": "0x...", "username": "Chef...", "signature": "0x..."}' https://profile.pancakeswap.com/api/users/register

Response :

{
    "adress": "<string>",
    "username": "<string>",
    "created_at": "<string>",
    "updated_at": "<string|null>"
}

GET /users/valid/{username}

Return username validity, based on multiple criteria.

Usage :

$ curl -X GET https://profile.pancakeswap.com/api/users/valid/ChefPancake

Response :

{
    "username": "<string>",
    "valid": "<boolean>"
}

2. Team

GET /leaderboard/global

Return leaderboard, ordered by rank (-> volume in USD (desc)).

Usage :

$ curl -X GET https://profile.pancakeswap.com/api/leaderboard/global

Response :

{
    "total": "<integer>",
    "volume": "<float>",
    "data": [
        {
            "rank": "<integer>",
            "address": "<string>",
            "volume": "<float>",
            "teamId": "<integer>"
        }
    ]
}

2. Team

GET /leaderboard/team/{id}

Return leaderboard, for a given team, ordered by rank (-> volume in USD).

Usage :

$ curl -X GET https://profile.pancakeswap.com/api/leaderboard/team/1

Response :

{
    "total": "<integer>",
    "volume": "<float>",
    "data": [
        {
            "rank": "<integer>",
            "address": "<string>",
            "volume": "<float>",
            "teamId": "<integer>"
        }
    ]
}