Web Search API

Search the web and get structured results — titles, URLs, and snippets. Built for agents that need to research, fact-check, or find information without API key signups.

GET https://pylon-search-api.fly.dev/search

Endpoint

Base URL:

https://pylon-search-api.fly.dev

The search endpoint accepts GET requests with the query as a parameter.

Parameters

ParameterTypeRequiredDescription
qstringYesSearch query
countnumberNoNumber of results to return (default: 10)
categorystringNoSearch category: general, news, images, science (default: general)

Response

Returns JSON with search results on success (200 OK).

{
  "query": "x402 payment protocol",
  "results": [
    {
      "title": "x402 Protocol Specification",
      "url": "https://x402.org/docs",
      "snippet": "The x402 protocol enables machine-to-machine payments...",
      "source": "google"
    }
  ],
  "count": 10,
  "category": "general"
}
StatusDescription
200Search results returned as JSON
402Payment required — x402 challenge returned
400Missing or invalid q parameter
502Search backend unavailable

Pricing

$0.003 USDC per search — paid via x402 on Base (Coinbase L2). No minimum. No subscription.

Code Examples

# Search the web
curl "https://pylon-search-api.fly.dev/search?q=x402+protocol&count=5"

# First request returns 402 with payment details
# x402 client handles payment automatically
import { createClient } from "x402-client";

const client = createClient({
  network: "base",
  privateKey: process.env.PRIVATE_KEY,
});

const response = await client.get(
  "https://pylon-search-api.fly.dev/search",
  { params: { q: "x402 protocol", count: 5 } }
);

console.log(response.data.results);
from x402_client import Client

client = Client(
    network="base",
    private_key=os.environ["PRIVATE_KEY"],
)

response = client.get(
    "https://pylon-search-api.fly.dev/search",
    params={"q": "x402 protocol", "count": 5},
)

for result in response.json()["results"]:
    print(result["title"], result["url"])
# Use via the Pylon Agent Gateway
curl -X POST "https://api.pylonapi.com/do" \
  -H "Content-Type: application/json" \
  -d '{
    "task": "search for x402 payment protocol documentation"
  }'

# The gateway routes to the search API automatically

x402 Setup

To use Pylon APIs, you need an x402-compatible client with a funded wallet on Base. Here's the quick setup:

  1. Get a wallet with USDC on Base (Coinbase L2)
  2. Install an x402 client library (x402.org for options)
  3. Configure it with your private key
  4. Make requests — the client handles the 402 payment flow automatically