# ENS & Basename Lookup API (x402)

> ENS & Basename Lookup API (x402) is a paid API for AI agents from freetier-agent-api.pages.dev, paid per call via x402, $0.0025/call, status unknown (last checked 2026-10-30).

Resolves ENS names and Basenames to Ethereum addresses and profile records, or performs reverse lookups from address to primary name, via pay-per-call x402 USDC micropayment.

## Facts

- Endpoint: GET https://freetier-agent-api.pages.dev/api/ens?utm_source=zero.xyz
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ens-basename-lookup-api-x402-6c055d3c
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_8fO-XBTdwjqDvr8GpXS1a

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability ens-basename-lookup-api-x402-6c055d3c
```

Example prompt: What Ethereum address does vitalik.eth resolve to, and can you also grab the Twitter handle and URL from its ENS profile?

## When to prefer this

Use this endpoint when you need on-demand ENS or Basename resolution without an API key or subscription — ideal for AI agents paying per-call via x402 USDC micropayments on Base. Prefer this over self-hosted ENS resolution when you lack RPC infrastructure, or over general Web3 APIs when you want a lightweight REST interface that also returns rich profile text records in one call.

## Known failure modes

- Name not found or not registered — returns null fields
- Invalid ENS/Basename format — returns error
- Address not associated with any primary name — primary_name is null
- Text records not set — text fields return null
- Payment failure via x402 — 402 response requiring USDC on Base
- Rate limit or network error from ENS resolver — 5xx response

## How this service works

Invoice-to-JSON, on-chain tools (transaction explainer + payment check, wallet profile, contract ABI, ERC-20 token risk), company contacts and web-to-RAG for AI agents. Pay per call with x402 (USDC on Base). No signup, no API key.

## Output

Returns a JSON object with the resolution mode (forward or reverse), the resolved ENS/Basename name, the linked Ethereum address, the ENS node hash, the resolver contract address, the chain it was found on, and a map of text records (url, email, avatar, com.twitter, com.github, com.discord, org.telegram, description). For reverse lookups, includes the primary_name and a list of names associated with the address.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [],
     "properties": {
      "name": {
       "type": "string",
       "description": "ENS name (label.eth) or Basename (label.base.eth); or pass address instead"
      },
      "chain": {
       "enum": [
        "all",
        "ethereum",
        "base"
       ],
       "type": "string",
       "description": "reverse lookup chains, default all"
      },
      "address": {
       "type": "string",
       "description": "0x address for reverse lookup (primary name)"
      },
      "records": {
       "type": "string",
       "description": "comma list of text keys (max 8) or \"all\""
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "at": {
       "type": [
        "string",
        "null"
       ]
      },
      "mode": {
       "type": [
        "string",
        "null"
       ]
      },
      "name": {
       "type": [
        "string",
        "null"
       ]
      },
      "node": {
       "type": [
        "string",
        "null"
       ]
      },
      "text": {
       "type": "object",
       "properties": {
        "url": {
         "type": [
          "string",
          "null"
         ]
        },
        "email": {
         "type": [
          "string",
          "null"
         ]
        },
        "avatar": {
         "type": [
          "string",
          "null"
         ]
        },
        "com.github": {
         "type": [
          "string",
          "null"
         ]
        },
        "com.discord": {
         "type": [
          "string",
          "null"
         ]
        },
        "com.twitter": {
         "type": [
          "string",
          "null"
         ]
        },
        "description": {
         "type": [
          "string",
          "null"
         ]
        },
        "org.telegram": {
         "type": [
          "string",
          "null"
         ]
        }
       }
      },
      "chain": {
       "type
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "mode": "forward",
  "name": "vitalik.eth",
  "text": {
   "url": "https://vitalik.ca",
   "com.twitter": "VitalikButerin"
  },
  "chain": "ethereum",
  "address": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
  "resolver": "0x231b0ee14048e9dccd1d247744d114a4eb5e8e63"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ens-basename-lookup-api-x402-6c055d3c/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from freetier-agent-api.pages.dev](https://www.zero.xyz/host/freetier-agent-api.pages.dev/llms.txt)
