API Reference: Common Methods & Error Handling
Common methods
A representative sample of frequently used EVM JSON-RPC methods:
| Method | Purpose |
|---|---|
eth_blockNumber | Latest block number |
eth_getBalance | Account balance at a given block |
eth_gasPrice | Current gas price estimate |
eth_getBlockByNumber | Full block data by number |
eth_call | Read-only contract call, no state change |
Example request/response for eth_getBlockByNumber:
// Request
{
"jsonrpc": "2.0",
"method": "eth_getBlockByNumber",
"params": ["0x1284d2f", false],
"id": 1
}
// Response (abbreviated)
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"number": "0x1284d2f",
"hash": "0x...",
"timestamp": "0x656789ab",
"transactions": ["0x...", "0x..."]
}
}
Error handling
Errors follow the standard JSON-RPC 2.0 error object shape: a code, a message, and sometimes a data field with more detail.
| Code | Meaning |
|---|---|
| -32700 | Parse error. Invalid JSON was sent. |
| -32600 | Invalid request. The JSON sent is not a valid request object. |
| -32601 | Method not found |
| -32602 | Invalid params |
| -32603 | Internal error |
| 429 (HTTP) | Rate limit exceeded for your current tier |
Handle a 429 explicitly in production code. See Rate Limits by Tier for the ceilings themselves.