API Directory › 🔗 Blockchain & Web3 › Solana JSON RPC
No authHTTPS

Solana JSON RPC API

Public JSON-RPC endpoints to read the Solana blockchain directly.

Auth
No auth needed
HTTPS
Yes
CORS
Unknown
Open Solana JSON RPC docs ↗

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

https://api.mainnet-beta.solana.com

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
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"]}'
Python
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.valueMost reads nest the payload under value (with a context.slot)
(getBalance) result.valueBalance in lamports
(getAccountInfo) result.value.dataAccount data (base64 or parsed with encoding: jsonParsed)
(getTransaction) result.meta / transactionStatus, fee, balances, instructions
error.code / error.messageJSON-RPC error (e.g. -32005 node behind, -32602 bad params)

Common errors

429Public-endpoint rate limit — move to a provider.
-32005Node is behind / rate limited — retry with backoff.
-32602Invalid params — e.g. bad base58 pubkey or missing config object.
-32004 / long-term storageOld 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.

🛠️ Handy LarzOS tools

Free tools to help you work with this API.

JSON Formatter

Related Blockchain & Web3 APIs

← Back

More Blockchain & Web3 APIs · All 196 APIs