{
  "openapi": "3.0.1",
  "info": {
    "title": "Canada Building Permits Scraper – 14 Cities, Construction Leads",
    "description": "Building permits from 14 Canadian cities' official open data in one run: Halifax, Calgary, Edmonton, Winnipeg, Mississauga, Kitchener, Victoria, Surrey and more. Filter by date, value and type.",
    "version": "0.1",
    "x-build-id": "GUqsognftlqr3P0PD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/loudtzu~canada-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-loudtzu-canada-building-permits",
        "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/loudtzu~canada-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-loudtzu-canada-building-permits",
        "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/loudtzu~canada-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-loudtzu-canada-building-permits",
        "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": [
          "cities"
        ],
        "properties": {
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Which cities to pull permits from. Each row in the output has city and province columns.",
            "items": {
              "type": "string",
              "enum": [
                "halifax",
                "kitchener",
                "oakville",
                "mississauga",
                "burlington",
                "waterloo",
                "kingston",
                "victoria",
                "surrey",
                "delta",
                "maple-ridge",
                "calgary",
                "edmonton",
                "winnipeg"
              ],
              "enumTitles": [
                "Halifax, NS",
                "Kitchener, ON",
                "Oakville, ON",
                "Mississauga, ON",
                "Burlington, ON",
                "Waterloo, ON",
                "Kingston, ON",
                "Victoria, BC",
                "Surrey, BC",
                "Delta, BC",
                "Maple Ridge, BC",
                "Calgary, AB",
                "Edmonton, AB",
                "Winnipeg, MB"
              ]
            },
            "default": [
              "halifax",
              "calgary",
              "mississauga"
            ]
          },
          "dateFrom": {
            "title": "Issued from (YYYY-MM-DD)",
            "type": "string",
            "description": "Only permits issued on or after this date. Leave empty for no lower limit. Delta publishes no issue date, so for Delta this filters on the completion date (the log warns)."
          },
          "dateTo": {
            "title": "Issued to (YYYY-MM-DD)",
            "type": "string",
            "description": "Only permits issued on or before this date. For Delta this filters on the completion date."
          },
          "minValue": {
            "title": "Minimum project value (CAD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only permits with an estimated construction value at or above this. Permits with no value recorded (blank or 0) are left out when you set a value filter. Delta and Winnipeg publish no value, so they are skipped when you set this."
          },
          "maxValue": {
            "title": "Maximum project value (CAD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only permits with an estimated construction value at or below this. Permits with no value recorded (blank or 0) are left out. Delta and Winnipeg publish no value, so they are skipped when you set this."
          },
          "permitType": {
            "title": "Permit type contains",
            "type": "string",
            "description": "Text match (contains, not case-sensitive) on the city's permit type. The words differ by city: see the README table. 'Residential' matches nothing in Oakville, Burlington, Kingston, Victoria, Surrey and Edmonton."
          },
          "workType": {
            "title": "Work type contains",
            "type": "string",
            "description": "Text match on work type, e.g. New, Addition, Alteration. Halifax accepts exactly: New Building, Addition, Renovation. Kingston, Victoria and Delta have no work-type column and are skipped when you set this."
          },
          "status": {
            "title": "Status contains",
            "type": "string",
            "description": "Text match on permit status, e.g. Issued, Closed. Surrey and Edmonton have no status column and are skipped when you set this."
          },
          "keyword": {
            "title": "Keyword",
            "type": "string",
            "description": "Searches each city's permit number and type/description-like fields."
          },
          "maxItems": {
            "title": "Max permits in total",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Total permits across all cities (default 100, up to 50,000). Split evenly between the cities you pick; a city that has fewer matches passes its unused share on to the next cities.",
            "default": 100
          },
          "maxItemsPerCity": {
            "title": "Max permits per city (optional)",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Optional upper limit for each city, newest first. A city never gets more than this or its share of 'Max permits in total', whichever is smaller."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}