Complete reference for the OpenScan.AI REST API v2.
Base URL: https://xdcscan.io/api/v2 ยท Interactive docs: xdcscan.io/api-docs
The API follows the Blockscout v2 specification. All endpoints are read-only GETs unless noted. Authentication is optional โ see API Keys & Rate Limits.
Conventions
- Addresses and hashes are
0x-prefixed hex strings. - Amounts are integers in the smallest unit (wei for the native coin, base units for tokens).
- Pagination: list endpoints return
itemsplusnext_page_params. Append the params to the next request;nullmeans the last page. Max 50 items per page. - Errors return a JSON body of
{ "message": "..." }with an appropriate HTTP status code.
Stats
Get network stats
GET /api/v2/statscurl https://xdcscan.io/api/v2/statsResponse fields include total_blocks, total_transactions, total_addresses, average_block_time (ms), coin_price, gas_prices, and network_utilization_percentage.
Get transaction chart data
GET /api/v2/stats/charts/transactionsGET /api/v2/stats/charts/marketReturns time-series arrays of { date, value } points for charting.
Blocks
List recent blocks
GET /api/v2/blocksQuery parameters: type โ block (default), uncle, or reorg.
curl https://xdcscan.io/api/v2/blocksGet a block
GET /api/v2/blocks/{number_or_hash}curl https://xdcscan.io/api/v2/blocks/89000000Returns height, hash, timestamp, miner, gas_used, gas_limit, tx_count, and reward details.
Transactions
List transactions
GET /api/v2/transactionsQuery parameters: filter โ pending or error.
Get a transaction
GET /api/v2/transactions/{hash}curl https://xdcscan.io/api/v2/transactions/0x9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f9a8bKey fields: hash, block, timestamp, from, to, value, fee, gas_used, gas_price, status (ok or error), method, and decoded_input (when the target contract is verified).
Token transfers, internal transactions, and logs
GET /api/v2/transactions/{hash}/token-transfersGET /api/v2/transactions/{hash}/internal-transactionsGET /api/v2/transactions/{hash}/logsGET /api/v2/transactions/{hash}/state-changesLogs include decoded topics and data for verified contracts; state changes show per-address balance and storage diffs.
Addresses
Get an address
GET /api/v2/addresses/{hash}curl https://xdcscan.io/api/v2/addresses/0x1234567890abcdef1234567890abcdef12345678{ "hash": "0x1234567890abcdef1234567890abcdef12345678", "coin_balance": "1234567890000000000000", "is_contract": false, "name": null, "token": null, "has_token_transfers": true, "has_logs": true}Address activity
GET /api/v2/addresses/{hash}/transactionsGET /api/v2/addresses/{hash}/token-transfersGET /api/v2/addresses/{hash}/internal-transactionsGET /api/v2/addresses/{hash}/token-balancesGET /api/v2/addresses/{hash}/tokens?type=ERC-20GET /api/v2/addresses/{hash}/countersGET /api/v2/addresses/{hash}/nft?type=ERC-721,ERC-1155/transactionsacceptsfilter=to,filter=from, orfilter=to%20%7C%20from./token-transfersacceptstype,filter, andtoken(contract address) parameters./countersreturns aggregate counts (transactions, transfers, gas used) without pagination.
Tokens
GET /api/v2/tokens?q={query}&type=ERC-20GET /api/v2/tokens/{hash}GET /api/v2/tokens/{hash}/transfersGET /api/v2/tokens/{hash}/holdersGET /api/v2/tokens/{hash}/instancesGET /api/v2/tokens/{hash}/instances/{token_id}Full field-by-field details are in the Tokens API Reference.
Smart contracts
List verified contracts
GET /api/v2/smart-contractsQuery parameters: q (name filter), filter (solidity, vyper, yul).
Get a contract
GET /api/v2/smart-contracts/{hash}curl https://xdcscan.io/api/v2/smart-contracts/0xabcdefabcdefabcdefabcdefabcdefabcdefabcdReturns name, compiler_version, optimization_enabled, source_code, abi, is_verified, is_partially_verified, and verified_at for verified contracts.
Read from a contract
GET /api/v2/smart-contracts/{hash}/methods-readPOST /api/v2/smart-contracts/{hash}/query-read-methodList read-only methods, then query one by posting { "args": [...], "method_id": "..." }. For read/write interaction from a wallet, use the explorer UIโs contract tabs โ see Contract Verification.
Search
GET /api/v2/search?q={query}GET /api/v2/search/quick?q={query}GET /api/v2/search/check-redirect?q={query}/searchโ full results across tokens, addresses, transactions, blocks, and contracts./search/quickโ compact matches for autocomplete widgets./search/check-redirectโ returns the canonical entity URL for a query (useful for โIโm feeling luckyโ search boxes).
See the Search & Filtering Guide for usage patterns.
Main-page helpers
Endpoints that power the explorer home page, useful for dashboards:
GET /api/v2/main-page/blocksGET /api/v2/main-page/transactionsGET /api/v2/main-page/indexing-statusindexing-status reports how far the indexer has caught up โ check it before assuming recent data is complete on a self-hosted instance.
Next steps
- Quick Start โ runnable first calls
- Examples โ portfolio tracker, whale alerts, CSV exports
- Account API โ keys, watchlists, and private tags