# record.getText

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

Reads one text record of an ENS name, such as url, avatar or com.twitter. Parameters, return value, errors and examples for record.getText in @ensforge/sdk.

Source: https://ensforge.com/docs/reference/sdk/record/get-text

<ApiMeta kind="Read" stability="stable" since="1.0.0" source="packages/sdk/src/actions/record/getText/index.ts#L56" batchable />

Reads one text record of an ENS name, such as `url`, `avatar` or `com.twitter`.

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

Use to read a single profile field. Use `record.get` to read several records in one call.

## Details [#details]

- Resolves through the Universal Resolver, so ENSv1, ENSv2, wildcard and off-chain (CCIP-Read)
  names all work.
- Returns `null` when the record, the resolver, or the resolver's text support is missing,
  unless `strict` is set.
- Calls made in the same tick are batched into one multicall where possible.

## Signature [#signature]

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

Call it as `ens.record.getText(options)` on a client, or `Actions.record.getText(client, options)`.

`record.getText.request(options)` builds a deferred read for `Actions.batch`. See [Look up many at once](/docs/sdk/look-up-many-at-once).

In React, use [`useText`](/docs/reference/react/use-text).

## Parameters [#parameters]

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `name` (required) | `string` |  | ENS name to read. Normalized automatically. |
| `key` (required) | `string` |  | Text record key, e.g. `url`, `avatar`, `com.twitter`. |

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

## Returns [#returns]

Resolves to `string | null`. The record value, or `null` when it is not set.

## Errors [#errors]

| Error | Codes | When |
| --- | --- | --- |
| [`InvalidInputError`](/docs/reference/errors/invalid-input-error) | [`INVALID_NAME`](/docs/reference/errors/INVALID_NAME) | the name cannot be normalized. |
| [`NotFoundError`](/docs/reference/errors/not-found-error) | [`RECORD_NOT_FOUND`](/docs/reference/errors/RECORD_NOT_FOUND), [`RESOLVER_NOT_FOUND`](/docs/reference/errors/RESOLVER_NOT_FOUND) | with `strict`. |
| [`UnsupportedError`](/docs/reference/errors/unsupported-error) | [`RESOLVER_PROFILE_UNSUPPORTED`](/docs/reference/errors/RESOLVER_PROFILE_UNSUPPORTED) | with `strict` when the resolver supports none of the records. |
| [`GatewayError`](/docs/reference/errors/gateway-error) | [`GATEWAY_REQUEST_FAILED`](/docs/reference/errors/GATEWAY_REQUEST_FAILED), [`GATEWAY_RESPONSE_INVALID`](/docs/reference/errors/GATEWAY_RESPONSE_INVALID), [`OFFCHAIN_LOOKUP_INVALID`](/docs/reference/errors/OFFCHAIN_LOOKUP_INVALID) | an off-chain gateway fails. |
| [`DnsError`](/docs/reference/errors/dns-error) |  | a DNS name's DNSSEC proof does not verify. |
| [`NetworkError`](/docs/reference/errors/network-error) | [`RPC_REQUEST_FAILED`](/docs/reference/errors/RPC_REQUEST_FAILED), [`RPC_TIMEOUT`](/docs/reference/errors/RPC_TIMEOUT), [`RATE_LIMITED`](/docs/reference/errors/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](/docs/sdk/errors-explained).

## Examples [#examples]

<Tabs groupId="api" items={["Client","Standalone","Effect"]} persist>
<Tab>
```ts title="Reading a profile URL"
const url = await ens.record.getText({ name: "nick.eth", key: "url" })
```
</Tab>

<Tab>
```ts title="Reading with a bare viem client"
import { Actions } from "@ensforge/sdk"

const url = await Actions.record.getText(publicClient, { name: "nick.eth", key: "url" })
```
</Tab>

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

const url = yield* Actions.record.getText(ens, { name: "nick.eth", key: "url" })
```
</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.record.getText({ name: "vitalik.eth", key: "url" })
```

```json
"https://vitalik.ca"
```

## See also [#see-also]

- [`record.set`](/docs/reference/sdk/record/set) to write text records