{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permits Scraper - Contractor Leads, 23 US Cities",
    "description": "New building permits as they are issued from 23 US city and county open-data portals in one schema: permit, date, type, description, address, valuation, plus the contractor's name, phone, email and license where the city publishes them. Keyword filter, only-new monitor mode. $0.00035 per permit.",
    "version": "0.1",
    "x-build-id": "UT1V7Y66maIu1d4eU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapersdelight~building-permits-leads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapersdelight-building-permits-leads-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/scrapersdelight~building-permits-leads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapersdelight-building-permits-leads-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/scrapersdelight~building-permits-leads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapersdelight-building-permits-leads-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 cities / counties to pull newly issued building permits from. Each is read from that city's own open-data portal. Contractor phone is published by Austin, NYC (DOB BIS), Mesa, Orlando and Raleigh; contractor email by Mesa and Raleigh; contractor name/company by most others (see the README table).",
            "items": {
              "type": "string",
              "enum": [
                "austin",
                "san-francisco",
                "new-york-city",
                "chicago",
                "los-angeles",
                "seattle",
                "boston",
                "philadelphia",
                "washington-dc",
                "raleigh",
                "new-orleans",
                "cincinnati",
                "mesa",
                "orlando",
                "baton-rouge",
                "norfolk",
                "cambridge-ma",
                "montgomery-county-md",
                "prince-georges-county-md",
                "marin-county",
                "college-station",
                "corona",
                "collin-county-tx"
              ],
              "enumTitles": [
                "Austin, TX",
                "San Francisco, CA",
                "New York City, NY (DOB NOW + BIS)",
                "Chicago, IL",
                "Los Angeles, CA",
                "Seattle, WA",
                "Boston, MA",
                "Philadelphia, PA",
                "Washington, DC",
                "Raleigh, NC",
                "New Orleans, LA",
                "Cincinnati, OH",
                "Mesa, AZ",
                "Orlando, FL",
                "Baton Rouge (East Baton Rouge Parish), LA",
                "Norfolk, VA",
                "Cambridge, MA",
                "Montgomery County, MD",
                "Prince George's County, MD",
                "Marin County, CA",
                "College Station, TX",
                "Corona, CA",
                "Collin County, TX (Collin CAD)"
              ]
            },
            "default": [
              "austin",
              "new-york-city",
              "chicago",
              "los-angeles",
              "seattle"
            ]
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 0,
            "maximum": 366,
            "type": "integer",
            "description": "Permits issued from this many days ago through today (each city's own local date). 7 = the last week. Ignored when 'Issued on or after' is set. Max 366.",
            "default": 7
          },
          "sinceDate": {
            "title": "Issued on or after (YYYY-MM-DD)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Optional fixed start date. Overrides 'Days back'."
          },
          "untilDate": {
            "title": "Issued on or before (YYYY-MM-DD)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "Optional end date. Leave empty for today."
          },
          "keywords": {
            "title": "Keywords (any of)",
            "type": "array",
            "description": "Keep only permits whose work description / permit type / work class contains ANY of these words (case-insensitive), e.g. solar, roof, HVAC, pool, ADU, demolition. Filtered on the city's own server, so it is fast and you only pay for matches. Empty = every permit.",
            "items": {
              "type": "string"
            }
          },
          "minValuation": {
            "title": "Minimum job valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only permits with a published job valuation of at least this many dollars. Permits whose city publishes no valuation are dropped when this is set (and never charged). 0 = no minimum.",
            "default": 0
          },
          "contractorFilter": {
            "title": "Contractor filter",
            "enum": [
              "any",
              "named",
              "phoneOrEmail"
            ],
            "type": "string",
            "description": "any = every permit. named = only permits naming a contractor. phoneOrEmail = only permits carrying a contractor phone or email (Austin, NYC BIS, Mesa, Orlando, Raleigh). Removed rows are never charged.",
            "default": "any"
          },
          "onlyNew": {
            "title": "Only new permits (monitor mode)",
            "type": "boolean",
            "description": "Remember every permit delivered (per filter set) and deliver - and charge for - each permit only once across runs. Pair with an Apify Schedule (e.g. daily, Days back = 3) for a new-permit feed.",
            "default": false
          },
          "maxItems": {
            "title": "Max permits",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Stop after this many permits (the charge cap). Split fairly across the selected cities: a quiet city's unused share goes to the others.",
            "default": 100
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional app token for the Socrata portals (most cities here) to raise their rate limit on very large pulls. Not needed for normal runs."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed: every source is a public open-data API. Leave off for a direct connection (fastest, cheapest). A request that fails directly is retried once through an Apify residential proxy automatically.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}