# name.getLabel

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

Recovers a label from its labelhash through the ENSv2 LabelStore. Parameters, return value, errors and examples for name.getLabel in @ensforge/sdk.

Source: https://ensforge.com/docs/reference/sdk/name/get-label

<ApiMeta kind="Read" stability="stable" since="1.0.0" source="packages/sdk/src/actions/name/getLabel/index.ts#L51" batchable />

Recovers a label from its labelhash through the ENSv2 LabelStore.

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

Use to display names that arrive as hashes, such as `[af2c…].eth` from events or indexers.

## Details [#details]

- ENSv2 registries store every label they register, so this covers every ENSv2 name.
- Returns `null` when the LabelStore has never seen the label.

## Signature [#signature]

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

Call it as `ens.name.getLabel(options)` on a client, or `Actions.name.getLabel(client, options)`.

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

## Parameters [#parameters]

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `labelhash` (required) | `Hex` |  | Keccak-256 hash of the label, as from `Name.labelhash`. |

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

## Returns [#returns]

Resolves to `string | null`. The label, or `null` when unknown.

## Errors [#errors]

| Error | Codes | When |
| --- | --- | --- |
| [`InvalidInputError`](/docs/reference/errors/invalid-input-error) | [`INVALID_RECORD_VALUE`](/docs/reference/errors/INVALID_RECORD_VALUE) | `labelhash` is not 32 bytes. |
| [`UnsupportedError`](/docs/reference/errors/unsupported-error) | [`UNSUPPORTED_ON_DEPLOYMENT`](/docs/reference/errors/UNSUPPORTED_ON_DEPLOYMENT) | without an ENSv2 deployment. |
| [`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="Recovering a label"
const label = await ens.name.getLabel({ labelhash: "0x5d5727cb0fb76e4944eafb88ec9a3cf0b3c9025a4b2f947729137c5d7f84f68f" })
```
</Tab>

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

const label = await Actions.name.getLabel(publicClient, { labelhash })
```
</Tab>

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

const label = yield* Actions.name.getLabel(ens, { labelhash })
```
</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.name.getLabel({ labelhash: "0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103cc" })
```

```json
"vitalik"
```