API Reference

BNBScan provides a public REST API for accessing BNB Chain block explorer data. All endpoints return JSON. Base URL: https://bnbscan.com

Rate Limiting: API requests are rate-limited to 100 requests per minute per IP address. Responses include X-RateLimit-Remaining headers.
GET/api/v1/stats

Returns high-level network statistics including the latest block number, total transaction count, total token count, and average gas price.

Example Response
{
  "latestBlock": 42000000,
  "totalTransactions": 1500000,
  "totalTokens": 3200,
  "avgGasPrice": "5000000000"
}
GET/api/v1/blocks

Returns a paginated list of blocks ordered by block number descending.

Parameters

NameTypeRequiredDescription
pagenumberNoPage number, starting from 1 (default: 1)
limitnumberNoNumber of results per page (default: 25, max: 100)
Example Response
{
  "blocks": [
    {
      "number": 42000000,
      "hash": "0xabc123...",
      "timestamp": "2024-01-01T00:00:00Z",
      "miner": "0xdef456...",
      "txCount": 120,
      "gasUsed": "8000000",
      "gasLimit": "10000000"
    }
  ],
  "total": 42000000
}
GET/api/v1/transactions

Returns a paginated list of transactions. Optionally filter by address.

Parameters

NameTypeRequiredDescription
pagenumberNoPage number, starting from 1 (default: 1)
limitnumberNoNumber of results per page (default: 25, max: 100)
addressstringNoFilter by from or to address (e.g. 0x...)
Example Response
{
  "transactions": [
    {
      "hash": "0x123abc...",
      "blockNumber": 42000000,
      "fromAddress": "0xaaa...",
      "toAddress": "0xbbb...",
      "value": "1000000000000000000",
      "gasPrice": "5000000000",
      "gasUsed": "21000",
      "status": true,
      "timestamp": "2024-01-01T00:00:00Z"
    }
  ],
  "total": 1500000
}
GET/api/v1/tokens

Returns a paginated list of BEP20/BEP721/BEP1155 tokens tracked by the indexer.

Parameters

NameTypeRequiredDescription
pagenumberNoPage number, starting from 1 (default: 1)
limitnumberNoNumber of results per page (default: 25, max: 100)
Example Response
{
  "tokens": [
    {
      "address": "0xccc...",
      "name": "Example Token",
      "symbol": "EXT",
      "decimals": 18,
      "type": "BEP20",
      "totalSupply": "1000000000000000000000000",
      "holderCount": 12500
    }
  ],
  "total": 3200
}
GET/api/v1/addresses/:address

Returns detailed information about an address including balance, transaction count, contract status, and recent transactions.

Parameters

NameTypeRequiredDescription
addressstringYesThe Ethereum/BNB address (0x-prefixed, 42 chars)
Example Response
{
  "address": "0xddd...",
  "balance": "5000000000000000000",
  "txCount": 42,
  "isContract": false,
  "label": null,
  "firstSeen": "2023-06-01T00:00:00Z",
  "lastSeen": "2024-01-01T00:00:00Z",
  "recentTxs": []
}
POST/api/v1/verify

Submit a smart contract for source code verification. The contract bytecode must already be indexed. Supports compiler version specification and license type.

Parameters

NameTypeRequiredDescription
addressstringYesContract address to verify (0x-prefixed)
sourceCodestringYesFull Solidity source code
compilerVersionstringYesSolidity compiler version (e.g. 0.8.19)
licensestringNoSPDX license identifier (e.g. MIT, Apache-2.0)
Example Response
{
  "success": true,
  "message": "Contract verified successfully",
  "address": "0xeee..."
}
POST/api/v1/contracts/:address/call

Call a read-only (view/pure) function on a verified contract using its ABI. Returns the result with BigInt values serialized as strings.

Parameters

NameTypeRequiredDescription
addressstringYesContract address (must be verified with ABI)
functionNamestringYesName of the view/pure function to call
argsarrayNoArray of arguments to pass to the function
Example Response
{
  "result": "1000000000000000000"
}
GET/api/v1/webhooks

List all webhooks registered to an owner address.

Parameters

NameTypeRequiredDescription
ownerstringYesOwner BNB address (0x-prefixed)
Example Response
{
  "webhooks": [
    {
      "id": 1,
      "url": "https://your-app.com/webhook",
      "watchAddress": "0xabc...",
      "eventTypes": [
        "tx",
        "token_transfer"
      ],
      "active": true,
      "createdAt": "2024-01-01T00:00:00Z",
      "lastTriggeredAt": null,
      "failCount": 0
    }
  ]
}
POST/api/v1/webhooks

Register a new webhook. Returns a one-time secret for verifying incoming webhook signatures (HMAC-SHA256). BNBScan will POST events to your URL with an X-BNBScan-Signature header.

Parameters

NameTypeRequiredDescription
ownerAddressstringYesYour BNB address (0x-prefixed)
urlstringYesYour HTTPS endpoint to receive events
watchAddressstringNoAddress to watch for events
eventTypesstring[]NoEvent types: ["tx", "token_transfer"] (default: ["tx"])
Example Response
{
  "id": 1,
  "secret": "abc123...",
  "message": "Webhook created. Keep the secret — it will not be shown again."
}
GET/api/v1/keys

List API keys for an owner address. Key hashes are never returned — only the prefix for identification.

Parameters

NameTypeRequiredDescription
ownerstringYesOwner BNB address (0x-prefixed)
Example Response
{
  "keys": [
    {
      "id": 1,
      "keyPrefix": "bnbs_abc123",
      "label": "My App",
      "requestsPerMinute": 100,
      "totalRequests": 5420,
      "createdAt": "2024-01-01T00:00:00Z",
      "lastUsedAt": "2024-01-10T12:00:00Z",
      "active": true
    }
  ]
}
POST/api/v1/keys

Generate a new API key linked to your BNB address. The full key is shown once — save it immediately. Use the X-API-Key header to authenticate requests.

Parameters

NameTypeRequiredDescription
ownerAddressstringYesYour BNB address (0x-prefixed)
labelstringNoHuman-readable label for this key
Example Response
{
  "id": 1,
  "key": "bnbs_abc123...",
  "keyPrefix": "bnbs_abc123",
  "message": "API key created. Save it now — the full key will not be shown again."
}
POST/api/v1/query

Flexible query endpoint for fetching any entity with filters, ordering, and pagination. Supports: transactions, blocks, tokens, token_transfers, dex_trades.

Parameters

NameTypeRequiredDescription
entitystringYesOne of: transactions, blocks, tokens, token_transfers, dex_trades
filterobjectNoFilter object: { address, from, to, blockNumber, blockFrom, blockTo, tokenAddress, dex }
orderBystringNo"asc" or "desc" (default: "desc")
limitnumberNoNumber of results (default: 25, max: 100)
offsetnumberNoPagination offset (default: 0)
Example Response
{
  "entity": "transactions",
  "count": 25,
  "data": [
    {
      "hash": "0x123...",
      "blockNumber": 42000000,
      "fromAddress": "0xaaa...",
      "toAddress": "0xbbb...",
      "value": "1000000000000000000"
    }
  ]
}