# indexer.getRecords

> For the complete documentation index, see [llms.txt](https://ensforge.com/llms.txt).

Reads a name's records and its record inventory from the indexer. Parameters, return value, errors and examples for indexer.getRecords in @ensforge/sdk.

Source: https://ensforge.com/docs/reference/sdk/indexer/get-records

<ApiMeta kind="Read" stability="stable" since="1.0.0" source="packages/sdk/src/actions/indexer/getRecords/index.ts#L58" batchable />

Reads a name's records and its record inventory from the indexer.

## When to use [#when-to-use]

Use to show a profile, or to learn every record key a name has ever set (the inventory).

## Details [#details]

- Without `keys`, reads the keys in the name's inventory; `values: false` returns only the
  inventory.
- Keys are record keys: `avatar` (a text key), `text:url`, `addr:60` or `contenthash`.
- `source: "verified"` reads the values on-chain through the indexer; `auto` falls back to it.
- `resolver` reads the records the name has on another resolver (e.g. its ENSv1 resolver).

## Signature [#signature]

```ts
function getRecords(
  client: Like,
  options: getRecords.Options,
): Promise<getRecords.ReturnType>
```

Call it as `ens.indexer.getRecords(options)` on a client, or `Actions.indexer.getRecords(client, options)`.

`indexer.getRecords.request(options)` builds a deferred read for `Actions.batch`. See [Look up many at once](/docs/sdk/look-up-many-at-once).

## Parameters [#parameters]

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `at` | `{ readonly token: string } \| { readonly timestamp: bigint \| Date }` |  | Read at a snapshot: an earlier answer's `asOfToken`, or a time. |
| `finality` | `"latest" \| "safe" \| "finalized"` | `"latest"` | How settled the data must be: `latest`, `safe` or `finalized`. |
| `name` (required) | `string` |  |  |
| `keys` | `readonly string[]` |  | Record keys (`avatar`, `text:url`, `addr:60`, `contenthash`); the inventory's when omitted. |
| `values` | `boolean` |  | `false` returns only the inventory, without values. @default true |
| `source` | `"indexed" \| "verified" \| "auto"` | `"indexed"` |  |
| `namespace` | `Namespace` | "basenames" for `*.base.eth`, otherwise "ens" | Namespace of the name. |
| `resolver` | `{ readonly address: string; readonly chainId?: number \| undefined }` |  | Read from this resolver (on the client's chain unless `chainId` is set). |

Also takes the [read options](/docs/reference/sdk/client#read-options).

## Returns [#returns]

Resolves to `Result<IndexedRecords> | null`. The records, or `null` when the indexer does not know the name.

## Errors [#errors]

| Error | Codes | When |
| --- | --- | --- |
| [`InvalidInputError`](/docs/reference/errors/invalid-input-error) | [`INVALID_NAME`](/docs/reference/errors/INVALID_NAME), [`INVALID_ADDRESS`](/docs/reference/errors/INVALID_ADDRESS) | invalid input. |
| [`NotFoundError`](/docs/reference/errors/not-found-error) | [`INDEXER_NOT_FOUND`](/docs/reference/errors/INDEXER_NOT_FOUND) | with `strict: true` when the indexer has no such name. |
| [`ConfigError`](/docs/reference/errors/config-error) | [`INDEXER_NOT_CONFIGURED`](/docs/reference/errors/INDEXER_NOT_CONFIGURED) | the client has no indexer. |
| [`IndexerError`](/docs/reference/errors/indexer-error) | [`INDEXER_UNSUPPORTED`](/docs/reference/errors/INDEXER_UNSUPPORTED) | the indexer does not serve the query or its namespace. |
| [`IndexerError`](/docs/reference/errors/indexer-error) | [`INDEXER_UNAVAILABLE`](/docs/reference/errors/INDEXER_UNAVAILABLE), [`INDEXER_RATE_LIMITED`](/docs/reference/errors/INDEXER_RATE_LIMITED), [`INDEXER_BEHIND`](/docs/reference/errors/INDEXER_BEHIND), [`INDEXER_REQUEST_REJECTED`](/docs/reference/errors/INDEXER_REQUEST_REJECTED), [`INDEXER_RESPONSE_INVALID`](/docs/reference/errors/INDEXER_RESPONSE_INVALID) | the indexer is unavailable, rate limiting, behind, rejects the request or answers unexpectedly. |

It can also fail with the errors every read can (`Errors.CommonError`: `ConfigError`, `ContractRevertError`, `InternalError`, `NetworkError`).

See [How errors work](/docs/sdk/errors-explained).

## Examples [#examples]

<Tabs groupId="api" items={["Client","Standalone","Effect"]} persist>
<Tab>
```ts title="Reading a profile"
const records = await ens.indexer.getRecords({ name: "nick.eth" })
```
</Tab>

<Tab>
```ts title="Reading the inventory with a standalone call"
import { Actions } from "@ensforge/sdk"

const records = await Actions.indexer.getRecords(ens, { name: "nick.eth", values: false })
const keys = records?.inventory?.keys ?? []
```
</Tab>

<Tab>
```ts title="Reading chosen records in an Effect program"
import { Actions } from "@ensforge/sdk/effect"

const records = yield* Actions.indexer.getRecords(ens, { name: "nick.eth", keys: ["avatar", "addr:60"] })
```
</Tab>
</Tabs>

## Example response [#example-response]

Recorded from Ethereum mainnet on 2026-11-18 at block 26443964. Values change as the chain does.

```ts
await ens.indexer.getRecords({ name: "ens.eth", namespace: "ens" })
```

```json
{
  "namespace": "ens",
  "resolver": {
    "chainId": 1,
    "address": "0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"
  },
  "texts": {
    "avatar": "https://i.imgur.com/ga6y0c0.jpg",
    "com.github": "ensdomains",
    "com.twitter": "ensdomains",
    "snapshot": "ipns://storage.snapshot.page/registry/0xb6E040C9ECAaE172a89bD561c5F73e1C48d28cd9/ens.eth",
    "url": "https://ens.domains/"
  },
  "addresses": {
    "60": "0xfe89cc7abb2c4183683ab71653c4cdc9b02d44b7"
  },
  "contentHash": "0xe40101fa011b20f5909b5286d9279a1f6a23d5155ddd72bb0f28f56b6b82c32de54a6529e6b1b0",
  "answers": {
    "addr:60": {
      "status": "ok",
      "value": "0xfe89cc7abb2c4183683ab71653c4cdc9b02d44b7",
      "reason": null
    },
    "contenthash": {
      "status": "ok",
      "value": "0xe40101fa011b20f5909b5286d9279a1f6a23d5155ddd72bb0f28f56b6b82c32de54a6529e6b1b0",
      "reason": null
    },
    "text:avatar": {
      "status": "ok",
      "value": "https://i.imgur.com/ga6y0c0.jpg",
      "reason": null
    },
    "text:com.github": {
      "status": "ok",
      "value": "ensdomains",
      "reason": null
    },
    "text:com.twitter": {
      "status": "ok",
      "value": "ensdomains",
      "reason": null
    },
    "text:snapshot": {
      "status": "ok",
      "value": "ipns://storage.snapshot.page/registry/0xb6E040C9ECAaE172a89bD561c5F73e1C48d28cd9/ens.eth",
      "reason": null
    },
    "text:url": {
      "status": "ok",
      "value": "https://ens.domains/",
      "reason": null
    }
  },
  "inventory": {
    "keys": [
      "addr:60",
      "contenthash",
      "text:avatar",
      "text:com.github",
      "text:com.twitter",
      "text:snapshot",
      "text:url"
    ],
    "unsetKeys": [],
    "unsupportedKeys": []
  },
  "asOf": {
    "chainId": 1,
    "blockNumber": "26443964n",
    "blockHash": "0xe75c58ea2f28bd7c6cc53c28a5ab4fc02023f3563661f0a7236a36b779e3ac86",
    "timestamp": "1795029143n"
  },
  "snapshots": {
    "1": {
      "chainId": 1,
      "blockNumber": "26443964n",
      "blockHash": "0xe75c58ea2f28bd7c6cc53c28a5ab4fc02023f3563661f0a7236a36b779e3ac86",
      "timestamp": "1795029143n"
    }
  },
  "asOfToken": "7b22657468657265756d223a7b22626c6f636b5f68617368223a22307865373563353865613266323862643763366363353363323861356162346663303230323366333536333636316630613732333661333662373739653361633836222c22626c6f636b5f6e756d626572223a32363434333936342c22636861696e5f6964223a22657468657265756d2d6d61696e6e6574222c2274696d657374616d70223a22323032362d31312d31385431393a31323a32335a227d7d",
  "completeness": "full",
  "unsupportedReason": null,
  "unsupportedFields": [],
  "origin": "indexed",
  "indexer": "bigname"
}
```

## See also [#see-also]

- [`record.get`](/docs/reference/sdk/record/get) for the on-chain read