API Documentation

Programmatically search and discover x402 endpoints

Base URL: https://agentindex.netlify.app/api

All endpoints return JSON. Free endpoints require no authentication. Premium endpoints require x402 payment.

Free Endpoints

GET /search FREE

Search indexed x402 endpoints by keyword, category, or filters.

Query Parameters

q string Search query (matches URL, domain, description)
category string Filter by category (e.g., "ai/ml", "defi", "crypto-data")
maxPrice number Maximum price per call in USD
healthyOnly boolean Only return healthy endpoints (true/false)
limit number Max results to return (default: 20)

Example

GET /api/search?q=crypto&maxPrice=0.05&healthyOnly=true
{
  "count": 9,
  "results": [
    {
      "url": "https://example.com/api/prices",
      "domain": "example.com",
      "description": "Real-time crypto prices",
      "priceUsd": 0.02,
      "category": "crypto-data",
      "health": "healthy",
      "tier": "A"
    }
  ]
}
GET /stats FREE

Get aggregate statistics about indexed endpoints.

Response

{
  "total": 108,
  "healthy": 63,
  "healthRate": "58.3%",
  "avgPriceUsd": "0.0238",
  "uniqueDomains": 48,
  "indexed": "2026-01-28T13:45:06.521Z"
}
GET /categories FREE

List all categories and endpoint counts.

{
  "categories": {
    "ai/ml": 24,
    "defi": 18,
    "crypto-data": 15,
    "content/ipfs": 12,
    ...
  }
}

Premium Endpoints (x402)

These endpoints require x402 payment. They return 402 Payment Required with payment instructions in the response header.

GET /premium/analytics $0.02

Deep analytics: most reliable endpoints, best value services, price distribution stats.

{
  "mostReliable": [...],
  "bestValue": [...],
  "priceDistribution": {
    "min": 0.001,
    "max": 0.5,
    "avg": 0.024
  },
  "totalIndexed": 108
}
GET /premium/trending $0.01

Get newest endpoints and top-tier rated services.

{
  "newest": [...],
  "topTier": [...]
}
GET /premium/compare $0.01

Compare multiple endpoints side-by-side.

Query Parameters

urls string Comma-separated endpoint URLs to compare required
GET /api/premium/compare?urls=https://api1.com,https://api2.com
GET /premium/recommend $0.03

AI-powered endpoint recommendation. Describe what you need in plain language.

Query Parameters

need string What you need (e.g., "real-time crypto prices") required
maxPrice number Maximum price per call optional
requireHealthy boolean Only return healthy endpoints optional
GET /api/premium/recommend?need=I need real-time crypto prices&maxPrice=0.05
GET /premium/reputation $0.02

Detailed reputation and reliability history for a specific endpoint.

Query Parameters

url string Endpoint URL to check required
{
  "reputation": {
    "overallScore": 87,
    "uptimePercent": "99.2",
    "avgResponseTime": 245,
    "trend": "stable"
  }
}
GET /premium/leaders $0.02

Get the top-rated endpoint in each category. One call to find the best across all categories.

{
  "leaders": {
    "ai/ml": { "url": "...", "score": 95, "price": 0.02 },
    "defi": { "url": "...", "score": 92, "price": 0.01 }
  }
}
GET /premium/budget $0.01

Find highest quality endpoints within your budget. Optimizes quality-per-dollar.

Query Parameters

maxPricePerCall number Maximum price per call required
category string Filter by category optional
GET /api/premium/budget?maxPricePerCall=0.02&category=defi

Using x402 Payments

To call premium endpoints, use the @x402/fetch SDK:

import { wrapFetchWithPayment } from '@x402/fetch';

const fetchWithPayment = wrapFetchWithPayment(fetch, client, {
  facilitatorUrl: 'https://api.cdp.coinbase.com/platform/v2/x402'
});

const response = await fetchWithPayment(
  'https://agentindex.netlify.app/api/premium/analytics'
);
const data = await response.json();

Rate Limits

Free endpoints: 100 requests/minute
Premium endpoints: Unlimited (payment required per call)