{
  "openapi": "3.0.1",
  "info": {
    "title": "Chicago Building Permits Scraper",
    "description": "Scrape City of Chicago building permit records from the public Socrata Open Data API. Search by permit type, work type, status, community area, ward, date range, or work description. Lookup by permit number(s) or by street address for full permit history.",
    "version": "1.0",
    "x-build-id": "9pFHVuUrac6u5ZHrM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~chicago-building-permits-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-chicago-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/crawlerbros~chicago-building-permits-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-chicago-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/crawlerbros~chicago-building-permits-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-chicago-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byPermitNumbers",
              "byAddress"
            ],
            "type": "string",
            "description": "What to fetch.",
            "default": "search"
          },
          "permitType": {
            "title": "Permit type",
            "enum": [
              "",
              "PERMIT – EXPRESS PERMIT PROGRAM",
              "PERMIT - EASY PERMIT PROCESS",
              "PERMIT - RENOVATION/ALTERATION",
              "PERMIT - SIGNS",
              "PERMIT - NEW CONSTRUCTION",
              "PERMIT - ELEVATOR EQUIPMENT",
              "PERMIT - WRECKING/DEMOLITION",
              "PERMIT - SCAFFOLDING",
              "PERMIT - REINSTATE REVOKED PMT",
              "PERMIT - PORCH CONSTRUCTION",
              "PERMIT - FOR EXTENSION OF PMT"
            ],
            "type": "string",
            "description": "Filter to a specific permit type (mode=search).",
            "default": ""
          },
          "permitStatus": {
            "title": "Permit status",
            "enum": [
              "",
              "ACTIVE",
              "CANCELLED",
              "COMPLETE",
              "EXPIRED",
              "PHASED PERMITTING",
              "REVOKED",
              "SUSPENDED"
            ],
            "type": "string",
            "description": "Filter to a specific current permit status (mode=search).",
            "default": ""
          },
          "permitMilestone": {
            "title": "Permit milestone",
            "enum": [
              "",
              "CANCELLED",
              "CERTIFICATE OF OCCUPANCY ISSUED",
              "CERTIFICATE OF OCCUPANCY PENDING",
              "CERTIFICATE OF OCCUPANCY PENDING (TEMPORARY OR PARTIAL OCCUPANCY APPROVED)",
              "COMPLETE",
              "DENIED",
              "EXPIRED",
              "FINAL INSPECTION",
              "INSPECTION ELIGIBLE",
              "INSPECTIONS",
              "INSPECTIONS (CERTIFICATE OF OCCUPANCY REQUIRED)",
              "PERMIT ISSUED (FEE DUE)",
              "POST CONSTRUCTION FILING",
              "PROGRESS INSPECTIONS",
              "STOP WORK",
              "SUSPENDED"
            ],
            "type": "string",
            "description": "Filter to a specific permit workflow milestone (mode=search).",
            "default": ""
          },
          "workType": {
            "title": "Work type",
            "enum": [
              "",
              "Electrical Work",
              "Monthly Maintenance Permit",
              "Administrative Change",
              "Fire Alarm System",
              "Small-Scale Solar PV System",
              "Masonry Work",
              "Reroofing",
              "Nonstructural Interior Work",
              "Fence or Trash Enclosure",
              "Plumbing Work",
              "Detached Frame Garage",
              "Other Work",
              "Mechanical Work",
              "Porch,Deck,Balcony,or Fire Escape",
              "Exterior Windows/Doors Replacement",
              "Scaffolding",
              "Communication Equipment",
              "Storm Water Management Plan",
              "Small Temporary Structure",
              "Construction Trailer"
            ],
            "type": "string",
            "description": "Filter to a specific category of work performed under the permit (mode=search).",
            "default": ""
          },
          "reviewType": {
            "title": "Review type",
            "enum": [
              "",
              "EXPRESS PERMIT PROGRAM",
              "EASY PERMIT",
              "STANDARD PLAN REVIEW",
              "SIGN PERMIT",
              "EASY PERMIT WEB",
              "SELF CERT",
              "CONVEYANCE DEVICE PERMIT",
              "DEMOLITION PERMIT",
              "TRADITIONAL DEVELOPER SERVICES",
              "DIRECT DEVELOPER SERVICES"
            ],
            "type": "string",
            "description": "Filter to a specific permit-application review pathway (mode=search).",
            "default": ""
          },
          "communityArea": {
            "title": "Community area",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10",
              "11",
              "12",
              "13",
              "14",
              "15",
              "16",
              "17",
              "18",
              "19",
              "20",
              "21",
              "22",
              "23",
              "24",
              "25",
              "26",
              "27",
              "28",
              "29",
              "30",
              "31",
              "32",
              "33",
              "34",
              "35",
              "36",
              "37",
              "38",
              "39",
              "40",
              "41",
              "42",
              "43",
              "44",
              "45",
              "46",
              "47",
              "48",
              "49",
              "50",
              "51",
              "52",
              "53",
              "54",
              "55",
              "56",
              "57",
              "58",
              "59",
              "60",
              "61",
              "62",
              "63",
              "64",
              "65",
              "66",
              "67",
              "68",
              "69",
              "70",
              "71",
              "72",
              "73",
              "74",
              "75",
              "76",
              "77"
            ],
            "type": "string",
            "description": "One of Chicago's 77 official community areas (mode=search).",
            "default": ""
          },
          "ward": {
            "title": "Ward",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7",
              "8",
              "9",
              "10",
              "11",
              "12",
              "13",
              "14",
              "15",
              "16",
              "17",
              "18",
              "19",
              "20",
              "21",
              "22",
              "23",
              "24",
              "25",
              "26",
              "27",
              "28",
              "29",
              "30",
              "31",
              "32",
              "33",
              "34",
              "35",
              "36",
              "37",
              "38",
              "39",
              "40",
              "41",
              "42",
              "43",
              "44",
              "45",
              "46",
              "47",
              "48",
              "49",
              "50"
            ],
            "type": "string",
            "description": "Chicago City Council ward, 1-50 (mode=search).",
            "default": ""
          },
          "latitude": {
            "title": "Near latitude (mode=search)",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Center latitude for a \"near me\" radius search. Combine with `longitude` and `radiusKm`."
          },
          "longitude": {
            "title": "Near longitude (mode=search)",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Center longitude for a \"near me\" radius search. Combine with `latitude` and `radiusKm`."
          },
          "radiusKm": {
            "title": "Radius (km)",
            "minimum": 0.1,
            "maximum": 50,
            "type": "number",
            "description": "Search radius in kilometers around `latitude`/`longitude`. Only applied when both are set. Default 1 km.",
            "default": 1
          },
          "workDescriptionContains": {
            "title": "Work description contains",
            "type": "string",
            "description": "Case-insensitive substring match against the free-text work description (e.g. `kitchen`, `roof`, `solar`) (mode=search).",
            "default": ""
          },
          "contractorNameContains": {
            "title": "Contractor/owner name contains",
            "type": "string",
            "description": "Case-insensitive substring match against any of the up-to-15 owner/contractor/architect/engineer names on the permit (e.g. `turner construction`) (mode=search).",
            "default": ""
          },
          "issueDateFrom": {
            "title": "Issue date from",
            "type": "string",
            "description": "Only include permits issued on/after this date (YYYY-MM-DD) (mode=search). Prefilled to a recent date so the default search stays fast (unfiltered + sorted queries scan the full 800K+ row table); clear it to search the full history."
          },
          "issueDateTo": {
            "title": "Issue date to",
            "type": "string",
            "description": "Only include permits issued on/before this date (YYYY-MM-DD) (mode=search)."
          },
          "applicationDateFrom": {
            "title": "Application date from",
            "type": "string",
            "description": "Only include permits whose application was started on/after this date (YYYY-MM-DD) (mode=search)."
          },
          "applicationDateTo": {
            "title": "Application date to",
            "type": "string",
            "description": "Only include permits whose application was started on/before this date (YYYY-MM-DD) (mode=search)."
          },
          "minReportedCost": {
            "title": "Min reported cost (USD)",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Only include permits with a reported project cost at or above this amount (mode=search)."
          },
          "maxReportedCost": {
            "title": "Max reported cost (USD)",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Only include permits with a reported project cost at or below this amount (mode=search)."
          },
          "minProcessingTimeDays": {
            "title": "Min processing time (days)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Only include permits whose application-to-issue processing time is at or above this many days (mode=search)."
          },
          "maxProcessingTimeDays": {
            "title": "Max processing time (days)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Only include permits whose application-to-issue processing time is at or below this many days (mode=search)."
          },
          "permitNumbers": {
            "title": "Permit numbers (mode=byPermitNumbers)",
            "type": "array",
            "description": "Exact City of Chicago permit number(s) to fetch, e.g. `100109616` or `B100522727`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "streetNumber": {
            "title": "Street number (mode=byAddress)",
            "minimum": 1,
            "maximum": 999999,
            "type": "integer",
            "description": "House/building street number, e.g. `401`."
          },
          "streetDirection": {
            "title": "Street direction (mode=byAddress)",
            "enum": [
              "",
              "N",
              "S",
              "E",
              "W"
            ],
            "type": "string",
            "description": "Street direction prefix.",
            "default": ""
          },
          "streetName": {
            "title": "Street name (mode=byAddress)",
            "type": "string",
            "description": "Street name including suffix, e.g. `ABERDEEN ST`."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "issueDate",
              "applicationStartDate",
              "reportedCost",
              "processingTime"
            ],
            "type": "string",
            "description": "Which date/amount field to sort results by (applies to mode=search and mode=byAddress).",
            "default": "issueDate"
          },
          "sortAscending": {
            "title": "Sort ascending",
            "type": "boolean",
            "description": "Sort oldest/lowest-first instead of newest/highest-first.",
            "default": false
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on emitted records.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}