{
  "openapi": "3.1.0",
  "info": {
    "title": "PACT Car Crash Victim Survey API",
    "description": "Programmatic access to key findings from the PACT national survey of 400 car crash victims who hired a personal injury attorney. Data published December 2025 by Protecting American Consumers Together (PACT).",
    "version": "1.0.0",
    "contact": {
      "name": "Protecting American Consumers Together (PACT)",
      "url": "https://protectingamericanconsumers.org"
    },
    "license": {
      "name": "Creative Commons Attribution 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://car-crash-survey.lovable.app",
      "description": "Production — static survey data"
    }
  ],
  "paths": {
    "/api/survey.json": {
      "get": {
        "operationId": "getSurveyData",
        "summary": "Full survey findings with all statistics",
        "description": "Returns structured JSON containing all six key findings from the PACT Car Crash Victim Survey, including percentages, methodology, and respondent quotes.",
        "responses": {
          "200": {
            "description": "Survey data",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/SurveyResponse" }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsSummary",
        "summary": "AI-readable summary of survey findings",
        "responses": {
          "200": {
            "description": "Plain-text summary optimized for LLMs",
            "content": { "text/plain": {} }
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "operationId": "getLlmsFull",
        "summary": "Complete AI-readable survey data with quotes and FAQ",
        "responses": {
          "200": {
            "description": "Full plain-text report optimized for LLMs",
            "content": { "text/plain": {} }
          }
        }
      }
    },
    "/feed.xml": {
      "get": {
        "operationId": "getRssFeed",
        "summary": "RSS feed of survey publications",
        "responses": {
          "200": {
            "description": "RSS 2.0 feed",
            "content": { "application/rss+xml": {} }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SurveyResponse": {
        "type": "object",
        "properties": {
          "meta": { "$ref": "#/components/schemas/SurveyMeta" },
          "findings": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Finding" }
          },
          "methodology": { "$ref": "#/components/schemas/Methodology" },
          "faq": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/FAQItem" }
          }
        }
      },
      "SurveyMeta": {
        "type": "object",
        "properties": {
          "title": { "type": "string" },
          "publisher": { "type": "string" },
          "publishedDate": { "type": "string", "format": "date" },
          "url": { "type": "string", "format": "uri" },
          "pdfUrl": { "type": "string", "format": "uri" }
        }
      },
      "Finding": {
        "type": "object",
        "properties": {
          "id": { "type": "integer" },
          "title": { "type": "string" },
          "statistics": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Statistic" }
          },
          "quotes": {
            "type": "array",
            "items": { "type": "string" }
          }
        }
      },
      "Statistic": {
        "type": "object",
        "properties": {
          "value": { "type": "string" },
          "description": { "type": "string" }
        }
      },
      "Methodology": {
        "type": "object",
        "properties": {
          "sampleSize": { "type": "integer" },
          "criteria": { "type": "string" },
          "dates": { "type": "string" },
          "marginOfError": { "type": "string" }
        }
      },
      "FAQItem": {
        "type": "object",
        "properties": {
          "question": { "type": "string" },
          "answer": { "type": "string" }
        }
      }
    }
  }
}
