{
  "openapi": "3.1.0",
  "info": {
    "title": "City Scope planning search",
    "version": "1.0.0",
    "description": "Search public UK planning applications and decisions (all 32 Scottish councils and the 33 London planning authorities). Returns Markdown records, each with a City Scope URL to cite and a link to the council's own record. Free, no key needed. Results are cached for an hour.",
    "contact": {
      "url": "https://www.city-scope.co.uk/about"
    },
    "termsOfService": "https://www.city-scope.co.uk/terms"
  },
  "externalDocs": {
    "url": "https://www.city-scope.co.uk/llms.txt"
  },
  "servers": [
    {
      "url": "https://www.city-scope.co.uk"
    }
  ],
  "paths": {
    "/.well-known/search": {
      "get": {
        "operationId": "searchPlanning",
        "summary": "Search UK planning applications",
        "description": "Accepts an application reference (25/01234/FUL), an address, street, postcode, town, council name, a topic (heat pump, student flats, data centre) or a plain question (refused housing applications in Glasgow this year). Council names, London, decisions and dates are read as filters. The response starts with how the query was read, then one `## title (score: n)` section per result.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "What to search for.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 160
            },
            "example": "heat pumps in Leith"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Results to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown search results.",
            "headers": {
              "X-CityScope-Search": {
                "description": "Which searches ran and how the applications were matched.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}
