Solana RPC · Accounts & balances
POST getProgramAccounts
All accounts owned by a program, with dataSize/memcmp filters — served from the on-disk mirror, whitelisted programs only.
Endpoint
POST https://solrpc.infinityblocks.io/<API_KEY>
Standard Solana JSON-RPC 2.0 over HTTP POST. The API key is part of the URL path.
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
programId | string | yes | Base-58 program id (must be whitelisted/indexed). |
config | object | no | filters (array of {"dataSize":N} and/or {"memcmp":{"offset":N,"bytes":"…","encoding":"base58"|"base64"}}, repeatable), dataSlice ({"offset":N,"length":N}). |
Request
curl -s https://solrpc.infinityblocks.io/<API_KEY> \
-X POST -H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"getProgramAccounts","params":["<PROGRAM_ID>",{"filters":[{"dataSize":165}]}]}'
With @solana/web3.js
const accts = await rpc.getProgramAccounts(new PublicKey("<PROGRAM_ID>"), { filters: [{ dataSize: 165 }] });
Response
{ "jsonrpc": "2.0", "id": 1, "result": [ { "pubkey": "<ACCOUNT>", "account": { "lamports": 2039280, "owner": "<PROGRAM_ID>", "data": ["<base64>","base64"], "executable": false, "rentEpoch": 0, "space": 0 } } ] }
Not run against the validator (it keeps no general account index) — served from an on-disk mirror (ClickHouse, fed by the geyser account stream), and only for whitelisted programs; any other program id returns
403. filters supports dataSize and repeatable memcmp (byte match at an offset — e.g. an 8-byte Anchor discriminator plus a pubkey field), matching standard JSON-RPC semantics. Whitelist a program yourself (add-only, live within seconds, no validator restart): POST /v1/programs/{programId}/whitelist with your API key. See also the REST equivalent, /programs/{programId}/accounts, which returns the same data with pagination.Try it
Run getProgramAccountslive · POST
Replace placeholders (e.g. <ADDRESS>) with real values. Your key is stored only in this browser.
—