openapi: 3.0.0
info:
  title: BestInSlot BRC-20 API
  description: API endpoints related to BRC-20 Protocol
  version: '3.0'
  contact:
    name: BestInSlot
    url: https://bestinslot.xyz
servers:
  - url: https://api.bestinslot.xyz/v3
    description: Production server
  - url: https://testnet.api.bestinslot.xyz/v3
    description: Testnet server
  - url: https://signet_api.bestinslot.xyz/v3
    description: Signet server
paths:
  /brc20/wallet_balances:
    get:
      summary: BRC-20 Balances of Wallet
      description: Returns BRC-20 token balances of a bitcoin wallet. Note that min_listed_unit_price is only available on Pro Tier.
      operationId: getBrc20WalletBalances
      tags:
        - BRC-20
      parameters:
        - name: address
          in: query
          description: Bitcoin wallet address
          required: true
          schema:
            type: string
            example: bc1pgmtxez2cnp3wk5q52wjcakrkqqfxukgmannrtttm4kq64q53qw7qw44juz
        - name: ticker
          in: query
          description: Filter response to only show the selected ticker
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        ticker:
                          type: string
                          description: BRC-20 ticker
                          example: oxbt
                        overall_balance:
                          type: string
                          description: Total balance
                          example: "5000.0000000000000000"
                        available_balance:
                          type: string
                          description: Available balance
                          example: "0.000000000000000000000000000000000000"
                        transferrable_balance:
                          type: string
                          description: Transferrable balance
                          example: "5000.0000000000000000"
                        image_url:
                          type: string
                          nullable: true
                          description: URL to token image
                          example: null
                        min_listed_unit_price:
                          type: number
                          description: Minimum listed unit price (Pro Tier only)
                          example: 335.94
                  block_height:
                    type: integer
                    description: Current block height
                    example: 795037
        '429':
          description: Too Many Requests - Rate limit exceeded
          
  /brc20/tickers:
    get:
      summary: Get BRC-20 Tickers
      description: Returns ordered list of brc-20 tickers with detailed information about them. Note that min_listed_unit_price, listed_supply, marketcap and total_sale_info is only available on Pro Tier.
      operationId: getBrc20Tickers
      tags:
        - BRC-20
      parameters:
        - name: sort_by
          in: query
          description: Field to sort by
          required: true
          schema:
            type: string
            enum: [deploy_ts, max_supply, burned_supply, minted_supply, remaining_supply, holder_count, tx_count, mint_progress, min_listed_unit_price, min_listed_unit_price_ordinalswallet, min_listed_unit_price_unisat, min_listed_unit_price_okx, listed_supply, listed_supply_ratio, marketcap]
        - name: order
          in: query
          description: Sort order
          required: true
          schema:
            type: string
            enum: [asc, desc]
        - name: offset
          in: query
          description: Pagination offset
          required: true
          schema:
            type: integer
            minimum: 0
        - name: count
          in: query
          description: Number of records to return
          required: true
          schema:
            type: integer
            minimum: 20
            maximum: 300
        - name: minting_status
          in: query
          description: Filter by minting status
          required: false
          schema:
            type: string
            enum: [not_complete, completed]
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        ticker:
                          type: string
                          description: BRC-20 ticker
                          example: ordi
                        original_ticker:
                          type: string
                          description: Original ticker
                          example: ordi
                        image_url:
                          type: string
                          description: URL to token image
                          example: "https://bis-brc20.fra1.cdn.digitaloceanspaces.com/big_icons/ORDI.png"
                        decimals:
                          type: integer
                          description: Token decimals
                          example: 18
                        limit_per_mint:
                          type: integer
                          description: Maximum tokens per mint
                          example: 1000
                        max_supply:
                          type: integer
                          description: Maximum supply
                          example: 21000000
                        minted_supply:
                          type: integer
                          description: Total minted supply
                          example: 21000000
                        burned_supply:
                          type: integer
                          description: Total burned supply
                          example: 0
                        remaining_supply:
                          type: integer
                          description: Remaining supply to be minted
                          example: 0
                        mint_progress:
                          type: integer
                          description: Minting progress percentage
                          example: 100
                        holder_count:
                          type: integer
                          description: Number of holders
                          example: 21425
                        tx_count:
                          type: integer
                          description: Number of transactions
                          example: 139415
                        deploy_ts:
                          type: string
                          format: date-time
                          description: Deployment timestamp
                          example: "2023-03-08T04:16:31.000Z"
                        deploy_incr_number:
                          type: integer
                          description: Deployment inscription number
                          example: 348020
                        deploy_inscr_id:
                          type: string
                          description: Deployment inscription ID
                          example: "b61b0172d95e266c18aea0c624db987e971a5d6d4ebc2aaed85da4642d635735i0"
                        is_self_mint:
                          type: boolean
                          description: Whether token is self-mintable
                          example: false
                        min_listed_unit_price:
                          type: number
                          description: Minimum listed unit price (Pro Tier only)
                          example: 66821.445
                        min_listed_unit_price_ordinalswallet:
                          type: number
                          description: Minimum listed unit price on Ordinals Wallet (Pro Tier only)
                          example: 71000
                        min_listed_unit_price_unisat:
                          type: number
                          description: Minimum listed unit price on Unisat (Pro Tier only)
                          example: 66821.445
                        min_listed_unit_price_okx:
                          type: number
                          description: Minimum listed unit price on OKX (Pro Tier only)
                          example: 68999.9909090909
                        listed_supply:
                          type: number
                          description: Total listed supply (Pro Tier only)
                          example: 37504.693454911176
                        listed_supply_ratio:
                          type: number
                          description: Ratio of listed supply to total supply (Pro Tier only)
                          example: 0.0017859377835671988
                        marketcap:
                          type: number
                          description: Market capitalization (Pro Tier only)
                          example: 1403250345000.0002
                        total_sale_info:
                          type: object
                          description: Sale information (Pro Tier only)
                          properties:
                            sale_count:
                              type: integer
                              description: Number of sales
                              example: 41894
                            sale_amount:
                              type: integer
                              description: Total amount sold
                              example: 6714108
                            vol_3h:
                              type: integer
                              description: Volume in last 3 hours
                              example: 0
                            vol_6h:
                              type: integer
                              description: Volume in last 6 hours
                              example: 0
                            vol_9h:
                              type: integer
                              description: Volume in last 9 hours
                              example: 0
                            vol_12h:
                              type: integer
                              description: Volume in last 12 hours
                              example: 0
                            vol_1d:
                              type: integer
                              description: Volume in last day
                              example: 0
                            vol_3d:
                              type: integer
                              description: Volume in last 3 days
                              example: 26836090
                            vol_7d:
                              type: integer
                              description: Volume in last 7 days
                              example: 51723223
                            vol_30d:
                              type: integer
                              description: Volume in last 30 days
                              example: 1443558529
                            vol_total:
                              type: integer
                              description: Total volume
                              example: 246425756972
                  block_height:
                    type: integer
                    description: Current block height
                    example: 795037
        '429':
          description: Too Many Requests - Rate limit exceeded
          
  /brc20/ticker_cnt:
    get:
      summary: Get BRC-20 Minting Ticker Count
      description: Returns the count of brc-20 tickers which haven't finished minting and total brc-20 ticker count.
      operationId: getBrc20TickerCount
      tags:
        - BRC-20
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      minting_ticker_cnt:
                        type: integer
                        description: Number of tickers still minting
                        example: 29039
                      ticker_cnt:
                        type: integer
                        description: Total number of tickers
                        example: 36899
                  block_height:
                    type: integer
                    description: Current block height
                    example: 798400
        '429':
          description: Too Many Requests - Rate limit exceeded
          
  /brc20/ticker_info:
    get:
      summary: Get BRC-20 Ticker Information
      description: Returns detailed information about a specific BRC-20 ticker.
      operationId: getBrc20TickerInfo
      tags:
        - BRC-20
      parameters:
        - name: ticker
          in: query
          description: BRC-20 ticker
          required: true
          schema:
            type: string
            example: ORDI
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      ticker:
                        type: string
                        description: BRC-20 ticker
                        example: ordi
                      original_ticker:
                        type: string
                        description: Original ticker
                        example: ordi
                      image_url:
                        type: string
                        description: URL to token image
                        example: "https://bis-brc20.fra1.digitaloceanspaces.com/icons/ordi.png"
                      limit_per_mint:
                        type: integer
                        description: Maximum tokens per mint
                        example: 1000
                      max_supply:
                        type: integer
                        description: Maximum supply
                        example: 21000000
                      minted_supply:
                        type: integer
                        description: Total minted supply
                        example: 21000000
                      burned_supply:
                        type: integer
                        description: Total burned supply
                        example: 0
                      mint_progress:
                        type: integer
                        description: Minting progress percentage
                        example: 100
                      holder_count:
                        type: integer
                        description: Number of holders
                        example: 12396
                      tx_count:
                        type: integer
                        description: Number of transactions
                        example: 57265
                      deploy_ts:
                        type: string
                        format: date-time
                        description: Deployment timestamp
                        example: "2023-03-08T04:16:31.000Z"
                      deploy_incr_number:
                        type: integer
                        description: Deployment inscription number
                        example: 348020
                      deploy_inscr_id:
                        type: string
                        description: Deployment inscription ID
                        example: "b61b0172d95e266c18aea0c624db987e971a5d6d4ebc2aaed85da4642d635735i0"
                      is_self_mint:
                        type: boolean
                        description: Whether token is self-mintable
                        example: false
                  block_height:
                    type: integer
                    description: Current block height
                    example: 795038
        '429':
          description: Too Many Requests - Rate limit exceeded
          
  /brc20/validtxnotes:
    get:
      summary: Get BRC-20 Valid Transfer Notes
      description: Returns ordered list of brc-20 valid transfer notes of a given ticker with detailed information about them.
      operationId: getBrc20ValidTransferNotes
      tags:
        - BRC-20
      parameters:
        - name: sort_by
          in: query
          description: Field to sort by
          required: true
          schema:
            type: string
            enum: [inscr_num, min_price, min_unit_price, transfer_amount]
        - name: order
          in: query
          description: Sort order
          required: true
          schema:
            type: string
            enum: [asc, desc]
        - name: offset
          in: query
          description: Pagination offset
          required: true
          schema:
            type: integer
            minimum: 0
        - name: count
          in: query
          description: Number of records to return
          required: true
          schema:
            type: integer
            minimum: 20
            maximum: 2000
        - name: ticker
          in: query
          description: BRC-20 ticker
          required: true
          schema:
            type: string
            example: ordi
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        inscription_id:
                          type: string
                          description: Inscription ID
                          example: "b82f206d2d1bd7e5a2752f969acf63ac3664b2016872a4cbcc1d81a06da0bb34i0"
                        inscription_number:
                          type: integer
                          description: Inscription number
                          example: 27576503
                        transfer_amount:
                          type: string
                          description: Transfer amount
                          example: "1000.0000000000000000"
                        is_valid:
                          type: boolean
                          description: Whether the transfer note is valid
                          example: true
                        is_used:
                          type: boolean
                          description: Whether the transfer note is used
                          example: false
                        satpoint:
                          type: string
                          description: Satpoint reference
                          example: "b82f206d2d1bd7e5a2752f969acf63ac3664b2016872a4cbcc1d81a06da0bb34:0:0"
                        min_price:
                          type: integer
                          description: Minimum price
                          example: 15575400
                        min_unit_price:
                          type: string
                          description: Minimum unit price
                          example: "15575.4000000000000000"
                        ordinalswallet_price:
                          type: integer
                          nullable: true
                          description: Price on Ordinals Wallet
                          example: null
                        ordinalswallet_unit_price:
                          type: string
                          nullable: true
                          description: Unit price on Ordinals Wallet
                          example: null
                        okx_price:
                          type: integer
                          nullable: true
                          description: Price on OKX
                          example: null
                        okx_unit_price:
                          type: string
                          nullable: true
                          description: Unit price on OKX
                          example: null
                        unisat_price:
                          type: integer
                          description: Price on Unisat
                          example: 15575400
                        unisat_unit_price:
                          type: string
                          description: Unit price on Unisat
                          example: "15575.4000000000000000"
                  block_height:
                    type: integer
                    description: Current block height
                    example: 798387
        '429':
          description: Too Many Requests - Rate limit exceeded
          
  /brc20/validtxnotes_wallet:
    get:
      summary: Get BRC-20 Valid Transfer Notes of a Wallet
      description: Returns ordered list of brc-20 valid transfer notes of a given BTC wallet with detailed information about them.
      operationId: getBrc20ValidTransferNotesWallet
      tags:
        - BRC-20
      parameters:
        - name: sort_by
          in: query
          description: Field to sort by
          required: true
          schema:
            type: string
            enum: [inscr_num, min_price, min_unit_price, transfer_amount]
        - name: order
          in: query
          description: Sort order
          required: true
          schema:
            type: string
            enum: [asc, desc]
        - name: offset
          in: query
          description: Pagination offset
          required: true
          schema:
            type: integer
            minimum: 0
        - name: count
          in: query
          description: Number of records to return
          required: true
          schema:
            type: integer
            minimum: 20
            maximum: 2000
        - name: address
          in: query
          description: Bitcoin wallet address
          required: true
          schema:
            type: string
            example: bc1pgmtxez2cnp3wk5q52wjcakrkqqfxukgmannrtttm4kq64q53qw7qw44juz
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        inscription_id:
                          type: string
                          description: Inscription ID
                          example: "c229a89b9f2e9fb6fd5ef124e6dcf4394163b5ff518f1c5d5ad62eaa02a61c56i0"
                        inscription_number:
                          type: integer
                          description: Inscription number
                          example: 10509196
                        ticker:
                          type: string
                          description: BRC-20 ticker
                          example: giga
                        transfer_amount:
                          type: string
                          description: Transfer amount
                          example: "1900000.000000000000"
                        is_valid:
                          type: boolean
                          description: Whether the transfer note is valid
                          example: true
                        is_used:
                          type: boolean
                          description: Whether the transfer note is used
                          example: false
                        satpoint:
                          type: string
                          description: Satpoint reference
                          example: "c229a89b9f2e9fb6fd5ef124e6dcf4394163b5ff518f1c5d5ad62eaa02a61c56:0:0"
                        min_price:
                          type: integer
                          description: Minimum price
                          example: 326880
                        min_unit_price:
                          type: string
                          description: Minimum unit price
                          example: "0.17204200000000000000"
                        ordinalswallet_price:
                          type: integer
                          nullable: true
                          description: Price on Ordinals Wallet
                          example: null
                        ordinalswallet_unit_price:
                          type: string
                          nullable: true
                          description: Unit price on Ordinals Wallet
                          example: null
                        okx_price:
                          type: integer
                          nullable: true
                          description: Price on OKX
                          example: null
                        okx_unit_price:
                          type: string
                          nullable: true
                          description: Unit price on OKX
                          example: null
                        unisat_price:
                          type: integer
                          description: Price on Unisat
                          example: 326880
                        unisat_unit_price:
                          type: string
                          description: Unit price on Unisat
                          example: "0.17204200000000000000"
                  block_height:
                    type: integer
                    description: Current block height
                    example: 798387
        '429':
          description: Too Many Requests - Rate limit exceeded 

  /brc20/single_info:
    get:
      summary: BRC-20 Validity Check
      description: Returns validity details about a specific inscription.
      operationId: getBrc20SingleInfo
      tags:
        - BRC-20
      parameters:
        - name: inscription_id
          in: query
          description: Inscription ID
          required: true
          schema:
            type: string
            example: 859905a264deaab7ce88832ad73684ddc45cf9e0022e2700b8ac549f14199279i0
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      transfer_info:
                        type: object
                        properties:
                          is_valid:
                            type: boolean
                            description: Whether the transfer is valid
                            example: true
                          ticker:
                            type: string
                            description: BRC-20 ticker
                            example: ordi
                          original_ticker:
                            type: string
                            description: Original ticker
                            example: ordi
                          amount:
                            type: string
                            description: Transfer amount
                            example: "100.0000000000000000"
                          is_used:
                            type: boolean
                            description: Whether the transfer is used
                            example: true
                      mint_info:
                        type: object
                        properties:
                          is_valid:
                            type: boolean
                            description: Whether the mint is valid
                            example: false
                          ticker:
                            type: string
                            nullable: true
                            description: BRC-20 ticker
                            example: null
                          original_ticker:
                            type: string
                            nullable: true
                            description: Original ticker
                            example: null
                          amount:
                            type: string
                            nullable: true
                            description: Mint amount
                            example: null
                          mint_wallet:
                            type: string
                            nullable: true
                            description: Mint wallet
                            example: null
                          parent_id:
                            type: string
                            nullable: true
                            description: Parent inscription ID
                            example: null
                      deploy_info:
                        type: object
                        properties:
                          is_valid:
                            type: boolean
                            description: Whether the deploy is valid
                            example: false
                          ticker:
                            type: string
                            nullable: true
                            description: BRC-20 ticker
                            example: null
                          original_ticker:
                            type: string
                            nullable: true
                            description: Original ticker
                            example: null
                          max_supply:
                            type: string
                            nullable: true
                            description: Maximum supply
                            example: null
                          decimals:
                            type: string
                            nullable: true
                            description: Decimals
                            example: null
                          limit_per_mint:
                            type: string
                            nullable: true
                            description: Limit per mint
                            example: null
                          is_self_mint:
                            type: boolean
                            nullable: true
                            description: Whether token is self-mintable
                            example: null
                  block_height:
                    type: integer
                    description: Current block height
                    example: 795034
        '429':
          description: Too Many Requests - Rate limit exceeded
          
  /brc20/batch_info:
    post:
      summary: BRC-20 Batch Validity Check
      description: Returns validity details about multiple inscriptions.
      operationId: brc20BatchInfo
      tags:
        - BRC-20
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                queries:
                  type: array
                  description: Array of inscription IDs
                  maxItems: 100
                  items:
                    type: string
                    example: "859905a264deaab7ce88832ad73684ddc45cf9e0022e2700b8ac549f14199279i0"
              required:
                - queries
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        inscription_id:
                          type: string
                          description: Inscription ID
                          example: "859905a264deaab7ce88832ad73684ddc45cf9e0022e2700b8ac549f14199279i0"
                        transfer_info:
                          type: object
                          properties:
                            is_valid:
                              type: boolean
                              description: Whether the transfer is valid
                              example: true
                            ticker:
                              type: string
                              nullable: true
                              description: BRC-20 ticker
                              example: ordi
                            original_ticker:
                              type: string
                              nullable: true
                              description: Original ticker
                              example: ordi
                            amount:
                              type: string
                              nullable: true
                              description: Transfer amount
                              example: "100.000000000000000000"
                            is_used:
                              type: boolean
                              nullable: true
                              description: Whether the transfer is used
                              example: true
                        mint_info:
                          type: object
                          properties:
                            is_valid:
                              type: boolean
                              description: Whether the mint is valid
                              example: false
                            ticker:
                              type: string
                              nullable: true
                              description: BRC-20 ticker
                              example: null
                            original_ticker:
                              type: string
                              nullable: true
                              description: Original ticker
                              example: null
                            amount:
                              type: string
                              nullable: true
                              description: Mint amount
                              example: null
                            mint_wallet:
                              type: string
                              nullable: true
                              description: Mint wallet
                              example: null
                            parent_id:
                              type: string
                              nullable: true
                              description: Parent inscription ID
                              example: null
                        deploy_info:
                          type: object
                          properties:
                            is_valid:
                              type: boolean
                              description: Whether the deploy is valid
                              example: false
                            ticker:
                              type: string
                              nullable: true
                              description: BRC-20 ticker
                              example: null
                            original_ticker:
                              type: string
                              nullable: true
                              description: Original ticker
                              example: null
                            max_supply:
                              type: string
                              nullable: true
                              description: Maximum supply
                              example: null
                            decimals:
                              type: string
                              nullable: true
                              description: Decimals
                              example: null
                            limit_per_mint:
                              type: string
                              nullable: true
                              description: Limit per mint
                              example: null
                            is_self_mint:
                              type: boolean
                              nullable: true
                              description: Whether token is self-mintable
                              example: null
                  block_height:
                    type: integer
                    description: Current block height
                    example: 821920
        '429':
          description: Too Many Requests - Rate limit exceeded
          
  /brc20/holders:
    get:
      summary: Get BRC-20 Ticker Holders
      description: Returns ordered list of brc-20 holders and their balances.
      operationId: getBrc20Holders
      tags:
        - BRC-20
      parameters:
        - name: sort_by
          in: query
          description: Field to sort by
          required: true
          schema:
            type: string
            enum: [balance]
        - name: order
          in: query
          description: Sort order
          required: true
          schema:
            type: string
            enum: [asc, desc]
        - name: offset
          in: query
          description: Pagination offset
          required: true
          schema:
            type: integer
            minimum: 0
        - name: count
          in: query
          description: Number of records to return
          required: true
          schema:
            type: integer
            minimum: 20
            maximum: 500
        - name: ticker
          in: query
          description: BRC-20 ticker
          required: true
          schema:
            type: string
            example: ordi
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        pkscript:
                          type: string
                          description: Public key script
                          example: "51207fee8ce58498d8f5228a1f848d9a5d3cf0a8918dbe54935c858875ed23814523"
                        wallet:
                          type: string
                          description: Wallet address
                          example: "bc1p0lhgeevynrv02g52r7zgmxja8nc23yvdhe2fxhy93p676gupg53sw46fy3"
                        overall_balance:
                          type: string
                          description: Total balance
                          example: "10.0000000000000000"
                  block_height:
                    type: integer
                    description: Current block height
                    example: 795034
        '429':
          description: Too Many Requests - Rate limit exceeded
          
  /brc20/event_from_txid:
    get:
      summary: Get BRC-20 Event from TxId
      description: Returns BRC-20 events in a given bitcoin txid. Note that price and marketplace_type information is only available in PRO Tier.
      operationId: getBrc20EventFromTxId
      tags:
        - BRC-20
      parameters:
        - name: txid
          in: query
          description: Bitcoin transaction ID
          required: true
          schema:
            type: string
            example: 21b7b3bf48b04af8102a560acdbf3993411a96caa9327b6c07423096ec2e17da
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        inscription_id:
                          type: string
                          description: Inscription ID
                          example: "6d4a1438ab43f941db9671fe8c4e5566984e14f0545f97143fa4df397295b755i0"
                        event_type:
                          type: string
                          description: Event type
                          example: "transfer-transfer"
                        event:
                          type: object
                          properties:
                            tick:
                              type: string
                              description: BRC-20 ticker
                              example: "𝛑"
                            amount:
                              type: string
                              description: Amount
                              example: "31415926535000000000000000000"
                            using_tx_id:
                              type: string
                              description: Using transaction ID
                              example: "60998008"
                            spent_wallet:
                              type: string
                              description: Spent wallet address
                              example: "bc1q7jyhzrgmaw26sggejpc5fe0ghecc53lu06u28c"
                            source_wallet:
                              type: string
                              description: Source wallet address
                              example: "bc1qgzdxs7vtzj3xywa9g50kdjkhsxqlu8ce6h6c63"
                            spent_pkScript:
                              type: string
                              description: Spent public key script
                              example: "0014f489710d1beb95a82119907144e5e8be718a47fc"
                            source_pkScript:
                              type: string
                              description: Source public key script
                              example: "0014409a68798b14a2623ba5451f66cad78181fe1f19"
                            price:
                              type: integer
                              description: Price (Pro Tier only)
                              example: 530300
                            marketplace_type:
                              type: string
                              description: Marketplace type (Pro Tier only)
                              example: "okx"
                  block_height:
                    type: integer
                    description: Current block height
                    example: 824865
        '429':
          description: Too Many Requests - Rate limit exceeded
        '403':
          description: Forbidden - Invalid API-Key
          
  /brc20/sales_info:
    get:
      summary: Get BRC-20 Sales Information
      description: Returns sales and volume information about a specific brc-20 ticker.
      operationId: getBrc20SalesInfo
      tags:
        - BRC-20
      parameters:
        - name: ticker
          in: query
          description: BRC-20 ticker
          required: true
          schema:
            type: string
            example: ordi
        - name: marketplace_type
          in: query
          description: Optional parameter to filter only by a given marketplace
          required: false
          schema:
            type: string
            example: magiceden
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      marketplace:
                        type: string
                        description: Marketplace filter
                        example: "all"
                      vol_3h:
                        type: integer
                        description: Volume in last 3 hours
                        example: 0
                      vol_6h:
                        type: integer
                        description: Volume in last 6 hours
                        example: 4855500
                      vol_9h:
                        type: integer
                        description: Volume in last 9 hours
                        example: 5266074
                      vol_12h:
                        type: integer
                        description: Volume in last 12 hours
                        example: 5266074
                      vol_1d:
                        type: integer
                        description: Volume in last day
                        example: 112874701
                      vol_3d:
                        type: integer
                        description: Volume in last 3 days
                        example: 171112507
                      vol_7d:
                        type: integer
                        description: Volume in last 7 days
                        example: 230695357
                      vol_30d:
                        type: integer
                        description: Volume in last 30 days
                        example: 777270095
                      vol_total:
                        type: integer
                        description: Total volume
                        example: 139743502715
                      sale_count:
                        type: integer
                        description: Number of sales
                        example: 23843
                      sale_amount:
                        type: integer
                        description: Total amount sold
                        example: 5120986
                  block_height:
                    type: integer
                    description: Current block height
                    example: 805713
        '429':
          description: Too Many Requests - Rate limit exceeded
        '403':
          description: Forbidden - Invalid API-Key
          
  /brc20/market_info:
    get:
      summary: Get BRC-20 Market Information
      description: Returns market information like marketcap, listed count, floor price about a specific BRC-20 ticker.
      operationId: getBrc20MarketInfo
      tags:
        - BRC-20
      parameters:
        - name: ticker
          in: query
          description: BRC-20 ticker
          required: true
          schema:
            type: string
            example: ordi
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      marketcap:
                        type: number
                        description: Market capitalization
                        example: 1403250345000.0002
                      min_listed_unit_price:
                        type: number
                        description: Minimum listed unit price
                        example: 66821.445
                      min_listed_unit_price_ordinalswallet:
                        type: number
                        description: Minimum listed unit price on Ordinals Wallet
                        example: 71000
                      min_listed_unit_price_unisat:
                        type: number
                        description: Minimum listed unit price on Unisat
                        example: 66821.445
                      min_listed_unit_price_okx:
                        type: number
                        description: Minimum listed unit price on OKX
                        example: 68999.9909090909
                      listed_supply:
                        type: number
                        description: Total listed supply
                        example: 37504.693454911176
                      listed_supply_ratio:
                        type: number
                        description: Ratio of listed supply to total supply
                        example: 0.0017859377835671988
                  block_height:
                    type: integer
                    description: Current block height
                    example: 849817
        '429':
          description: Too Many Requests - Rate limit exceeded
        '403':
          description: Forbidden - Invalid API-Key
          
  /brc20/listings:
    get:
      summary: Get BRC-20 Listings
      description: Returns ordered list of listings of a specific BRC-20 ticker.
      operationId: getBrc20Listings
      tags:
        - BRC-20
      parameters:
        - name: sort_by
          in: query
          description: Field to sort by
          required: true
          schema:
            type: string
            enum: [min_price, min_unit_price, ordinalswallet_price, ordinalswallet_unit_price, unisat_price, unisat_unit_price, okx_price, okx_unit_price]
        - name: order
          in: query
          description: Sort order
          required: true
          schema:
            type: string
            enum: [asc, desc]
        - name: offset
          in: query
          description: Pagination offset
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 5000
        - name: count
          in: query
          description: Number of records to return
          required: true
          schema:
            type: integer
            minimum: 20
            maximum: 100
        - name: ticker
          in: query
          description: BRC-20 ticker
          required: true
          schema:
            type: string
            example: ordi
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        inscription_id:
                          type: string
                          description: Inscription ID
                          example: "6d6bdc8a1c36f80144ce250745840ab10e1308a4b8cc9a769d3719095e1242e7i0"
                        transfer_amount:
                          type: string
                          description: Transfer amount
                          example: "1.00000000000000000000"
                        min_price:
                          type: integer
                          description: Minimum price
                          example: 300000000
                        min_unit_price:
                          type: string
                          description: Minimum unit price
                          example: "300000000.00000000000000000000"
                        ordinalswallet_price:
                          type: integer
                          description: Price on Ordinals Wallet
                          example: 300000000
                        ordinalswallet_unit_price:
                          type: string
                          description: Unit price on Ordinals Wallet
                          example: "300000000.00000000000000000000"
                        unisat_price:
                          type: integer
                          nullable: true
                          description: Price on Unisat
                          example: null
                        unisat_unit_price:
                          type: string
                          nullable: true
                          description: Unit price on Unisat
                          example: null
                        okx_price:
                          type: integer
                          nullable: true
                          description: Price on OKX
                          example: null
                        okx_unit_price:
                          type: string
                          nullable: true
                          description: Unit price on OKX
                          example: null
                        owner_wallet_addr:
                          type: string
                          description: Owner wallet address
                          example: "bc1p96u7df3xhr6x5h8ch9dld5le73k820awhhu6fpnn0r3k6xprz6tqtw2h2u"
                  block_height:
                    type: integer
                    description: Current block height
                    example: 795034
        '429':
          description: Too Many Requests - Rate limit exceeded
        '403':
          description: Forbidden - Invalid API-Key
          
  /brc20/activity:
    get:
      summary: Get BRC-20 Activity
      description: Returns ordered list of inscribes, sales and transfers of a specific BRC-20 ticker.
      operationId: getBrc20Activity
      tags:
        - BRC-20
      parameters:
        - name: sort_by
          in: query
          description: Field to sort by
          required: true
          schema:
            type: string
            enum: [ts, unit_price, amount, sale_price]
        - name: order
          in: query
          description: Sort order
          required: true
          schema:
            type: string
            enum: [asc, desc]
        - name: offset
          in: query
          description: Pagination offset
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 5000
        - name: count
          in: query
          description: Number of records to return
          required: true
          schema:
            type: integer
            minimum: 20
            maximum: 100
        - name: ticker
          in: query
          description: BRC-20 ticker
          required: true
          schema:
            type: string
            example: ordi
        - name: activity_filter
          in: query
          description: Filter for activity types (1=mints, 2=transfers, 4=sales, combine with OR operator)
          required: true
          schema:
            type: integer
            example: 7
        - name: last_new_satpoint
          in: query
          description: Use this with offset 0 to continue from a known transfer
          required: false
          schema:
            type: string
            example: a47f806f7fa622a44bc77bc886c8e0646cc61878d412285aa4a297cf2a5ce296:0:0
        - name: wallet
          in: query
          description: Bitcoin wallet filter
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        _tx_id:
                          type: integer
                          description: Transaction ID
                          example: 15271002
                        inscription_id:
                          type: string
                          description: Inscription ID
                          example: "5f236832ad63e35d005f93e14ce93741836732599efc921ab074e079b36ea418i0"
                        amount:
                          type: string
                          description: Amount
                          example: "100.0000000000000000"
                        sale_price:
                          type: integer
                          description: Sale price
                          example: -1
                        unit_price:
                          type: string
                          description: Unit price
                          example: "-0.01000000000000000000"
                        activity_type:
                          type: integer
                          description: Activity type (1=mint, 2=transfer, 4=sale)
                          example: 1
                        from_wallet:
                          type: string
                          description: Source wallet address
                          example: "bc1q3sda3q9hd82qzm8j9wfff0afmdkvsh8qafmrfh"
                        to_wallet:
                          type: string
                          description: Destination wallet address
                          example: "1P3XJT34R9bVntfQXVoZDwA6z4oxjaaiTU"
                        block_height:
                          type: integer
                          description: Block height
                          example: 795034
                        ts:
                          type: string
                          format: date-time
                          description: Timestamp
                          example: "2023-06-19T09:30:18.000Z"
                        new_satpoint:
                          type: string
                          description: New satpoint reference
                          example: "a47f806f7fa622a44bc77bc886c8e0646cc61878d412285aa4a297cf2a5ce296:0:0"
                        tx_id:
                          type: string
                          description: Transaction ID
                          example: "a47f806f7fa622a44bc77bc886c8e0646cc61878d412285aa4a297cf2a5ce296"
                  block_height:
                    type: integer
                    description: Current block height
                    example: 795035
        '429':
          description: Too Many Requests - Rate limit exceeded
        '403':
          description: Forbidden - Invalid API-Key
          
  /brc20/wallet_activity:
    get:
      summary: Get BRC-20 Wallet Activity
      description: Returns ordered list of deploy-inscribe, mint-inscribe, transfer-inscribe and transfer-transfer of a given bitcoin wallet.
      operationId: getBrc20WalletActivity
      tags:
        - BRC-20
      parameters:
        - name: order
          in: query
          description: Sort order (ordered by timestamp)
          required: true
          schema:
            type: string
            enum: [asc, desc]
        - name: offset
          in: query
          description: Pagination offset
          required: true
          schema:
            type: integer
            minimum: 0
            maximum: 5000
        - name: count
          in: query
          description: Number of records to return
          required: true
          schema:
            type: integer
            minimum: 20
            maximum: 2000
        - name: wallet_addr
          in: query
          description: Bitcoin wallet address
          required: true
          schema:
            type: string
            example: bc1pxaneaf3w4d27hl2y93fuft2xk6m4u3wc4rafevc6slgd7f5tq2dqyfgy06
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        ticker:
                          type: string
                          description: BRC-20 ticker
                          example: ordi
                        event_type:
                          type: string
                          description: Event type
                          example: "deploy-inscribe"
                        to_wallet:
                          type: string
                          description: Destination wallet address
                          example: "bc1pxaneaf3w4d27hl2y93fuft2xk6m4u3wc4rafevc6slgd7f5tq2dqyfgy06"
                        block_height:
                          type: integer
                          description: Block height
                          example: 779832
                        ts:
                          type: string
                          format: date-time
                          description: Timestamp
                          example: "2023-03-08T04:16:31.000Z"
                        inscription_id:
                          type: string
                          description: Inscription ID
                          example: "b61b0172d95e266c18aea0c624db987e971a5d6d4ebc2aaed85da4642d635735i0"
                        sale_price:
                          type: integer
                          nullable: true
                          description: Sale price
                          example: null
                        unit_price:
                          type: number
                          nullable: true
                          description: Unit price
                          example: null
                        amount:
                          type: string
                          nullable: true
                          description: Amount
                          example: null
                  block_height:
                    type: integer
                    description: Current block height
                    example: 844736
        '429':
          description: Too Many Requests - Rate limit exceeded
          
  /brc20/activity_on_block:
    get:
      summary: Get BRC-20 Activity on Block
      description: Returns ordered list of mint note and transfer note inscribes, and transfer note transfers in a given block height.
      operationId: getBrc20ActivityOnBlock
      tags:
        - BRC-20
      parameters:
        - name: block_height
          in: query
          description: Block height (must be smaller than or equal to current bitcoin block height)
          required: true
          schema:
            type: integer
            example: 802396
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                          description: Activity ID
                          example: 28093931
                        inscription_id:
                          type: string
                          description: Inscription ID
                          example: "6d5ba7f257f634ee7ec3220263dc3c5c6df13e6d5f3f61957250ceed1c43666ai0"
                        old_pkscript:
                          type: string
                          description: Old public key script
                          example: "0014870dba15d6b5a0563b6df472359a7ef75d21f26c"
                        old_wallet:
                          type: string
                          description: Old wallet address
                          example: "bc1qsuxm59wkkks9vwmd73ertxn77awjrunv8x0nv6"
                        old_satpoint:
                          type: string
                          description: Old satpoint reference
                          example: "6d5ba7f257f634ee7ec3220263dc3c5c6df13e6d5f3f61957250ceed1c43666a:0:0"
                        new_pkscript:
                          type: string
                          description: New public key script
                          example: "0014ad42179475826f3cae94c1c3bae2797c6933a53a"
                        new_wallet:
                          type: string
                          description: New wallet address
                          example: "bc1q44pp09r4sfhnet55c8pm4cne035n8ff6t0lhgz"
                        new_satpoint:
                          type: string
                          description: New satpoint reference
                          example: "da30e16bda726bee66f94d2872a90350c29b08bca01ad8070e4ccb06112a0b8a:1:0"
                        tick:
                          type: string
                          description: BRC-20 ticker
                          example: "rdex"
                        original_tick:
                          type: string
                          description: Original ticker
                          example: "rdex"
                        amount:
                          type: string
                          description: Amount
                          example: "10000000000000000000000"
                        activity_type:
                          type: string
                          description: Activity type
                          example: "transfer-transfer"
                  block_height:
                    type: integer
                    description: Current block height (not the queried block height)
                    example: 804496
        '429':
          description: Too Many Requests - Rate limit exceeded
        '403':
          description: Forbidden - Invalid API-Key
          
  /brc20/balance_on_block:
    get:
      summary: Get BRC-20 Balance on Block
      description: Returns BRC-20 balances of a given wallet (address or pkscript) at the beginning of the given block height.
      operationId: getBrc20BalanceOnBlock
      tags:
        - BRC-20
      parameters:
        - name: block_height
          in: query
          description: Block height (must not be bigger than current bitcoin block height + 1)
          required: true
          schema:
            type: integer
            example: 802397
        - name: pkscript
          in: query
          description: Script public key of the wallet (only one of wallet/pkscript should be set)
          required: false
          schema:
            type: string
            example: "0014cd6cccc69331a96ea0fe0fa5d1d184a811979a8b"
        - name: wallet
          in: query
          description: Address of the wallet (only one of wallet/pkscript should be set)
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        tick:
                          type: string
                          description: BRC-20 ticker
                          example: "bili"
                        balance:
                          type: string
                          description: Balance
                          example: "1000000000000000000"
                  block_height:
                    type: integer
                    description: Current block height (not the queried block height)
                    example: 804496
        '429':
          description: Too Many Requests - Rate limit exceeded
        '403':
          description: Forbidden - Invalid API-Key
          
  /brc20/batch_balance_on_block:
    post:
      summary: Get BRC-20 Balance on Block Batch
      description: Returns BRC-20 ticker balance of several given wallet (address or pkscript) at the beginning of the given block height.
      operationId: brc20BatchBalanceOnBlock
      tags:
        - BRC-20
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                queries:
                  type: array
                  description: List of (block_height, ticker, (wallet|pkscript)) objects
                  maxItems: 100
                  items:
                    type: object
                    properties:
                      block_height:
                        type: integer
                        description: Block height
                        example: 802397
                      ticker:
                        type: string
                        description: BRC-20 ticker
                        example: "pepe"
                      pkscript:
                        type: string
                        description: Script public key (only one of wallet/pkscript is required)
                        example: "0014cd6cccc69331a96ea0fe0fa5d1d184a811979a8b"
                      wallet:
                        type: string
                        description: Wallet address (only one of wallet/pkscript is required)
              required:
                - queries
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        block_height:
                          type: integer
                          description: Block height
                          example: 802397
                        tick:
                          type: string
                          description: BRC-20 ticker
                          example: "pepe"
                        balance:
                          type: string
                          description: Balance
                          example: "11500000000000000000000"
                        pkscript:
                          type: string
                          description: Script public key
                          example: "0014cd6cccc69331a96ea0fe0fa5d1d184a811979a8b"
                  block_height:
                    type: integer
                    description: Current block height (not the queried block height)
                    example: 814812
        '429':
          description: Too Many Requests - Rate limit exceeded
        '403':
          description: Forbidden - Invalid API-Key
          
  /brc20/all_validtxnotes:
    get:
      summary: Get BRC-20 All Valid Tx Notes
      description: Returns all valid BRC-20 tx notes.
      operationId: getBrc20AllValidTxNotes
      tags:
        - BRC-20
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        inscription_id:
                          type: string
                          description: Inscription ID
                          example: "1c0c902e49a9730671069c0b273ecf880c9d173a6716ef358d7323703902d71di0"
                        ticker:
                          type: string
                          description: BRC-20 ticker
                          example: "drac"
                        amount:
                          type: string
                          description: Amount
                          example: "21040000000000000000000"
                        source_pkscript:
                          type: string
                          description: Source public key script
                          example: "5120df3a840ed1ea279110180fd09853e5b15a162c53309162dae0b8aa10b7b2919a"
                  block_height:
                    type: integer
                    description: Current block height
                    example: 814029
        '429':
          description: Too Many Requests - Rate limit exceeded
        '403':
          description: Forbidden - Invalid API-Key
          
  /brc20/all_balances:
    get:
      summary: Get BRC-20 All Balances
      description: Returns all BRC-20 balances of all wallets.
      operationId: getBrc20AllBalances
      tags:
        - BRC-20
      responses:
        '200':
          description: OK Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        wallet:
                          type: string
                          description: Wallet address
                          example: "bc1qqqpx5690calxc5q2x83mhyftk6zmtvlprvdujz"
                        pkscript:
                          type: string
                          description: Public key script
                          example: "001400026a68afc77e6c500a31e3bb912bb685b5b3e1"
                        tick:
                          type: string
                          description: BRC-20 ticker
                          example: "btcs"
                        overall_balance:
                          type: string
                          description: Total balance
                          example: "10.0000000000000000"
                        available_balance:
                          type: string
                          description: Available balance
                          example: "10.0000000000000000"
                  block_height:
                    type: integer
                    description: Current block height
                    example: 814029
        '429':
          description: Too Many Requests - Rate limit exceeded
        '403':
          description: Forbidden - Invalid API-Key
          
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API key for authentication. Required for all endpoints, different tiers (Basic, Pro, Dedicated, Enterprise) have access to different endpoints.
security:
  - ApiKeyAuth: []
tags:
  - name: BRC-20
    description: Endpoints related to BRC-20 Protocol 