Short answer: The Solana RPC API is JSON-RPC 2.0 over HTTP for requests and over WebSocket for subscriptions, served publicly at https://api.mainnet.solana.com, https://api.devnet.solana.com and https://api.testnet.solana.com. As documented on 26 November 2026, each public endpoint allows 100 requests per 10 seconds per IP, 40 per 10 seconds for a single method and 40 concurrent connections. Solana's docs say these endpoints are not meant for production.
Solana's documentation site blocked automated reading on 26 November 2026 behind a browser check, so the pages were read from their source in the official solana-foundation/solana-com repository, where the clusters page was last changed on 24 November 2026. The docs now live under solana.com/developers/docs; old URLs redirect. Every request below was sent to the public endpoints that day from one IP address, with the output pasted as returned.
This guide explains an interface. It does not recommend a token, a provider or any trading activity, and the Python samples only read public data.
Solana public RPC endpoints and their rate limits
Each cluster has one public HTTP endpoint run by Solana Labs, with the same published limits on all three; the same host also answered WebSocket subscriptions over wss:// in the test below.
| Cluster | HTTP | Purpose | Notes |
|---|---|---|---|
| Mainnet | https://api.mainnet.solana.com | Production, real SOL | Load-balanced node cluster |
| Devnet | https://api.devnet.solana.com | Application testing | Single node; test SOL from the web faucet; RPC airdrop closed |
| Testnet | https://api.testnet.solana.com | Validator and stress testing | Single node; may have downtime |
The docs now name api.mainnet.solana.com; the older api.mainnet-beta.solana.com still answered getVersion on 26 November 2026, but new code should use the documented name.
| Limit | Value |
|---|---|
| Requests per 10 seconds | 100 |
| Requests per 10 seconds for a single RPC method | 40 |
| Concurrent connections | 40 |
| New connections per 10 seconds | 40 |
| Data per 30 seconds | 100 MB |
The same page warns that these figures are not guaranteed to be current, and the live headers do differ. On 26 November 2026 a getSlot response from the mainnet endpoint carried x-ratelimit-tier: free, x-ratelimit-method-limit: 150, x-ratelimit-rps-limit: 250, x-ratelimit-conn-limit: 40, x-ratelimit-connrate-limit: 40 and x-ratelimit-pubsub-limit: 5. The headers do not state their time window, so they cannot be compared directly with the documented 10-second figures; the connection limits match, the request limits do not obviously match, and five appears to cap WebSocket subscriptions or connections. Budget to the documented numbers and read the headers at run time.
Hypothetical example. A monitor polls getSignaturesForAddress for 30 addresses every 10 seconds: 30 calls of one method per 10 seconds, under the documented 40. At 50 addresses it needs 50, over the single-method limit though under the 100-request total, so it gets 429 responses. Subscriptions or a private endpoint avoid the problem.
Over the limit the endpoint returns 429 with a Retry-After header; 403 means your IP or site has been blocked.
Solana RPC methods most programs need
A read-only integration usually needs about six HTTP methods; the docs list them under the HTTP reference with request and response shapes.
| Method | Returns | Watch out for |
|---|---|---|
getBalance | Lamports for one account (1 SOL = 1,000,000,000 lamports) | Result sits in value with a context.slot |
getAccountInfo, getMultipleAccounts | Owner, lamports, data | Use base64; base58 fails above 128 bytes |
getSignaturesForAddress | Signatures newest first | limit 1 to 1,000 (default 1,000); page with before and until; rejects processed |
getTransaction | One transaction with meta and logs | Set maxSupportedTransactionVersion to read versioned transactions |
getProgramAccounts | All accounts owned by a program | Heavy; filter it (next section) |
getLatestBlockhash, sendTransaction | Blockhash; submit a signed transaction | Out of scope here; the Jupiter swap API guide covers a full send flow |
Commitment changed meaning in 2026. The RPC overview read on 26 November 2026 describes three values: processed (newest, the block can still be skipped), confirmed (now the same block as finalized, kept for compatibility and planned for removal) and finalized (a finalization certificate from 80% of stake in one round or 60% in each of two rounds). It says confirmed and finalized arrive roughly 150 milliseconds after a block on mainnet and recommends finalized in new code; most methods default to it. Older articles that describe confirmed as a faster, weaker level are out of date. Mint and token-account concepts are covered in Solana tokens explained.
Solana getProgramAccounts: filters and cost
getProgramAccounts returns every account a program owns, so on a large program it must be narrowed with filters, or the response is huge and many providers refuse or price it separately.
- Up to 4 filters, all of which must match.
dataSizecompares account length;memcmpcompares bytes at anoffset(decoded data limited to 128 bytes);tokenAccountStatekeeps only initialized Token or Token-2022 accounts. - Return less.
dataSlicewithlength: 0returns only the addresses and lamports;encoding: base64is recommended;binaryis still the documented default but is marked deprecated. - Order.
sortResultsdefaults to true; if you turn it off, assume no order.
The documented example finds the token accounts of one owner: dataSize 165 (an SPL token account) plus a memcmp on the owner field at offset 32. Sent with dataSlice length 0 on 26 November 2026, that query returned results from both the public mainnet and devnet endpoints, the devnet call in 0.28 seconds. For one owner's tokens, getTokenAccountsByOwner is the lighter method; keep getProgramAccounts for questions that cut across owners.
Solana WebSocket subscriptions and what they miss
Subscriptions push changes over one persistent connection: you send a *Subscribe request, get a numeric subscription id, then receive notifications carrying that id.
| Method | Notifies on | Documented limit |
|---|---|---|
accountSubscribe | Lamports or data change on one account | Ignores minContextSlot |
programSubscribe | Accounts owned by a program | Takes the same filters as getProgramAccounts |
logsSubscribe | Transaction logs: all, allWithVotes or mentions | mentions takes exactly one address; more returns Invalid params |
signatureSubscribe | Status of one signature | Ends after the final confirmation notification |
slotSubscribe, rootSubscribe | New slot or new root | Useful as a liveness signal |
blockSubscribe | Blocks at confirmed or finalized | Marked unstable; the node must run with --rpc-pubsub-enable-block-subscription |
The most important sentence is on the provider guide: subscription notifications are not a durable event log, so after a reconnect you must reconcile state over HTTP. A dropped socket loses whatever happened while it was down. The pattern that works is: reconnect with backoff, resubscribe, then fetch what you missed, for example getSignaturesForAddress with until set to the last signature you processed. Keepalive and stale-socket detection are covered in WebSocket heartbeat and reconnect in Python.
Solana RPC API in Python: HTTP and WebSocket, tested
Both samples use plain JSON-RPC through requests and websockets 13.1, so they show the wire format that any SDK wraps.
HTTP: version, balance and signatures
import time, datetime, requests
URL = "https://api.mainnet.solana.com" # public, rate-limited, not for production
TOKEN_PROGRAM = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
def rpc(method, params=None, tries=4):
body = {"jsonrpc": "2.0", "id": 1, "method": method, "params": params or []}
for i in range(tries):
r = requests.post(URL, json=body, headers={"User-Agent": "Mozilla/5.0"}, timeout=20)
if r.status_code == 429: # docs: honour Retry-After
time.sleep(float(r.headers.get("Retry-After", 2 ** i)))
continue
r.raise_for_status() # 403 means blocked: stop, do not retry
data = r.json()
if "error" in data:
raise RuntimeError(data["error"])
return data["result"], r.headers
raise RuntimeError("still rate limited")
print("checked", datetime.datetime.now(datetime.timezone.utc).isoformat(timespec="seconds"))
version, h = rpc("getVersion")
print("version", version["solana-core"], "| tier", h.get("x-ratelimit-tier"),
"| method limit", h.get("x-ratelimit-method-limit"), "| pubsub limit", h.get("x-ratelimit-pubsub-limit"))
bal, _ = rpc("getBalance", [TOKEN_PROGRAM, {"commitment": "finalized"}])
print("balance", bal["value"] / 1e9, "SOL at slot", bal["context"]["slot"])
sigs, _ = rpc("getSignaturesForAddress", [TOKEN_PROGRAM, {"limit": 3}])
for s in sigs:
print(s["slot"], s["signature"][:16] + "...", "failed" if s["err"] else "ok", s["confirmationStatus"])
Output on 26 November 2026:
checked 2026-11-26T20:51:09+00:00
version 4.4.0 | tier free | method limit 150 | pubsub limit 5
balance 0.240230698 SOL at slot 474288440
474288443 48wBKinbQZ5tXhc6... failed finalized
474288443 2JCRYXBpewco9nh8... ok finalized
474288443 5nZkawwgDEqLoDE4... ok finalized
WebSocket: slots and logs with reconnect
import asyncio, json, datetime, websockets
WS = "wss://api.mainnet.solana.com"
async def watch(max_msgs=4):
backoff = 1
while True:
try:
async with websockets.connect(WS, ping_interval=20, ping_timeout=20,
user_agent_header="Mozilla/5.0") as ws:
backoff = 1
await ws.send(json.dumps({"jsonrpc": "2.0", "id": 1, "method": "slotSubscribe"}))
await ws.send(json.dumps({"jsonrpc": "2.0", "id": 2, "method": "logsSubscribe",
"params": [{"mentions": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"]},
{"commitment": "finalized"}]}))
seen = {"slotNotification": 0, "logsNotification": 0}
while min(seen.values()) < max_msgs:
msg = json.loads(await asyncio.wait_for(ws.recv(), timeout=30))
if "id" in msg:
print("subscribed", msg["id"], "->", msg.get("result", msg.get("error")))
continue
m = msg["method"]
if seen.get(m, max_msgs) >= max_msgs:
continue
seen[m] += 1
r = msg["params"]["result"]
if m == "slotNotification":
print("slot", r["slot"], "root", r["root"])
else:
v = r["value"]
print("logs slot", r["context"]["slot"], v["signature"][:16] + "...",
"failed" if v["err"] else "ok", len(v["logs"]), "lines")
return
except (OSError, asyncio.TimeoutError, websockets.ConnectionClosed) as e:
print("disconnected:", type(e).__name__, "retry in", backoff, "s")
await asyncio.sleep(backoff)
backoff = min(backoff * 2, 30)
print("checked", datetime.datetime.now(datetime.timezone.utc).isoformat(timespec="seconds"))
asyncio.run(watch())
Output on 26 November 2026:
checked 2026-11-26T20:41:19+00:00
subscribed 1 -> 1765638
subscribed 2 -> 37288416
slot 474285681 root 474285679
logs slot 474285680 4wmQQc8gnbBLEtBB... ok 19 lines
logs slot 474285680 aqYGSY1aTiKCmqva... failed 3 lines
logs slot 474285680 5wzqteBw6qSY319b... ok 22 lines
logs slot 474285680 2bfQXXeaUUCYrgDh... ok 65 lines
slot 474285682 root 474285680
slot 474285683 root 474285681
slot 474285684 root 474285682
Both subscriptions were accepted on the public endpoint, and the logs stream included a failed transaction, which a watcher must not count as a transfer. Notice that the root trails the processed slot by two or three slots in these runs, which is the gap between what a node has seen and what it has rooted. The reconnect loop resubscribes after any drop, but a real watcher also needs the HTTP catch-up described above; the sample stops after four messages of each kind.
What third-party Solana RPC providers add
Private providers sell capacity, history and extra APIs on top of standard RPC; Solana's own provider guide says to compare them on method coverage, history depth, limits, regions, reliability and billing units, and to keep the standard RPC boundary clear so you can switch.
| Provider | Extras documented for Solana | Billing unit stated |
|---|---|---|
| Alchemy | Solana RPC, DAS API, Solana gRPC | Compute units; getBalance costs 10 CU; gRPC from $75 per TB |
| Helius | Webhooks, LaserStream gRPC with up to 48 hours of replay, Parsed Streams | Credits; 1 credit per webhook event |
| QuickNode | Streams with historical backfill; Webhooks for Ethereum, Solana and other chains | API credits; 30 per delivered webhook payload |
The guide's checklist is worth copying: test the exact methods you need on a trial endpoint, check minimumLedgerSlot and getFirstAvailableBlock for history, measure p95 and p99 latency and slot freshness from your own region, and test how each service reports rate limits and bad keys. It also says that a timed-out sendTransaction may already have landed, so while its blockhash is still valid, resend the same signed transaction and track its signature instead of building a new one. Solana keeps a provider directory at solana.com/rpc. Helius's documentation index (llms.txt) contains a section addressed to AI agents, with steps to sign up and pay from a local keypair; it was read as data and not acted on. A watcher built on these subscriptions is covered in the wallet tracking API guide, and Fincode's market data pipelines page describes that kind of build.
Frequently asked questions
What is the Solana mainnet RPC URL?
The public mainnet endpoint documented on 26 November 2026 is https://api.mainnet.solana.com, with WebSocket on wss://api.mainnet.solana.com. The older api.mainnet-beta.solana.com still answered that day.
What are the Solana public RPC rate limits?
The docs list 100 requests per 10 seconds per IP, 40 per 10 seconds for one method, 40 concurrent connections, 40 new connections per 10 seconds and 100 MB per 30 seconds, and say the figures may be outdated. Live headers that day showed different request numbers without a stated window.
Can I use the public Solana RPC in production?
Solana's documentation says no: the public endpoints are shared, rate-limited, may change limits without notice and may block high-traffic sites. Use a private provider or your own node.
Why does my Solana WebSocket miss events?
Notifications are not a durable log. After any disconnect, reconnect, resubscribe and fetch the gap over HTTP, for example with getSignaturesForAddress and the until parameter.
Is confirmed or finalized commitment faster on Solana?
As documented on 26 November 2026 they return the same block, roughly 150 milliseconds after it is produced on mainnet; confirmed is kept for compatibility and planned for removal, and finalized is recommended.
Sources
- Solana docs: Clusters and Public RPC Endpoints (source updated 24 November 2026; read from the repository because the site blocks automated reading) (opens in a new tab)
- Solana docs: Solana RPC Overview, endpoints and commitment (opens in a new tab)
- Solana docs: WebSocket methods (opens in a new tab)
- Solana docs: getProgramAccounts (opens in a new tab)
- Solana docs: Choosing an RPC Provider (opens in a new tab)
- solana-foundation/solana-com repository: documentation source for the RPC pages (read 26 November 2026) (opens in a new tab)
- Alchemy docs: Compute Unit Costs (opens in a new tab)
- Alchemy: Pricing (read 26 November 2026) (opens in a new tab)
- Helius docs: Webhooks (opens in a new tab)
- QuickNode docs: Getting Started with Webhooks (opens in a new tab)
This guide is general information about software and markets, not investment, legal or tax advice. Automated trading can lose money, past or backtested performance does not guarantee future results, and the rules that apply depend on your jurisdiction and your exchange's terms. Sources, checks and corrections: see the editorial policy.