{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits Scraper: Construction Leads",
    "description": "Building permits scraper for 25 US city and county open-data portals, including New York City, Los Angeles, Chicago, Miami and Austin. Building permit data with type, trade, valuation, address and contractor. Contractor leads for roofing, solar and HVAC. Monitor mode returns new permits.",
    "version": "0.1",
    "x-build-id": "3Rebw12AhAaLVRmDz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/maliksaid~us-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-maliksaid-us-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/maliksaid~us-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-maliksaid-us-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/maliksaid~us-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-maliksaid-us-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",
        "properties": {
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Cities and counties to read. Leave the field out to read the first ten (New York City to Baton Rouge). Clear the list to read all 28.",
            "items": {
              "type": "string",
              "enum": [
                "nyc",
                "chicago",
                "la",
                "sf",
                "austin",
                "seattle",
                "boston",
                "neworleans",
                "cincinnati",
                "batonrouge",
                "miami",
                "nashville",
                "detroit",
                "louisville",
                "memphis",
                "orlando",
                "mesa",
                "norfolk",
                "everett",
                "corona",
                "collegestation",
                "marincounty",
                "montgomerymd",
                "montgomerymdcommercial",
                "piercecounty",
                "philadelphia",
                "raleigh",
                "washingtondc"
              ],
              "enumTitles": [
                "New York City, NY",
                "Chicago, IL",
                "Los Angeles, CA",
                "San Francisco, CA",
                "Austin, TX",
                "Seattle, WA",
                "Boston, MA",
                "New Orleans, LA",
                "Cincinnati, OH",
                "Baton Rouge, LA",
                "Miami, FL",
                "Nashville, TN",
                "Detroit, MI",
                "Louisville, KY",
                "Memphis, TN",
                "Orlando, FL",
                "Mesa, AZ",
                "Norfolk, VA",
                "Everett, WA",
                "Corona, CA",
                "College Station, TX",
                "Marin County, CA (unincorporated)",
                "Montgomery County, MD (residential)",
                "Montgomery County, MD (commercial)",
                "Pierce County, WA (unincorporated)",
                "Philadelphia, PA",
                "Raleigh, NC",
                "Washington, DC"
              ]
            },
            "default": [
              "nyc",
              "chicago",
              "la",
              "sf",
              "austin",
              "seattle",
              "boston",
              "neworleans",
              "cincinnati",
              "batonrouge"
            ]
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Read permits issued in the last N days. Ignored when Issued from is set.",
            "default": 7
          },
          "dateFrom": {
            "title": "Issued from",
            "type": "string",
            "description": "Earliest issue date, YYYY-MM-DD. Overrides Days back."
          },
          "dateTo": {
            "title": "Issued to",
            "type": "string",
            "description": "Latest issue date, YYYY-MM-DD. Leave empty for today."
          },
          "permitTypes": {
            "title": "Permit types or trades",
            "type": "array",
            "description": "Keep permits whose type or work class contains one of these words, for example electrical, plumbing, demolition, solar. A word matches the start of a word, so roof matches roofing. Leave empty to keep every type.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tradeCategories": {
            "title": "Trade categories",
            "type": "array",
            "description": "Keep permits in at least one of these trade categories. The Actor sets the category from the permit type, work class and description, so it works the same way in every city. Leave empty to keep every trade.",
            "items": {
              "type": "string",
              "enum": [
                "roofing",
                "solar",
                "hvac",
                "electrical",
                "plumbing",
                "new-construction",
                "addition-remodel",
                "demolition",
                "pool",
                "fence",
                "sign",
                "fire-protection",
                "other"
              ],
              "enumTitles": [
                "Roofing",
                "Solar",
                "HVAC and mechanical",
                "Electrical",
                "Plumbing and gas",
                "New construction",
                "Addition, alteration or remodel",
                "Demolition",
                "Pool or spa",
                "Fence",
                "Sign",
                "Fire sprinkler or alarm",
                "Other"
              ]
            },
            "default": []
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep permits whose description, type, work class or contractor contains one of these words. Leave empty to keep every permit.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minValuation": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep permits with a declared project value of at least this amount. Permits without a value are dropped when this is above 0.",
            "default": 0
          },
          "maxValuation": {
            "title": "Maximum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep permits with a declared project value of at most this amount. Permits without a value are dropped when this is above 0. Set 0 for no maximum.",
            "default": 0
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Keep permits whose ZIP code starts with one of these values, for example 94110 or 941. Permits without a ZIP code are dropped when this list is set. Leave empty to keep every ZIP code.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "monitorMode": {
            "title": "Monitor mode (only new permits)",
            "type": "boolean",
            "description": "Return only permits that earlier monitor-mode runs with the same monitor name did not return. Schedule the Actor daily with this on to get a feed of new permits.",
            "default": false
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name of the memory that monitor mode uses. Use a different name for each separate watch list. Inputs that still send the old field `stateKey` keep working.",
            "default": "default"
          },
          "maxItems": {
            "title": "Maximum permits",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after saving this many permits. The limit is shared evenly across the selected cities. Set 0 for no limit.",
            "default": 100
          },
          "maxPagesPerCity": {
            "title": "Maximum pages per city",
            "minimum": 0,
            "type": "integer",
            "description": "Each page holds up to 1,000 permits. 0 means all pages.",
            "default": 0
          },
          "customSources": {
            "title": "Your own Socrata permit datasets",
            "type": "array",
            "description": "Optional. Read a permit dataset from any Socrata open-data portal that ends in .gov, .org or .us. Each entry needs name, domain, dataset (the four-four ID), dateField (the issue date column) and fields.permitNumber. Optional fields map our names to the dataset's columns: permitType, description, valuation, address, zipCode, latitude, longitude, contractorName, status. Columns with owner, applicant, phone, email, contact or tenant in the name are refused. Rows get city \"custom-<name>\". When you add custom sources and leave Cities out, only the custom sources are read.",
            "default": []
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. The city open-data APIs do not need a proxy.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}