77trust / 100

X402 Eth Reads V1 Eth Mainnet Eth Get Block By Number

by Ethereum in Onchain & crypto

x402 APIPassing, checked 3 h ago

Ethereum mainnet on-chain read: a block by number or 'latest'. Returns an Ethereum mainnet block by number or 'latest' via eth_getBlockByNumber. Takes block (a block number, or 'latest').

GET
https://api.arysphere.com/v1/ventures/x402_eth_reads_v1/eth_mainnet_eth_get_block_by_number
Price
$0.003
per call in USDC
Uptime
100%
last 30 days
Response time
329 ms
361 ms slowest 5%
Last check
Passed
3 h ago, next any minute now

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

Status and outage history · Atom feed · Watch with other listings

How to call it

GET https://api.arysphere.com/v1/ventures/x402_eth_reads_v1/eth_mainnet_eth_get_block_by_number

Each call costs $0.003 in USDC on Base, paid with the request over x402.

Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.

Example request

From the listing.

GET https://api.arysphere.com/v1/ventures/x402_eth_reads_v1/eth_mainnet_eth_get_block_by_number?block=latest

Parameters

ParameterTypeRequiredDescription
blockstringNoa block number, or 'latest'

Example response

The provider's example. We can't check it without paying.

Example response, 32 lines
{
  "chain": "ethereum",
  "method": "eth_getBlockByNumber",
  "ok": true,
  "result": {
    "baseFeePerGas": "0x206e2cc9",
    "blobGasUsed": "0x140000",
    "difficulty": "0x0",
    "excessBlobGas": "0xc0db577",
    "extraData": "0x546974616e2028746974616e6275696c6465722e78797a29",
    "gasLimit": "0x3938700",
    "gasUsed": "0x169e64a",
    "hash": "0x7538fe3a3bb34856c428edf3a6987a3f65c62e420473a509e0ef6e6446aac74b",
    "logsBloom": "0x51ef0f6b5db85bb77c3f1b4de1e5dfafd5fedf65f45c753c161735b56e9beff5dc2cc73aa3bc2fafb97e7b917abf7dddc76b513d9f67ef73dfff2ff2bfefe4db7379d7e11ef186fae93b772fb47b47ffeee47771edfe1bba7176649acf657edef630646aa6ce2a61faf7faf32e606cc7dbffc2be70d6b6",
    "miner": "0x4838b106fce9647bdf1e7877bf73ce8b0bad5f97",
    "mixHash": "0xae6149f7ce26ec6622dcee60ac3581ec58f376c6e617344d5d26fa6c79fcd84f",
    "nonce": "0x0000000000000000",
    "number": "0x18f1ab8",
    "parentBeaconBlockRoot": "0x0a477cb0499fc7f2a7d288b176f58f017ce1fc816648df3df102066289a3a962",
    "parentHash": "0x49c6e74104654981bc3d21e12e9df6dcb4fad59c775948d9c43ecc662dbbeebe",
    "receiptsRoot": "0xd4d60719e4ba28f68eb398a5d861d44bfdb8a171742a756e0dbcc50250136183",
    "requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "size": "0x1d1af",
    "stateRoot": "0xafc5c4791f953764c1240c4605600bffa650467910ff793a6ad44a44ec5bcdad",
    "timestamp": "0x6ac905e3",
    "transactionsRoot": "0xc00956eb9e6da8da2db4d3a68333bf790f6fb92471b67121666f3a739a0b9e6c",
    "uncles": [],
    "withdrawalsRoot": "0x58b153ac66ecab07f3a899101e5e839985a01f22419ae16886f5321840808584"
  },
  "service": "x402_chain_reads_v1.eth_getblockbynumber"
}

Call it from code

The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.003.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i 'https://api.arysphere.com/v1/ventures/x402_eth_reads_v1/eth_mainnet_eth_get_block_by_number?block=latest'

# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - 'https://api.arysphere.com/v1/ventures/x402_eth_reads_v1/eth_mainnet_eth_get_block_by_number?block=latest' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
JavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

// Pays at most $0.003 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.003" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.003 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fapi.arysphere.com%2Fv1%2Fventures%2Fx402_eth_reads_v1%2Feth_mainnet_eth_get_block_by_number
const res = await pay("https://api.arysphere.com/v1/ventures/x402_eth_reads_v1/eth_mainnet_eth_get_block_by_number?block=latest");
console.log(res.status, await res.text());
Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# Pays at most $0.003 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.003"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.get("https://api.arysphere.com/v1/ventures/x402_eth_reads_v1/eth_mainnet_eth_get_block_by_number?block=latest")
    print(res.status_code, res.text)

Security scan

No findings

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

Recent checks

WhenResultHTTPTimePrice
3 h agoPassed402313 ms$0.003
8 h agoPassed402329 ms$0.003
13 h agoPassed402361 ms$0.003