> ## Documentation Index
> Fetch the complete documentation index at: https://base-a060aa97-eb-mini-app-ia-overhaul.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# getNames

The `getNames` utility is designed to retrieve multiple names from an onchain identity
provider for an array of addresses in a single batch request.

Consider the utility instead of the hook when you
use it with Next.js or any Node.js backend.

## Usage

Get ENS names from multiple addresses:

<CodeGroup>
  ```tsx code
  import { getNames } from '@coinbase/onchainkit/identity';

  const addresses = [
    '0x4bEf0221d6F7Dd0C969fe46a4e9b339a84F52FDF',
    '0x838aD0EAE54F99F1926dA7C3b6bFbF617389B4D9'
  ];
  const names = await getNames({ addresses });
  ```

  ```ts return value
  ['paulcramer.eth', 'vitalik.eth']
  ```
</CodeGroup>

Get Basenames from multiple addresses:

<CodeGroup>
  ```tsx code
  import { getNames } from '@coinbase/onchainkit/identity';
  import { base } from 'viem/chains';

  const addresses = [
    '0x4bEf0221d6F7Dd0C969fe46a4e9b339a84F52FDF',
    '0x4bEf0221d6F7Dd0C969fe46a4e9b339a84F52FDF'
  ];
  const names = await getNames({ addresses, chain: base });
  ```

  ```ts return value
  ['paul.base.eth', 'coinbase.base.eth']
  ```
</CodeGroup>

Get a mix of ENS names and sliced addresses when some addresses don't have names:

<CodeGroup>
  ```tsx code
  import { getNames } from '@coinbase/onchainkit/identity';

  const addresses = [
    '0x4bEf0221d6F7Dd0C969fe46a4e9b339a84F52FDF',
    '0x1234567890abcdef1234567890abcdef12345678'
  ];
  const names = await getNames({ addresses });
  ```

  ```ts return value
  ['paulcramer.eth', null]
  ```
</CodeGroup>

## Returns

Array of [`GetNameReturnType`](/onchainkit/identity/types#getnamereturntype)

## Parameters

### GetNames

[`GetNames`](/onchainkit/identity/types#getnames)
