{
  "name": "Real-Time Intelligence API",
  "version": "1.0.0",
  "description": "Pay-per-request public-data API (x402, USDC on Base) powered by Cloudflare Workers.",
  "endpoints": [
    {
      "path": "/api/ai-trends",
      "method": "GET",
      "description": "Fetch and rank AI, technology and open-source stories from Hacker News.",
      "parameters": {},
      "response": {
        "success": "boolean",
        "source": "string",
        "generated_at": "ISO 8601 timestamp",
        "total": "number",
        "data": [
          {
            "id": "number",
            "title": "string",
            "score": "number",
            "descendants": "number",
            "url": "string",
            "time": "ISO 8601 timestamp",
            "author": "string",
            "type": "string"
          }
        ]
      }
    },
    {
      "path": "/api/market-pulse",
      "method": "GET",
      "description": "Retrieve cryptocurrency prices and foreign exchange reference rates.",
      "parameters": {},
      "response": {
        "success": "boolean",
        "generated_at": "ISO 8601 timestamp",
        "crypto": {
          "source": "string",
          "available": "boolean",
          "assets": {
            "BTC": {
              "price_usd": "number | null",
              "change_24h_percent": "number | null"
            }
          }
        },
        "forex": {
          "source": "string",
          "available": "boolean",
          "base": "USD",
          "date": "string | null",
          "rates": {
            "MYR": "number | null",
            "SGD": "number | null",
            "CNY": "number | null"
          }
        }
      }
    },
    {
      "path": "/api/extract",
      "method": "GET",
      "description": "Extract webpage title and convert selected HTML content into Markdown.",
      "parameters": {
        "url": {
          "type": "string",
          "required": true,
          "description": "Target HTTP or HTTPS webpage URL."
        }
      },
      "response": {
        "success": "boolean",
        "source": "string",
        "extracted_at": "ISO 8601 timestamp",
        "title": "string | null",
        "content": "Markdown string",
        "content_length": "number"
      }
    }
  ],
  "example_requests": {
    "ai_trends": "/api/ai-trends",
    "market_pulse": "/api/market-pulse",
    "extract": "/api/extract?url=https%3A%2F%2Fexample.com"
  },
  "cors": "Enabled",
  "authentication": "x402 payment (USDC on Base)",
  "api_key_required": false
}