Response headers

Understanding rate limit and quota information in API response headers.

All Hiro APIs return response headers that provide important information about rate limits and usage quotas.

The following headers are returned with every API response:

Terminal
$
curl -I https://api.hiro.so/extended/v1/info -H 'x-api-key: your-api-key'
HeaderDescription
ratelimit-limitThe rate limit ceiling for that endpoint
ratelimit-remainingThe number of requests left for the current window
ratelimit-resetThe time when the rate limit window resets (Unix timestamp)
retry-afterTime to wait before retrying (only present when rate limited)

Stacks service headers

When calling Stacks-related endpoints (Stacks Blockchain API, Token Metadata API, etc), you'll receive:

// Example: Fetching Stacks account info
const response = await fetch('https://api.hiro.so/extended/v1/address/SP318Q55DEKHRXJK696033DQN5C54D9K2EE6DHRWP/assets', {
headers: { 'x-api-key': apiKey }
});
console.log(response)
// Example response headers:
// x-ratelimit-cost-stacks: 1 // !mark
// x-ratelimit-limit-stacks-minute: 5000
// x-ratelimit-remaining-stacks-minute: 4999
HeaderDescription
x-ratelimit-cost-stacksThe quota cost for this specific request
x-ratelimit-limit-stacks-secondPer-second limit for Stacks services
x-ratelimit-remaining-stacks-secondRemaining requests this second
x-ratelimit-limit-stacks-minutePer-minute limit for Stacks services
x-ratelimit-remaining-stacks-minuteRemaining requests this minute
x-ratelimit-limit-stacks-monthMonthly limit for Stacks services
x-ratelimit-remaining-stacks-monthRemaining requests this month

The x-ratelimit-cost-stacks header shows the exact quota cost for each request, which may vary based on the endpoint and parameters used.

Further reading

How is this guide?