# OneSource Ethereum Block Lookup RPC

> OneSource Ethereum Block Lookup RPC is a paid API for AI agents from api.onesource.io, paid per call via x402, $0.003/call, status unknown (last checked 2026-09-15).

Fetches on-chain block data (hash, number, gas used, timestamp, parent hash) for a given block number or tag on Ethereum mainnet or Sepolia testnet

## Facts

- Endpoint: GET https://api.onesource.io/api/chain/block/%7Bnumber%7D
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/onesource-ethereum-block-lookup-rpc-abefdcd1
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_cY1XRSZV6ehsipkJ-VuNE

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 onesource-ethereum-block-lookup-rpc-abefdcd1
```

Example prompt: What are the details for Ethereum mainnet block number 20,000,000 — give me the hash, gas used, timestamp, and parent hash?

## When to prefer this

Use this endpoint when you need fast, pay-per-call access to raw Ethereum block metadata (hash, gas, timestamp) on mainnet or Sepolia without managing API keys. Prefer it over self-hosted RPC when you want micropayment-based access via x402/USDC on Base.

## Known failure modes

- Block number out of range or not yet mined — returns error or null
- Invalid block tag string — returns 400 or error body
- Network parameter not recognized — defaults to ethereum or returns error
- Block pending and not yet available — may return empty/null fields
- Payment not included or insufficient — returns 402 Payment Required

## How this service works

Two data families for AI agents: live Ethereum mainnet, Sepolia testnet, and Robinhood Chain RPC reads, plus Deepstate on-chain market data (order books, trades, candles, and analytics). Pay per call or use batch/session mode: USDC on Base via x402, or pathUSD/USDC.e on Tempo via MPP. No API key required to start; a flat-rate monthly subscription is also available.

## Output

A JSON object with the block's hash, hex-encoded block number, gas used, gas limit, Unix timestamp (hex), and parent block hash for the requested Ethereum or Sepolia block.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "pathParams": {
     "type": "object",
     "required": [
      "number"
     ],
     "properties": {
      "number": {
       "oneOf": [
        {
         "enum": [
          "latest",
          "pending",
          "earliest",
          "safe",
          "finalized"
         ],
         "type": "string"
        },
        {
         "type": "string",
         "pattern": "^(0[xX][a-fA-F0-9]+|[0-9]+)$"
        }
       ]
      }
     }
    },
    "queryParams": {
     "type": "object",
     "properties": {
      "network": {
       "enum": [
        "ethereum",
        "sepolia",
        "robinhood"
       ],
       "type": "string",
       "default": "ethereum"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "data",
      "meta"
     ],
     "properties": {
      "data": {
       "type": "object",
       "properties": {
        "result": {
         "type": [
          "object",
          "null"
         ],
         "properties": {
          "hash": {
           "type": "string"
          },
          "number": {
           "type": "string"
          },
          "gasUsed": {
           "type": "string"
          },
          "gasLimit": {
           "type": "string"
          },
          "timestamp": {
           "type": "string"
          },
          "parentHash": {
           "type": "string"
          },
          "transactions": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       },
       "description": "Endpoint-specific response payload"
      },
      "meta": {
       "type": "object",
       "required": [
        "endpoint",
        "request_id"
       ],
       "properties": {
        "endpoint": {
         "type": "string"
        },
        "cost_usdc": {
         "type": "string"
        },
        "request_id": {
         "type": "string"
        },

… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "data": {
   "result": {
    "hash": "0x3f5f8b0a8e9b7c6d4f2a1b5e8c9d7a3f6e4b9d1c5a8f2e7b4d6c3a9e1f0b8d5c",
    "number": "0x133da1e",
    "gasUsed": "0xe4e1c0",
    "gasLimit": "0x1c9c380",
    "timestamp": "0x6567c8e0",
    "parentHash": "0x3f5f8b0a8e9b7c6d4f2a1b5e8c9d7a3f6e4b9d1c5a8f2e7b4d6c3a9e1f0b8d5b",
    "transactions": [
     "0xad7e04119ecd85857728205f5b12e95f0bab8e99f9c2f60be5dc79cfc6a8df1f"
    ]
   }
  },
  "meta": {
   "endpoint": "/api/chain/block/{number}",
   "cost_usdc": "0.001",
   "request_id": "00000000abcdef01",
   "payment_chain": "base",
   "payment_token": "USDC"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/onesource-ethereum-block-lookup-rpc-abefdcd1/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from api.onesource.io](https://www.zero.xyz/host/api.onesource.io/llms.txt)
