Directory / Crypto & onchain data

Ethereum chain ID (EIP-155) via eth_chainId

Ethereum chain ID (EIP-155) via eth_chainId - confirm which chain a network is on

402 OKBaseGETx402 v2

Price per call
$0.001
Endpoint
https://api.onesource.io/api/chain/chain-id
Provider
api.onesource.io
Paid calls (30 days)
273
Unique payers (30 days)
257
Last paid call
10 days ago
Health check
HTTP 402 4 min ago
Pays to
0x52E29e0d2Aa49bfBfC548C0A9F2196F4aa51f3ea
Listed here since
2026-11-23 (source: bazaar)

Input

{
  "method": "GET",
  "queryParams": {
    "network": "ethereum"
  },
  "type": "http"
}

Example output

{
  "example": {
    "data": {
      "result": "0x1"
    },
    "meta": {
      "cost_usdc": "0.001",
      "endpoint": "/api/chain/chain-id",
      "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/chain-id", { method: "GET" });
console.log(await res.json()); // costs $0.001 in USDC on Base

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