{
  "openapi": "3.0.1",
  "info": {
    "title": "Chicago Building Permits Scraper",
    "description": "Search the official City of Chicago building-permit dataset by date, status, work type, location, contact, cost, or exact permit ID. Save structured permit details, project scope, fees, contacts, and source links for construction and property research.",
    "version": "0.0",
    "x-build-id": "RBA4cYxg4gtiwfgUM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maximedupre~chicago-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maximedupre-chicago-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/maximedupre~chicago-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-maximedupre-chicago-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/maximedupre~chicago-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-maximedupre-chicago-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": [
          "target"
        ],
        "properties": {
          "target": {
            "title": "Target",
            "enum": [
              "search",
              "permit"
            ],
            "type": "string",
            "description": "Choose one kind of Chicago permit lookup for this run."
          },
          "searchMode": {
            "title": "Search mode",
            "enum": [
              "all",
              "newSincePreviousRun"
            ],
            "type": "string",
            "description": "Choose all matching permits or only permits newly available since the prior run. If omitted, this uses all matching permits.",
            "default": "all"
          },
          "projectSearch": {
            "title": "Project search text",
            "type": "string",
            "description": "Optional text to find in the published project description."
          },
          "issueDateFrom": {
            "title": "Issue date from",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional first issue date to include."
          },
          "issueDateTo": {
            "title": "Issue date to",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Optional last issue date to include."
          },
          "permitStatuses": {
            "title": "Permit statuses",
            "type": "array",
            "description": "Optional list of published permit status values to include. Leave empty to include every status.",
            "items": {
              "type": "string"
            }
          },
          "permitTypes": {
            "title": "Permit types",
            "type": "array",
            "description": "Optional list of published permit type values to include. Leave empty to include all permit types.",
            "items": {
              "type": "string"
            }
          },
          "reviewTypes": {
            "title": "Review types",
            "type": "array",
            "description": "Optional list of published review type values to include. Leave empty to include all review types.",
            "items": {
              "type": "string"
            }
          },
          "workTypes": {
            "title": "Work types",
            "type": "array",
            "description": "Optional list of published work type values to include. Leave empty to include all work types.",
            "items": {
              "type": "string"
            }
          },
          "wards": {
            "title": "Wards",
            "type": "array",
            "description": "Optional list of Chicago ward numbers to include. Leave empty to include all wards.",
            "items": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          "communityAreas": {
            "title": "Community areas",
            "type": "array",
            "description": "Optional list of Chicago community area numbers to include. Leave empty to include all community areas.",
            "items": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          "street": {
            "title": "Street",
            "type": "string",
            "description": "Optional street text to match in the published job address."
          },
          "address": {
            "title": "Address",
            "type": "string",
            "description": "Optional full address text to match in the published job address."
          },
          "owner": {
            "title": "Owner",
            "type": "string",
            "description": "Optional owner name text to match in published permit contacts."
          },
          "applicant": {
            "title": "Applicant",
            "type": "string",
            "description": "Optional applicant name text to match in published permit contacts."
          },
          "contractor": {
            "title": "Contractor",
            "type": "string",
            "description": "Optional contractor name text to match in published permit contacts."
          },
          "contactName": {
            "title": "Contact name",
            "type": "string",
            "description": "Optional name text to match in any published contact entry."
          },
          "contactZip": {
            "title": "Contact ZIP",
            "type": "string",
            "description": "Optional ZIP code to match in published contact entries."
          },
          "minProjectCost": {
            "title": "Minimum project cost (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Optional lowest reported project cost to include."
          },
          "maxProjectCost": {
            "title": "Maximum project cost (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Optional highest reported project cost to include."
          },
          "maxItems": {
            "title": "Maximum permits",
            "minimum": 1,
            "type": "integer",
            "description": "Optional stop after this many matching permits. Leave empty to return all available results until the source is exhausted."
          },
          "permitId": {
            "title": "Permit ID",
            "minLength": 1,
            "type": "string",
            "description": "Required when Target is Look up a permit. Enter one exact published Chicago permit ID."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}