{
  "openapi": "3.1.0",
  "info": {
    "title": "x402 Finance Hub",
    "version": "1.0.0",
    "description": "Forex, stocks, crypto, and trading data from Alpha Vantage, Twelve Data, TradingView, and Forex Factory. Pay with USDC on Base.",
    "contact": { "email": "sna4an@users.noreply.github.com" },
    "x-guidance": "All endpoints use POST with JSON body. Stocks need symbol (e.g. AAPL), forex needs pair (e.g. EUR/USD), crypto needs symbol (e.g. BTC). Technical indicators support RSI, MACD, SMA, EMA."
  },
  "servers": [{ "url": "https://x402-trading-hub.vercel.app" }],
  "paths": {
    "/api/forex/news": {
      "post": {
        "operationId": "forexNews",
        "summary": "Forex news & events",
        "tags": ["Forex"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.080000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } },
        "responses": { "200": { "description": "Forex news", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    },
    "/api/forex/calendar": {
      "post": {
        "operationId": "forexCalendar",
        "summary": "Economic calendar",
        "tags": ["Forex"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.100000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } },
        "responses": { "200": { "description": "Economic events", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    },
    "/api/forex/rate": {
      "post": {
        "operationId": "forexRate",
        "summary": "Forex exchange rate",
        "tags": ["Forex"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.080000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "from": { "type": "string", "description": "Source currency (e.g. EUR)" }, "to": { "type": "string", "description": "Target currency (e.g. USD)" } }, "required": ["from", "to"] } } } },
        "responses": { "200": { "description": "Exchange rate", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    },
    "/api/forex/time-series": {
      "post": {
        "operationId": "forexTimeSeries",
        "summary": "Historical forex data",
        "tags": ["Forex"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.100000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "symbol": { "type": "string", "description": "Forex pair (e.g. EUR/USD)" }, "interval": { "type": "string", "default": "1day" }, "outputsize": { "type": "string", "default": "30" } }, "required": ["symbol"] } } } },
        "responses": { "200": { "description": "Historical data", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    },
    "/api/stocks/quote": {
      "post": {
        "operationId": "stocksQuote",
        "summary": "Real-time stock quote",
        "tags": ["Stocks"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.080000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "symbol": { "type": "string", "description": "Stock symbol (e.g. AAPL)" } }, "required": ["symbol"] } } } },
        "responses": { "200": { "description": "Stock quote", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    },
    "/api/stocks/search": {
      "post": {
        "operationId": "stocksSearch",
        "summary": "Search stocks by symbol",
        "tags": ["Stocks"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.080000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "keywords": { "type": "string", "description": "Search keywords" } }, "required": ["keywords"] } } } },
        "responses": { "200": { "description": "Search results", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    },
    "/api/stocks/time-series": {
      "post": {
        "operationId": "stocksTimeSeries",
        "summary": "Historical stock data",
        "tags": ["Stocks"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.100000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "symbol": { "type": "string", "description": "Stock symbol" }, "interval": { "type": "string", "default": "1day" }, "outputsize": { "type": "string", "default": "30" } }, "required": ["symbol"] } } } },
        "responses": { "200": { "description": "Historical data", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    },
    "/api/stocks/technical": {
      "post": {
        "operationId": "stocksTechnical",
        "summary": "Technical indicators",
        "tags": ["Stocks"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.120000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "properties": { "symbol": { "type": "string", "description": "Stock symbol" }, "indicator": { "type": "string", "default": "rsi", "description": "Indicator: rsi, macd, sma, ema" }, "interval": { "type": "string", "default": "1day" } }, "required": ["symbol"] } } } },
        "responses": { "200": { "description": "Technical data", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    },
    "/api/crypto/market": {
      "post": {
        "operationId": "cryptoMarket",
        "summary": "Crypto market data",
        "tags": ["Crypto"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.080000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "symbol": { "type": "string", "default": "BTC", "description": "Crypto symbol" } } } } } },
        "responses": { "200": { "description": "Market data", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    },
    "/api/trading/ideas": {
      "post": {
        "operationId": "tradingIdeas",
        "summary": "Trading ideas & analysis",
        "tags": ["Trading"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.100000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "symbol": { "type": "string", "default": "BTCUSD", "description": "Trading pair" } } } } } },
        "responses": { "200": { "description": "Trading ideas", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    },
    "/api/trading/screener": {
      "post": {
        "operationId": "tradingScreener",
        "summary": "Stock screener",
        "tags": ["Trading"],
        "x-payment-info": { "price": { "mode": "fixed", "currency": "USD", "amount": "0.120000" }, "protocols": [{ "x402": {} }] },
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": {} } } } },
        "responses": { "200": { "description": "Screener results", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object" } } } } } }, "402": { "description": "Payment Required" } }
      }
    }
  }
}
