Usage
Understand general concepts, response codes, and authentication strategies.
Base URL
The Stacks API is built on REST principles, enforcing HTTPS for all requests to ensure data security, integrity, and privacy. The base URL for all API requests is:
https://api.mainnet.hiro.so
Making requests
To make a request to the Stacks API, you can paste the curl
command below in your terminal.
Terminal
$curl -L 'https://api.hiro.so/extended' \-H 'Accept: application/json'
Authentication
If you are using an api-key
, you will need to replace $HIRO_API_KEY
with your secret API key.
Terminal
$curl -L 'https://api.hiro.so/extended' \-H 'Accept: application/json' \-H 'X-API-Key: $HIRO_API_KEY'
Response codes
The Stacks API uses standard HTTP response codes to indicate the success or failure of an API request:
200
: Successful request400
: Check that the parameters were correct401
: Missing API key403
: Invalid API key404
: Resource not found429
: Rate limit exceeded5xx
: Server errors
Rate limits
API key | Rate limit |
---|---|
No | 50 requests per minute (RPM) per client IP, for unauthenticated traffic |
Yes | 500 requests per minute (RPM) regardless of origin IP, with an authenticated API key |
Rate limits
For more information on rate limiting, you can check out the rate limiting documentation.