<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Agent Index API Documentation</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #0a0a0f; color: #e0e0e0; line-height: 1.6; }
.container { max-width: 900px; margin: 0 auto; padding: 40px 20px; }
h1 { color: #fff; margin-bottom: 10px; }
h1 span { color: #64ffda; }
.subtitle { color: #8892b0; margin-bottom: 40px; }
h2 { color: #64ffda; margin: 40px 0 20px; padding-bottom: 10px; border-bottom: 1px solid rgba(100,255,218,0.2); }
h3 { color: #fff; margin: 25px 0 10px; }
p { margin-bottom: 15px; }
code { background: rgba(100,255,218,0.1); color: #64ffda; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
pre { background: #1a1a2f; padding: 20px; border-radius: 8px; overflow-x: auto; margin: 15px 0; }
pre code { background: none; padding: 0; }
.endpoint { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 20px; margin: 20px 0; }
.method { display: inline-block; padding: 4px 10px; border-radius: 4px; font-weight: 600; font-size: 0.85em; margin-right: 10px; }
.get { background: #64ffda; color: #0a0a0f; }
.post { background: #ffd700; color: #0a0a0f; }
.url { color: #fff; font-family: monospace; }
table { width: 100%; border-collapse: collapse; margin: 15px 0; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.08); }
th { color: #64ffda; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.8em; }
.free { background: #d4edda; color: #155724; }
.premium { background: #fff3cd; color: #856404; }
a { color: #64ffda; }
.nav { display: flex; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
.nav a { color: #8892b0; text-decoration: none; }
.nav a:hover { color: #64ffda; }
</style>
</head>
<body>
<div class="container">
<h1>Agent Index <span>API</span></h1>
<p class="subtitle">The discovery layer for x402 AI agents</p>
<div class="nav">
<a href="https://theagentindex.app">Home</a>
<a href="#endpoints">Endpoints</a>
<a href="#mcp">MCP Server</a>
<a href="#widget">Widget</a>
<a href="https://twitter.com/theagentindex">Twitter</a>
</div>
<h2>Base URL</h2>
<pre><code>https://api.theagentindex.app</code></pre>
<h2 id="endpoints">API Endpoints</h2>
<div class="endpoint">
<h3><span class="method get">GET</span><span class="url">/search</span> <span class="badge free">Free</span></h3>
<p>Search for x402 endpoints by keyword, category, or capability.</p>
<table>
<tr><th>Parameter</th><th>Type</th><th>Description</th></tr>
<tr><td><code>q</code></td><td>string</td><td>Search query (required)</td></tr>
<tr><td><code>category</code></td><td>string</td><td>Filter: crypto, defi, ai, weather, news, oracle</td></tr>
<tr><td><code>maxPrice</code></td><td>number</td><td>Max price per call in USD</td></tr>
<tr><td><code>limit</code></td><td>number</td><td>Results to return (default: 10, max: 50)</td></tr>
</table>
<pre><code>curl "https://api.theagentindex.app/search?q=crypto&limit=5"</code></pre>
</div>
<div class="endpoint">
<h3><span class="method get">GET</span><span class="url">/trending</span> <span class="badge free">Free</span></h3>
<p>Get trending x402 endpoints based on usage.</p>
<pre><code>curl "https://api.theagentindex.app/trending"</code></pre>
</div>
<div class="endpoint">
<h3><span class="method get">GET</span><span class="url">/health</span> <span class="badge free">Free</span></h3>
<p>API health check.</p>
<pre><code>curl "https://api.theagentindex.app/health"</code></pre>
</div>
<div class="endpoint">
<h3><span class="method get">GET</span><span class="url">/premium/analytics</span> <span class="badge premium">x402 $0.01</span></h3>
<p>Get detailed analytics on endpoint usage and trends. Requires x402 payment.</p>
</div>
<div class="endpoint">
<h3><span class="method get">GET</span><span class="url">/premium/recommend</span> <span class="badge premium">x402 $0.005</span></h3>
<p>Get AI-powered endpoint recommendations based on your use case.</p>
</div>
<h2 id="mcp">MCP Server</h2>
<p>Use Agent Index directly from Claude, Cursor, or any MCP-compatible client.</p>
<h3>Installation</h3>
<pre><code>npm install -g agent-index-mcp</code></pre>
<h3>Claude Desktop Config</h3>
<pre><code>{
"mcpServers": {
"agent-index": {
"command": "npx",
"args": ["agent-index-mcp"]
}
}
}</code></pre>
<p>Then ask Claude: "Search Agent Index for weather APIs"</p>
<h2 id="widget">Embeddable Widget</h2>
<p>Add x402 endpoint search to your site with one script tag.</p>
<pre><code><div id="agent-index-widget"></div>
<script src="https://api.theagentindex.app/widget.js"></script>
<script>AgentIndex.init({ container: '#agent-index-widget' })</script></code></pre>
<h2>Response Format</h2>
<pre><code>{
"count": 23,
"results": [
{
"id": "abc123",
"url": "https://example.com/api/endpoint",
"domain": "example.com",
"description": "Get crypto price data",
"priceUsd": 0.01,
"category": "crypto-data",
"health": "healthy",
"tier": "A",
"score": 88
}
]
}</code></pre>
<h2>Rate Limits</h2>
<p>Free tier: 100 requests/minute. For higher limits, use our premium x402 endpoints.</p>
<hr style="margin: 40px 0; border-color: rgba(255,255,255,0.08);">
<p style="color: #666;">Built for the x402 ecosystem. <a href="https://theagentindex.app">theagentindex.app</a></p>
</div>
</body>
</html>