{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Planning Applications Search — Council Portals",
    "description": "Search UK council planning applications in Cardiff, Edinburgh, Highland, Southampton and Northern Ireland: proposal, address, status, dates. USD 10 per 1,000.",
    "version": "2.0",
    "x-build-id": "1Of71U3z9yWyhUYC7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhammadafzal~planning-permission-uk-scraper-candidate/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhammadafzal-planning-permission-uk-scraper-candidate",
        "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-candidate/runs": {
      "post": {
        "operationId": "runs-sync-muhammadafzal-planning-permission-uk-scraper-candidate",
        "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-candidate/run-sync": {
      "post": {
        "operationId": "run-sync-muhammadafzal-planning-permission-uk-scraper-candidate",
        "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": {
          "source": {
            "title": "Data source",
            "enum": [
              "council-portals",
              "planning-data"
            ],
            "type": "string",
            "description": "Use council-portals for supported Idox councils and the Northern Ireland register. Use planning-data for England applications and constraints.",
            "default": "council-portals"
          },
          "councils": {
            "title": "Council presets",
            "type": "array",
            "description": "Built-in presets: cardiff (Wales), edinburgh/highland (Scotland), southampton (England), northern-ireland (10 councils plus DfI; excludes Mid Ulster). Used only in council-portals search mode.",
            "items": {
              "type": "string"
            },
            "default": [
              "cardiff",
              "edinburgh",
              "southampton",
              "northern-ireland"
            ]
          },
          "query": {
            "title": "Council search query",
            "type": "string",
            "description": "Keyword, address, postcode, or application reference for council search. Example: solar or LA04/2025. Clear this in planning-data mode. A query searches within selected portals; it does not choose councils.",
            "default": "solar"
          },
          "portals": {
            "title": "Additional Idox portals",
            "type": "array",
            "description": "Optional public Idox portal roots, e.g. [{\"url\":\"https://wam.highland.gov.uk/wam/\",\"nation\":\"Scotland\",\"authority\":\"Highland Council\"}]. HTTPS .gov.uk hosts only; include the trailing slash. Other portal systems are unsupported.",
            "default": []
          },
          "startUrls": {
            "title": "Idox application URLs",
            "type": "array",
            "description": "Optional direct applicationDetails.do URLs with keyVal from built-in or additional Idox portals. If supplied, reads these application summaries instead of searching. Maximum 20 URLs.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "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": "Restrict national results to a Planning Data organisation entity ID, e.g. 26 for Adur. This is not a council postcode or planning 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": "Received / entity start date from",
            "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'."
          },
          "endDate": {
            "title": "Received / entity start date through",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive upper bound on application received date (validated date for councils that publish no received date) or national entity start date. Undated records are excluded when either date bound is set. This never filters entity end-date."
          },
          "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 20 and accepts 1-1,000; council searches take one record from each selected council in turn. This limits output rows, not the number of matching records available from the source.",
            "default": 20
          },
          "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": "Request delay (ms)",
            "minimum": 100,
            "maximum": 5000,
            "type": "integer",
            "description": "Pace every source request. Default 500 ms; accepted range 100–5,000 ms. Idox council requests have a 2-second minimum; runtime and request budgets are separate.",
            "default": 500
          },
          "maxPages": {
            "title": "Maximum pages per source",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Bounds pages of search results; requests are also capped separately.",
            "default": 20
          },
          "maxRequests": {
            "title": "Maximum total HTTP requests",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Run-wide request cap, including retries, redirects and application details.",
            "default": 200
          },
          "pageSize": {
            "title": "National / NI page size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Page size for Planning Data and Northern Ireland. Idox chooses its own page size.",
            "default": 20
          },
          "maxRuntimeSecs": {
            "title": "Maximum runtime seconds",
            "minimum": 30,
            "maximum": 600,
            "type": "integer",
            "description": "Stop with retained partial results after this runtime budget; cloud timeout is a separate bound.",
            "default": 260
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}