{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits Scraper - 16 Cities, Contractor Leads",
    "description": "Issued building permits from 16 official US city open-data portals (NYC, Chicago, LA, SF, Austin, Denver, DC...) in one clean schema. Filter by trade, value and date; only-new mode for leads.",
    "version": "0.1",
    "x-build-id": "GBsjtbxwSCdGnFZER"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/onomatopoeia_dev~building-permits-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-onomatopoeia_dev-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/onomatopoeia_dev~building-permits-scraper/runs": {
      "post": {
        "operationId": "runs-sync-onomatopoeia_dev-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/onomatopoeia_dev~building-permits-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-onomatopoeia_dev-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": "One or more cities or counties. Every city's permits come out in the same normalized columns.",
            "items": {
              "type": "string",
              "enum": [
                "new-york",
                "chicago",
                "los-angeles",
                "san-francisco",
                "seattle",
                "austin",
                "philadelphia",
                "denver",
                "washington-dc",
                "columbus",
                "las-vegas",
                "new-orleans",
                "baton-rouge",
                "cincinnati",
                "montgomery-county-md",
                "mesa"
              ],
              "enumTitles": [
                "New York City, NY",
                "Chicago, IL",
                "Los Angeles, CA",
                "San Francisco, CA",
                "Seattle, WA",
                "Austin, TX",
                "Philadelphia, PA",
                "Denver, CO",
                "Washington, DC",
                "Columbus, OH",
                "Las Vegas, NV",
                "New Orleans, LA",
                "Baton Rouge, LA",
                "Cincinnati, OH",
                "Montgomery County, MD",
                "Mesa, AZ"
              ]
            },
            "default": [
              "new-york",
              "chicago",
              "los-angeles"
            ]
          },
          "issuedAfter": {
            "title": "Issued on or after",
            "type": "string",
            "description": "Only permits issued on or after this date. Use a date (`2026-01-31`) or a relative value such as `7 days`, `2 weeks` or `3 months` (counted back from today). Leave empty for the last 12 months."
          },
          "issuedBefore": {
            "title": "Issued on or before",
            "type": "string",
            "description": "Only permits issued on or before this date (same formats). Leave empty for up to today."
          },
          "trades": {
            "title": "Trades / project types",
            "type": "array",
            "description": "Keep permits tagged with any of these trades. Tags come from the permit type and work description, so they work the same in every city (for example `solar` finds \"PV system\", \"roof mounted solar panels\" and \"22.8 KW\").",
            "items": {
              "type": "string",
              "enum": [
                "roofing",
                "solar",
                "hvac",
                "electrical",
                "plumbing",
                "new-construction",
                "addition-alteration",
                "demolition",
                "pool",
                "fence",
                "sign",
                "windows-doors",
                "fire-protection",
                "ev-charging",
                "adu",
                "deck-patio",
                "foundation-structural",
                "elevator"
              ],
              "enumTitles": [
                "Roofing",
                "Solar / PV",
                "HVAC / mechanical",
                "Electrical",
                "Plumbing",
                "New construction",
                "Addition / alteration / remodel",
                "Demolition",
                "Pool / spa",
                "Fence / wall",
                "Signs",
                "Windows / doors / siding",
                "Fire protection",
                "EV charging",
                "ADU / accessory dwelling",
                "Deck / patio / porch",
                "Foundation / structural",
                "Elevator"
              ]
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep permits whose type, description, contractor or address contains any of these words (case-insensitive), for example `kitchen`, `tenant improvement`, `Tesla`.",
            "items": {
              "type": "string"
            }
          },
          "permitTypes": {
            "title": "Permit type contains",
            "type": "array",
            "description": "Keep permits whose permit type, subtype or work class contains any of these texts (case-insensitive), for example `new building`, `electrical`, `demolition`.",
            "items": {
              "type": "string"
            }
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "any",
              "residential",
              "commercial"
            ],
            "type": "string",
            "description": "Residential or commercial only. Uses the city's own residential/commercial field when it has one, otherwise the permit text. Permits that cannot be classified are left out when you choose one.",
            "default": "any"
          },
          "minValue": {
            "title": "Minimum project value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only permits with a declared project value / valuation at or above this amount. Permits without a value are left out when set. Leave empty for no minimum."
          },
          "maxValue": {
            "title": "Maximum project value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only permits with a project value at or below this amount. Leave empty for no maximum."
          },
          "contractorRequired": {
            "title": "Only permits with a contractor name",
            "type": "boolean",
            "description": "Leave out permits where the city does not publish a contractor or permittee company.",
            "default": false
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Keep permits in these ZIP codes. A prefix works too (`787` = all of 787xx).",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new permits since the last run",
            "type": "boolean",
            "description": "Lead-alert mode for scheduled runs: each permit is delivered (and billed) once. The Actor remembers what it delivered in a named key-value store in your account and re-checks the last 14 days, because cities publish some permits late. The first run looks back to \"Issued on or after\" or 30 days.",
            "default": false
          },
          "stateKey": {
            "title": "Memory name for \"only new\"",
            "type": "string",
            "description": "Use a different name for each saved search or schedule (for example `austin-solar`), so separate searches do not share memory.",
            "default": "default"
          },
          "maxItems": {
            "title": "Maximum permits (all cities)",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many permits in total. Every permit row is one billed item.",
            "default": 100
          },
          "maxItemsPerCity": {
            "title": "Maximum permits per city",
            "minimum": 1,
            "type": "integer",
            "description": "Optional cap per city, so one big city cannot use the whole budget. Leave empty to share the total limit."
          },
          "maxScannedPerCity": {
            "title": "Maximum records scanned per city",
            "minimum": 100,
            "maximum": 500000,
            "type": "integer",
            "description": "Safety limit for narrow filters: stop looking after this many permits per city (filtered-out permits are free). Default 25,000.",
            "default": 25000
          },
          "includeRawRecord": {
            "title": "Include the original record",
            "type": "boolean",
            "description": "Add the city's original record as `raw` (phone, e-mail, owner name and owner mailing-address fields removed). Useful when you need a city-specific column.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}