record.get
Reads any mix of a name's records in one request: texts, addresses, content hash, ABI, public key, name record, interface implementers and data records.
Reads any mix of a name's records in one request: texts, addresses, content hash, ABI, public key, name record, interface implementers and data records.
When to use
Use to load a profile or several records at once. Use record.getText or
record.getAddress for a single value.
Details
- One Universal Resolver call, whatever the selection (ENSv1, ENSv2, wildcard and off-chain
names). ENSv1 names answered through the ENSv1 bridge cost one more batched call, to report
the ENSv1 resolver behind it in
resolver. - The result has exactly the selected fields:
texts.urlexists only when"url"was requested. - Missing records are
null. A missing resolver givesresolver: nulland every recordnull, unlessstrictis set. - EVM chain addresses fall back to the default EVM address (ENSIP-19).
Signature
function get<const selection extends Selection>(
client: Like,
options: get.Options & selection,
): Promise<get.ReturnType<selection>>Call it as ens.record.get(options) on a client, or Actions.record.get(client, options).
record.get.request(options) builds a deferred read for Actions.batch. See Look up many at once.
In React, use useRecords.
Parameters
| Option | Type | Default | Description |
|---|---|---|---|
texts | readonly string[] | Text record keys, e.g. ["url", "avatar", "com.twitter"]. | |
addresses | readonly (string | bigint)[] | Coins by symbol ("eth", "btc", "base") or coin type (2147492101n). EVM chains fall back to the default EVM address (ENSIP-19). | |
contentHash | true | Read the content hash (ENSIP-7). | |
abi | true | { readonly contentTypes: bigint } | Read the ABI record (ENSIP-4); contentTypes is a bitmask of acceptable types. | |
pubkey | true | Read the SECP256k1 public key. | |
nameRecord | true | Read the name record (ENSIP-3), used for reverse resolution. | |
interfaces | readonly Hex[] | ERC-165 interface IDs to read implementers for. | |
data | readonly string[] | Data record keys (ENSIP-24). | |
name (required) | string | ENS name to read. Normalized automatically. |
Also takes the read options.
Returns
Resolves to Records<selection>. The selected records.
Errors
| Error | Codes | When |
|---|---|---|
InvalidInputError | INVALID_NAME, INVALID_COIN_TYPE | invalid input. |
NotFoundError | RESOLVER_NOT_FOUND | with strict when the name has no resolver. |
UnsupportedError | RESOLVER_PROFILE_UNSUPPORTED | with strict when the resolver supports none of the records. |
GatewayError | GATEWAY_REQUEST_FAILED, GATEWAY_RESPONSE_INVALID, OFFCHAIN_LOOKUP_INVALID | an off-chain gateway fails. |
DnsError | a DNS name's DNSSEC proof does not verify. | |
NetworkError | RPC_REQUEST_FAILED, RPC_TIMEOUT, RATE_LIMITED | the RPC request fails. |
It can also fail with the errors every read can (Errors.CommonError: ConfigError, ContractRevertError, InternalError, NetworkError).
See How errors work.
Examples
const profile = await ens.record.get({ name: "nick.eth", texts: ["avatar", "url"], addresses: ["eth", "btc"] })
profile.texts.url // string | nullExample response
Recorded from Ethereum mainnet on 2026-11-18 at block 26443964. Values change as the chain does.
await ens.record.get({ name: "vitalik.eth", texts: ["url", "com.twitter"], addresses: ["eth"] }){
"resolver": "0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63",
"texts": {
"url": "https://vitalik.ca",
"com.twitter": "VitalikButerin"
},
"addresses": {
"eth": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}
}See also
record.setto write records
Was this page helpful?