POSTgetProgramAccounts

Returns all accounts owned by the provided program Pubkey

Request Body
jsonrpcstringrequired
idintegerrequired
methodstringrequired
paramsoneOf[]required

It contains following items:

  1. Pubkey of program (required)
  2. ConfigurationObject (optional)
params[0]string

Base-58 encoded Pubkey of the program to query

Responses
idinteger

The request ID

jsonrpcstring

The JSON-RPC version

pubkeystring

The account Pubkey as base-58 encoded string

accountobject
dataany[]

Data associated with the account, either as encoded binary data or JSON format {: } - depending on encoding parameter

executableboolean

Boolean indicating if the account contains a program (and is strictly read-only)

lamportsinteger (uint64)

Number of lamports assigned to this account

ownerstring

Base-58 encoded Pubkey of the program this account has been assigned to

rentEpochinteger (uint64)

The epoch at which this account will next owe rent

spaceinteger (uint64)

The data size of the account

X-API-KEY
RequestCU150
cURL
curl -X POST "https://solana-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getProgramAccounts",
  "params": [
    "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
    {
      "commitment": "finalized",
      "filters": [
        {
          "dataSize": 17
        },
        {
          "memcmp": {
            "offset": 4,
            "bytes": "3Mc6vR"
          }
        }
      ]
    }
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "result": [
    {
      "pubkey": "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY",
      "account": {
        "data": "2R9jLfiAQ9bgdcw6h8s44439",
        "executable": false,
        "lamports": 15298080,
        "owner": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
        "rentEpoch": 28,
        "space": 42
      }
    }
  ],
  "id": 1
}