{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits API: Construction, Roofing & Solar Leads",
    "description": "Newly issued building permits from 38 official US city & county open-data APIs (Chicago, NYC, LA, Boston, Philadelphia, Denver, Nashville, Austin, Seattle...). Filter by date, cost, ZIP, keyword and lead category: roofing, solar, HVAC, pool, ADU, new construction. Only-new mode for daily lead feeds.",
    "version": "1.0",
    "x-build-id": "0UfpofgvwjXexj26d"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/spriggs-data~us-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-spriggs-data-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/spriggs-data~us-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-spriggs-data-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/spriggs-data~us-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-spriggs-data-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 / counties",
            "type": "array",
            "description": "Which official open-data portals to pull. Leave empty and use States or All sources instead if you prefer.",
            "items": {
              "type": "string",
              "enum": [
                "chicago",
                "nyc",
                "los-angeles",
                "austin",
                "san-francisco",
                "seattle",
                "cincinnati",
                "baton-rouge",
                "mesa",
                "marin-county",
                "corona",
                "montgomery-county-md",
                "montgomery-county-md-commercial",
                "cambridge-ma",
                "cambridge-ma-new-construction",
                "cambridge-ma-solar",
                "new-orleans",
                "norfolk",
                "college-station",
                "everett",
                "pierce-county",
                "san-diego-county",
                "prince-georges-county-md",
                "collin-county-tx",
                "urbana",
                "rockford",
                "raleigh",
                "columbus",
                "maricopa-county",
                "wake-county",
                "charlotte",
                "detroit",
                "boston",
                "philadelphia",
                "san-antonio",
                "nashville",
                "denver",
                "denver-commercial"
              ],
              "enumTitles": [
                "Chicago, IL",
                "New York City, NY (DOB NOW)",
                "Los Angeles, CA",
                "Austin, TX",
                "San Francisco, CA",
                "Seattle, WA",
                "Cincinnati, OH",
                "East Baton Rouge Parish, LA",
                "Mesa, AZ",
                "Marin County, CA (unincorporated)",
                "Corona, CA",
                "Montgomery County, MD (residential)",
                "Montgomery County, MD (commercial)",
                "Cambridge, MA (additions/alterations)",
                "Cambridge, MA (new construction)",
                "Cambridge, MA (solar installations)",
                "New Orleans, LA",
                "Norfolk, VA",
                "College Station, TX",
                "Everett, WA",
                "Pierce County, WA (unincorporated)",
                "San Diego County, CA (unincorporated)",
                "Prince George's County, MD",
                "Collin County, TX (all cities, via Collin CAD)",
                "Urbana, IL",
                "Rockford, IL",
                "Raleigh, NC",
                "Columbus, OH",
                "Maricopa County, AZ (unincorporated)",
                "Wake County, NC",
                "Charlotte / Mecklenburg County, NC",
                "Detroit, MI",
                "Boston, MA",
                "Philadelphia, PA",
                "San Antonio, TX",
                "Nashville / Davidson County, TN",
                "Denver, CO (residential)",
                "Denver, CO (commercial)"
              ]
            },
            "default": [
              "chicago",
              "austin",
              "seattle"
            ]
          },
          "states": {
            "title": "States (optional)",
            "type": "array",
            "description": "Two-letter state codes, e.g. IL, TX, CA. Adds every supported city/county in those states.",
            "items": {
              "type": "string"
            }
          },
          "allSources": {
            "title": "All sources",
            "type": "boolean",
            "description": "Pull every supported city and county (currently 35). Combine with a small Max permits per city to keep runs cheap.",
            "default": false
          },
          "daysBack": {
            "title": "Issued in the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Ignored when Date from is set.",
            "default": 7
          },
          "dateFrom": {
            "title": "Date from (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional. Earliest issue date (inclusive)."
          },
          "dateTo": {
            "title": "Date to (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional. Latest issue date (inclusive). Defaults to today."
          },
          "categories": {
            "title": "Lead categories (optional)",
            "type": "array",
            "description": "Keep only permits tagged with at least one of these categories (matched on permit type, work type and description).",
            "items": {
              "type": "string",
              "enum": [
                "solar",
                "roofing",
                "hvac",
                "pool",
                "adu",
                "new_construction",
                "demolition",
                "electrical",
                "plumbing",
                "kitchen_bath",
                "ev_charger",
                "fence",
                "windows_doors"
              ],
              "enumTitles": [
                "Solar / PV",
                "Roofing / re-roof",
                "HVAC / mechanical",
                "Pool / spa",
                "ADU (accessory dwelling unit)",
                "New construction",
                "Demolition",
                "Electrical",
                "Plumbing / water heater",
                "Kitchen & bath",
                "EV charger",
                "Fence",
                "Windows, doors & siding"
              ]
            }
          },
          "keywords": {
            "title": "Keywords (optional)",
            "type": "array",
            "description": "Keep only permits whose type or description contains any of these words (case-insensitive), e.g. \"generator\", \"battery\", \"deck\".",
            "items": {
              "type": "string"
            }
          },
          "minEstimatedCost": {
            "title": "Min estimated job cost (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Permits with a lower or missing job value are skipped.",
            "default": 0
          },
          "zipCodes": {
            "title": "ZIP codes (optional)",
            "type": "array",
            "description": "Keep only permits in these 5-digit ZIP codes.",
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Skip permits this actor already returned in an earlier run with the same filters. Ideal for a daily or weekly schedule (lead feed). State is kept in a named key-value store in your account.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store used by Only new. Use a different name per schedule if you run several independent feeds.",
            "default": "us-building-permits-state"
          },
          "maxItemsPerCity": {
            "title": "Max permits per city",
            "minimum": 1,
            "maximum": 25000,
            "type": "integer",
            "description": "Stop after this many permits per city/county (newest first).",
            "default": 200
          },
          "maxItems": {
            "title": "Max permits in total",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap for the whole run (also caps your cost).",
            "default": 1000
          },
          "includeRaw": {
            "title": "Include raw source record",
            "type": "boolean",
            "description": "Adds the original portal record under raw (all native columns).",
            "default": false
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free token from any Socrata portal for higher rate limits. Not required."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}