{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Planning Applications Scraper | Building Leads by Council",
    "description": "Search UK planning applications by council, postcode, coordinates, dates and keywords. Export decisions, document links, site addresses and agent companies for property research and construction prospecting. Coverage depends on each council.",
    "version": "0.1",
    "x-build-id": "9HmVY0aNQ7a6cU3Qs"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrape_api~uk-planning-applications/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrape_api-uk-planning-applications",
        "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/scrape_api~uk-planning-applications/runs": {
      "post": {
        "operationId": "runs-sync-scrape_api-uk-planning-applications",
        "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/scrape_api~uk-planning-applications/run-sync": {
      "post": {
        "operationId": "run-sync-scrape_api-uk-planning-applications",
        "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",
        "properties": {
          "councils": {
            "title": "Councils",
            "type": "array",
            "description": "Council or region names (case insensitive), full names, or numeric PlanIt area IDs. Arrays or comma-separated text. Omit for UK-wide search.",
            "items": {
              "type": "string"
            }
          },
          "include_sub_areas": {
            "title": "Include sub areas",
            "type": "boolean",
            "description": "Include authorities contained in the selected area. Set false for only the named authority.",
            "default": true
          },
          "postcode": {
            "title": "Postcode",
            "maxLength": 12,
            "type": "string",
            "description": "UK postcode for the search centre. Spaces and case are normalized."
          },
          "latitude": {
            "title": "Latitude",
            "minimum": 48,
            "maximum": 62,
            "type": "number",
            "description": "WGS84 latitude; requires longitude. Coordinates take precedence over postcode."
          },
          "longitude": {
            "title": "Longitude",
            "minimum": -11,
            "maximum": 4,
            "type": "number",
            "description": "WGS84 longitude; requires latitude."
          },
          "radius_km": {
            "title": "Radius km",
            "minimum": 0.001,
            "maximum": 50,
            "type": "number",
            "description": "Radius in kilometres, requires postcode or coordinates. Defaults to 1 km."
          },
          "keywords": {
            "title": "Keywords",
            "maxLength": 200,
            "type": "string",
            "description": "PlanIt text search: quoted phrases, or, and a minus prefix are supported."
          },
          "company": {
            "title": "Company",
            "maxLength": 200,
            "type": "string",
            "description": "Search agent/applicant companies and addresses. Requires council or location. With reference, a council is required."
          },
          "reference": {
            "title": "Reference",
            "maxLength": 200,
            "type": "string",
            "description": "Exact application identifier. Spatial filters are ignored. Council and date filters still apply."
          },
          "date_field": {
            "title": "Date field",
            "enum": [
              "received",
              "decided",
              "changed"
            ],
            "type": "string",
            "description": "Date used by last_days or date_from/date_to.",
            "default": "received"
          },
          "last_days": {
            "title": "Last days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Last N calendar days; zero means today. Overrides date_from/date_to when explicitly supplied. Defaults to 7 only if no date range is supplied."
          },
          "date_from": {
            "title": "Date from",
            "maxLength": 10,
            "type": "string",
            "description": "Inclusive start date, YYYY-MM-DD. Used when last_days is omitted."
          },
          "date_to": {
            "title": "Date to",
            "maxLength": 10,
            "type": "string",
            "description": "Inclusive end date, YYYY-MM-DD. Used when last_days is omitted."
          },
          "max_items": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum applications across the whole search. Defaults to 100. Each request returns at most 300; follow next_cursor."
          },
          "maxItems": {
            "title": "Maxitems",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Alias for max_items. If both are supplied, they must agree."
          },
          "cursor": {
            "title": "Cursor",
            "maxLength": 8000,
            "type": "string",
            "description": "Signed continuation from next_cursor. Keep the original filters; expires after 24 hours."
          },
          "app_type": {
            "title": "App type",
            "type": "array",
            "description": "PlanIt normalized filters; multiple values are combined with OR within this filter.",
            "items": {
              "type": "string"
            }
          },
          "app_state": {
            "title": "App state",
            "type": "array",
            "description": "PlanIt normalized filters; multiple values are combined with OR within this filter.",
            "items": {
              "type": "string"
            }
          },
          "app_size": {
            "title": "App size",
            "type": "array",
            "description": "PlanIt normalized filters; multiple values are combined with OR within this filter.",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}