Base URLs and chains
Use https://api.starkscan.co/v1/{chain}/... for hosted integrations, and discover the chain from the API instead of assuming one.
Base URLs and chains
One rule for the base URL
External integrations call:
https://api.starkscan.co/v1/{chain}/...The hosted production base is https://api.starkscan.co. The CLI and SDK use that default when STARKSCAN_BASE_URL is unset. Set STARKSCAN_BASE_URL only for preview or self-hosted hosts, and append /v1/{chain}/... to that base for raw HTTP calls.
curl -H "X-Starkscan-Api-Key: $STARKSCAN_API_KEY" \
"https://api.starkscan.co/v1/SN_MAIN/status"Inside the explorer web app the browser may call /v1/... directly on the same origin, and app-host compatibility maps /api/v1/... to the same backend. If you are pinned to an app host such as https://starkscan.co, use https://starkscan.co/api/v1/{chain}/...; new hosted integrations should use https://api.starkscan.co/v1/{chain}/....
The {chain} segment
{chain} selects the network: SN_MAIN is Starknet mainnet and SN_SEPOLIA is the Sepolia testnet.
A deployment is typically single-chain, so do not hard-code a chain list. Discover the chains a host serves and use the returned id in your paths:
curl -H "X-Starkscan-Api-Key: $STARKSCAN_API_KEY" \
"https://api.starkscan.co/v1/meta/chains"Sepolia
api.starkscan.co serves SN_MAIN only. Sepolia has its own host, and the key you made on starkscan.co works there too:
curl -H "X-Starkscan-Api-Key: $STARKSCAN_API_KEY" \
"https://sepolia.starkscan.co/api/v1/SN_SEPOLIA/status"JSON-RPC on Sepolia is POST https://sepolia.starkscan.co/api/v1/SN_SEPOLIA/rpc with the same header, or the node URL https://sepolia.starkscan.co/rpc/v0_10/SN_SEPOLIA/<key> for libraries that only accept a URL. For the SDK and CLI, set STARKSCAN_BASE_URL=https://sepolia.starkscan.co/api.
Sepolia history starts at block 10,692,545 (June 2026). Older blocks answer 410 history_expired; older transactions and classes are not in the index.