{
  "openapi": "3.0.1",
  "info": {
    "title": "🏗️ UK Planning Applications — All Councils, Full Detail",
    "description": "Scrape UK planning applications from all ~420 councils via PlanIt. Address, description, type, size, status, decision, all dates + AGENT & APPLICANT contacts (name, company, phone). Free, no key, no proxy.",
    "version": "1.0",
    "x-build-id": "tlb2eZQCeyyt61Mmg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/inexhaustible_glass~uk-planning-applications/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-inexhaustible_glass-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/inexhaustible_glass~uk-planning-applications/runs": {
      "post": {
        "operationId": "runs-sync-inexhaustible_glass-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/inexhaustible_glass~uk-planning-applications/run-sync": {
      "post": {
        "operationId": "run-sync-inexhaustible_glass-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": {
          "areas": {
            "title": "🏛️ Councils (leave empty for ALL UK)",
            "type": "array",
            "description": "Target specific local planning authorities by their PlanIt name (e.g. 'Hackney', 'Leeds', 'Manchester', 'Cornwall'). Leave EMPTY to scrape every one of the ~420 active UK councils at once.",
            "items": {
              "type": "string"
            }
          },
          "recentDays": {
            "title": "📅 Recent days (if no date range)",
            "minimum": 1,
            "type": "integer",
            "description": "Fetch applications from the last N days. Used only when you don't set an explicit Start/End date below. Great for a daily fresh-leads run.",
            "default": 14
          },
          "startDate": {
            "title": "📆 Start date (YYYY-MM-DD)",
            "type": "string",
            "description": "Only applications from this date onward. Overrides 'Recent days'. Example: 2024-01-01. Combine with End date to backfill any historical period."
          },
          "endDate": {
            "title": "📆 End date (YYYY-MM-DD)",
            "type": "string",
            "description": "Only applications up to this date. Defaults to today."
          },
          "search": {
            "title": "🔍 Keyword search",
            "type": "string",
            "description": "Free-text search across the application (description, address, etc.). Supports quotes & OR, e.g. \"solar panel\" or photovoltaic. Leave empty for everything."
          },
          "appType": {
            "title": "🏷️ Application type filter",
            "type": "string",
            "description": "Keep only applications whose type contains this text. Examples: Full, Outline, Householder, Reserved, Listed, Advertisement, Conditions, Trees."
          },
          "appState": {
            "title": "📌 Status filter",
            "type": "string",
            "description": "Keep only applications in this state. Examples: Permitted, Rejected, Undecided, Withdrawn, Conditions, Referred."
          },
          "appSize": {
            "title": "📐 Size filter",
            "enum": [
              "",
              "Small",
              "Medium",
              "Large"
            ],
            "type": "string",
            "description": "Keep only Small, Medium or Large applications (PlanIt's size band). Large = major developments — the best construction leads.",
            "default": ""
          },
          "minDwellings": {
            "title": "🏠 Minimum dwellings",
            "minimum": 0,
            "type": "integer",
            "description": "Only residential schemes with at least this many dwellings (read from the data or parsed from the description). Example: 5 to skip single-house jobs."
          },
          "onlyWithAgentContact": {
            "title": "📞 Only with an agent/architect contact",
            "type": "boolean",
            "description": "Keep only applications that include the agent's name, company or phone — the directly-callable sales leads.",
            "default": false
          },
          "fetchDocumentLinks": {
            "title": "📎 Fetch document download links",
            "type": "boolean",
            "description": "For each application, open the council's document page and pull the direct links to every document (drawings, forms, reports). Works on Idox portals (~60% of councils). Slower — each application opens its council page. Leave off for a fast metadata-only run.",
            "default": false
          },
          "includeGeometry": {
            "title": "🗺️ Include full GeoJSON geometry",
            "type": "boolean",
            "description": "Add the raw GeoJSON location to each row. Off by default (lat/long are always included).",
            "default": false
          },
          "useProxy": {
            "title": "🔀 Route via Apify proxy",
            "type": "boolean",
            "description": "Off by default — the direct connection works fine. Turn ON only if you run very large jobs and start hitting PlanIt's per-IP rate limit, to route through Apify's proxy.",
            "default": false
          },
          "maxResults": {
            "title": "🔢 Max results",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Cap how many applications to return.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}