Real-time crypto market data API designed for AI agents. Pay-per-request with USDC on Base Mainnet via the x402 protocol. 16 endpoints. No accounts. No API keys. No subscriptions.
🌐 Live: agentdata-api.com · 📊 Dashboard: agentdata-api.com/admin · 🤖 MCP: https://agentdata-api.com/mcp
AI agents can't sign up for traditional APIs. They can't enter a credit card, fill out a form, or wait for an API key to be emailed. But they can sign USDC transactions.
AgentData API exposes 16 crypto market data endpoints behind the x402 payment protocol. An agent sends a GET request, receives HTTP 402 Payment Required, signs an ERC-3009 TransferWithAuthorization message, and resends. The server settles the payment on-chain and returns the data. Cost: $0.001–$0.005 per request.
No accounts. No API keys. No rate limits you have to negotiate. Pay only for what you use.
- 16 production endpoints across Market Data, On-Chain, Arbitrage, Technical Analysis, Sentiment, and Historical data
- Self-hosted facilitator — no Coinbase Developer Platform lock-in, no third-party outage risk
- Base Mainnet native — USDC settlement via x402 v2 with
exactscheme - Agent-discoverable — OpenAPI 3.0, Google A2A Agent Card, llms.txt, Bazaar extension, MCP remote transport
- Redis caching — 15s–300s TTLs protect against upstream rate limits
- On-chain revenue tracking — live dashboard with USDC inflow monitoring and lazy transaction verification
- SQLite analytics — request logging, error tracking, upstream failure monitoring
- Production hardened — systemd auto-restart, cron uptime monitoring, balance alerting, auto-refill scripts
| Endpoint | Price | Description |
|---|---|---|
GET /api/prices |
$0.001 | Real-time prices for BTC, ETH, SOL, BNB, XRP |
GET /api/funding-rates |
$0.001 | Perpetual futures funding rates with long/short bias |
GET /api/market-overview |
$0.002 | Full market overview with sentiment and arbitrage signals |
GET /api/volatility |
$0.001 | 24h volatility, range, annualized vol for BTC/ETH/SOL |
GET /api/liquidation-levels |
$0.002 | Estimated liquidation zones by leverage (5x/10x/20x) |
GET /api/correlation |
$0.001 | 30-day price correlation matrix (ETH/BTC, SOL/BTC, SOL/ETH) |
| Endpoint | Price | Description |
|---|---|---|
GET /api/gas-prices |
$0.001 | Multi-chain gas prices (Base, Ethereum, Solana) |
GET /api/base-activity |
$0.002 | Base Mainnet activity: TPS, blocks, gas utilization |
GET /api/defi-yields |
$0.002 | Top DeFi yields (Aave, Compound, Morpho, Pendle) via DefiLlama |
| Endpoint | Price | Description |
|---|---|---|
GET /api/arbitrage-opportunities |
$0.003 | Cross-exchange spread opportunities (MEXC/Binance/Bybit/OKX) |
GET /api/dex-vs-cex |
$0.003 | DEX aggregated prices vs CEX with spread analysis |
| Endpoint | Price | Description |
|---|---|---|
GET /api/indicators |
$0.002 | RSI, MACD, Bollinger Bands, ATR. ?symbol=BTCUSDT&interval=1h |
GET /api/support-resistance |
$0.003 | Support & resistance levels via fractal analysis |
| Endpoint | Price | Description |
|---|---|---|
GET /api/sentiment |
$0.001 | Composite sentiment: Fear & Greed + funding-based |
GET /api/stablecoin-health |
$0.001 | USDC/DAI live depeg check + top 10 stablecoins |
GET /api/historical |
$0.005 | OHLCV candles for backtesting. ?symbol=BTCUSDT&interval=1d&limit=500 |
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"agentdata": {
"url": "https://agentdata-api.com/mcp"
}
}
}Restart Claude Desktop. The 16 tools become available in any conversation.
# Step 1: Request the endpoint — receive 402
curl -i https://agentdata-api.com/api/prices
# Step 2: Decode the PAYMENT-REQUIRED header (base64 JSON)
# {"x402Version":2,"accepts":[{"scheme":"exact","network":"eip155:8453","maxAmountRequired":"1000","asset":"0x833...","payTo":"0x844...",...}]}
# Step 3: Sign ERC-3009 TransferWithAuthorization message with your wallet
# Step 4: Resend with PAYMENT-SIGNATURE header
curl -H "PAYMENT-SIGNATURE: eyJ4NDA..." https://agentdata-api.com/api/pricesSee scripts/payment-test.js for a complete working Node.js client using viem.
import { agentdataPlugin } from '@agentdata/plugin-elizaos';
export const character = {
plugins: [agentdataPlugin],
settings: {
AGENTDATA_BUYER_PRIVATE_KEY: '0x...', // wallet funded with USDC on Base
},
};┌─────────────┐ 402 ┌─────────────────┐
│ AI Agent │◄─────────────┤ Nginx (HTTPS) │
│ (Claude/ │ │ Rate limiting │
│ ElizaOS) │ signed │ /mcp /api/... │
│ │──payment────►│ │
└─────────────┘ └────────┬────────┘
│
┌────────▼─────────┐
│ Express Server │
│ ┌────────────┐ │
│ │ x402/v2 │ │
│ │ middleware │ │
│ └─────┬──────┘ │
│ │ │
│ ┌─────▼──────┐ │
│ │ Local │ │
│ │ Facilitator│ │──► Base RPC
│ │ (viem) │ │ (eth_call,
│ └─────┬──────┘ │ eth_sendRaw)
│ │ │
│ ┌─────▼──────┐ │
│ │ Redis │ │
│ │ cache │──┼──► Upstream APIs
│ │ (DB 5) │ │ (MEXC, Binance,
│ └────────────┘ │ DefiLlama, etc.)
│ │
│ ┌────────────┐ │
│ │ SQLite │ │
│ │ analytics │ │
│ │ + revenue │ │
│ └────────────┘ │
└──────────────────┘
- Node.js 20 + Express 5
- viem for EVM wallet and EIP-712 typed data signing
- @x402/core v2.9 with local facilitator
- @modelcontextprotocol/sdk for MCP remote transport
- Redis (ioredis) with isolated DB for upstream caching
- better-sqlite3 for analytics and payment indexing
- systemd for service management
- nginx for HTTPS, rate limiting, MCP proxy
- Let's Encrypt for SSL
The service is listed/compatible with:
- x402scan.com ✅
- awesome-x402 ✅ (PR filed)
- MCP Registry ✅ (
io.github.speteai/agentdata-mcp) - Google A2A Protocol ✅ (
/agent.json) - llms.txt ✅ (
/llms.txt) - OpenAPI 3.0 ✅ (
/openapi.json) - Bazaar discovery extension ✅ (v2 format in 402 response)
- Ubuntu 22.04+ (or any Linux with systemd)
- Node.js 20+
- Redis 6+ (for caching layer)
- nginx (reverse proxy + SSL termination)
- Domain with DNS A-record to your server
- Base Mainnet wallet with ~0.001 ETH for facilitator gas
git clone https://github.com/speteai/agentdata-api.git
cd agentdata-api
npm install
cp .env.example .env
# Edit .env with your wallet addresses and RPC URL
npm start| Variable | Required | Description |
|---|---|---|
WALLET_ADDRESS |
✅ | Payee wallet (receives USDC) |
FACILITATOR_PRIVATE_KEY |
✅ | Signer for settlement transactions (needs ETH for gas) |
BASE_RPC_URL |
recommended | Base Mainnet RPC (default: https://mainnet.base.org) |
PORT |
- | Server port (default: 4021) |
NODE_ENV |
- | production = Base Mainnet, else Base Sepolia |
- systemd unit (
systemd/x402-agentdata.service) — auto-restart, sandboxing - nginx config (
nginx/agentdata-api.conf) — HTTPS, rate limiting, MCP endpoint - cron scripts (
scripts/) — uptime monitoring, balance alerting, auto-refill
If you have a data source (on-chain analytics, ML predictions, proprietary signals), you can turn it into a paid API in hours:
- Fork this repo
- Replace the
fetch*()functions with your data source - Configure your wallet addresses
- Deploy with the provided systemd + nginx templates
The facilitator handles all x402 payment complexity. You only write the data fetcher.
x402 API, AI agent API, crypto market data API, pay-per-request API, USDC API, Base Mainnet API, agentic payments, machine-to-machine payments, ERC-3009, EIP-3009, HTTP 402, Model Context Protocol MCP server, ElizaOS plugin, Coinbase x402, Linux Foundation x402, agent economy, DeFAI, crypto data for AI agents, autonomous agent payments
MIT — see LICENSE.
- Live service: https://agentdata-api.com
- Admin dashboard: https://agentdata-api.com/admin
- Revenue API: https://agentdata-api.com/revenue
- MCP endpoint: https://agentdata-api.com/mcp
- Discovery: https://agentdata-api.com/discovery
- OpenAPI spec: https://agentdata-api.com/openapi.json
- A2A Agent Card: https://agentdata-api.com/agent.json
- LLMs documentation: https://agentdata-api.com/llms.txt
Related repositories:
- agentdata-mcp — standalone MCP server wrapper
- elizaos-plugin-agentdata — ElizaOS plugin
Built for the Agent Economy · Powered by x402 · Settled on Base