{
  "openapi": "3.0.1",
  "info": {
    "title": "Planning Permission UK Scraper — Applications & Constraints",
    "description": "Search the Planning Data API for England planning applications and constraints. Filter by postcode, UPRN, coordinates, geometry, date, authority, or reference. Returns typed records with proposals, decisions, addresses, and council links. For research, not legal advice. $0.005/record + $0.00005/run.",
    "version": "1.3",
    "x-build-id": "ZXfTXTs4C9FUJz4JI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhammadafzal~planning-permission-uk-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhammadafzal-planning-permission-uk-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/muhammadafzal~planning-permission-uk-scraper/runs": {
      "post": {
        "operationId": "runs-sync-muhammadafzal-planning-permission-uk-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/muhammadafzal~planning-permission-uk-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-muhammadafzal-planning-permission-uk-scraper",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "datasets"
        ],
        "properties": {
          "datasets": {
            "title": "Planning datasets",
            "type": "array",
            "description": "Use this to choose official Planning Data dataset slugs. Example: ['planning-application'] for applications or ['listed-building','conservation-area'] for constraints. Defaults to planning-application and accepts up to 10 slugs. This is not a council portal name or a free-text keyword search.",
            "items": {
              "type": "string",
              "minLength": 2,
              "maxLength": 100
            },
            "default": [
              "planning-application"
            ]
          },
          "postcodeOrUprn": {
            "title": "Postcode or UPRN",
            "type": "string",
            "description": "Use this to search by a UK postcode or Unique Property Reference Number. Example: 'BN15 0EE' or '10008315764'. Defaults to no location filter. This is not a council name, planning reference, or latitude/longitude pair.",
            "default": ""
          },
          "reference": {
            "title": "Planning reference",
            "type": "string",
            "description": "Use this to match an authority planning reference such as 'AWDM/0550/25'. Example: 'AWDM/0550/25'. Defaults to no reference filter. This is not the numeric Planning Data entity ID; use postcodeOrUprn or the dataset search for that.",
            "default": ""
          },
          "organisationEntity": {
            "title": "Planning authority entity",
            "minimum": 1,
            "type": "integer",
            "description": "Use this to restrict applications to a local planning authority entity ID from the Planning Data API. Example: 626195 for Lambeth in the official documentation. Defaults to no authority filter. This is not a council postcode or planning application reference."
          },
          "latitude": {
            "title": "Latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Use this with longitude to search entities intersecting a point. Example: 51.5074. Defaults to no coordinate filter. This is WGS84 decimal latitude, not a British National Grid easting."
          },
          "longitude": {
            "title": "Longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Use this with latitude to search entities intersecting a point. Example: -0.1278. Defaults to no coordinate filter. This is WGS84 decimal longitude, not a British National Grid northing."
          },
          "geometryWkt": {
            "title": "Search geometry WKT",
            "type": "string",
            "description": "Use this for a custom WGS84 Well-Known Text geometry, such as 'POLYGON((-0.15 51.50,-0.10 51.50,-0.10 51.52,-0.15 51.52,-0.15 51.50))'. Defaults to no geometry filter. This is not GeoJSON; use coordinates for a single point.",
            "default": ""
          },
          "geometryRelation": {
            "title": "Geometry relation",
            "enum": [
              "within",
              "equals",
              "disjoint",
              "intersects",
              "touches",
              "contains",
              "covers",
              "coveredby",
              "overlaps",
              "crosses"
            ],
            "type": "string",
            "description": "Use this to select the spatial relation between geometryWkt and returned entities. Example: 'intersects'. Defaults to intersects. This applies only to geometryWkt, not postcode, UPRN, or coordinates.",
            "default": "intersects"
          },
          "startDate": {
            "title": "Submitted from date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Use this as the inclusive lower date for entity start dates. Example: '2025-05-01'. Defaults to no lower date filter. This is an ISO date, not a council decision date or a relative phrase like 'last week'.",
            "default": "2025-05-01"
          },
          "endDate": {
            "title": "Submitted before date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Use this as the upper date for entity start dates. Example: '2025-12-31'. Defaults to no upper date filter. This is an ISO date, not a planning decision date or a page number."
          },
          "maxResults": {
            "title": "Maximum planning records",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Use this to cap stored records and result-event charges. Example: 100. Defaults to 100 and accepts 1-1,000; the actor paginates the official API in pages of up to 100. This limits output rows, not the number of matching records available from the source.",
            "default": 100
          },
          "responseFormat": {
            "title": "Response format",
            "enum": [
              "concise",
              "detailed"
            ],
            "type": "string",
            "description": "Use detailed when you need geometry WKT retained, or concise for smaller AI-agent output. Example: 'detailed'. Defaults to detailed. This changes geometry inclusion only; applications and constraints use the same record fields.",
            "default": "detailed"
          },
          "requestDelayMs": {
            "title": "API request delay (ms)",
            "minimum": 100,
            "maximum": 5000,
            "type": "integer",
            "description": "Use this to pace paginated requests to the public Planning Data API. Example: 250. Defaults to 250 milliseconds and accepts 100-5,000. This is not a browser wait, proxy setting, or total run timeout.",
            "default": 250
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}