TheRPC API follows JSON-RPC 2.0 specification and provides:
Best for single requests and simple integrations. See examples in our HTTP/Curl guide.
https://YOUR_API_ENDPOINT
Ideal for subscriptions and real-time data. See eth_subscribe for subscription examples.
wss://YOUR_API_ENDPOINT
All API calls follow the JSON-RPC 2.0 format. See complete examples in our Basic Operations guide:
{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 1
}
Required fields:
jsonrpc
: Version identifier (always "2.0")method
: The RPC method to call (see Available Methods)params
: Array of parameters (can be empty)id
: Request identifierAll responses follow a consistent structure:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x..."
}
Or in case of error:
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32600,
"message": "Invalid Request"
}
}
All requests require an API key in the Authorization header. See our Authentication guide for detailed setup:
Authorization: Bearer YOUR_API_KEY
Common error codes (see FAQ for detailed error handling strategies):
-32700
: Parse error-32600
: Invalid request-32601
: Method not found-32602
: Invalid params-32603
: Internal errorFor practical implementation examples, check our language-specific guides:
For information about request limits and quotas, see our Rate Limits documentation.