# Contract ABI Lookup API (x402)

> Contract ABI 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-11-19).

Fetches the ABI, function selectors, proxy info, and verification status for a smart contract by address on Base or Ethereum

## Facts

- Endpoint: GET https://freetier-agent-api.pages.dev/api/contract-abi?utm_source=zero.xyz
- Price: $0.0025/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/contract-abi-lookup-api-x402-73b9d7c6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Yz-zDjRyyHMZWTfRuxyjn

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 contract-abi-lookup-api-x402-73b9d7c6
```

Example prompt: Can you pull the ABI and function list for the contract at 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 on Base, and tell me if it's a proxy and what it's verified as?

## When to prefer this

Use this endpoint when you need programmatic, pay-per-call access to smart contract ABIs and proxy resolution without requiring an API key or account. Ideal for AI agents operating autonomously on Base or Ethereum that need to inspect contract interfaces before executing transactions or building integrations. Prefer over Etherscan API when you want micro-payment (USDC/x402) billing with no signup overhead.

## Known failure modes

- Contract address not found or unverified — returns limited data or empty ABI
- Invalid address format — returns validation error
- Unsupported chain specified — returns error
- Payment not completed via x402 — returns 402 Payment Required
- Rate limit or upstream blockchain data source timeout

## How this service works

Base or Ethereum contract address -> ABI and function list: Sourcify verification (exact/partial match), contract name, compiler, ABI, function selectors + signatures, event topics; proxies (EIP-1967, ZeppelinOS, others Sourcify detects) resolved to the implementation with its own ABI. Unverified contracts: selectors guessed from bytecode and named via the public OpenChain database. abi=false returns signatures only (smaller).

## Output

Returns a JSON object containing the chain, contract name, verification status, whether the contract is a proxy (and if so, the implementation address and its name/verification), and an array of function signatures with their 4-byte selectors.

## 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": [
      "address"
     ],
     "properties": {
      "abi": {
       "enum": [
        "true",
        "false"
       ],
       "type": "string",
       "description": "include full ABI JSON (default true)"
      },
      "chain": {
       "enum": [
        "base",
        "ethereum"
       ],
       "type": "string",
       "description": "default base"
      },
      "address": {
       "type": "string",
       "description": "contract address 0x..."
      }
     }
    }
   }
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "chain": "base",
  "match": "exact_match",
  "proxy": {
   "isProxy": true,
   "implementation": "0x2ce6311ddae708829bc0784c967b7d77d19fd779",
   "implementationName": "FiatTokenV2_2",
   "implementationVerified": true
  },
  "verified": true,
  "functions": [
   {
    "selector": "0xf851a440",
    "signature": "admin()"
   }
  ],
  "contractName": "FiatTokenProxy"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/contract-abi-lookup-api-x402-73b9d7c6/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)
