# EVM Contract Source & ABI Fetcher

> EVM Contract Source & ABI Fetcher is a paid API for AI agents from api.agentstools.dev, paid per call via x402, $0.02/call, status unknown (last checked 2026-09-15).

Fetches verified smart contract source code, ABI, compiler settings, NatSpec docs, and proxy implementation ABI for any EVM address across major networks.

## Facts

- Endpoint: GET https://api.agentstools.dev/contract/source
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/evm-contract-source-abi-fetcher-4043d5c4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_PQe_9ye-sZF_7pqWopAMl

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 evm-contract-source-abi-fetcher-4043d5c4
```

Example prompt: Can you pull the full source code, ABI, and NatSpec docs for the contract at 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on Ethereum — and if it's a proxy, also give me the implementation ABI?

## When to prefer this

Choose this endpoint when an agent needs the full contract source, ABI, compiler metadata, and NatSpec in a single call without managing API keys for Etherscan or similar block explorers. Especially valuable for audit or integration workflows where proxy resolution is needed automatically. Prefer over block explorer REST APIs when operating in a keyless, pay-per-call (x402) agentic context across multiple EVM networks.

## Known failure modes

- Contract address not verified on the requested network — returns honest unverified status rather than partial data
- Invalid or malformed address (not 0x + 40 hex) — returns validation error
- Network not supported — returns error for chains outside base/ethereum/arbitrum/optimism/polygon/bnb
- Proxy resolution failure — implementation address cannot be determined from known proxy patterns
- Network timeout or block explorer API unavailability — returns service error
- Rate limiting or payment failure via x402 protocol — returns 402 or payment-related error

## How this service works

Fetch a verified smart-contract's full source, ABI, compiler settings and NatSpec docs for an EVM address, and automatically resolve a proxy to its implementation so the response also carries the implementation ABI. One call returns everything an audit or integration agent needs to understand the contract, keyless and pay-per-call. Unverified contracts are reported honestly.

## Output

Returns the contract's verified Solidity source code, full ABI, compiler settings (version, optimization flags), NatSpec documentation, and — for proxy contracts — automatically resolves to the implementation and includes its ABI as well. Unverified contracts are reported as such rather than silently failing.

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "address"
     ],
     "properties": {
      "address": {
       "type": "string",
       "description": "Contract address, 0x + 40 hex"
      },
      "network": {
       "enum": [
        "base",
        "ethereum",
        "arbitrum",
        "optimism",
        "polygon",
        "bnb"
       ],
       "type": "string",
       "description": "EVM network (default base)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/evm-contract-source-abi-fetcher-4043d5c4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.agentstools.dev](https://www.zero.xyz/host/api.agentstools.dev/llms.txt)
