Skip to content
AgentSearch

x402 v2 · USDC on Base · no API key

AgentSearch direct x402 API

Web search, page extract, headless render and search + read at https://api.agentsearchhq.com, paid per call with standard x402 in USDC on Base mainnet. No account, plan or API key: an unpaid request returns HTTP 402 with the price, and any x402 client pays and retries. Failed calls are never charged.

Endpoints and prices

All four are POST with a JSON body. Settlement uses the Coinbase CDP facilitator, so the endpoints are discoverable in the x402 Bazaar.

EndpointPrice per callBodyReturns
POST /x402/v1/search$0.008 (8000 atomic USDC){"query": "...", "max_results": 5}Ranked live web results: title, URL, snippet/content, score, domain, date
POST /x402/v1/extract$0.007 (7000 atomic USDC){"url": "https://..."}Clean markdown of a public page, with title, links and fetch metadata
POST /x402/v1/render$0.010 (10000 atomic USDC){"url": "https://..."}A JavaScript page rendered in headless Chromium, returned as markdown with title and links
POST /x402/v1/search_and_read$0.015 (15000 atomic USDC){"query": "...", "num_results": 3}Top 1–5 results with each page's markdown (title, URL, snippet, score, page text). Charged only when at least one page has text. See Search + Read.
Payment terms

x402 v2, exact scheme

Network eip155:8453 (Base). Asset USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913. payTo 0xC49B157887e51c21CB655f39CF65D6a4c2a4C337. Terms arrive in the PAYMENT-REQUIRED header; send the signed payload in PAYMENT-SIGNATURE; the receipt comes back in PAYMENT-RESPONSE.

Never charged

Failures cost nothing

Payment is verified first and settled only after a successful answer. Invalid input (400), blocked or private URLs (400), upstream failures (502), empty search results and empty extractions are not settled; the signed authorization simply expires unused. A reused payment gets 409.

If you sign in MetaMask

A “High-risk approval” banner can appear

MetaMask may show a “High-risk approval” banner that calls the recipient an “untrusted EOA.” This signature pays the exact listed USDC amount once to the published payTo 0xC49B157887e51c21CB655f39CF65D6a4c2a4C337 on Base, with a short validity window. It is not an allowance: the payee cannot take more, use it twice, or use it after the window expires. Before you sign, check that the address matches /.well-known/x402, and that the amount, token and network match the 402 terms. Never sign a Permit, Permit2 or approve request for a payment. Agents paying with an SDK or a server wallet will not see this banner.

See the price with curl (free)

An unpaid call is free and shows the exact terms. Paying needs an x402 client, shown below.

curl: get and decode the 402

# 1) Unpaid request: HTTP 402, nothing charged. Terms are in the PAYMENT-REQUIRED header (base64 JSON).
curl -si https://api.agentsearchhq.com/x402/v1/search \
  -H 'content-type: application/json' \
  -d '{"query":"x402 payments","max_results":5}' | head -20

# Decode the terms (scheme exact, network eip155:8453, amount 8000 = $0.008, payTo, asset USDC)
curl -s -D - -o /dev/null https://api.agentsearchhq.com/x402/v1/search \
  -H 'content-type: application/json' -d '{"query":"x402"}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 -d | python3 -m json.tool

Python: read the 402 terms

import base64, json, requests

r = requests.post("https://api.agentsearchhq.com/x402/v1/render",
                  json={"url": "https://example.com"}, timeout=30)
print(r.status_code)  # 402: payment required, nothing charged
terms = json.loads(base64.b64decode(r.headers["PAYMENT-REQUIRED"]))
a = terms["accepts"][0]
print(a["network"], a["amount"], a["payTo"])  # eip155:8453 10000 0xC49B...C337
print(terms["extensions"]["bazaar"]["info"]["input"])  # machine-readable input example

Pay per call with an x402 client

Use a new wallet that holds only a little USDC on Base, and keep its key in an environment variable. No ETH is needed for gas.

TypeScript: @x402/fetch

// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

// A new wallet holding a little USDC on Base. No ETH needed; the facilitator pays gas.
const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY);
const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await fetchWithPayment("https://api.agentsearchhq.com/x402/v1/extract", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({ url: "https://example.com" }),
});
console.log(res.status, await res.json()); // 200 + markdown; receipt in PAYMENT-RESPONSE

TypeScript: @x402/axios

