Resolving a Domain

How to resolve content records from a domain name.

Overview

The Domain Resolution Request, a GET request to the /domain/resolve endpoint, is a request used retrieve the content records associated with a provided ENS domain, returning IPFS and IPNS type content, and Ethereum Wallet addresses. For domains that are used as a wallet address alias, only an Ethereum Wallet address will be returned by a Domain Resolution Request. In instances where the domain serves content, such as a website, the Domain Resolution Request will return IPFS or IPNS content records, in addition to an Ethereum Wallet address.

Request Spec
  /domain/resolve/{domain}:
    get:
      summary: Resolve an ENS Domain to content or wallet address. Initiates an IPNS resolution request if the content is IPNS.
      parameters:
        - in: path
          name: domain
          required: true
          description: An ENS domain name.
          schema:
            type: string

Sending the Request

Sending a request to the /domain/resolve endpoint requires a valid API Key to be provided in the x-api-key header, and that an ENS domain name be provided.

Domain Resolution Request
curl -X GET -H "x-api-key: Your-API-Key" https://api.sgr-a.xyz/domain/resolve/ethereum.eth

When a Domain Resolution Request completes successfully, the returned output will contain a success message for confirmation, along with the obtained content records for IPFS/IPNS and Ethereum Wallet address details.

Domain Resolution Output
{
    "message": "Domain resolved successfully",
    "walletAddress": {
        "type": "address",
        "addr": "ETH_WALLET_ADDRESS"
    },
    "content": {
        "type": "ipfs" OR "ipns",
        "cid": OR "name": "IPFS_CID" OR "IPNS_NAME",
        "ipnsCache": "CACHED_IPFS_CID" // Only for IPNS type content
    }
}

Last updated