Basic usage

Learn the basics of using the Stacks Node RPC API.

Usage

The Stacks Node RPC API provides direct access to Stacks blockchain nodes through RPC endpoints. All requests use HTTPS and enforce standard REST principles.

Base URL

https://api.hiro.so

Making requests

Terminal
$
curl -L 'https://api.hiro.so/v2/info' \
-H 'Accept: application/json'

Authentication

Include your API key for higher rate limits:

Terminal
$
curl -L 'https://api.hiro.so/v2/info' \
-H 'Accept: application/json' \
-H 'x-api-key: $HIRO_API_KEY'

Rate limits

RPC calls are weighted based on method cost and consume more units than REST endpoints:

Method TypeExamplesCost Multiplier
Light readsget_block, get_transaction
Read-only contract callscall_read_only_function
Transaction submissionsubmit_transaction
Heavy operationstrace_call, deep contract scans

Rate limit headers

X-RateLimit-Limit: 900 # window capacity in units
X-RateLimit-Remaining: 125 # remaining units
X-RateLimit-Reset: 60 # seconds until reset
X-RateLimit-Method-Cost: 3 # cost for this RPC method
X-Plan-Tier: starter # your plan tier
X-Surface: rpc # indicates RPC endpoint

Response codes

CodeDescription
200Successful request
400Invalid parameters
401Missing API key
403Invalid API key
404Resource not found
429Rate limit exceeded
5xxServer/upstream node errors

How is this guide?