Multi-search (batch)
POST /api/multi-searchRun 2-5 web searches in one call with a 20% volume discount vs. individual searches. Send POST /api/multi-search with the required field queries and pay $0.08 per call over x402 or MPP (there is no free tier). It returns a JSON object with searches and totalResults.
Each query returns ranked results (title, URL, snippet). Ideal for multi-faceted research or comparing sources on different aspects of a topic.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
queries | array of string | yes | Array of 2-5 search queries (each max 400 chars) |
count | number | no | Results per query, 1-10 (default 5) |
freshness | string | no | Optional: pd, pw, pm, or py (past day/week/month/year) |
Example request
curl -i -X POST https://agent402.tools/api/multi-search \
-H "Content-Type: application/json" \
-d '{"queries":["x402 payment protocol","USDC micropayments"]}'
Without payment this returns HTTP 402 Payment Required with the exact price for multi-search; any x402 v2 or MPP client pays it and retries.
Example response
{
"searches": [
{
"query": "x402 payment protocol",
"count": 2,
"results": [
{
"title": "x402.org",
"url": "https://www.x402.org/",
"description": "An open standard…",
"age": null
}
]
},
{
"query": "USDC micropayments",
"count": 2,
"results": [
{
"title": "Circle USDC",
"url": "https://www.circle.com/usdc",
"description": "Digital dollar…",
"age": null
}
]
}
],
"totalResults": 4
}
| Field | Type | Always present | In the example |
|---|---|---|---|
searches | array of objects | yes | 2 items in the example |
totalResults | number | yes | 4 |
From an MCP client
catalog.call {
"slug": "multi-search",
"params": {
"queries": [
"x402 payment protocol",
"USDC micropayments"
]
}
}
The hosted connector at https://agent402.tools/mcp needs a payment for multi-search; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.
Errors and behavior
queriesis required. An input the tool rejects returns an HTTP 4xx whose body carrieserror,tool,expected,requiredandexample, so the caller can correct it.- A paid call that ends in any status of 400 or above is not charged: settlement is cancelled when the tool fails.
- Wallet-only: this tool reaches the network or stored state, so it has no proof-of-work tier. A prepaid card-credits key (
Authorization: Bearer a402_...) also pays it. - A
GETorHEADto /api/multi-search 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.
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/multi-search", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"queries": [
"x402 payment protocol",
"USDC micropayments"
]
}),
});
Related tools
Web answer
GET /api/answerAI-generated answer to a natural-language question, grounded in live web search results with source citations. Returns c…
LLM grounding context
POST /api/llm-contextWeb search that returns READY-TO-USE grounding text, not links: for one query you get the passages an independent search…
Web search
GET /api/searchLive web search: ranked results[] of {title, url, description (the snippet, plain text), age, publishedAt (ISO)} from an…
Image search
GET /api/search-imagesLive image search: ranked image results (title, source page, image URL, thumbnail URL, dimensions) from an independent s…
News search
GET /api/search-newsLive news search: ranked recent articles as results[] of {title, url, description (the snippet, plain text), age, publis…
Video search
GET /api/search-videosLive video search: ranked video results (title, video page URL, description, duration, creator, publisher, thumbnail, ag…