# Mach Gallery Base Contract Code Lookup

> Mach Gallery Base Contract Code Lookup is a paid API for AI agents from api.mach.gallery, paid per call via x402, $0.005/call, status unknown (last checked 2026-10-02).

Retrieves the deployed bytecode and contract status for a given EVM address on the Base network

## Facts

- Endpoint: POST https://api.mach.gallery/api/base/contract-code?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/mach-gallery-base-contract-code-lookup-c4c48953
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QkzT_s7VSAeaznzPe_dZc

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 mach-gallery-base-contract-code-lookup-c4c48953 -d '<json body>'
```

Example prompt: Can you check if the address 0x4200000000000000000000000000000000000006 on Base is a deployed smart contract, and if so, how big is its bytecode?

## When to prefer this

Use this endpoint when you need lightweight, pay-per-call contract existence and bytecode-size checks on Base without managing API keys or subscriptions. Prefer it over full node RPC calls or heavier blockchain indexers when you only need contract status and bytecode metadata rather than decoded ABI, events, or full source code.

## Known failure modes

- Invalid address format (not a 40-hex-character 0x address) returns a validation error
- Address is a valid EOA (externally owned account) — returns is_contract: false with zero bytecode
- Network unavailability or Base RPC issues may cause timeouts
- Payment failure via x402 if insufficient USDC balance

## How this service works

Fast, low-cost Base data for autonomous agents. No API keys, no subscriptions; pay per call with USDC over x402.

## Output

Returns a JSON object with the queried address, the network identifier (eip155:8453 for Base mainnet), a boolean indicating whether the address is a deployed smart contract, and the size of the contract bytecode in bytes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "address": {
   "type": "string",
   "pattern": "^0x[0-9a-fA-F]{40}$",
   "description": "Wallet or account address on Base mainnet."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "address": "0x4200000000000000000000000000000000000006",
  "network": "eip155:8453",
  "is_contract": true,
  "bytecode_bytes": 1000
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/mach-gallery-base-contract-code-lookup-c4c48953/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.mach.gallery](https://www.zero.xyz/host/api.mach.gallery/llms.txt)
