# indexer.getRegistry

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

Reads an ENSv2 registry: the name it serves, its parent registry, when it was created and its counts. Options, errors and examples for indexer.getRegistry.

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

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

Reads an ENSv2 registry: the name it serves, its parent registry, when it was created and its counts.

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

Use to inspect a registry found through a name's `subregistry`, e.g. in an explorer.

## Details [#details]

- `includeCounts` adds the number of labels, roles and events.

## Signature [#signature]

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

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

`indexer.getRegistry.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`. |
| `address` (required) | `string` |  | Contract address. |
| `chainId` | `number` |  | Chain of the contract. @default the client's chain |
| `includeCounts` | `boolean` |  | Include label, role and event counts. |

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

## Returns [#returns]

Resolves to `Result<IndexedRegistry> | null`. The registry, or `null` when the indexer does not know it.

## Errors [#errors]

| Error | Codes | When |
| --- | --- | --- |
| [`InvalidInputError`](/docs/reference/errors/invalid-input-error) | [`INVALID_ADDRESS`](/docs/reference/errors/INVALID_ADDRESS) | an invalid address. |
| [`NotFoundError`](/docs/reference/errors/not-found-error) | [`INDEXER_NOT_FOUND`](/docs/reference/errors/INDEXER_NOT_FOUND) | with `strict: true` when the indexer does not know the contract. |
| [`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 registry"
const registry = await ens.indexer.getRegistry({ address: "0x02ca…" })
```
</Tab>

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

const registry = await Actions.indexer.getRegistry(ens, { address, includeCounts: true })
```
</Tab>

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

const registry = yield* Actions.indexer.getRegistry(ens, { address })
```
</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.getRegistry({ address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", chainId: 1 })
```

```json
{
  "chainId": 1,
  "address": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",
  "name": "wh1tehat.eth",
  "parent": {
    "chainId": 1,
    "address": "0xf60aba43E1f7F3DAB1186Ff03B561401C9Df85E2"
  },
  "createdAt": "1794139355n",
  "createdBlockNumber": "26370025n",
  "createdTransactionHash": "0xcd43345f1d89446fcf0f8d088a8b0d2f8d15e5a188fadee5000d4781c3ae7669",
  "counts": {
    "labels": null,
    "roles": null,
    "events": null
  },
  "referencedBy": [
    "wh1tehat.eth"
  ],
  "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": null,
  "indexer": "bigname"
}
```

## See also [#see-also]

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