{
  "openapi": "3.0.3",
  "info": {
    "title": "OOTWOracle API",
    "description": "Daily AI-powered psychedelic intelligence. Returns confidence-scored predictions on FDA regulatory decisions, clinical trials, biotech markets, legislation, and culture. Updated every day by noon ET.",
    "version": "1.0.0",
    "contact": {
      "name": "OOTWOracle",
      "url": "https://www.ootworacle.com",
      "email": "alex@ootw.co"
    }
  },
  "servers": [
    {
      "url": "https://www.ootworacle.com",
      "description": "OOTWOracle production"
    }
  ],
  "paths": {
    "/predictions.json": {
      "get": {
        "operationId": "getDailyPredictions",
        "summary": "Get today's AI predictions",
        "description": "Returns the most recent set of confidence-scored predictions on psychedelic medicine — covering FDA/DEA regulatory signals, clinical trial milestones, biotech market movements, legislation, and cultural developments. Each prediction has a title, confidence percentage (0–100), category, reasoning, resolution date, and geography.",
        "responses": {
          "200": {
            "description": "Today's predictions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PredictionsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/feed.xml": {
      "get": {
        "operationId": "getRssFeed",
        "summary": "Get RSS feed of all Oracle reports",
        "description": "Returns the full RSS 2.0 feed containing all daily Oracle reports with headlines, summaries, and links to full reports.",
        "responses": {
          "200": {
            "description": "RSS XML feed",
            "content": {
              "application/rss+xml": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "operationId": "getFullReportsText",
        "summary": "Get full text of all Oracle reports for AI consumption",
        "description": "Returns plain text containing the complete content of all daily Oracle reports, optimized for AI agent consumption. Includes all predictions, reasoning, and editorial commentary.",
        "responses": {
          "200": {
            "description": "Full reports plain text",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/ai-sources.json": {
      "get": {
        "operationId": "getSourceRegistry",
        "summary": "Get AI source discovery registry",
        "description": "Returns a JSON registry of all published Oracle reports with metadata — dates, headlines, URLs, and article descriptions. Useful for discovering what reports exist and navigating to specific dates.",
        "responses": {
          "200": {
            "description": "Source registry JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceRegistry"
                }
              }
            }
          }
        }
      }
    },
    "/all_predictions.json": {
      "get": {
        "operationId": "getAllPredictions",
        "summary": "Get all predictions across all dates",
        "description": "Returns the complete archive of every OOTWOracle prediction ever published. Each prediction includes its date, title, confidence score (0–100), category, reasoning, resolve date, geography, and status (pending/resolved). Use this for trend analysis, searching for predictions about specific topics, or tracking the oracle's historical accuracy.",
        "responses": {
          "200": {
            "description": "All predictions archive",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": {"type": "integer", "description": "Total number of predictions in archive"},
                    "generated": {"type": "string", "format": "date"},
                    "predictions": {
                      "type": "array",
                      "items": {"$ref": "#/components/schemas/ArchivePrediction"}
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/report/{date}": {
      "get": {
        "operationId": "getDailyReport",
        "summary": "Get the full Oracle intelligence report for a specific date",
        "description": "Returns the complete HTML daily intelligence report for the given date. Each report has a unique title and follows a five-layer structure: (1) Current Signal — what happened in the data, (2) Deeper Pattern — the thread beneath the news, (3) Human Current — the felt reality for patients and clinicians, (4) OOTW Golden Thread — the highest positive trajectory, (5) Manifestation Seal — one-line vision. Reports are ~500–650 words of editorial prose.",
        "parameters": [
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {"type": "string", "format": "date"},
            "description": "Date in YYYY-MM-DD format (e.g. 2026-05-18). Reports available from 2026-04-24 onward."
          }
        ],
        "responses": {
          "200": {
            "description": "Full Oracle report HTML page",
            "content": {
              "text/html": {"schema": {"type": "string"}}
            }
          },
          "404": {
            "description": "No report exists for this date"
          }
        }
      }
    },
    "/feed.json": {
      "get": {
        "operationId": "getJsonFeed",
        "summary": "Get JSON feed of all Oracle reports",
        "description": "Returns the JSON Feed 1.1 format feed of all daily Oracle reports. Preferred over RSS for programmatic consumption — returns structured JSON with report dates, titles, URLs, and summaries.",
        "responses": {
          "200": {
            "description": "JSON Feed",
            "content": {
              "application/json": {"schema": {"type": "object"}}
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PredictionsResponse": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "description": "The date of this prediction set (YYYY-MM-DD)"
          },
          "headline": {
            "type": "string",
            "description": "The editorial headline for today's Oracle report"
          },
          "predictions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Prediction"
            }
          }
        }
      },
      "Prediction": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "description": "The falsifiable prediction statement"
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "AI confidence score as a percentage (0–100)"
          },
          "category": {
            "type": "string",
            "enum": ["legislation", "research", "market", "culture", "regulation"],
            "description": "Prediction domain category"
          },
          "reasoning": {
            "type": "string",
            "description": "The Oracle's reasoning for this confidence level, citing signal sources"
          },
          "resolve_date": {
            "type": "string",
            "format": "date",
            "description": "The date by which this prediction can be verified (YYYY-MM-DD)"
          },
          "geography": {
            "type": "string",
            "description": "Geographic scope of the prediction (e.g. USA, Global, EU)"
          }
        },
        "required": ["title", "confidence", "category"]
      },
      "ArchivePrediction": {
        "type": "object",
        "properties": {
          "date": {"type": "string", "format": "date", "description": "Date this prediction was published"},
          "title": {"type": "string", "description": "The falsifiable prediction statement"},
          "confidence": {"type": "number", "minimum": 0, "maximum": 100, "description": "AI confidence score (0–100)"},
          "category": {"type": "string", "enum": ["legislation", "research", "market", "culture"]},
          "reasoning": {"type": "string"},
          "resolve_date": {"type": "string", "format": "date"},
          "geography": {"type": "string"},
          "status": {"type": "string", "enum": ["pending", "resolved_true", "resolved_false"], "description": "Resolution status once the resolve date has passed"},
          "tags": {"type": "array", "items": {"type": "string"}}
        },
        "required": ["date", "title", "confidence", "category"]
      },
      "SourceRegistry": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "articles": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {"type": "string"},
                "headline": {"type": "string"},
                "url": {"type": "string"},
                "description": {"type": "string"}
              }
            }
          }
        }
      }
    }
  }
}
