{
  "openapi": "3.1.0",
  "info": {
    "title": "The Waterline Data API",
    "version": "1.0.0",
    "description": "Free JSON for every number published on The Waterline (the-waterline.com): reservoirs, drought, allocations, streamflow, snowpack, history, heatmap. Wet water, not paper water. No key needed. Credit The Waterline (the-waterline.com) 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://the-waterline.com/api"
    }
  },
  "servers": [
    {
      "url": "https://the-waterline.com/api/v1"
    }
  ],
  "externalDocs": {
    "description": "Docs",
    "url": "https://the-waterline.com/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 The Waterline (58 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"
                }
              }
            }
          }
        }
      }
    },
    "/stats.json": {
      "get": {
        "operationId": "getStats",
        "summary": "Key statistics",
        "description": "The 11 headline numbers on the the-waterline.com/stats page, each as a quotable sentence with its data date and a ready-made citation.",
        "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": [
                "reservoir",
                "drought",
                "allocation",
                "streamflow",
                "snowpack",
                "history",
                "heatmap"
              ]
            }
          },
          {
            "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)."
          }
        ]
      }
    }
  }
}
