I built a pay-per-search API discovery engine — no API keys, just crypto (x402)

Published: (March 8, 2026 at 08:19 AM EDT)
3 min read
Source: Dev.to

Source: Dev.to

Cover image for I built a pay-per-search API discovery engine — no API keys, just crypto (x402)

The problem

When an agent needs a capability it doesn’t have — weather data, image generation, price feeds, web scraping — it has no good way to go find a paid API on its own. Every API monetization model today assumes a human is doing the signup. There’s no standard way for a machine to say “I want this capability, here’s payment, give me the result.”

That gap is what I’m trying to close.

What is x402?

x402 is an open protocol that brings the HTTP 402 Payment Required status code to life. When a client hits an x402‑enabled endpoint without paying, the server returns a 402 with a machine‑readable payment request. The client pays on‑chain (USDC on Base mainnet, typically), attaches a payment‑proof header, and retries — all in a single round‑trip. No accounts, no API keys, no dashboards. Just a wallet and an HTTP client.

What x402search does

x402search is a discovery engine for x402‑enabled APIs. It indexes 13,000+ APIs across the x402 ecosystem and exposes them via an MCP (Model Context Protocol) tool that Claude, Cursor, Windsurf, and any MCP‑compatible agent can call natively.

  • Each search costs $0.01 USDC on Base mainnet — paid automatically by the agent using the x402 protocol.
  • No signup, no rate‑limit tiers, no API key rotation.
  • The search tool understands natural‑language queries and supports filters for network (eip155:8453 for Base) and max price.
  • Results include endpoint URLs, descriptions, pricing, and the payment metadata needed to actually call the API.

Install in 2 lines

Add the following to your MCP configuration (Claude Desktop, Cursor, Windsurf, etc.):

{
  "mcpServers": {
    "x402search": {
      "command": "npx",
      "args": ["-y", "x402search-mcp"],
      "env": {
        "WALLET_PRIVATE_KEY": ""
      }
    }
  }
}

Your wallet needs a small amount of USDC on Base mainnet. At $0.01 per search, $1 gets you 100 queries. The MCP server handles payment automatically — the agent just calls search_x402_apis with a query string.

How it works under the hood

  1. The agent calls search_x402_apis.
  2. The MCP server sends a POST to https://x402search.xyz/v1/search.
  3. The server responds with a 402 containing a payment request: network eip155:8453, amount 10000 (0.01 USDC in 6‑decimal format), recipient address, and a nonce.
  4. The x402 client library signs and submits a USDC transfer on Base mainnet, attaches the X-Payment header with the proof, and retries the request.
  5. The server verifies the on‑chain payment and returns the search results.

The MCP server uses @x402/axios to wrap a standard Axios instance, @x402/evm (with viem) for EVM signing, and @modelcontextprotocol/sdk to expose the tool over stdio. The private key stays local — it never leaves the agent’s environment.

Current status

  • The indexer is live, running against the CDP Bazaar dataset with 12,845+ resources indexed.
  • The search API is running on Base mainnet and accepting real payments.
  • The MCP package is published on npm.

What’s next

  • Broader index coverage beyond CDP Bazaar
  • Keyword + semantic hybrid search
  • An agent that can not only find APIs but autonomously compose multi‑step workflows across them
  • A public leaderboard of the most‑queried capabilities

Try it

If you’re building with MCP or exploring the x402 ecosystem, drop a star and let me know what you’re working on. I’m especially curious about use cases where agents need to compose multiple paid APIs in a single task — that’s where this gets interesting.

0 views
Back to Blog

Related posts

Read more »