{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits Scraper: Construction Leads, 17 Cities",
    "description": "New building permits from official open-data portals of Chicago, New York, Los Angeles, San Francisco, Seattle, Austin and 11 more US cities and counties in one schema: type, work tags, value, address, dates and contractor company. Value filters and an only-new mode for daily lead alerts.",
    "version": "0.1",
    "x-build-id": "fnca84hRM17f4r27S"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/latamdatatools~us-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-latamdatatools-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/latamdatatools~us-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-latamdatatools-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/latamdatatools~us-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-latamdatatools-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": {
          "sources": {
            "title": "Cities / counties",
            "type": "array",
            "description": "Official open-data portals to read (Socrata API of each city or county).",
            "items": {
              "type": "string",
              "enum": [
                "chicago",
                "new-york-city",
                "los-angeles",
                "san-francisco",
                "seattle",
                "austin",
                "cincinnati",
                "norfolk",
                "montgomery-county-md",
                "cambridge",
                "marin-county",
                "corona",
                "baton-rouge",
                "new-orleans",
                "mesa",
                "buffalo",
                "orlando"
              ],
              "enumTitles": [
                "Chicago, IL",
                "New York City, NY (DOB NOW)",
                "Los Angeles, CA",
                "San Francisco, CA",
                "Seattle, WA",
                "Austin, TX",
                "Cincinnati, OH",
                "Norfolk, VA",
                "Montgomery County, MD",
                "Cambridge, MA",
                "Marin County, CA",
                "Corona, CA",
                "Baton Rouge (East Baton Rouge Parish), LA",
                "New Orleans, LA",
                "Mesa, AZ",
                "Buffalo, NY",
                "Orlando, FL"
              ]
            },
            "default": [
              "chicago",
              "new-york-city",
              "los-angeles",
              "seattle",
              "austin"
            ]
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Permits issued in the last N days (0 = today only). Ignored when \"Issued from\" is set, and on \"only new\" runs after the first one. Cities publish with a 1-5 day lag.",
            "default": 7
          },
          "dateFrom": {
            "title": "Issued from (optional)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD. Maximum range 366 days per run."
          },
          "dateTo": {
            "title": "Issued to (optional)",
            "pattern": "^(\\d{4}-\\d{2}-\\d{2})?$",
            "type": "string",
            "description": "YYYY-MM-DD. Default: today."
          },
          "minValue": {
            "title": "Minimum project value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep permits whose declared job value is at least this amount."
          },
          "maxValue": {
            "title": "Maximum project value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep permits whose declared job value is at most this amount."
          },
          "includeWithoutValue": {
            "title": "Keep permits without a value",
            "type": "boolean",
            "description": "Some cities do not publish a value for every permit (Austin trade permits, for example). Turn on to keep those when you set a minimum or maximum value.",
            "default": false
          },
          "propertyClass": {
            "title": "Property type",
            "enum": [
              "any",
              "residential",
              "commercial"
            ],
            "type": "string",
            "description": "Residential or commercial comes from the class field of the city when it has one, otherwise from the permit type and use. Permits that cannot be classified are dropped by this filter.",
            "default": "any"
          },
          "workTags": {
            "title": "Work tags",
            "type": "array",
            "description": "Keep permits with ANY of these tags (derived from permit type and description).",
            "items": {
              "type": "string",
              "enum": [
                "new-construction",
                "addition-alteration",
                "demolition",
                "roofing",
                "solar",
                "electrical",
                "plumbing",
                "mechanical-hvac",
                "pool",
                "sign",
                "fence",
                "ev-charger",
                "adu",
                "windows-doors",
                "fire-protection",
                "elevator"
              ],
              "enumTitles": [
                "New construction",
                "Addition / alteration / remodel",
                "Demolition",
                "Roofing",
                "Solar / PV",
                "Electrical",
                "Plumbing",
                "Mechanical / HVAC",
                "Pool / spa",
                "Sign",
                "Fence",
                "EV charger",
                "ADU",
                "Windows / doors",
                "Fire protection",
                "Elevator"
              ]
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep permits where ANY keyword appears in the type, work class, description or contractor (case insensitive).",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new permits (incremental)",
            "type": "boolean",
            "description": "Remember what was delivered and return only permits not seen in earlier runs with the same alert name. Ideal for a daily schedule.",
            "default": false
          },
          "alertName": {
            "title": "Alert name",
            "type": "string",
            "description": "Separate memory per alert, so several schedules with different filters do not interfere.",
            "default": "default"
          },
          "maxItems": {
            "title": "Max permits per run",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Stop after this many permits in total.",
            "default": 1000
          },
          "maxItemsPerSource": {
            "title": "Max permits per city (0 = no limit)",
            "minimum": 0,
            "type": "integer",
            "description": "Cap per city or county.",
            "default": 0
          },
          "maxPagesPerSource": {
            "title": "Max pages per city",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "1 page = 1,000 permits read from the portal (before your filters).",
            "default": 30
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Free token from any Socrata portal (Developer settings). Only needed for very large pulls; the public API works without it."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}