Skip to content

Web Search API

Search the web and receive structured results with titles, URLs, and content snippets. Optionally include a synthesized answer above the results. Powered by Tavily.

Free test endpoint: GET /search/test at https://x402-search-api-production.up.railway.app — returns fixture data, no wallet required. Paid endpoint: POST /search — $0.01 USDC on Base per call.

ParameterTypeRequiredDefaultDescription
querystringYesSearch query (1–400 characters)
max_resultsintegerNo5Number of results to return (1–10)
include_answerbooleanNofalseInclude a synthesized answer above search results
include_domainsstring[]NoRestrict results to these domains (max 20)
exclude_domainsstring[]NoExclude results from these domains (max 20)
Terminal window
# Free test (no wallet required)
curl https://x402-search-api-production.up.railway.app/search/test
# Paid call (requires x402-fetch or x402-mcp-server — handles X-Payment header automatically)
curl -X POST https://x402-search-api-production.up.railway.app/search \
-H "Content-Type: application/json" \
-d '{"query": "Ethereum L2 scaling solutions 2025", "max_results": 3}'

“Search for recent news about Ethereum L2 scaling solutions, limit to 3 results.”

{
"tool": "x402_web_search",
"arguments": {
"query": "Ethereum L2 scaling solutions 2025",
"max_results": 3
}
}

The response contains an array of result objects, each with:

  • title (string) — page title
  • url (string) — page URL
  • content (string) — snippet or summary of the page content

If include_answer is true, the response also includes an answer field with a synthesized summary above the individual results.

CodeMeaning
402Payment required — x402 handshake (handled automatically by MCP server)
422Invalid query or parameter validation failed
429Daily wallet limit (50/day) or free test rate limit (100/hour per IP) exceeded
500Search provider error
503Search provider credits exhausted