// npm i axios @x402/axios @x402/evm viem
import axios from "axios";
import { wrapAxiosWithPaymentFromConfig } from "@x402/axios";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY);
const api = wrapAxiosWithPaymentFromConfig(
  axios.create({ baseURL: "https://api.agentsearchhq.com", timeout: 60000 }),
  { schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }] },
);

const { data } = await api.post("/x402/v1/search", { query: "x402 payments", max_results: 5 });
console.log(data.results.map((r) => r.url));

Python: x402 + httpx

# pip install "x402[httpx,evm]" eth-account
import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact import register_exact_evm_client
from x402.http.clients import x402HttpxClient

async def main():
    account = Account.from_key(os.environ["WALLET_PRIVATE_KEY"])  # small, dedicated wallet
    client = x402Client()
    register_exact_evm_client(client, EthAccountSigner(account))
    async with x402HttpxClient(client, timeout=60) as http:
        r = await http.post("https://api.agentsearchhq.com/x402/v1/search",
                            json={"query": "x402 payments", "max_results": 5})
        print(r.status_code, [x["url"] for x in r.json()["results"]])

asyncio.run(main())

Typical agent flow

1. search   POST /x402/v1/search  {"query": "..."}      $0.008
2. extract  POST /x402/v1/extract {"url": best_url}     $0.007
3. render   POST /x402/v1/render  {"url": best_url}     $0.010
   (only when extract comes back empty, e.g. a single-page app)

One search plus two page reads: $0.022.
$1 of USDC covers 125 searches or about 140 extracts.

Search + Read ($0.015)

Search the live web and return the top pages as markdown in one paid call. $0.015 versus $0.029 a la carte (one search plus three extracts), and one payment instead of four. Short link: agentsearchhq.com/sar. Product page: /search-and-read.

Body

query, plus optional limits

query (required, 1–400 characters). num_results defaults to 3, max 5 (max_results is an alias). max_chars defaults to 8000, max 20000. render_fallback defaults to false and retries at most one empty or thin page in a headless browser.

Charge rule

Only when a page has text

Settled only when at least one result has page text. Empty search, all-empty extracts, 400 and 502 are not charged. This route is on the direct API only — it is not on Pocket Network and has no free tier.

Response

Hits plus markdown

Each result includes title, URL, snippet, score, domain, markdown, chars, truncated, extract_status and source. Top-level extracted_count is how many pages came back with text.

curl: unpaid 402 for Search + Read

curl -si https://api.agentsearchhq.com/x402/v1/search_and_read \
  -H 'content-type: application/json' \
  -d '{"query":"x402 payment protocol","num_results":3}'
# HTTP 402, amount 15000 = $0.015, payTo 0xC49B…C337, nothing charged

Typical agent flow

// One call when you need hits and their text:
POST /x402/v1/search_and_read  {"query": "..."}     $0.015

// Or a la carte:
1. search   POST /x402/v1/search  {"query": "..."}  $0.008
2. extract  POST /x402/v1/extract {"url": best_url} $0.007  (× each URL)
3. render   POST /x402/v1/render  {"url": best_url} $0.010  (only if extract is empty)

Search + three extracts a la carte: $0.029 and four payments.
$1 of USDC covers about 66 Search + Read calls.

Direct x402 (default) or Pocket?

Direct (this page, default)

api.agentsearchhq.com

Standard x402 with any x402 client, listed through the CDP facilitator for x402 Bazaar discovery. Search $0.008, Extract $0.007, Render $0.010, Search + Read $0.015. Body fields: search query, max_results; extract and render url; search_and_read query, num_results.

Also on Pocket Network

$0.005 per call

Search, Extract and Render are also on the Pocket Network Agentic Portal at $0.005 per call, with extra options such as Render screenshots and output formats. Search + Read is direct-only. The MCP server (1.7.0+), LangChain (0.6.0+) and n8n (0.6.0+) packages pay the direct API by default; set AGENTSEARCH_PAYMENT_ROUTE=pocket (n8n: Payment Route "Pocket Portal") to use Pocket for the three a la carte tools. See pricing.

Free

Free search tier

Up to 25 searches/day per IP through the free relay, and a small daily Extract/Render trial, no key or wallet. See free tier.

More

Search + Read · Pricing · agents.md · llms.txt · /.well-known/x402 · OpenAPI · MCP server · x402 tutorial