{
  "openapi": "3.0.1",
  "info": {
    "title": "UK Planning Leads Finder",
    "description": "Find contractor opportunities in recent UK planning applications across 18 trades. Exact filters, local semantic ranking, and explainable fit scores.",
    "version": "0.2",
    "x-build-id": "TfUyIBDCgca9MtmDW"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/porcelain_vista~uk-planning-lead-qualifier/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-porcelain_vista-uk-planning-lead-qualifier",
        "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/porcelain_vista~uk-planning-lead-qualifier/runs": {
      "post": {
        "operationId": "runs-sync-porcelain_vista-uk-planning-lead-qualifier",
        "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/porcelain_vista~uk-planning-lead-qualifier/run-sync": {
      "post": {
        "operationId": "run-sync-porcelain_vista-uk-planning-lead-qualifier",
        "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": [
          "authorities"
        ],
        "properties": {
          "tradePack": {
            "title": "Contractor trade",
            "enum": [
              "commercial_roofing",
              "hvac_ventilation",
              "signage_shopfronts",
              "windows_doors_glazing",
              "tree_surgery",
              "solar_energy",
              "ev_charging",
              "extensions_building",
              "demolition",
              "fencing_gates",
              "landscaping_groundworks",
              "drainage",
              "facades_cladding_rendering",
              "heritage_restoration",
              "telecommunications",
              "lighting_security",
              "highways_parking_access",
              "industrial_agricultural_buildings"
            ],
            "type": "string",
            "description": "The Actor uses a curated vocabulary and semantic descriptions for this trade.",
            "default": "commercial_roofing"
          },
          "serviceIds": {
            "title": "Specific services (optional)",
            "uniqueItems": true,
            "type": "array",
            "description": "Leave empty to monitor all standard services in the selected trade. If used, select services belonging to that trade.",
            "items": {
              "type": "string",
              "enum": [
                "roof_repair",
                "roof_replacement",
                "new_roof",
                "roof_cladding_insulation",
                "mechanical_ventilation",
                "commercial_extraction",
                "air_conditioning",
                "heat_pumps",
                "illuminated_signs",
                "shopfronts",
                "window_graphics",
                "awnings_branding",
                "replacement_windows",
                "external_doors",
                "commercial_glazing",
                "fenestration",
                "tree_felling",
                "crown_work",
                "pollarding_deadwood",
                "stump_safety",
                "solar_pv",
                "solar_roof",
                "battery_storage",
                "charging_points",
                "charging_hub",
                "single_storey_extension",
                "multi_storey_extension",
                "loft_conversion",
                "garage_conversion",
                "building_demolition",
                "partial_demolition",
                "site_clearance",
                "fencing",
                "gates",
                "walls_railings",
                "hard_landscaping",
                "soft_landscaping",
                "groundworks",
                "retaining_walls",
                "surface_water",
                "foul_drainage",
                "suds",
                "external_cladding",
                "rendering",
                "facade_refurbishment",
                "external_insulation",
                "stonework_repointing",
                "historic_windows",
                "timber_restoration",
                "listed_building_alterations",
                "masts_antennas",
                "street_hubs",
                "cabinets_equipment",
                "external_lighting",
                "cctv",
                "floodlighting",
                "car_parks",
                "vehicle_access",
                "roads_footways",
                "cycle_facilities",
                "industrial_units",
                "agricultural_buildings",
                "warehouses_storage"
              ],
              "enumTitles": [
                "Commercial roofing — Roof repair and refurbishment",
                "Commercial roofing — Roof replacement and reroofing",
                "Commercial roofing — New roof construction",
                "Commercial roofing — Roof cladding, waterproofing and insulation",
                "HVAC and ventilation — Mechanical ventilation",
                "HVAC and ventilation — Commercial extraction",
                "HVAC and ventilation — Air conditioning and plant",
                "HVAC and ventilation — Heat pumps",
                "Commercial signage and shopfronts — Illuminated and directional signs",
                "Commercial signage and shopfronts — Shopfront installation and alteration",
                "Commercial signage and shopfronts — Window graphics and digital displays",
                "Commercial signage and shopfronts — Awnings and external branding",
                "Windows, doors and glazing — Replacement and new windows",
                "Windows, doors and glazing — External, bifold and patio doors",
                "Windows, doors and glazing — Commercial glazing",
                "Windows, doors and glazing — Fenestration alterations",
                "Tree surgery and arboriculture — Tree felling and removal",
                "Tree surgery and arboriculture — Crown reduction, lifting and thinning",
                "Tree surgery and arboriculture — Pollarding and deadwood removal",
                "Tree surgery and arboriculture — Stump and tree safety work",
                "Solar PV and battery storage — Solar PV panels",
                "Solar PV and battery storage — Roof-mounted solar",
                "Solar PV and battery storage — Battery energy storage",
                "Electric vehicle charging — EV charging points",
                "Electric vehicle charging — Charging hubs and forecourts",
                "Extensions and general building — Single-storey extensions",
                "Extensions and general building — Multi-storey extensions",
                "Extensions and general building — Loft conversions and dormers",
                "Extensions and general building — Garage conversions",
                "Demolition and site clearance — Building demolition",
                "Demolition and site clearance — Partial demolition",
                "Demolition and site clearance — Site clearance",
                "Fencing, gates and access control — Fencing",
                "Fencing, gates and access control — Vehicle and pedestrian gates",
                "Fencing, gates and access control — Boundary walls and railings",
                "Landscaping and groundworks — Hard landscaping",
                "Landscaping and groundworks — Soft landscaping and planting",
                "Landscaping and groundworks — Groundworks and hardstanding",
                "Landscaping and groundworks — Retaining walls",
                "Drainage and water management — Surface-water drainage",
                "Drainage and water management — Foul drainage and sewer connections",
                "Drainage and water management — Sustainable drainage systems",
                "Facades, cladding and rendering — External wall cladding",
                "Facades, cladding and rendering — External rendering",
                "Facades, cladding and rendering — Facade refurbishment",
                "Facades, cladding and rendering — External wall insulation",
                "Heritage restoration — Historic stonework and repointing",
                "Heritage restoration — Historic windows and doors",
                "Heritage restoration — Historic timber restoration",
                "Heritage restoration — Listed-building alterations",
                "Telecommunications infrastructure — Masts and antennas",
                "Telecommunications infrastructure — Street hubs and kiosks",
                "Telecommunications infrastructure — Telecom cabinets and equipment",
                "External lighting and security — External lighting",
                "External lighting and security — CCTV and security systems",
                "External lighting and security — Sports and site floodlighting",
                "Highways, parking and access — Car parks and parking areas",
                "Highways, parking and access — Vehicle access and dropped kerbs",
                "Highways, parking and access — Roads and footways",
                "Highways, parking and access — Cycle facilities",
                "Industrial and agricultural buildings — Industrial units and workshops",
                "Industrial and agricultural buildings — Agricultural buildings",
                "Industrial and agricultural buildings — Warehouses and storage buildings"
              ]
            },
            "default": []
          },
          "targetBuildingTypes": {
            "title": "Preferred building types (optional)",
            "uniqueItems": true,
            "type": "array",
            "description": "Examples: warehouse, restaurant, school. Leave empty for the trade defaults.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "authorities": {
            "title": "Planning authorities",
            "minItems": 1,
            "maxItems": 20,
            "uniqueItems": true,
            "type": "array",
            "description": "One or more PlanIt authority names, for example Leeds, Hackney or Manchester.",
            "default": [
              "Leeds"
            ],
            "items": {
              "type": "string"
            }
          },
          "recentDays": {
            "title": "Applications received in the last N days",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Limit collection to applications received within this many days.",
            "default": 30
          },
          "onlyNew": {
            "title": "Return only projects not seen in earlier runs",
            "type": "boolean",
            "description": "Seen-project history is scoped to this search and persisted across cloud runs.",
            "default": false
          },
          "filters": {
            "title": "Exact filters",
            "type": "object",
            "description": "Optional deterministic rules applied before semantic ranking.",
            "properties": {
              "states": {
                "title": "Allowed project stages",
                "description": "Only include applications currently in one of these stages.",
                "type": "array",
                "editor": "select",
                "items": {
                  "type": "string",
                  "enumSuggestedValues": [
                    "Undecided",
                    "Permitted",
                    "Conditions"
                  ],
                  "enumTitles": [
                    "Undecided — decision pending",
                    "Permitted — approved",
                    "Conditions — details being discharged"
                  ]
                }
              },
              "applicationTypes": {
                "title": "Allowed application types (optional)",
                "description": "Leave empty to accept every application type.",
                "type": "array",
                "editor": "select",
                "items": {
                  "type": "string",
                  "enumSuggestedValues": [
                    "Full",
                    "Outline",
                    "Reserved Matters",
                    "Heritage",
                    "Advertising",
                    "Trees",
                    "Prior Approval",
                    "Conditions",
                    "Amendment"
                  ],
                  "enumTitles": [
                    "Full planning application",
                    "Outline planning application",
                    "Reserved matters",
                    "Listed building / heritage",
                    "Advertisement consent",
                    "Protected tree works",
                    "Prior approval",
                    "Discharge of conditions",
                    "Amendment"
                  ]
                }
              },
              "minimumProjectSize": {
                "title": "Minimum PlanIt project size",
                "description": "Reject projects below this broad size classification.",
                "type": "string",
                "editor": "select",
                "enum": [
                  "Small",
                  "Medium",
                  "Large"
                ],
                "enumTitles": [
                  "Small",
                  "Medium",
                  "Large"
                ]
              },
              "requiredTerms": {
                "title": "Required exact phrases (optional)",
                "description": "A project must contain the configured phrases using the selected logic.",
                "type": "array",
                "editor": "stringList"
              },
              "requiredTermMode": {
                "title": "Required phrase logic",
                "description": "Require any configured phrase or require all configured phrases.",
                "type": "string",
                "editor": "select",
                "enum": [
                  "any",
                  "all"
                ],
                "enumTitles": [
                  "Any phrase",
                  "All phrases"
                ]
              },
              "requiredTermScope": {
                "title": "Required phrase search scope",
                "description": "Choose which application fields are checked for required phrases.",
                "type": "string",
                "editor": "select",
                "enum": [
                  "description",
                  "description_and_address"
                ],
                "enumTitles": [
                  "Description only",
                  "Description and address"
                ]
              },
              "excludedTerms": {
                "title": "Excluded exact phrases (optional)",
                "description": "Reject a project when any configured phrase is present.",
                "type": "array",
                "editor": "stringList"
              }
            },
            "default": {
              "states": [
                "Undecided",
                "Permitted",
                "Conditions"
              ],
              "applicationTypes": [],
              "minimumProjectSize": "Small",
              "requiredTerms": [],
              "requiredTermMode": "any",
              "requiredTermScope": "description",
              "excludedTerms": []
            },
            "additionalProperties": false
          },
          "maxCandidates": {
            "title": "Maximum source candidates",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of applications collected before qualification and ranking.",
            "default": 30
          },
          "maxResults": {
            "title": "Maximum ranked leads",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum number of accepted leads written to the Dataset.",
            "default": 10
          },
          "sourceSearch": {
            "title": "PlanIt source search override",
            "maxLength": 2000,
            "type": "string",
            "description": "Leave blank to generate the broad source query from the selected services."
          },
          "scoring": {
            "title": "Ranking settings",
            "type": "object",
            "description": "Control how accepted planning applications are ranked for business fit.",
            "properties": {
              "mode": {
                "title": "Ranking mode",
                "description": "Catalog hybrid combines BM25, local semantic ranking, and an absolute service-evidence guardrail.",
                "type": "string",
                "editor": "select",
                "enum": [
                  "catalog_hybrid",
                  "transformer",
                  "rules"
                ],
                "enumTitles": [
                  "Catalog hybrid — recommended",
                  "Single-query transformer",
                  "Rules only"
                ]
              },
              "minimumScore": {
                "title": "Minimum fit score",
                "description": "45 is the recall-first default. Use 0 only to inspect every ranked candidate.",
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "transformerBatchSize": {
                "title": "Transformer batch size",
                "description": "Number of query and application pairs evaluated in one model batch.",
                "type": "integer",
                "minimum": 1,
                "maximum": 64
              }
            },
            "default": {
              "mode": "catalog_hybrid",
              "minimumScore": 45,
              "transformerBatchSize": 32
            },
            "additionalProperties": true
          },
          "includeRejected": {
            "title": "Include rejected records for debugging",
            "type": "boolean",
            "description": "Write rejected projects and their rejection reasons to the Dataset.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}