indexer.getName
Reads one name from the indexer: owner, manager, expiry, resolver, records and protocol. Options, result, errors and examples for indexer.getName.
Reads one name from the indexer: owner, manager, expiry, resolver, records and protocol.
When to use
Use to show a name page, or anywhere an indexed answer is fast enough; for an authoritative on-
chain read, use name.get.
Details
- Basenames (
*.base.eth) are read from thebasenamesnamespace. authoritysays which protocol holds the name (ensV0,ensV1orensV2).source: "verified"asks the indexer to read the answer on-chain (bigname).- Returns
nullwhen the indexer has no such name, or throws withstrict: true.
Signature
function getName(client: Like, options: getName.Options): Promise<getName.ReturnType>Call it as ens.indexer.getName(options) on a client, or Actions.indexer.getName(client, options).
indexer.getName.request(options) builds a deferred read for Actions.batch. See Look up many at once.
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 | ||
source | "indexed" | "verified" | verified reads the answer on-chain through the indexer. @default "indexed" | |
namespace | Namespace | "basenames" for *.base.eth, otherwise "ens" | Namespace of the name. |
Also takes the read options.
Returns
Resolves to Result<IndexedNameDetail> | null. The name, or null when the indexer does not know it.
Errors
| Error | Codes | When |
|---|---|---|
InvalidInputError | INVALID_NAME | the name does not normalize. |
NotFoundError | INDEXER_NOT_FOUND | with strict: true when the indexer has no such name. |
ConfigError | INDEXER_NOT_CONFIGURED | the client has no indexer. |
IndexerError | INDEXER_UNSUPPORTED | the indexer does not serve the query or its namespace. |
IndexerError | INDEXER_UNAVAILABLE, INDEXER_RATE_LIMITED, INDEXER_BEHIND, INDEXER_REQUEST_REJECTED, 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.
Examples
const name = await ens.indexer.getName({ 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.getName({ name: "ens.eth", namespace: "ens" }){
"name": "ens.eth",
"displayName": "ens.eth",
"namespace": "ens",
"node": "0x4e34d3a81dc3a20f71bbdf2160492ddaa17ee7e5523757d47153379c13cb46df",
"status": "active",
"authority": "ensV1",
"owner": "0x690F0581eCecCf8389c223170778cD9D029606F2",
"manager": "0x2d2e339c93dA91682Db720ee73e3c8F854f5F246",
"registeredAt": "1580760321n",
"createdAt": "1566796141n",
"expiresAt": "1919549217n",
"graceEndsAt": "1921968417n",
"expiryReason": null,
"ensV1": {
"resolver": {
"chainId": 1,
"address": "0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"
},
"expiresAt": "1914192417n",
"wrapperState": "unwrapped",
"wrapperExpiresAt": null,
"wrapperFuses": null
},
"chainId": 1,
"registrationId": "04316989-63d2-5789-b7a6-c454b62d0294",
"tokenId": "42033647921836720708986079437023664695436352815832009766988496528855301124570n",
"resolver": {
"chainId": 1,
"address": "0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"
},
"subregistry": null,
"primaryAddress": "0xFe89cc7aBB2C4183683ab71653C4cdc9B02D44b7",
"migratedAt": null,
"records": {
"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",
"name": null,
"textKeys": [
"avatar",
"com.github",
"com.twitter",
"snapshot",
"url"
],
"coinTypes": [
"60"
]
},
"recordCount": null,
"subnameCount": null,
"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
name.getfor the on-chain state
Was this page helpful?