{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits Scraper — City & County Permit Records",
    "description": "Scrape building permits from 26 US city and county open-data portals (NYC, Chicago, LA, SF, Seattle, Austin, Philadelphia, Boston, DC, Miami-Dade, more) into a normalized JSON schema. Filter by date, type, cost and keyword; monitor new permits for contractor, solar and roofing leads. $0.003/permit.",
    "version": "0.1",
    "x-build-id": "z72ce5VJOFGv8FGGo"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/owlabee~building-permits-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-owlabee-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/owlabee~building-permits-scraper/runs": {
      "post": {
        "operationId": "runs-sync-owlabee-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/owlabee~building-permits-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-owlabee-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": [
          "jurisdictions"
        ],
        "properties": {
          "jurisdictions": {
            "title": "Jurisdictions",
            "minItems": 1,
            "uniqueItems": true,
            "type": "array",
            "description": "Cities and counties to query. Each entry is one open-data portal (Socrata, CKAN, ArcGIS or Carto). Pick \"All supported jurisdictions\" to crawl every registry entry. Each jurisdiction crawled is one paid event; see the README table for source, freshness and update frequency per jurisdiction.",
            "items": {
              "type": "string",
              "enum": [
                "all",
                "nyc",
                "chicago",
                "los-angeles",
                "san-francisco",
                "seattle",
                "austin",
                "philadelphia",
                "boston",
                "washington-dc",
                "miami-dade-county",
                "maricopa-county-az",
                "nashville",
                "detroit",
                "raleigh",
                "baltimore",
                "cincinnati",
                "pittsburgh",
                "louisville",
                "memphis",
                "new-orleans",
                "tucson",
                "buffalo",
                "orlando",
                "montgomery-county-md-residential",
                "montgomery-county-md-commercial",
                "cambridge-ma"
              ],
              "enumTitles": [
                "All supported jurisdictions",
                "New York City, NY (DOB NOW approved permits)",
                "Chicago, IL",
                "Los Angeles, CA",
                "San Francisco, CA",
                "Seattle, WA",
                "Austin, TX",
                "Philadelphia, PA",
                "Boston, MA",
                "Washington, DC",
                "Miami-Dade County, FL (unincorporated + county-permitted)",
                "Maricopa County, AZ (unincorporated)",
                "Nashville / Davidson County, TN",
                "Detroit, MI",
                "Raleigh, NC",
                "Baltimore, MD",
                "Cincinnati, OH",
                "Pittsburgh, PA",
                "Louisville / Jefferson County, KY",
                "Memphis / Shelby County, TN",
                "New Orleans, LA",
                "Tucson, AZ (residential permits)",
                "Buffalo, NY",
                "Orlando, FL",
                "Montgomery County, MD (residential)",
                "Montgomery County, MD (commercial)",
                "Cambridge, MA (addition / alteration permits)"
              ]
            },
            "default": [
              "chicago",
              "seattle"
            ]
          },
          "issuedWithinDays": {
            "title": "Issued within (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Only permits whose issued date falls in the last N days (1–3650). Applied server-side on every portal that supports it, so narrow windows are fast and cheap.",
            "default": 30
          },
          "permitTypes": {
            "title": "Permit type keywords (optional)",
            "type": "array",
            "description": "Keep only permits whose type or subtype contains one of these words, case-insensitive (for example \"electrical\", \"roof\", \"solar\", \"demolition\", \"new construction\"). Each portal uses its own type vocabulary, so prefer generic words. Applied server-side where the API allows, otherwise client-side.",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "title": "Work description keyword (optional)",
            "type": "string",
            "description": "Keep only permits whose work description contains this text, case-insensitive (for example \"solar\", \"re-roof\", \"kitchen\", \"ADU\"). Applied server-side where the API allows, otherwise client-side."
          },
          "minEstimatedCost": {
            "title": "Minimum estimated cost (USD, optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop permits whose declared valuation / estimated cost is below this amount. Permits with no published cost are kept (cost is null) so you do not silently lose jurisdictions that do not publish valuations."
          },
          "maxResultsPerJurisdiction": {
            "title": "Max permits per jurisdiction",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Upper bound on permit records saved per jurisdiction per run (newest first). Use it together with the run's maximum cost to control spend.",
            "default": 1000
          },
          "onlyNewSinceLastRun": {
            "title": "Only new permits since last run",
            "type": "boolean",
            "description": "Monitor mode for schedules: remember the permit numbers already seen per jurisdiction (up to 50,000 each) in the state store and emit only permits not seen before, flagged isNew: true. The first run is a baseline and emits (and charges for) everything in the window.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that holds the seen-permit sets for monitor mode. Use a different name per schedule if two schedules query the same jurisdiction with different filters.",
            "default": "building-permits-scraper-state"
          },
          "includeRaw": {
            "title": "Include raw source record",
            "type": "boolean",
            "description": "Attach the untouched source row as \"raw\" on every permit, so you can read jurisdiction-specific fields (fees, units, zoning, inspector...) that the normalized schema does not carry. Roughly doubles dataset size.",
            "default": false
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free Socrata application token (sign up on any data.*.gov portal → Developer Settings). Raises the per-IP rate limit for the Socrata-backed jurisdictions. Works without it. Stored encrypted and never logged."
          },
          "webhookUrl": {
            "title": "Webhook URL (optional)",
            "pattern": "^https?://.+",
            "type": "string",
            "description": "If set, the Actor POSTs a JSON run summary plus the emitted permits (max 500; only the new ones in monitor mode) to this URL when it finishes. Failures are logged, never fatal."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}