{
  "openapi": "3.1.0",
  "info": {
    "title": "Know Your Onions Data API",
    "version": "1.0.0",
    "description": "Free JSON for every number published on Know Your Onions (knowyouronions.news): origins, varieties, packs, price trend, exports, the Board, why prices are moving, current price. The onion market page produce buyers actually need. No key needed. Credit Know Your Onions (knowyouronions.news) with a visible link to the page the figure came from; every record carries its page_url.",
    "license": {
      "name": "Free to use with attribution",
      "url": "https://knowyouronions.news/api"
    }
  },
  "servers": [
    {
      "url": "https://knowyouronions.news/api/v1"
    }
  ],
  "externalDocs": {
    "description": "Docs",
    "url": "https://knowyouronions.news/api"
  },
  "paths": {
    "/index.json": {
      "get": {
        "operationId": "getIndex",
        "summary": "API index",
        "description": "What this API is, its license and attribution, the sections it covers, and every endpoint.",
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/latest.json": {
      "get": {
        "operationId": "getLatest",
        "summary": "Latest readings",
        "description": "The newest reading of every data page on Know Your Onions (23 series): the headline value as the site shows it, the newest point of each charted line with its date, whether it is current, and links to its page and full history.",
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/series/{section}/{slug}.json": {
      "get": {
        "operationId": "getSeries",
        "summary": "One series, full history",
        "description": "Everything behind one data page: every charted point (date + value), the historical band where the page draws one, the page's tables exactly as shown, its source and citation. Find each series_url in latest.json.",
        "responses": {
          "200": {
            "description": "JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "section",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "origin",
                "variety",
                "pack",
                "trend",
                "export",
                "board",
                "why",
                "current-price"
              ]
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The page slug; every valid section/slug pair is listed in latest.json (id field)."
          }
        ]
      }
    }
  }
}
