{
  "openapi": "3.1.0",
  "info": {
    "title": "x402-data-hub",
    "description": "Crypto prices, exchange rates, yield farming, DAO governance, and market sentiment — 16 paid endpoints for AI agents.",
    "version": "1.0.0",
    "x-guidance": "All endpoints use POST with JSON body. Payment via x402 protocol on Base chain (USDC). Each endpoint returns structured JSON data."
  },
  "servers": [{ "url": "https://x402-data-hub-v2.vercel.app" }],
  "paths": {
    "/api/crypto/coin": {
      "post": {
        "tags": ["Crypto"],
        "summary": "Single cryptocurrency details",
        "x-payment-info": { "description": "Get detailed info for a single cryptocurrency by ID", "price": "$0.05", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string", "description": "CoinGecko coin ID (e.g. bitcoin)" } } } } } },
        "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "description": "Coin details" } } } } } }, "402": { "description": "Payment required" } }
      }
    },
    "/api/crypto/coins": {
      "post": {
        "tags": ["Crypto"],
        "summary": "Top cryptocurrencies list",
        "x-payment-info": { "description": "List top cryptocurrencies by market cap", "price": "$0.05", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "limit": { "type": "number", "description": "Number of coins to return (default 20)" } } } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/exchange/convert": {
      "post": {
        "tags": ["Exchange"],
        "summary": "Currency conversion",
        "x-payment-info": { "description": "Convert between currencies (fiat and crypto)", "price": "$0.05", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "from": { "type": "string" }, "to": { "type": "string" }, "amount": { "type": "number" } } } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/exchange/rates": {
      "post": {
        "tags": ["Exchange"],
        "summary": "Exchange rates",
        "x-payment-info": { "description": "Current exchange rates for major currencies", "price": "$0.05", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/yield/best-pools": {
      "post": {
        "tags": ["Yield"],
        "summary": "Best APY pools ranked",
        "x-payment-info": { "description": "Top yield farming pools ranked by APY from DeFiLlama", "price": "$0.12", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "chain": { "type": "string", "description": "Filter by chain (e.g. Ethereum, Base)" }, "stablecoin": { "type": "boolean", "description": "Filter stablecoin pools only" } } } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/yield/stablecoin": {
      "post": {
        "tags": ["Yield"],
        "summary": "Stablecoin yield comparison",
        "x-payment-info": { "description": "Compare yields across stablecoin pools", "price": "$0.08", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/yield/lending": {
      "post": {
        "tags": ["Yield"],
        "summary": "Lending rate aggregator",
        "x-payment-info": { "description": "Aggregate lending rates across DeFi protocols", "price": "$0.10", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "asset": { "type": "string", "description": "Asset to lend (e.g. USDC, ETH)" } } } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/yield/strategy": {
      "post": {
        "tags": ["Yield"],
        "summary": "Auto-suggest yield strategy",
        "x-payment-info": { "description": "AI-optimized yield strategy recommendations", "price": "$0.18", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "risk": { "type": "string", "enum": ["low", "medium", "high"] }, "amount": { "type": "number" } } } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/gov/proposals": {
      "post": {
        "tags": ["Governance"],
        "summary": "Active DAO proposals",
        "x-payment-info": { "description": "List active governance proposals across major DAOs", "price": "$0.06", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "dao": { "type": "string", "description": "Filter by DAO name" } } } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/gov/vote-results": {
      "post": {
        "tags": ["Governance"],
        "summary": "Proposal vote results",
        "x-payment-info": { "description": "Vote results for governance proposals", "price": "$0.08", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/gov/whale-votes": {
      "post": {
        "tags": ["Governance"],
        "summary": "Whale voting analysis",
        "x-payment-info": { "description": "Analyze whale voter behavior in DAO proposals", "price": "$0.12", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/gov/treasury": {
      "post": {
        "tags": ["Governance"],
        "summary": "DAO treasury overview",
        "x-payment-info": { "description": "Treasury holdings and spending for DAOs", "price": "$0.10", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/sentiment/token": {
      "post": {
        "tags": ["Sentiment"],
        "summary": "Token sentiment score",
        "x-payment-info": { "description": "Sentiment analysis score for a specific token", "price": "$0.10", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": "string", "description": "Token symbol (e.g. BTC, ETH)" } } } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/sentiment/trending": {
      "post": {
        "tags": ["Sentiment"],
        "summary": "Crypto trending topics",
        "x-payment-info": { "description": "Trending crypto topics and narratives", "price": "$0.08", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/sentiment/news": {
      "post": {
        "tags": ["Sentiment"],
        "summary": "Crypto news aggregation",
        "x-payment-info": { "description": "Aggregated crypto news from multiple sources", "price": "$0.05", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    },
    "/api/sentiment/fear-greed": {
      "post": {
        "tags": ["Sentiment"],
        "summary": "Fear & Greed index",
        "x-payment-info": { "description": "Crypto Fear & Greed index with historical data", "price": "$0.08", "network": "eip155:8453" },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object" } } } },
        "responses": { "200": { "description": "Success" }, "402": { "description": "Payment required" } }
      }
    }
  }
}
