{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permits Scraper: New Construction Leads by City",
    "description": "Returns newly issued building permits from 22 official US open-data portals (NYC, LA, Chicago and more) in one schema: type, value, address, ZIP, coordinates, business contractor and trade tags (solar, roofing, HVAC...). Filter by trade, value and ZIP; only new permits.",
    "version": "0.1",
    "x-build-id": "GcVCx5aPSyLgnoiub"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fedsignals~building-permits-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fedsignals-building-permits-monitor",
        "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/fedsignals~building-permits-monitor/runs": {
      "post": {
        "operationId": "runs-sync-fedsignals-building-permits-monitor",
        "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/fedsignals~building-permits-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-fedsignals-building-permits-monitor",
        "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": "Returns permits from these portals (biggest metros first). Only datasets whose licence or terms allow commercial reuse are offered. Empty = the original five (San Francisco, Seattle, Austin, New Orleans, Boston).",
            "items": {
              "type": "string",
              "enum": [
                "new-york",
                "los-angeles",
                "chicago",
                "san-antonio",
                "san-jose",
                "austin",
                "san-francisco",
                "columbus",
                "seattle",
                "washington-dc",
                "boston",
                "raleigh",
                "minneapolis",
                "mesa",
                "new-orleans",
                "pittsburgh",
                "cincinnati",
                "baton-rouge",
                "tempe",
                "cambridge-ma",
                "montgomery-county-md",
                "new-jersey"
              ],
              "enumTitles": [
                "New York City, NY",
                "Los Angeles, CA",
                "Chicago, IL",
                "San Antonio, TX",
                "San Jose, CA",
                "Austin, TX",
                "San Francisco, CA",
                "Columbus, OH",
                "Seattle, WA",
                "Washington, DC",
                "Boston, MA",
                "Raleigh, NC",
                "Minneapolis, MN",
                "Mesa, AZ",
                "New Orleans, LA",
                "Pittsburgh, PA",
                "Cincinnati, OH",
                "Baton Rouge, LA",
                "Tempe, AZ",
                "Cambridge, MA",
                "Montgomery County, MD",
                "New Jersey (statewide)"
              ]
            },
            "default": [
              "san-francisco",
              "seattle",
              "austin",
              "new-orleans",
              "boston"
            ]
          },
          "daysBack": {
            "title": "Issued in the last N days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Returns permits issued on or after today minus N days. Use 7 with a daily schedule so late-posted permits are caught.",
            "default": 7
          },
          "tradeTags": {
            "title": "Trade tags (any)",
            "type": "array",
            "description": "Returns only permits tagged with any of these trades (from permit type and description keywords). Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "solar",
                "roofing",
                "hvac",
                "electrical",
                "plumbing",
                "ev-charging",
                "pool",
                "adu",
                "demolition",
                "new-construction",
                "kitchen-bath",
                "windows-doors",
                "fire-protection",
                "signage",
                "fence-deck",
                "foundation-structural"
              ]
            },
            "default": []
          },
          "propertyClasses": {
            "title": "Property class",
            "type": "array",
            "description": "Residential, Mixed or Commercial (best-effort label from the city's class, use or occupancy field).",
            "items": {
              "type": "string",
              "enum": [
                "Residential",
                "Mixed",
                "Commercial"
              ]
            },
            "default": []
          },
          "minEstimatedCost": {
            "title": "Minimum project value ($)",
            "type": "integer",
            "description": "Returns only permits with a declared value of at least this many USD. Permits without a value are skipped when set."
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Only these 5-digit ZIP codes.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords (any)",
            "type": "array",
            "description": "Match permit type, work class, description or use.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop permits mentioning any of these.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "onlyNew": {
            "title": "Only new since last run (incremental)",
            "type": "boolean",
            "description": "On: returns only permits not delivered by an earlier run with the same filters. Turn on for scheduled runs.",
            "default": true
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Optional. Separate incremental memory per saved task. Defaults to a hash of your filters."
          },
          "maxItems": {
            "title": "Max permits per run",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum permits returned (and charged) per run.",
            "default": 1000
          },
          "maxPerCity": {
            "title": "Max rows scanned per city",
            "minimum": 1,
            "type": "integer",
            "description": "Safety cap on rows read from each portal per run.",
            "default": 5000
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free Socrata app token for higher rate limits on the Socrata portals."
          },
          "minRequestIntervalSec": {
            "title": "Delay between requests (s)",
            "type": "number",
            "description": "Polite delay between API calls.",
            "default": 0.5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}