Agent402 bestsellers
GET /api/bestsellersWhat agents actually pay for on a 500+ tool x402 catalog - the paid intelligence layer over Agent402's own sales ledger, the one demand signal that never reaches the chain...
Details
What agents actually pay for on a 500+ tool x402 catalog - the paid intelligence layer over Agent402's own sales ledger, the one demand signal that never reaches the chain (settlements are on-chain; WHICH tool was bought is not). Aggregate sales totals are free at /api/sales; this adds the per-tool layer they deliberately omit: pick the window (days 1-90) and the ranking lens with sort: 'buyers' (distinct paying wallets, default - the whale/wash-resistant read), 'sales' (volume), 'usd' (revenue), or 'organic' (buyers-per-sale diversity grade, same metric as x402-trending); every row carries all lenses plus organicScore, avgTicketUsd, revenueShare, and a trend vs the previous same-length window (deltaSales + rising/flat/cooling/new - never faked: a row with no prior-window sales says 'new'). Canary/burner/heartbeat traffic is excluded at the source, and if this tool ranks in its own chart the row is flagged isSelf:true rather than hidden - buying the chart puts you on the chart.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
days | integer | no | Aggregation window in days, 1-90 (default 30). The trend compares against the same-length window immediately before it. The example sends 30. |
sort | string (one of: buyers, sales, usd, organic) | no | Ranking lens: buyers=distinct paying wallets (default, whale-resistant), sales=volume, usd=revenue, organic=organicScore (buyer diversity) One of buyers, sales, usd, organic. |
limit | integer | no | How many tools to return (1-50, default 10) The example sends 10. |
Example request
curl -i "https://agent402.tools/api/bestsellers?days=30&sort=buyers&limit=10"
Watch a call get paid
GET /api/bestsellers$0.005 USDCPAYMENT-SIGNATUREon 14 chains200 OKAgent402-ReceiptEd25519Example response
{
"days": 30,
"sort": "buyers",
"limit": 10,
"recordingSince": "2026-07-04T00:00:00.000Z",
"persistent": true,
"totals": {
"sales": 63,
"revenueUsd": 0.58,
"distinctTools": 12
},
"bestsellers": [
{
"rank": 1,
"slug": "vin-decode",
"sales": 14,
"revenueUsd": 0.056,
"revenueShare": 0.0966,
"buyers": 6,
"organicScore": 0.4286,
"avgTicketUsd": 0.004,
"firstAt": "2026-07-05T11:00:00.000Z",
"lastAt": "2026-07-14T09:30:00.000Z",
"prevSales": 3,
"deltaSales": 11,
"trend": "rising"
}
],
"note": "External paid demand only - canary/burner/heartbeat traffic excluded at the source.",
"generatedAt": "2026-07-16T00:00:05.000Z"
}| Field | Type | Always present | In the example |
|---|---|---|---|
days | number | yes | 30 |
sort | string | yes | buyers |
limit | number | yes | 10 |
recordingSince | string | yes | 2026-07-04T00:00:00.000Z |
persistent | boolean | yes | true |
totals | object | yes | 3 fields: sales, revenueUsd and 1 more |
bestsellers | array of objects | yes | 1 item in the example |
note | string | yes | External paid demand only - canary/burner/heartbeat traffic excluded at the s... |
generatedAt | string | yes | 2026-07-16T00:00:05.000Z |
From an MCP client
catalog.call {
"slug": "bestsellers",
"params": {
"days": 30,
"sort": "buyers",
"limit": 10
}
}Hosted connector (https://agent402.tools/mcp): paid in the call. Stdio package (npx -y agent402-mcp@0.17.2): pays from a wallet or an AGENT402_CREDITS_KEY issued earlier.
Errors and behavior
- Pay $0.005 per call over x402 or MPP. Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A card-credits key issued earlier (
Authorization: Bearer a402_...) also pays it. - Every field is optional; a rejected input answers 4xx with
error,tool,expected,requiredandexample. - On this route, a call ending in any status of 400 or above is not charged over x402, MPP or a credits key. A Tempo push credential pays before the call; a failure is a refund owed.
- A
POSTwith a JSON body is served as this GET. - An
Idempotency-Keyreplays the first 200 uncharged (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?.({ maxAmountPerPayment: "$0.005" }); // refuse any quote above this tool's price
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.AGENT_KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);
const res = await payFetch("https://agent402.tools/api/bestsellers?days=30&sort=buyers&limit=10");Get a wallet or run npx -y agent402-mcp@0.17.2 wallet new.
The quote (Python)
import base64, json, urllib.error, urllib.request
req = urllib.request.Request("https://agent402.tools/api/bestsellers?days=30&sort=buyers&limit=10", method="GET", headers={})
try:
urllib.request.urlopen(req)
except urllib.error.HTTPError as e:
quote = json.loads(base64.b64decode(e.headers["PAYMENT-REQUIRED"]))
print(e.code, [(a["network"], a["amount"]) for a in quote["accepts"]]) # the price, per chain, in base units