{
  "openapi": "3.0.1",
  "info": {
    "title": "Canada Building Permits Scraper | Development Applications",
    "description": "Scrape Canada building permits at $3.00 per 1,000 records, under the other Canadian permit scrapers ($3.50-$5.00), and the only one with development applications (rezoning, site plan) and a ward filter. Toronto, Calgary, Edmonton, Vancouver, Winnipeg, Kitchener, Montréal; status-change feed.",
    "version": "0.1",
    "x-build-id": "CIGm4oxhdWxiYjPDM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/aurelix~canada-building-permits-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-aurelix-canada-building-permits-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/aurelix~canada-building-permits-scraper/runs": {
      "post": {
        "operationId": "runs-sync-aurelix-canada-building-permits-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/aurelix~canada-building-permits-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-aurelix-canada-building-permits-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": {
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Which city datasets to read: 'toronto' (development applications: rezoning, site plan, subdivision, condo, part lot), 'calgary' (development permits), 'edmonton' (development permits), 'vancouver' (issued building permits), 'toronto-building' (building permit applications and issued permits), 'calgary-building' (issued building permits), 'edmonton-building' (issued building permits), 'winnipeg' (issued development permits), 'kitchener' (issued building permits, refreshed weekly), 'montreal' (issued building, alteration and demolition permits, refreshed weekly). Example: ['toronto', 'toronto-building'].",
            "items": {
              "type": "string",
              "enum": [
                "toronto",
                "calgary",
                "edmonton",
                "vancouver",
                "toronto-building",
                "calgary-building",
                "edmonton-building",
                "winnipeg",
                "kitchener",
                "montreal"
              ],
              "enumTitles": [
                "Toronto (development applications)",
                "Calgary (development permits)",
                "Edmonton (development permits)",
                "Vancouver (issued building permits)",
                "Toronto (building permits)",
                "Calgary (building permits)",
                "Edmonton (building permits)",
                "Winnipeg (development permits)",
                "Kitchener (building permits)",
                "Montréal (building permits)"
              ]
            },
            "default": [
              "toronto",
              "calgary"
            ]
          },
          "daysBack": {
            "title": "Dated in the last N days",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Keep applications dated on or after today minus this many days (UTC): submitted date for Toronto (both datasets) and Calgary development permits, decision date for Edmonton development permits, issue date for every other dataset. Example: 7 for a weekly feed.",
            "default": 60
          },
          "applicationTypes": {
            "title": "Application types",
            "type": "array",
            "description": "Keep applications whose type or category contains one of these (case-insensitive), e.g. ['zoning', 'site plan', 'new', 'commercial']. Empty = all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "statuses": {
            "title": "Statuses",
            "type": "array",
            "description": "Keep applications whose status contains one of these (case-insensitive), e.g. ['received', 'under review', 'approved']. Empty = all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "wards": {
            "title": "Wards",
            "type": "array",
            "description": "Keep applications in these wards, by number or name, e.g. ['18', 'Willowdale', 'Karhiio']. Only Toronto development applications, Calgary and Edmonton development permits and Winnipeg publish a ward. Empty = all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep applications whose description or address contains one of these (case-insensitive), e.g. ['storey', 'mixed-use', 'Finch']. Empty = all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResultsPerCity": {
            "title": "Max results per city",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Upper limit of results per city after filters, newest first. 0 = no limit.",
            "default": 1000
          },
          "incremental": {
            "title": "Only new or changed since last run",
            "type": "boolean",
            "description": "Return only applications not returned by a previous run with the same cities and filters, plus applications whose status has changed. Use with a daily or weekly schedule.",
            "default": false
          },
          "stateKey": {
            "title": "Incremental state name (optional)",
            "type": "string",
            "description": "Name for the 'new since last run' memory. Leave empty to derive it from the cities and filters; set it to keep separate feeds apart, e.g. 'toronto-rezonings'."
          },
          "slackWebhookUrl": {
            "title": "Slack webhook URL (optional)",
            "type": "string",
            "description": "After each run, post a short digest to Slack: how many results were saved (new ones only when 'Only new or changed since last run' is on) and the top 10 with links, e.g. https://hooks.slack.com/services/T000/B000/XXXX. Nothing is posted when the run saved nothing. Leave empty to skip."
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "type": "string",
            "description": "After each run, POST the same digest as JSON (actor, newOnly, count, items = top 10 results, runUrl, text) to any URL, e.g. a Zapier, Make or n8n webhook. Nothing is sent when the run saved nothing. Leave empty to skip."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}