{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permits Scraper - Permit Data API & Contractor Leads",
    "description": "Find building permits and the contractors who pulled them, e.g. roofing permits in Austin this week. 16 US cities: Austin, San Antonio, NYC DOB, LA, Chicago, Philadelphia, Boston, Seattle, SF, Cincinnati, Baton Rouge, DC, Denver, Nashville, Raleigh, Louisville. Contractor phones: Austin, Raleigh.",
    "version": "0.1",
    "x-build-id": "VJ57tYrHP4xmSfyvi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/make_no_mistakes~us-building-permits-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-make_no_mistakes-us-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/make_no_mistakes~us-building-permits-scraper/runs": {
      "post": {
        "operationId": "runs-sync-make_no_mistakes-us-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/make_no_mistakes~us-building-permits-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-make_no_mistakes-us-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": [
          "cities"
        ],
        "properties": {
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Cities to pull permits from, as lowercase slugs from the allowed list (e.g. austin, new-york, washington-dc). Each is an official city open-data feed refreshed daily. Default: [\"austin\"]. Example: [\"austin\", \"raleigh\"].",
            "items": {
              "type": "string",
              "enum": [
                "austin",
                "san-antonio",
                "new-york",
                "los-angeles",
                "chicago",
                "philadelphia",
                "boston",
                "seattle",
                "san-francisco",
                "cincinnati",
                "baton-rouge",
                "washington-dc",
                "denver",
                "nashville",
                "raleigh",
                "louisville"
              ],
              "enumTitles": [
                "Austin, TX",
                "San Antonio, TX",
                "New York, NY",
                "Los Angeles, CA",
                "Chicago, IL",
                "Philadelphia, PA",
                "Boston, MA",
                "Seattle, WA",
                "San Francisco, CA",
                "Cincinnati, OH",
                "Baton Rouge, LA",
                "Washington, DC",
                "Denver, CO",
                "Nashville, TN",
                "Raleigh, NC",
                "Louisville, KY"
              ]
            },
            "default": [
              "austin"
            ]
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Size of the issued-date window in days, counting back from today (UTC). 0-365. Default: 7 (the last week). Ignored when both startDate and endDate are set. Example: 30.",
            "default": 7
          },
          "startDate": {
            "title": "Start date (optional)",
            "type": "string",
            "description": "Earliest permit issued date to include, YYYY-MM-DD. Overrides daysBack. Optional; leave empty to use daysBack. Example: \"2026-09-01\"."
          },
          "endDate": {
            "title": "End date (optional)",
            "type": "string",
            "description": "Latest permit issued date to include, YYYY-MM-DD. Optional; defaults to today (UTC). Example: \"2026-09-15\"."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of permits returned across all cities combined, and so the spend cap: each permit costs $0.008 plus $0.02 per run, so 100 permits = $0.82 and 1,000 = $8.02. Default: 100, sized to fit Apify's free monthly credit. 0 = unlimited (a wide date range over several cities can return hundreds of thousands of permits). Example: 500.",
            "default": 100
          },
          "permitTypes": {
            "title": "Permit type filter (optional)",
            "type": "string",
            "description": "Comma-separated keywords, case-insensitive. A permit is kept when any keyword appears in its permit type, permit class or work description; use it for trades like roofing, solar, HVAC, pool, demolition. Default: empty = every permit type. Example: \"roof, solar, hvac\"."
          },
          "includeAdministrative": {
            "title": "Include administrative permits",
            "type": "boolean",
            "description": "Default: false. Leave off for construction permits only. Some cities mix non-construction records into the same feed (San Antonio garage sales and tree affidavits, Philadelphia tent and fireworks permits, Baton Rouge business licences and code complaints, DC home-business registrations, Louisville tent permits, Nashville change-contractor records). These have no scope, valuation or contractor and are excluded by default. Example: true to get the full register.",
            "default": false
          },
          "contractorPhoneOnly": {
            "title": "Only permits with a contractor phone number",
            "type": "boolean",
            "description": "Default: false. When true, keep only permits with a contractor phone number, so every row is a dialable lead. Only Austin (~92% of rows) and Raleigh (~80%) publish phones; the other 14 cities return nothing with this on. Filtered before writing, so phoneless permits are never charged and never use up maxItems. Example: true with cities [\"austin\", \"raleigh\"].",
            "default": false
          },
          "onlyNewSinceLastRun": {
            "title": "Only new permits since the last run (delta mode)",
            "type": "boolean",
            "description": "Default: false. Delta mode for scheduled runs: return only permits not returned by a previous run, so you never pay twice for the same permit. State is kept in a named key-value store in your own account (see deltaStateName). The first run behaves like a normal run and records what it returned. Already-delivered permits are dropped before writing and are never charged. Example: true for a daily n8n, Make or cron job.",
            "default": false
          },
          "deltaStateName": {
            "title": "Delta state store name",
            "type": "string",
            "description": "Name of the key-value store in your account that holds delta state. Only used when onlyNewSinceLastRun is true. Use a different name per independent stream (e.g. one per workflow or city group); each name tracks what it has delivered on its own. Default: \"us-building-permits-delta\". Example: \"austin-roofing-leads\".",
            "default": "us-building-permits-delta"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}