PancakeSwap Users API

The Users API from PancakeSwap — 3 operation(s) for users.

OpenAPI Specification

pancakeswap-users-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: PancakeSwap Info Leaderboard Users API
  description: 'REST API providing on-chain data for the top ~1000 PancakeSwap trading pairs, tokens, and market summaries sourced from underlying subgraphs. Used by market aggregators such as CoinMarketCap to surface liquidity and volume data. Responses are cached for 5 minutes.

    '
  version: '2.0'
  contact:
    name: PancakeSwap
    url: https://pancakeswap.finance
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
- url: https://api.pancakeswap.info/api
  description: PancakeSwap Info API
tags:
- name: Users
paths:
  /users/{address}:
    get:
      operationId: getUser
      summary: Get user profile
      description: Fetches user information and latest trading competition leaderboard statistics.
      tags:
      - Users
      parameters:
      - name: address
        in: path
        required: true
        description: User's wallet address (BEP20)
        schema:
          type: string
          pattern: ^0x[a-fA-F0-9]{40}$
        example: '0x1234567890abcdef1234567890abcdef12345678'
      responses:
        '200':
          description: Successful response with user profile data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserProfile'
        '404':
          description: User not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /users/register:
    post:
      operationId: registerUser
      summary: Register a new user
      description: Creates a new user with signature-verified address and username.
      tags:
      - Users
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterRequest'
            example:
              address: '0x1234567890abcdef1234567890abcdef12345678'
              username: pancake_trader
              signature: 0xabc123...
      responses:
        '200':
          description: Successful registration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserBase'
        '400':
          description: Invalid request or signature
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Username or address already registered
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /users/valid/{username}:
    get:
      operationId: validateUsername
      summary: Validate a username
      description: Validates username according to platform criteria.
      tags:
      - Users
      parameters:
      - name: username
        in: path
        required: true
        description: Username to validate
        schema:
          type: string
          minLength: 3
          maxLength: 15
        example: pancake_trader
      responses:
        '200':
          description: Username validation result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsernameValidation'
              example:
                username: pancake_trader
                valid: true
components:
  schemas:
    RegisterRequest:
      type: object
      required:
      - address
      - username
      - signature
      properties:
        address:
          type: string
          description: User's wallet address
          pattern: ^0x[a-fA-F0-9]{40}$
          example: '0x1234567890abcdef1234567890abcdef12345678'
        username:
          type: string
          description: Desired username
          minLength: 3
          maxLength: 15
          example: pancake_trader
        signature:
          type: string
          description: Cryptographic signature for address verification
          example: 0xabc123...
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
          example: User not found
        message:
          type: string
          description: Detailed error description
          example: No user found with the provided address
    LeaderboardStats:
      type: object
      description: User's leaderboard statistics
      properties:
        global:
          type: integer
          description: Global rank of the user
          example: 42
        team:
          type: integer
          description: Team rank of the user
          example: 5
        volume:
          type: number
          format: float
          description: Trading volume in USD
          example: 150000.5
        next_rank:
          type: number
          format: float
          description: Volume needed to reach the next rank in USD
          example: 200000.0
    UserBase:
      type: object
      properties:
        address:
          type: string
          description: User's wallet address
          example: '0x1234567890abcdef1234567890abcdef12345678'
        username:
          type: string
          description: User's chosen username
          example: pancake_trader
        created_at:
          type: string
          format: date-time
          description: Account creation timestamp
          example: '2023-01-15T12:00:00Z'
        updated_at:
          type: string
          format: date-time
          nullable: true
          description: Last update timestamp
          example: null
    UserProfile:
      allOf:
      - $ref: '#/components/schemas/UserBase'
      - type: object
        properties:
          leaderboard:
            $ref: '#/components/schemas/LeaderboardStats'
    UsernameValidation:
      type: object
      properties:
        username:
          type: string
          description: Submitted username
          example: pancake_trader
        valid:
          type: boolean
          description: Whether the username is valid
          example: true