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

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.

ReadBatchablestable
Since v1.0.0View source

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.url exists only when "url" was requested.
  • Missing records are null. A missing resolver gives resolver: null and every record null, unless strict is 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

OptionTypeDefaultDescription
textsreadonly string[]Text record keys, e.g. ["url", "avatar", "com.twitter"].
addressesreadonly (string | bigint)[]Coins by symbol ("eth", "btc", "base") or coin type (2147492101n). EVM chains fall back to the default EVM address (ENSIP-19).
contentHashtrueRead the content hash (ENSIP-7).
abitrue | { readonly contentTypes: bigint }Read the ABI record (ENSIP-4); contentTypes is a bitmask of acceptable types.
pubkeytrueRead the SECP256k1 public key.
nameRecordtrueRead the name record (ENSIP-3), used for reverse resolution.
interfacesreadonly Hex[]ERC-165 interface IDs to read implementers for.
datareadonly string[]Data record keys (ENSIP-24).
name (required)stringENS name to read. Normalized automatically.

Also takes the read options.

Returns

Resolves to Records<selection>. The selected records.

Errors

ErrorCodesWhen
InvalidInputErrorINVALID_NAME, INVALID_COIN_TYPEinvalid input.
NotFoundErrorRESOLVER_NOT_FOUNDwith strict when the name has no resolver.
UnsupportedErrorRESOLVER_PROFILE_UNSUPPORTEDwith strict when the resolver supports none of the records.
GatewayErrorGATEWAY_REQUEST_FAILED, GATEWAY_RESPONSE_INVALID, OFFCHAIN_LOOKUP_INVALIDan off-chain gateway fails.
DnsErrora DNS name's DNSSEC proof does not verify.
NetworkErrorRPC_REQUEST_FAILED, RPC_TIMEOUT, RATE_LIMITEDthe RPC request fails.

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

See How errors work.

Examples

Loading a profile
const profile = await ens.record.get({ name: "nick.eth", texts: ["avatar", "url"], addresses: ["eth", "btc"] })
profile.texts.url // string | null

Example 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

Was this page helpful?