Base URLs and chains
Use /api/v1/{chain}/... for external 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://<host>/api/v1/{chain}/...Set STARKSCAN_BASE_URL to the /api root (for example https://starkscan.co/api) and append /v1/{chain}/....
curl -H "X-Starkscan-Api-Key: $STARKSCAN_API_KEY" \
"https://starkscan.co/api/v1/SN_MAIN/status"Inside the explorer web app the browser may call /v1/... directly on the same origin, and a trusted edge maps the external /api prefix to the same backend. If you copy a path that begins with /v1 from an internal snippet, prepend your /api base before calling it externally.
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://starkscan.co/api/v1/meta/chains"