MEV recent blocks
POST /api/mev-recent-blocksLast N MEV-Boost-built blocks via the Flashbots relay. Send POST /api/mev-recent-blocks with no required fields (1 optional) and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with count, totalEthToProposers, avgEthPerBlock, relay and blocks.
For each block: slot, block number/hash, builder pubkey, proposer pubkey, gas used/limit, ETH paid to the proposer, and tx count. Use to monitor block-builder market share, proposer revenue, or to correlate an arbitrage opportunity with the block it landed in.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | number | no | Number of recent blocks (1-100, default 20). |
Example request
curl -i -X POST https://agent402.tools/api/mev-recent-blocks \
-H "Content-Type: application/json" \
-d '{"limit":5}'
Without payment this returns HTTP 402 Payment Required with the exact price for mev-recent-blocks; any x402 v2 or MPP client pays it and retries.
Example response
{
"count": 1,
"totalEthToProposers": 0.072345,
"avgEthPerBlock": 0.072345,
"relay": "flashbots",
"blocks": [
{
"slot": 12345678,
"blockNumber": 22345678,
"blockHash": "0xabc...",
"parentHash": "0xdef...",
"builderPubkey": "0x9000...",
"builderShort": "0x90000000…abcdef",
"proposerPubkey": "0xa000...",
"proposerFeeRecipient": "0x1234...",
"gasUsed": 14987654,
"gasLimit": 30000000,
"valueWei": "72345000000000000",
"valueEth": 0.072345,
"numTx": 187
}
]
}
| Field | Type | Always present | In the example |
|---|---|---|---|
count | number | yes | 1 |
totalEthToProposers | number | yes | 0.072345 |
avgEthPerBlock | number | yes | 0.072345 |
relay | string | yes | flashbots |
blocks | array of objects | yes | 1 item in the example |
From an MCP client
catalog.call {
"slug": "mev-recent-blocks",
"params": {
"limit": 5
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for mev-recent-blocks; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
- Every field is optional. An input the tool rejects returns an HTTP 4xx whose body carries
error,tool,expected,requiredandexample. - A paid call that ends in any status of 400 or above is not charged over x402, MPP or a prepaid credits key: settlement is cancelled when the tool fails. The exception is a Tempo push credential, a transfer the buyer sent before the call: it settles before the tool runs, so if the tool then fails the payment is recorded as a refund owed to the paying wallet.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/mev-recent-blocks returns the same 402 quote, so the price can be read without a body. - An
Idempotency-Keyheader makes a retried paid call replay the first 200 instead of charging again (an answer larger than 1 MB is not replayed).
Paid call (JavaScript agent)
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/mev-recent-blocks", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"limit": 5
}),
});
Related tools
MEV block payment lookup
POST /api/mev-block-paymentLook up the MEV-Boost payment for a specific slot or block number via the Flashbots relay. Returns the builder, proposer…
MEV builder share
POST /api/mev-builder-shareBuilder market share aggregated over the last N MEV-Boost blocks via the Flashbots relay. Returns per-builder block coun…
Known-address label lookup
POST /api/address-labelLabel a known EVM address from a curated, committed dataset: major stablecoin + token contracts (the USDC and USDG contr…
Wallet token transfers (filtered)
POST /api/asset-transfersRecent token transfers for a wallet on Base, Ethereum and other EVM chains, newest first. Filtered transfer log for an E…
Block info
GET /api/block-infoHeader-level detail for one block on Ethereum, Base, Polygon, Arbitrum, or Optimism: hash, timestamp (unix + ISO), trans…
Latest block number
GET /api/block-numberThe latest block number on Ethereum, Base, Polygon, Arbitrum, or Optimism: returns network, blockNumber (integer) and he…