{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Planning Applications & Construction Leads Scraper",
    "description": "Extract UK council planning applications nationwide with postcode radius, keyword filters (extension, loft, solar, new dwelling), coordinates, application status & architect/agent firm details. Clean CRM-ready leads for UK builders, solar installers & property teams.",
    "version": "0.0",
    "x-build-id": "cd6V2FairJpgQ9fGJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kailouis_labs~uk-planning-applications-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kailouis_labs-uk-planning-applications-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/kailouis_labs~uk-planning-applications-scraper/runs": {
      "post": {
        "operationId": "runs-sync-kailouis_labs-uk-planning-applications-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/kailouis_labs~uk-planning-applications-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-kailouis_labs-uk-planning-applications-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",
        "properties": {
          "postcode": {
            "title": "Postcode (radius centre)",
            "type": "string",
            "description": "UK postcode to search around, e.g. \"CB1 1PT\" or \"SW1A 1AA\". Leave empty to search by local authority or keyword only."
          },
          "radiusKm": {
            "title": "Radius in km",
            "minimum": 0.5,
            "maximum": 100,
            "type": "number",
            "description": "Search radius around the postcode centre. Used only when a postcode is given.",
            "default": 10
          },
          "localAuthorities": {
            "title": "Local authorities",
            "type": "array",
            "description": "One or more UK councils, e.g. [\"Cambridge\", \"Camden\"]. Sub-areas are included. Partial names match: \"Cambridge\" also matches \"Cambridgeshire\".",
            "items": {
              "type": "string"
            }
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 0,
            "maximum": 7300,
            "type": "integer",
            "description": "Fetch applications received in the last N days. Ignored when startDate is set.",
            "default": 30
          },
          "startDate": {
            "title": "Start date (YYYY-MM-DD)",
            "type": "string",
            "description": "Explicit start of the date range. Overrides daysBack."
          },
          "endDate": {
            "title": "End date (YYYY-MM-DD)",
            "type": "string",
            "description": "Explicit end of the date range. Defaults to today."
          },
          "keywords": {
            "title": "Keywords (description intent)",
            "type": "array",
            "description": "Case-insensitive match against the application description, e.g. [\"extension\",\"loft\",\"solar\",\"heat pump\"]. Sent to the API as a full-text search and re-checked locally.",
            "items": {
              "type": "string"
            }
          },
          "applicationTypes": {
            "title": "Application types",
            "type": "array",
            "description": "PlanIt types: Full, Outline, Amendment, Conditions, Heritage, Trees, Advertising, Telecoms, Other. Leave empty for all types.",
            "items": {
              "type": "string"
            }
          },
          "applicationStates": {
            "title": "Application states",
            "type": "array",
            "description": "Permitted (approved), Conditions (approved with conditions), Undecided (live lead), Rejected, Withdrawn, Referred, Unresolved, Other. Leave empty for all states.",
            "items": {
              "type": "string"
            }
          },
          "onlyWithAgentCompany": {
            "title": "Only leads with an agent company",
            "type": "boolean",
            "description": "Keep only applications where a real architectural practice or planning consultancy is named in agentCompany.",
            "default": false
          },
          "includeExtraDetails": {
            "title": "Include extra details",
            "type": "boolean",
            "description": "Also fetch /planapplic/{uid}@{areaId}/json per application. The list endpoint already returns the same fields, so this only helps when a council's list record is thin (one extra rate-limited request per item).",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Safety cap on returned applications. 0 = unlimited.",
            "default": 25
          },
          "minDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 1000,
            "maximum": 60000,
            "type": "integer",
            "description": "Polite baseline gap between API requests. PlanIt allows roughly one request every 3 seconds; keep 3200 unless you know what you are doing.",
            "default": 3200
          },
          "concurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Parallel request slots. 1 is the safe default for the PlanIt rate limit.",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}