90trust / 100

Chain Network Info

by api.onesource.io in Other

x402 APIPassing, checked 2 h ago

EVM network info - chain ID, block height, gas price, chain head age, and chain characteristics in one batched RPC call (eth_chainId + eth_blockNumber + eth_gasPrice + latest block header)

GET https://api.onesource.io/api/chain/network-info

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
147 ms typical, 147 ms slowest 5%
Last check
2 h ago
Next check
any minute now

How to call it

# See the payment challenge (nothing is charged)
curl -i -X GET "https://api.onesource.io/api/chain/network-info?network=ethereum"
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.03:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.onesource.io%2Fapi%2Fchain%2Fnetwork-info
const res = await pay("https://api.onesource.io/api/chain/network-info?network=ethereum");
console.log(await res.json());

Example input

{
  "network": "ethereum"
}

Example output

{
  "data": {
    "block_number": "0x133da1e",
    "chain": {
      "avg_block_time_ms": 12000,
      "chain_id": 1,
      "ens": true,
      "finality": "beacon",
      "indexed": true,
      "layer": 1,
      "mempool": true,
      "native_currency": "ETH",
      "stack": "ethereum"
    },
    "chain_id": "0x1",
    "gas_price": "0x4a817c800",
    "head_age_seconds": 9,
    "head_timestamp": 1754240345,
    "net_version": "1",
    "network": "ethereum",
    "stale": false,
    "stale_after_seconds": 1200
  },
  "meta": {
    "cost_usdc": "0.001",
    "endpoint": "/api/chain/network-info",
    "payment_chain": "base",
    "payment_token": "USDC",
    "request_id": "00000000abcdef01"
  }
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
2 h agoPassed402147 ms$0.001