Directory / Crypto & onchain data

Check if an Ethereum address is a contract via eth_getCode

Check if an Ethereum address is a contract via eth_getCode - returns deployed bytecode

402 OKBaseGETx402 v2

Price per call
$0.003
Endpoint
https://api.onesource.io/api/chain/code/:address
Provider
api.onesource.io
Paid calls (30 days)
265
Unique payers (30 days)
265
Last paid call
11 days ago
Health check
HTTP 402 6 min ago
Pays to
0x52E29e0d2Aa49bfBfC548C0A9F2196F4aa51f3ea
Listed here since
2026-11-23 (source: bazaar)

Input

{
  "method": "GET",
  "pathParams": {
    "address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
  },
  "queryParams": {
    "network": "ethereum"
  },
  "type": "http"
}

Example output

{
  "example": {
    "data": {
      "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
      "code": "0x6080604052600436106101...",
      "code_length": 10234,
      "is_contract": true
    },
    "meta": {
      "cost_usdc": "0.001",
      "endpoint": "/api/chain/code/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
      "payment_chain": "base",
      "payment_token": "USDC",
      "request_id": "00000000abcdef01"
    }
  },
  "type": "json"
}

Call it from an agent

import { wrapFetchWithPayment } from "x402-fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY);
const paidFetch = wrapFetchWithPayment(fetch, account);

const res = await paidFetch("https://api.onesource.io/api/chain/code/:address", { method: "GET" });
console.log(await res.json()); // costs $0.003 in USDC on Base

Machine-readable: /api/tools/6674ad95fd52. Listings are informational; check a provider before sending large amounts.