X402 Chain Reads V1 Base Eth Getblockbynumber
by Base in Onchain & crypto
Base on-chain read: a block by number or 'latest'. Returns Base block information for query parameter block (block number or latest) via eth_getBlockByNumber.
https://api.arysphere.com/v1/ventures/x402_chain_reads_v1/base_eth_getblockbynumber- Price
- $0.003
- per call in USDC
- Uptime
- 100%
- last 30 days
- Response time
- 310 ms
- 818 ms slowest 5%
- Last check
- Passed
- 2 h ago, next any minute now
Reliability
Status and outage history · Atom feed · Watch with other listings
How to call it
GET https://api.arysphere.com/v1/ventures/x402_chain_reads_v1/base_eth_getblockbynumber
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_chain_reads_v1/base_eth_getblockbynumber?block=latestParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
block | string | No | a block number, or 'latest' |
Example response
The provider's example. We can't check it without paying.
Example response, 37 lines
{
"chain": "base",
"method": "eth_getBlockByNumber",
"ok": true,
"result": {
"baseFeePerGas": "0x4c4b40",
"blobGasUsed": "0x49fdb0",
"difficulty": "0x0",
"excessBlobGas": "0x0",
"extraData": "0x01000000640000000500000000004c4b40",
"gasLimit": "0x17d78400",
"gasUsed": "0x20543ad",
"hash": "0xea00d8455c460589a746efd2ddb95112df516d68f47f41c7247249b5519397d6",
"logsBloom": "0x5ec0c56035693ee7c0495a12f60bfbb6b73dd4f1a02ea3711ae4529f3852ed90b33e8b48b46627a63646c0dfe0ceff9d4a3bbec7dd25e362afc19ee3edb7b708a641fed8847ba50edb87d43dd2a852b4d9430c075a6d1af815d3a39cdf7eff42bae2a0aadaab0cee3f66c9750d872e88c123401219742e",
"miner": "0x4200000000000000000000000000000000000011",
"mixHash": "0x1107a40b1f89981b57fd6f8e24717d0e76cf87525d041987514d3c139405a90f",
"nonce": "0x0000000000000000",
"number": "0x3245954",
"parentBeaconBlockRoot": "0x62515d9866021870f7635c4a8e0ac37fb94e5ac70133aa8a0946a19ba7349239",
"parentHash": "0x1fd770bbc4aa41d486f43084897347279410637eb3233f2afa7c6eb4994c0655",
"receiptsRoot": "0xdd340ae2e87543370b59c54eb67043fd0108ed319fef18f5357fee05a3d2e12d",
"requestsHash": "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x14e2f",
"stateRoot": "0xe0df8779fdd9e7b3b0ebb0bf73314f53a093f0812eabfd8420d6537c9b5de8b4",
"timestamp": "0x6ad30f8b",
"transactions": [
"0xd0050c0481165f1b64e8be794aa79b503ba7718d10087982ccf6283477d54d66",
"0x30a89c4cf89346243822f98da080791feaf5b2b3e1128e530018a6060071ca53"
],
"transactionsRoot": "0xf59afdfe8e069e8e60a09c3069da7017829938e90e6cf8bf785bf33b9248fee5",
"uncles": [],
"withdrawals": [],
"withdrawalsRoot": "0xbb0b3c9c1132167b3257e9f50c915d664fce551810ebb0fbfa883441b76ed426"
},
"service": "x402_chain_reads_v1.base_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_chain_reads_v1/base_eth_getblockbynumber?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_chain_reads_v1/base_eth_getblockbynumber?block=latest' \
| grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decodeJavaScript: 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_chain_reads_v1%2Fbase_eth_getblockbynumber
const res = await pay("https://api.arysphere.com/v1/ventures/x402_chain_reads_v1/base_eth_getblockbynumber?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_chain_reads_v1/base_eth_getblockbynumber?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
| When | Result | HTTP | Time | Price |
|---|---|---|---|---|
| 2 h ago | Passed | 402 | 304 ms | $0.003 |
| 7 h ago | Passed | 402 | 818 ms | $0.003 |
| 12 h ago | Passed | 402 | 310 ms | $0.003 |