{
  "openapi": "3.1.0",
  "info": {
    "title": "Spectrum allocations",
    "version": "1.0.0",
    "summary": "What is allocated at a frequency, by jurisdiction.",
    "description": "Read-only answers over national frequency allocation tables (Germany's Frequenzplan by the Bundesnetzagentur now; the US is planned). Every answer carries the source, the edition, the legal notice and a link into the tool page. Source wording is unchanged; colour groups, ITU service names, English glosses and search aliases are editorial additions. The same questions are answered over MCP at /mcp (Streamable HTTP). Rate limit: 60 requests per minute per client."
  },
  "servers": [{ "url": "https://eljefedelrodeo.humans.airdress.co" }],
  "paths": {
    "/data/spectrum/v1/index.json": {
      "get": {
        "operationId": "listJurisdictions",
        "summary": "The jurisdictions, available and planned, with links to their data",
        "responses": { "200": { "description": "Jurisdiction list", "content": { "application/json": {} } } }
      }
    },
    "/data/spectrum/v1/{code}.json": {
      "get": {
        "operationId": "getDataset",
        "summary": "One jurisdiction's whole table, in the spectrum/v1 format",
        "parameters": [{ "$ref": "#/components/parameters/code" }],
        "responses": {
          "200": {
            "description": "The dataset",
            "content": { "application/json": { "schema": { "$ref": "https://eljefedelrodeo.humans.airdress.co/data/spectrum/v1/schema.json" } } }
          }
        }
      }
    },
    "/api/spectrum/v1/{code}/query": {
      "get": {
        "operationId": "query",
        "summary": "A frequency, a range or words",
        "description": "\"868 MHz\" returns every entry at that frequency; \"2400-2483.5 MHz\" every entry overlapping the range; anything else is a text search in English or the source language (\"LoRa\", \"Wetterradar\").",
        "parameters": [
          { "$ref": "#/components/parameters/code" },
          { "name": "q", "in": "query", "required": true, "schema": { "type": "string" }, "examples": { "frequency": { "value": "868 MHz" }, "range": { "value": "2400-2483.5 MHz" }, "text": { "value": "LoRa" } } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 } }
        ],
        "responses": {
          "200": { "description": "Matching entries with provenance", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Answer" } } } },
          "400": { "description": "Missing q" },
          "404": { "description": "Unknown or planned jurisdiction" },
          "429": { "description": "Rate limited" }
        }
      }
    },
    "/api/spectrum/v1/{code}/entry": {
      "get": {
        "operationId": "getEntry",
        "summary": "One entry by the source's entry number",
        "parameters": [
          { "$ref": "#/components/parameters/code" },
          { "name": "id", "in": "query", "required": true, "schema": { "type": "string" }, "example": "318003" }
        ],
        "responses": { "200": { "description": "The entry with provenance", "content": { "application/json": {} } }, "404": { "description": "No such entry" } }
      }
    }
  },
  "components": {
    "parameters": {
      "code": { "name": "code", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^[a-z]{2}$" }, "example": "de", "description": "ISO 3166-1 alpha-2, lower case" }
    },
    "schemas": {
      "Answer": {
        "type": "object",
        "properties": {
          "jurisdiction": { "type": "string" },
          "source": { "type": "string" },
          "edition": { "type": "string" },
          "source_url": { "type": "string" },
          "attribution": { "type": "string" },
          "legal_notice": { "type": "string" },
          "kind": { "enum": ["frequency", "range", "text"] },
          "total_entries": { "type": "integer" },
          "total_applications": { "type": "integer" },
          "truncated": { "type": "boolean" },
          "entries": { "type": "array", "items": { "type": "object", "description": "A spectrum/v1 entry plus range (label) and url (tool deep link)" } },
          "applications": { "type": "array", "items": { "type": "object" } }
        }
      }
    }
  }
}
