Documentation for agents: an index at /llms.txt, every docs page in one file at /llms-full.txt, and Markdown for any docs page by adding .md to its URL.

Skip to Content
ensforgeSDK

indexer.getRecords

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

ReadBatchablestable
Since v1.0.0View source

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

When to use

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

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

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.

Parameters

OptionTypeDefaultDescription
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
keysreadonly string[]Record keys (avatar, text:url, addr:60, contenthash); the inventory's when omitted.
valuesbooleanfalse returns only the inventory, without values. @default true
source"indexed" | "verified" | "auto""indexed"
namespaceNamespace"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.

Returns

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

Errors

ErrorCodesWhen
InvalidInputErrorINVALID_NAME, INVALID_ADDRESSinvalid input.
NotFoundErrorINDEXER_NOT_FOUNDwith strict: true when the indexer has no such name.
ConfigErrorINDEXER_NOT_CONFIGUREDthe client has no indexer.
IndexerErrorINDEXER_UNSUPPORTEDthe indexer does not serve the query or its namespace.
IndexerErrorINDEXER_UNAVAILABLE, INDEXER_RATE_LIMITED, INDEXER_BEHIND, INDEXER_REQUEST_REJECTED, INDEXER_RESPONSE_INVALIDthe 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.

Examples

Reading a profile
const records = await ens.indexer.getRecords({ name: "nick.eth" })

Example response

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

await ens.indexer.getRecords({ name: "ens.eth", namespace: "ens" })
{
  "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

Was this page helpful?