API overview
| Network | Base URL |
|---|---|
| Mainnet | https://api.stxer.xyz |
| Testnet | https://testnet-api.stxer.xyz |
Both networks serve the same paths. The live OpenAPI description is at /openapi.json, browsable at /docs.
Conventions
- No keys. No authentication; please identify your client.
- JSON request and response bodies (
content-type: application/json), except traces, which are binary (application/octet-stream). - CORS is open (
access-control-allow-origin: *), so browsers can call the API directly. - Clarity values are hex-serialized strings, without
0xin responses. STX balances and nonces in reads are decimal strings. Large integers (u64, u128) may arrive as numbers or strings; parse them asBigInt. - Ids: transaction ids and block hashes are 32-byte hex. Simulation ids are 32 hex characters.
Errors
Errors carry a plain-text body.
| Status | Meaning | What to do |
|---|---|---|
400 | Malformed request: bad step, principal or contract id, or an AdvanceBlocks argument out of bounds | Fix the request |
404 | Unknown route or resource, or no trace for that transaction | Check ids; see traces |
409 | Body starts simulation_busy: — another submit is running on the session | Retry the same request after a short wait |
410 | Body starts simulation_outdated: — the session predates a simulator format change | Start a new session |
Do not parse error text beyond those prefixes. Back off on 429 and 5xx.
Endpoints
| Method | Path | Page |
|---|---|---|
POST | /devtools/v2/simulations | Sessions |
POST | /devtools/v2/simulations/{id} | Sessions |
GET | /devtools/v2/simulations/{id} | Sessions |
GET | /devtools/v2/simulations/{id}/tip | Sessions |
POST | /devtools/v2/simulations/{id}/reads | Sessions |
POST | /devtools/v2/simulations:instant | Instant |
GET | /inspect/{block_height}/{block_hash}/{txid} | Traces |
GET | /devtools/v2/simulations/{id}/inspect/{txid} | Traces |
GET | /contracts/{contract_id} | Contracts |
GET | /contracts/by-deploy/{txid} | Contracts |
POST | /contracts:parse | Contracts |