{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permits Tracker (15 US Cities, Trade Filters)",
    "description": "New building permits from 15 US city open-data portals (NYC, LA, Chicago, SF, Seattle, DC, Denver and more) with trade category (roofing, solar, HVAC...), valuation and contractor business. New-permit alerts. No owner or applicant names. Unofficial; not affiliated with the cities.",
    "version": "0.3",
    "x-build-id": "Ut7rdRjfgexDgfiRZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/signalloom~building-permits-tracker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-signalloom-building-permits-tracker",
        "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/signalloom~building-permits-tracker/runs": {
      "post": {
        "operationId": "runs-sync-signalloom-building-permits-tracker",
        "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/signalloom~building-permits-tracker/run-sync": {
      "post": {
        "operationId": "run-sync-signalloom-building-permits-tracker",
        "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": "Which city portals to read. NYC = New York City DOB NOW, CHI = Chicago, AUS = Austin, BUF = Buffalo, LA = Los Angeles (refreshed weekly: use a look-back of 10+ days), SF = San Francisco, SEA = Seattle, NOLA = New Orleans, CIN = Cincinnati, MESA = Mesa AZ, NOR = Norfolk VA, DC = Washington DC (last 30 days only), MSP = Minneapolis, RAL = Raleigh (last 31 days only), DEN = Denver. Buffalo is skipped when 'New construction only' is on. Default: the first four.",
            "items": {
              "type": "string",
              "enum": [
                "NYC",
                "CHI",
                "AUS",
                "BUF",
                "LA",
                "SF",
                "SEA",
                "NOLA",
                "CIN",
                "MESA",
                "NOR",
                "DC",
                "MSP",
                "RAL",
                "DEN"
              ],
              "enumTitles": [
                "New York City",
                "Chicago",
                "Austin",
                "Buffalo",
                "Los Angeles",
                "San Francisco",
                "Seattle",
                "New Orleans",
                "Cincinnati",
                "Mesa, AZ",
                "Norfolk, VA",
                "Washington, DC",
                "Minneapolis",
                "Raleigh",
                "Denver"
              ]
            },
            "default": [
              "NYC",
              "CHI",
              "AUS",
              "BUF"
            ]
          },
          "lookbackDays": {
            "title": "Look-back window (days)",
            "minimum": 1,
            "maximum": 31,
            "type": "integer",
            "description": "Read permits issued in the last N days (1-31). Keep it at least as long as the gap between your runs.",
            "default": 3
          },
          "newConstructionOnly": {
            "title": "New construction only",
            "type": "boolean",
            "description": "Keep only permits for new construction. NYC: jobs filed as 'New Building' in DOB NOW. Chicago: permit type 'New Construction'. Austin: a Building Permit with work class 'New'.",
            "default": false
          },
          "minValuation": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only permits whose reported job cost is at least this much. 0 = no minimum. Permits with no reported value are dropped when a minimum is set.",
            "default": 0
          },
          "permitTypes": {
            "title": "Permit / work types",
            "type": "array",
            "description": "Only keep permits whose permit type or work type contains one of these texts, e.g. Plumbing, Demolition, Solar. Empty = all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "tradeCategories": {
            "title": "Trade categories",
            "type": "array",
            "description": "Only keep permits whose tradeCategory is one of these (roofing, solar, HVAC, plumbing, electrical, pool, demolition, new construction, addition / remodel, signage, other). The category is derived from the permit type and work description with a fixed keyword list. Empty = all.",
            "items": {
              "type": "string",
              "enum": [
                "roofing",
                "solar",
                "hvac",
                "plumbing",
                "electrical",
                "pool",
                "demolition",
                "new_construction",
                "addition_remodel",
                "signage",
                "other"
              ],
              "enumTitles": [
                "Roofing",
                "Solar",
                "HVAC / mechanical",
                "Plumbing / gas",
                "Electrical",
                "Pool / spa",
                "Demolition",
                "New construction",
                "Addition / remodel",
                "Signage",
                "Other"
              ]
            },
            "default": []
          },
          "includeRenewals": {
            "title": "Include NYC renewals",
            "type": "boolean",
            "description": "NYC re-issues permits on renewal. Off (default): renewal permits are skipped so only initial permits are output.",
            "default": false
          },
          "onlyNew": {
            "title": "Only new permits",
            "type": "boolean",
            "description": "On (default): output only permits that were not in the previous run's state. Off: also output permits whose published fields changed (for example a status change).",
            "default": true
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "changes",
              "snapshot"
            ],
            "type": "string",
            "description": "'changes' = compare with the previous run (the first run stores a baseline). 'snapshot' = output everything in the look-back window; never touches the stored state.",
            "default": "changes"
          },
          "emitBaselineRows": {
            "title": "Output rows on the first run",
            "type": "boolean",
            "description": "On the first run (or after the filters change) nothing can be compared yet. On (default): output the window's permits as 'baseline' rows. Off: only store the baseline.",
            "default": true
          },
          "redactIndividualNames": {
            "title": "(Deprecated) Withhold individual names",
            "type": "boolean",
            "description": "Deprecated and ignored: output is always business-only. A contractor name is kept only if it looks like a business (Inc, LLC, Construction, Plumbing...); otherwise contractorBusinessName is null and contractorBusinessNameWithheld is true.",
            "default": true
          },
          "maxItems": {
            "title": "Max output rows",
            "minimum": 0,
            "type": "integer",
            "description": "Cap on rows pushed to the dataset (0 = no cap).",
            "default": 500
          },
          "newConstructionLookbackDays": {
            "title": "NYC: new-building look-back (days)",
            "minimum": 30,
            "maximum": 1825,
            "type": "integer",
            "description": "NYC permits are matched to 'New Building' jobs filed in this many days (30-1825). Longer = fewer missed new-construction flags, a few more requests.",
            "default": 1095
          },
          "stateStoreName": {
            "title": "State key-value store name",
            "type": "string",
            "description": "Named key-value store that holds the previous run's state. The default run store is erased with each run, so a named store is needed for change detection (it is created on first use).",
            "default": "building-permits-state"
          },
          "commitState": {
            "title": "Save state after this run",
            "type": "boolean",
            "description": "Untick for a dry run that leaves the stored state untouched.",
            "default": true
          },
          "sourceRowLimit": {
            "title": "Testing: max rows read per city",
            "minimum": 0,
            "type": "integer",
            "description": "0 = read the whole look-back window. Set a small number only for tests; part of the state signature, so changing it starts a new baseline.",
            "default": 0
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 1000,
            "type": "integer",
            "description": "Pause between requests to the city portals. Minimum 1000 (the portals declare Crawl-delay: 1).",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}