# primaryName.get

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

Reads the primary name of an address (ENSIP-19 reverse resolution), verified against the name's address record. Errors and examples for primaryName.get.

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

<ApiMeta kind="Read" stability="stable" since="1.0.0" source="packages/sdk/src/actions/primaryName/get/index.ts#L63" batchable />

Reads the primary name of an address (ENSIP-19 reverse resolution), verified against the
name's address record.

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

Use to show a name instead of an address.

## Details [#details]

- The name counts only when it resolves back to the address, so nobody can claim another
  account's name. `verify: false` skips this and returns the raw reverse record.
- `coin` selects the chain: `"eth"` (default), any EVM chain such as `{ chainId: 8453 }`, or
  `"default"`. Chains without their own primary name fall back to `default.reverse`.
- Names that are not normalized are treated as unset.
- Returns `null` when there is no valid primary name, unless `strict` is set. With `strict`, an
  address whose reverse name has no resolver or name fails [`PRIMARY_NAME_NOT_SET`](/docs/reference/errors/PRIMARY_NAME_NOT_SET); a name that
  does not resolve back (no resolver, no address record or another address) fails
  [`PRIMARY_NAME_MISMATCH`](/docs/reference/errors/PRIMARY_NAME_MISMATCH), whose `cause` names the name or the profile that failed. A resolver
  that reverts without data says neither, and counts as not set.

## Signature [#signature]

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

Call it as `ens.primaryName.get(options)` on a client, or `Actions.primaryName.get(client, options)`.

`primaryName.get.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 [`usePrimaryName`](/docs/reference/react/use-primary-name).

## Parameters [#parameters]

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `address` (required) | `string` |  | Address to look up. |
| `coin` | `CoinType.Input \| "default"` | `"eth"` | Chain of the primary name: a coin symbol, `{ chainId }`, a coin type, or `"default"`. |
| `verify` | `boolean` | `true` | Require the name to resolve back to the address. |

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

## Returns [#returns]

Resolves to `string | null`. The primary name, or `null` when there is no valid one.

## Errors [#errors]

| Error | Codes | When |
| --- | --- | --- |
| [`InvalidInputError`](/docs/reference/errors/invalid-input-error) | [`INVALID_ADDRESS`](/docs/reference/errors/INVALID_ADDRESS), [`INVALID_COIN_TYPE`](/docs/reference/errors/INVALID_COIN_TYPE), [`INVALID_NAME`](/docs/reference/errors/INVALID_NAME) | invalid input, or with `strict` an unnormalized name. |
| [`NotFoundError`](/docs/reference/errors/not-found-error) | [`PRIMARY_NAME_NOT_SET`](/docs/reference/errors/PRIMARY_NAME_NOT_SET), [`PRIMARY_NAME_MISMATCH`](/docs/reference/errors/PRIMARY_NAME_MISMATCH) | with `strict` when there is no valid primary name. |
| [`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="Showing a name for an address"
const name = await ens.primaryName.get({ address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" })
name // "vitalik.eth"
```
</Tab>

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

const name = await Actions.primaryName.get(publicClient, { address, coin: { chainId: 8453 } })
```
</Tab>

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

const name = yield* Actions.primaryName.get(ens, { address, strict: true })
```
</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.primaryName.get({ address: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" })
```

```json
"vitalik.eth"
```

## See also [#see-also]

- [`primaryName.set`](/docs/reference/sdk/primary-name/set) to set it