{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permits Feed: New US City Permits Daily",
    "description": "New building permits from 23 US city and county open-data feeds (NYC, LA, Chicago, SF, Austin, Seattle, DC and more) in one normalized schema, with a new-since-last-run mode and filters for trade (solar, roofing, HVAC, pool), valuation and contractor.",
    "version": "0.1",
    "x-build-id": "ts97BQbPBJthziFIi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/longlever~building-permits-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-longlever-building-permits-feed",
        "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/longlever~building-permits-feed/runs": {
      "post": {
        "operationId": "runs-sync-longlever-building-permits-feed",
        "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/longlever~building-permits-feed/run-sync": {
      "post": {
        "operationId": "run-sync-longlever-building-permits-feed",
        "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 and county permit feeds to check. Leave empty to check all of them.",
            "items": {
              "type": "string",
              "enum": [
                "new-york-city",
                "los-angeles",
                "chicago",
                "san-francisco",
                "austin",
                "seattle",
                "new-orleans",
                "cincinnati",
                "baton-rouge",
                "norfolk",
                "montgomery-county-md-residential",
                "montgomery-county-md-commercial",
                "mesa",
                "kansas-city",
                "marin-county",
                "nashville",
                "columbus",
                "fort-worth",
                "baltimore",
                "cleveland",
                "detroit",
                "miami-dade-county",
                "washington-dc"
              ],
              "enumTitles": [
                "New York, NY",
                "Los Angeles, CA",
                "Chicago, IL",
                "San Francisco, CA",
                "Austin, TX",
                "Seattle, WA",
                "New Orleans, LA",
                "Cincinnati, OH",
                "Baton Rouge (East Baton Rouge Parish), LA",
                "Norfolk, VA",
                "Montgomery County, MD (residential)",
                "Montgomery County, MD (commercial)",
                "Mesa, AZ",
                "Kansas City, MO",
                "Marin County, CA",
                "Nashville, TN",
                "Columbus, OH",
                "Fort Worth, TX (new applications)",
                "Baltimore, MD",
                "Cleveland, OH",
                "Detroit, MI",
                "Miami-Dade County, FL",
                "Washington, DC"
              ]
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "snapshot",
              "new"
            ],
            "type": "string",
            "description": "Snapshot returns every matching permit issued in the lookback window. New returns only permits not returned by an earlier run with the same filters (schedule this daily).",
            "default": "snapshot"
          },
          "daysBack": {
            "title": "Lookback window (days)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "Permits issued within this many days. In New mode the whole window is rechecked every run, so permits a city publishes a few days late are still caught. 7 suits a daily schedule.",
            "default": 7
          },
          "trades": {
            "title": "Trades (any)",
            "type": "array",
            "description": "Keep permits tagged with any of these trades. Tags come from the permit type and work description.",
            "items": {
              "type": "string",
              "enum": [
                "solar",
                "battery_storage",
                "ev_charger",
                "generator",
                "roofing",
                "hvac",
                "pool",
                "electrical",
                "plumbing",
                "gas",
                "new_construction",
                "addition",
                "remodel",
                "adu",
                "demolition",
                "fence",
                "sign",
                "fire_protection",
                "windows_doors",
                "siding",
                "foundation",
                "deck_patio",
                "elevator",
                "grading_site",
                "mechanical"
              ],
              "enumTitles": [
                "Solar",
                "Battery storage",
                "EV charger",
                "Generator",
                "Roofing",
                "HVAC",
                "Pool and spa",
                "Electrical",
                "Plumbing",
                "Gas",
                "New construction",
                "Addition",
                "Remodel or alteration",
                "ADU (accessory dwelling unit)",
                "Demolition",
                "Fence",
                "Sign",
                "Fire protection",
                "Windows and doors",
                "Siding",
                "Foundation",
                "Deck, patio or porch",
                "Elevator",
                "Grading and site work",
                "Mechanical (general)"
              ]
            }
          },
          "categories": {
            "title": "Permit categories (any)",
            "type": "array",
            "description": "Keep permits in any of these categories, derived from the permit type.",
            "items": {
              "type": "string",
              "enum": [
                "building",
                "electrical",
                "plumbing",
                "mechanical",
                "demolition",
                "fire",
                "sign",
                "elevator",
                "grading",
                "other"
              ],
              "enumTitles": [
                "Building",
                "Electrical",
                "Plumbing and gas",
                "Mechanical",
                "Demolition",
                "Fire",
                "Sign",
                "Elevator",
                "Grading",
                "Other"
              ]
            }
          },
          "permitTypes": {
            "title": "Permit type contains (any)",
            "type": "array",
            "description": "Keep permits whose type, subtype or work class contains any of these words, for example \"Express\" or \"Single Family\".",
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords (any)",
            "type": "array",
            "description": "Keep permits whose description or type contains any of these (case-insensitive), for example \"tesla\" or \"generator\".",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "type": "array",
            "description": "Drop permits whose description or type contains any of these.",
            "items": {
              "type": "string"
            }
          },
          "minValuation": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep permits with a declared job value at or above this. Permits with no value are dropped when this is set."
          },
          "maxValuation": {
            "title": "Maximum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep permits with a declared job value at or below this."
          },
          "propertyUse": {
            "title": "Property use",
            "enum": [
              "any",
              "residential",
              "commercial"
            ],
            "type": "string",
            "description": "Residential or commercial, where the city publishes it. Mixed-use permits match both.",
            "default": "any"
          },
          "contractors": {
            "title": "Contractor or applicant contains (any)",
            "type": "array",
            "description": "Keep permits whose contractor or applicant name contains any of these, for example a competitor's name.",
            "items": {
              "type": "string"
            }
          },
          "requireContractor": {
            "title": "Only permits that name a contractor",
            "type": "boolean",
            "description": "Drop permits with no contractor name. Not every city publishes contractors (see README).",
            "default": false
          },
          "zipCodes": {
            "title": "ZIP codes (any)",
            "type": "array",
            "description": "Keep permits in these ZIP codes. A prefix like \"787\" matches every ZIP starting with it.",
            "items": {
              "type": "string"
            }
          },
          "maxPermitsPerCity": {
            "title": "Max permits per city (snapshot mode)",
            "minimum": 0,
            "type": "integer",
            "description": "0 means no limit. Newest permits are kept. Ignored in New mode so no permit is ever skipped.",
            "default": 0
          },
          "includeRawRecord": {
            "title": "Include the original record",
            "type": "boolean",
            "description": "Add every field the city publishes, unmodified, under raw. Makes rows larger.",
            "default": false
          },
          "emitBaselineOnFirstRun": {
            "title": "Return the window on the first New-mode run",
            "type": "boolean",
            "description": "On the first run in New mode, return everything in the window. Turn off to only save a baseline, so the first alert carries only truly new permits.",
            "default": true
          },
          "stateKey": {
            "title": "State key (New mode)",
            "type": "string",
            "description": "Optional name for the saved state. By default it is derived from your filters, so changing a filter starts a fresh baseline."
          },
          "maxConcurrency": {
            "title": "Max cities fetched at once",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Requests to each portal are also rate-limited.",
            "default": 6
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}