{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits - 19 sources, one schema",
    "description": "Building permits from 19 actively-maintained US municipal open-data portals (~11.4M records) normalised into a single schema with one date format, one address field and one currency field.",
    "version": "0.1",
    "x-build-id": "ojHuriPu9jxzmLemz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/formal_sadness_xvx~us-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-formal_sadness_xvx-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/formal_sadness_xvx~us-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-formal_sadness_xvx-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/formal_sadness_xvx~us-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-formal_sadness_xvx-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",
            "type": "array",
            "description": "Which sources to fetch. Defaults to all 19 actively-maintained ones. Dallas and Gainesville are supported but abandoned upstream and excluded unless selected explicitly.",
            "items": {
              "type": "string",
              "enum": [
                "chicago",
                "nyc",
                "seattle",
                "austin",
                "los_angeles",
                "cincinnati",
                "baton_rouge",
                "mesa",
                "cambridge",
                "new_orleans",
                "austin_construction",
                "seattle_electrical",
                "marin_county",
                "montgomery_md",
                "nyc_electrical",
                "seattle_trade",
                "montgomery_residential",
                "montgomery_commercial",
                "montgomery_mechanical",
                "dallas",
                "gainesville"
              ],
              "enumTitles": [
                "Chicago, IL (~842k)",
                "New York City, NY (~4.0M) - no valuation",
                "Seattle, WA (~191k)",
                "Austin, TX (~285k)",
                "Los Angeles, CA (~403k)",
                "Cincinnati, OH (~178k)",
                "Baton Rouge, LA (~142k)",
                "Mesa, AZ (~155k) - date approximate",
                "Cambridge, MA (~14k)",
                "New Orleans, LA (~460k)",
                "Austin (all trades), TX (~2.4M)",
                "Seattle (electrical), WA (~498k)",
                "Marin County, CA (~50k)",
                "Montgomery County, MD (~319k) - no valuation",
                "New York City (electrical), NY (~580k) - no valuation",
                "Seattle (trade), WA (~284k)",
                "Montgomery County (residential), MD (~185k)",
                "Montgomery County (commercial), MD (~41k)",
                "Montgomery County (mechanical), MD (~157k) - no valuation",
                "Dallas, TX - STALE, ends 2020",
                "Gainesville, FL - STALE, ends 2023"
              ]
            }
          },
          "issuedAfter": {
            "title": "Issued after",
            "type": "string",
            "description": "Only permits issued on or after this date (YYYY-MM-DD)."
          },
          "issuedBefore": {
            "title": "Issued before",
            "type": "string",
            "description": "Only permits issued on or before this date (YYYY-MM-DD)."
          },
          "permitTypeContains": {
            "title": "Permit type contains",
            "type": "string",
            "description": "Case-insensitive substring match on permit type, e.g. 'solar', 'roof', 'electrical'. Applied server-side where the city exposes a permit_type column; skipped for cities that do not."
          },
          "search": {
            "title": "Keyword search",
            "type": "string",
            "description": "Case-insensitive substring match across description, type, address, contractor and applicant."
          },
          "minProjectValue": {
            "title": "Minimum project value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Excludes permits below this declared value. NOTE: records where the city publishes no valuation are excluded too - NYC and Mesa publish none at all, so setting this drops them entirely."
          },
          "requireAddress": {
            "title": "Require a street address",
            "type": "boolean",
            "description": "Drop records with no resolvable street address.",
            "default": false
          },
          "maxResultsPerCity": {
            "title": "Max results per city",
            "minimum": 1,
            "type": "integer",
            "description": "Caps results from each city. Leave empty for no limit."
          },
          "maxResults": {
            "title": "Max results total",
            "minimum": 1,
            "type": "integer",
            "description": "Hard cap across all cities. Use this to bound cost."
          },
          "includeRawRecord": {
            "title": "Include raw source record",
            "type": "boolean",
            "description": "Attach the original municipal record under `raw`, so nothing is lost to normalisation.",
            "default": false
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "A free Socrata app token raises rate limits from the shared anonymous pool. Only worth setting for large multi-city sweeps."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}