All Collections
Developer Basics
The ENS Metadata Service
The ENS Metadata Service

How to get the NFT metadata for ENS names

Updated over a week ago

NFT Metadata

The ENS Metadata Service provides NFT metadata for ENS names. It can be queried for any wrapped name, or any unwrapped .eth 2LD.

To get the metadata for a name, call this endpoint:

https://metadata.ens.domains/{network}/{contractAddress}/{tokenId}

The parameters are as follows:

{network}

The Ethereum network to look the name up in:

  • mainnet

  • goerli

  • sepolia

{contractAddress}

The address of the NFT contract. This will depend on the network you're using and whether the name is wrapped.

  • Mainnet:

    • Unwrapped .eth 2LDs: 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85

    • Wrapped names: 0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401

  • Goerli:

    • Unwrapped .eth 2LDs: 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85

    • Wrapped names: 0x114D4603199df73e7D157787f8778E21fCd13066

  • Sepolia:

    • Unwrapped .eth 2LDs: 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85

    • Wrapped names: 0x0635513f179D50A207757E05759CbD106d7dFcE8

{tokenId}

The token ID of the NFT for the ENS name. This will depend on whether the name is wrapped or not.

  • Unwrapped .eth 2LDs: The labelhash of the name (without the ".eth").

  • Wrapped names: The namehash of the name.

More information here: NFT Token IDs

You can also just enter the ENS name itself for {tokenId}, and the metadata service will accept that as well.

Examples

Avatars

The metadata service also has endpoints to return information about avatars.

NFT Metadata Image

If you want the image used for the on-chain NFT, then see the section above. The image link in the NFT metadata will point to that image. For example:

The metadata will contain the image URL:

"image":"https://metadata.ens.domains/mainnet/0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85/0x5cee339e13375638553bdf5a6e36ba80fb9f6a4f0783680884d92b558aa471da/image"

ENS Avatar

To retrieve the avatar image for an ENS name, call this endpoint:

https://metadata.ens.domains/{network}/avatar/{name}

The parameters are as follows:

{network}

The Ethereum network to look the name up in:

  • mainnet

  • goerli

  • sepolia

{name}

The ENS name to query the avatar for.

Examples

Avatar Metadata

You can also append /meta to the end of the avatar endpoint, and the metadata service will return you some custom JSON metadata about that ENS name's avatar.

If it's an NFT, then the avatar metadata will return information like the contract address and the actual image URL from the NFT contract.

Did this answer your question?