Solana JSON RPC API
Public JSON-RPC endpoints to read the Solana blockchain directly.
What it does
Solana nodes expose a JSON-RPC API for reading chain state and submitting transactions: account balances and data, token accounts, transaction and block lookup, signature status, program accounts, epoch/slot info, and (via WebSocket) subscriptions to account and slot changes.
Base URL
Authentication
The public endpoints (api.mainnet-beta.solana.com, api.devnet.solana.com, api.testnet.solana.com) need no key but are strictly rate limited and explicitly not for production. Real apps use a provider (Helius, QuickNode, Triton, Alchemy) with a keyed URL.
Code examples
curl -s https://api.mainnet-beta.solana.com -X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"getBalance",
"params":["9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"]}'import requests
r = requests.post("https://api.mainnet-beta.solana.com", json={
"jsonrpc": "2.0", "id": 1, "method": "getSignaturesForAddress",
"params": ["Vote111111111111111111111111111111111111111", {"limit": 3}]},
timeout=15)
for s in r.json()["result"]:
print(s["slot"], s["signature"])Rate limits & quotas
Public mainnet endpoint: roughly 100 requests/10 seconds per IP overall, 40 per 10 seconds per method, smaller caps for expensive calls, and no getProgramAccounts guarantees. Over the limit returns HTTP 429. Lamports are the base unit (1 SOL = 1,000,000,000 lamports).
Key response fields
| result.value | Most reads nest the payload under value (with a context.slot) |
| (getBalance) result.value | Balance in lamports |
| (getAccountInfo) result.value.data | Account data (base64 or parsed with encoding: jsonParsed) |
| (getTransaction) result.meta / transaction | Status, fee, balances, instructions |
| error.code / error.message | JSON-RPC error (e.g. -32005 node behind, -32602 bad params) |
Common errors
| 429 | Public-endpoint rate limit — move to a provider. |
| -32005 | Node is behind / rate limited — retry with backoff. |
| -32602 | Invalid params — e.g. bad base58 pubkey or missing config object. |
| -32004 / long-term storage | Old transactions/blocks may be pruned from the public node — use an archive provider. |
When to use it (and alternatives)
Use the public endpoint only for learning, scripts and devnet testing. For any real app, get a keyed RPC URL from a Solana infrastructure provider — the interface is identical, so you just swap the base URL. For rich indexed data (NFTs, token holders, parsed history) those providers also offer enhanced APIs, similar to Alchemy on EVM.
FAQ
Can I build a production app on api.mainnet-beta.solana.com?
No — the Solana docs explicitly say the public RPC is not for production. It is heavily rate limited and offers no reliability guarantees. Use a provider endpoint.
Why is my balance a huge integer?
It is in lamports. Divide by 1,000,000,000 for SOL. Use integer math for exact values.
How do I get parsed account/transaction data?
Pass {"encoding": "jsonParsed"} in the params config object for getAccountInfo, getTransaction, getTokenAccountsByOwner and similar — the node decodes known program data for you.
New to APIs?
Short guides for working with this API — and any other.