Solana RPC
Endpoints, request format, limits and method availability for the constant-k Solana JSON-RPC API.
constant-k serves the standard Solana JSON-RPC API from mainnet nodes it builds and runs. Any Solana SDK works unchanged against a constant-k endpoint with your API key.
- Standard JSON-RPC methods, including
getTransaction,getSignaturesForAddressandgetBlock. - Accounts indexed by program ID and by SPL token mint and owner, so queries such as
getTokenAccountsByOwnerresolve from an index. sendTransactionforwards to the next five leaders and rebroadcasts. See Sending Transactions.- WebSocket subscriptions in the Operator, Blade Runner and Nexus plans. See WebSockets.
Endpoints
| Region | URL |
|---|---|
https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY | |
https://rpc-frankfurt.constant-k.com/?api-key=YOUR_API_KEY | |
https://rpc-amsterdam.constant-k.com/?api-key=YOUR_API_KEY | |
| Nearest region (geo-routed) | https://rpc.constant-k.com/?api-key=YOUR_API_KEY |
The key can also go in a header. See Authentication.
Request format
Requests are JSON-RPC 2.0 over HTTP POST, one call per request or a batch of calls in one request. This example reads a wallet's SOL balance.
curl "https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY" \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getBalance",
"params": ["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri", {"commitment": "confirmed"}]
}'Each method's parameters and response format are in the method reference, for example getBalance, getAccountInfo and getTransaction.
A response can carry HTTP 200 and a JSON-RPC error object. Any body with an error field is a failure, whatever the status code. See Errors.
Commitment levels
Most read methods take a commitment option. It sets how final the data must be.
| Level | Meaning | Suits |
|---|---|---|
processed | The node has processed the block. It can still be skipped. | The lowest latency, when you can handle rollbacks |
confirmed | A supermajority of stake has voted on the block. | Most apps and trading logic |
finalized | The block is rooted and will not change. | Balances you report to users, accounting, withdrawals |
Method availability
Most methods are on every plan. Per-plan rates are on Plans & Limits.
| Methods | Plans |
|---|---|
getLatestBlockhash, getMultipleAccounts, getSignatureStatuses, getSignaturesForAddress, getTokenAccountsByOwner, simulateTransaction, sendBundle, simulateBundle, getBundleStatuses, getInflightBundleStatuses, the staked (SWQoS) send path | OperatorBlade RunnerNexus |
getBlocks, getBlocksWithLimit, getSupply, getTokenLargestAccounts, getTokenAccountsByDelegate, getProgramAccounts, getProgramAccountsV2, Address Lookup Table lookups | Blade RunnerNexus |
getTransactionsForAddress | Nexus |
getProgramAccounts, getProgramAccountsV2 and Address Lookup Table lookups have extra conditions:
getProgramAccountsneeds at least one filter (dataSizeormemcmp), except on the indexed programs listed on its page. Scans of the token programs must be owner-scoped: adataSize: 165filter plus amemcmpof the full 32-byte owner at offset 32.getProgramAccountsandgetProgramAccountsV2share one budget per API key: 25 calls per second in the Blade Runner plan and 75 in the Nexus plan. There is no cap on open requests. Over the rate, the endpoint returns429.getProgramAccountsV2is paginated and returns up to 10,000 accounts per page, 1,000 by default, on the same shared budget.- Address Lookup Table queries go through
getProgramAccountsorgetProgramAccountsV2with the Address Lookup Table program id as the first parameter, are answered from an in-memory index, and count against the same budget; there is no separate method or hostname. See Address Lookup Tables.
Methods not served on any plan
| Method | Instead |
|---|---|
getLargestAccounts | Not available |
Batch requests
A batch is a JSON array of JSON-RPC calls in one HTTP POST. It is accepted on the standard RPC URLs, the staked RPC URLs and the Neon Zero URLs, in every region, on every plan.
[
{ "jsonrpc": "2.0", "id": 1, "method": "getBalance", "params": ["83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri", { "commitment": "confirmed" }] },
{ "jsonrpc": "2.0", "id": 2, "method": "getSlot" }
]| Plan | Calls per batch |
|---|---|
| Free | 5 |
| Operator | 10 |
| Blade Runner | 25 |
| Nexus | 50 |
- Every method that works as a single call works inside a batch. On a staked URL,
sendTransactionin a batch takes the staked send path. - Each call counts as one request against every limit a single call has: the plan total, the method rate, the monthly limits and the send limits. A batch of 10 uses 10 requests.
- A batch over the cap is refused with HTTP
400and code-32600, and none of its calls run. - The reply is one JSON array in the same order as the calls, each entry carrying its own
id. A call with noid(a notification) runs and gets no entry. - A call that is refused, over a limit or fails gets its own error object in its slot, the same error a single call would get. The other calls still run, and the batch reply carries HTTP
200. Retry-Afteron a batch reply is the longestRetry-Afterany of its calls got.
Batch size and order
At most 8 calls of one batch run at the same time. Reply slots come back in the order of the calls, so a slow call delays the calls after it. Slow calls such as getProgramAccounts and history calls keep the rest of the batch fast when they are placed last, or sent alone.
| Situation | Reply |
|---|---|
| An item is not a JSON object | Its slot is { "code": -32600, "message": "Invalid Request" } with id null. The other calls run. |
An empty array [] | HTTP 400, code -32600, Invalid Request. |
| A call whose reply would pass the 32 MiB cap on the whole batch reply | That call gets -32600 with Batch reply over 32 MiB: send this request alone, and the calls after it get the same. |
| A reply over 64 KiB to an HTTP/1.0 client | HTTP 400 with Batch reply too long for HTTP/1.0: use HTTP/1.1. |
Request limits
| Cap | Value |
|---|---|
| Calls per request | One call, or a batch of up to 5, 10, 25 or 50 calls by plan. See Batch requests. |
| Request body | 1 MB. Over that the gateway returns a plain HTTP 413. The nodes themselves accept 200 KB, so that is the effective ceiling. |
getMultipleAccounts, getSignatureStatuses | 100 items per call |
| Time per request | 60 seconds. A longer call is cut off, so heavy getBlock and getProgramAccounts calls need narrowing. |
Cached reads
Reads can be up to one slot old. Identical getAccountInfo, getMultipleAccounts, getTokenAccountsByOwner, getLatestBlockhash, getSignaturesForAddress, getRecentPrioritizationFees and getSlotLeaders calls that arrive within 366 ms of each other, which is one slot, share a single answer.
Polling the same account faster than that returns the same data and still uses your quota. A getTransaction for a transaction that has not landed is never cached, so confirmation polling always reads live state.
Transaction history
History is served from each region's own ledger. Once a slot falls out of a region's ledger, getTransaction can no longer return it. In the Free, Operator and Blade Runner plans, history ends at that window.
Past the ledger window, these lookups reach long-term storage:
| Lookup past the region's ledger window | Free | Operator | Blade Runner | Nexus |
|---|---|---|---|---|
getBlock: older blocks, back to genesis | None | None | 1 block / 15 s | 1 block / 3 s |
getSignaturesForAddress: older signatures | None | None | None | ✓ |
getTransaction: older transactions, for signatures from getSignaturesForAddress | None | None | None | ✓ |
getTransactionsForAddress: full address history | None | None | None | ✓ |
Limits, waits and over-limit behaviour are on Historical lookups.
Cube Runner answers every getBlock request and can return blocks older than the ledger window. It returns an older block when the region cache or another region's cache holds that block. It also retrieves older blocks from long-term storage, which holds every block since genesis, for the plans in Cube Runner's plan comparison.
- The window is finite and moves with the chain. It is measured in stored data, not in hours, so its length changes with the size of recent blocks.
- The window differs between regions. A signature that resolves in one region can be missing in another. Only the region being queried can answer for its own window.
getFirstAvailableBlockreturns the oldest block from which every later block can be retrieved withgetBlock. With long-term storage (Blade Runner and Nexus plans), it returns0, the genesis block. Without it (Free and Operator plans), it returns the oldest block from which the region holds every later block, in its cache or its ledger. Older blocks are still returned when a cache in any region holds them.minimumLedgerSlotreturns the oldest slot the region's ledger holds. That slot is the history depth forgetTransaction.- Both calls are cheap and report the actual depth rather than an assumed one.
Transaction history older than the window, past the historical lookups limits, has to come from your own store, written as the data arrives, or from an archive service.
Browser requests
The endpoints answer CORS preflight requests and allow any origin, including credentials. They accept the X-API-Key and solana-client request headers, so a page can call the RPC directly.
A browser call exposes your API key
Anyone who loads the page can read the key. A public site needs its own backend in front.
Efficient calls
- One HTTP client with keep-alive per process. A new TLS handshake on every call adds a full round trip or more.
- One
getMultipleAccountscall fetches up to 100 accounts, in place of manygetAccountInfocalls. encoding: "base64"withdataSlicereturns only the bytes you need.minContextSlotrejects state older than a slot you have already seen.- A WebSocket subscription or a Kaldera stream replaces fast polling.
- One region per flow. See Choosing a region.