# Sourcify Contract Source Fetcher

> Sourcify Contract Source Fetcher is a paid API for AI agents from agent402.tools, paid per call via x402, $0.005/call, status unknown (last checked 2026-09-15).

Fetches verified Solidity source files and compiler metadata for an EVM contract address from Sourcify's open verification repository across 8 mainnets.

## Facts

- Endpoint: POST https://agent402.tools/api/contract-source
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/sourcify-contract-source-fetcher-25a96c2e
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_TE40V79INzcJHvAVKKhnw

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 sourcify-contract-source-fetcher-25a96c2e -d '<json body>'
```

Example prompt: Can you pull the verified Solidity source code and compiler metadata for contract 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 on Ethereum from Sourcify?

## When to prefer this

Use this endpoint when you need the verified Solidity source code and compiler metadata for a specific EVM contract address from Sourcify's decentralized open repository, particularly when working across any of the 8 supported mainnets (ethereum, base, polygon, arbitrum, optimism, bsc, gnosis, celo). Prefer this over Etherscan-based alternatives when you want open, decentralized verification data or when targeting chains like Gnosis or Celo.

## Known failure modes

- Contract not verified on Sourcify — returns empty or error indicating no verified source exists
- Invalid contract address format — rejects non-0x-prefixed or wrong-length addresses
- Unsupported network — returns error if a chain not in the supported 8 is specified
- Contract exists on-chain but source was never submitted to Sourcify
- Network connectivity issues reaching Sourcify's repository

## How this service works

Fetch the verified Solidity source files and compiler metadata for a contract address from Sourcify's open verification repository. Covers 8 EVM mainnets (ethereum, base, polygon, arbitrum, optimism, bsc, gnosis, celo). Contracts that were never verified return a structured {verified:false} miss, not an error. Feed the returned source into /api/solidity-scan for a heuristic pattern check.

## Output

Returns the verified Solidity source files (one or more .sol files) and compiler metadata (compiler version, optimization settings, ABI, etc.) for the specified contract as stored in Sourcify's open verification repository. Returns an error or empty result if the contract was never submitted for verification.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "address": {
   "type": "string",
   "description": "0x-prefixed 40-char contract address."
  },
  "network": {
   "type": "string",
   "description": "ethereum / base / polygon / arbitrum / optimism / bsc / gnosis / celo (default base)."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "match": "exact_match",
  "address": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
  "chainId": 8453,
  "network": "base",
  "sources": {
   "contracts/FiatTokenProxy.sol": "// SPDX-License-Identifier: MIT …"
  },
  "compiler": {
   "version": "0.6.12",
   "language": "Solidity"
  },
  "verified": true,
  "verifiedAt": "2024-08-08T13:59:29Z",
  "sourceCount": 2
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/sourcify-contract-source-fetcher-25a96c2e/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
