> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thornode.io/llms.txt
> Use this file to discover all available pages before exploring further.

# getProgramAccounts

> Returns all accounts owned by the provided program Pubkey.

Returns all accounts owned by the provided program Pubkey.

## On ThorNode

Answered by FastGate through the ThorEdge RPC URL; no separate endpoint or key. `commitment` and `minContextSlot` are accepted and ignored: the response reflects FastGate's indexed slot, reported as `context.slot` (no `apiVersion`). The request times out after 30 s. Encodings: `base64` (default), `base58`, `base64+zstd`, `jsonParsed` (token accounts and mints; other accounts fall back to base64). The options parameter must be an object; `dataSlice` is ignored with `jsonParsed`. `filters` are optional. Accepts `changedSinceSlot` in addition to the standard options. At most 10,000 accounts; a larger result returns `-32600` and asks you to use [`getProgramAccountsV2`](/api-reference/fastgate/getprogramaccountsv2). Standard `dataSize` and `memcmp` filters apply; `memcmp.bytes` is base-58 unless `encoding` is `"base64"`.

## Parameters

<ParamField body="address" type="string" required>
  The Solana program public key (address) to query accounts for, as a base-58 encoded string.
</ParamField>

<ParamField body="commitment" type="string">
  The commitment level for the request. Accepted and ignored by FastGate.

  * `confirmed`
  * `finalized`
  * `processed`
</ParamField>

<ParamField body="minContextSlot" type="number">
  The minimum slot that the request can be evaluated at. Accepted and ignored by FastGate.
</ParamField>

<ParamField body="withContext" type="boolean">
  Wrap the result in an RpcResponse JSON object.
</ParamField>

<ParamField body="encoding" type="string">
  Encoding format for the returned account data.

  * `jsonParsed`
  * `base58`
  * `base64`
  * `base64+zstd`
</ParamField>

<ParamField body="dataSlice" type="object">
  Request a slice of the account's data.
</ParamField>

<ParamField body="dataSlice.length" type="number">
  Number of bytes to return.
</ParamField>

<ParamField body="dataSlice.offset" type="number">
  Byte offset from which to start reading.
</ParamField>

<ParamField body="changedSinceSlot" type="number">
  Only return accounts that were modified at or after this slot number. Useful for incremental updates.
</ParamField>

<ParamField body="filters" type="array">
  Filters that every returned account must match.
</ParamField>

## Response

<ResponseField name="result" type="array">
  <Expandable title="item">
    <ResponseField name="pubkey" type="string">
      The account Pubkey as a base-58 encoded string.
    </ResponseField>

    <ResponseField name="account" type="object">
      Details about the account.

      <Expandable title="properties">
        <ResponseField name="lamports" type="integer">
          Number of lamports assigned to this account.
        </ResponseField>

        <ResponseField name="owner" type="string">
          Base-58 encoded Pubkey of the program this account is assigned to.
        </ResponseField>

        <ResponseField name="data" type="string[]">
          Account data as encoded binary or JSON format.
        </ResponseField>

        <ResponseField name="executable" type="boolean">
          Indicates if the account contains a program.
        </ResponseField>

        <ResponseField name="rentEpoch" type="integer">
          The epoch at which this account will next owe rent.
        </ResponseField>

        <ResponseField name="space" type="integer">
          The data size of the account.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --fail-with-body "$THORNODE_RPC_URL" \
    --header 'content-type: application/json' \
    --data '{
      "jsonrpc": "2.0",
      "id": 1,
      "method": "getProgramAccounts",
      "params": [
        "Config1111111111111111111111111111111111111",
        {
          "encoding": "base64",
          "dataSlice": {
            "offset": 0,
            "length": 0
          }
        }
      ]
    }'
  ```

  ```javascript Node.js theme={null}
  const body = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getProgramAccounts",
    "params": [
      "Config1111111111111111111111111111111111111",
      {
        "encoding": "base64",
        "dataSlice": {
          "offset": 0,
          "length": 0
        }
      }
    ]
  };

  const response = await fetch(process.env.THORNODE_RPC_URL, {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify(body),
  });
  const { result, error } = await response.json();
  console.log(result ?? error);
  ```
</RequestExample>

<ResponseExample>
  ```json Response (truncated to 2 accounts) theme={null}
  {
    "jsonrpc": "2.0",
    "result": [
      {
        "pubkey": "1P6xWzuJZGAGu456ZZYrACfDFh2xydPnCoNvhgnP5Kv",
        "account": {
          "lamports": 5366200,
          "data": [
            "",
            "base64"
          ],
          "owner": "Config1111111111111111111111111111111111111",
          "executable": false,
          "rentEpoch": 18446744073709551615,
          "space": 643
        }
      },
      {
        "pubkey": "1Wcz4RFmsZKBmdDrojRLSzQa2Tecw9eh1CTh1ZB6vRw",
        "account": {
          "lamports": 5366200,
          "data": [
            "",
            "base64"
          ],
          "owner": "Config1111111111111111111111111111111111111",
          "executable": false,
          "rentEpoch": 18446744073709551615,
          "space": 643
        }
      }
    ],
    "id": 1
  }
  ```
</ResponseExample>
