{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permits Feed: US City Open Data",
    "description": "Fresh building permits from 25 US city and county open-data portals in one format: permit number, work class (roof, solar, HVAC, pool, ADU, new homes), description, valuation, issue date, address, coordinates, contractor. Date range, filters, only-new mode for daily lead feeds.",
    "version": "1.0",
    "x-build-id": "fwQq4B1dpgZjGMtqx"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sapphire_studio~building-permits-feed/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sapphire_studio-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/sapphire_studio~building-permits-feed/runs": {
      "post": {
        "operationId": "runs-sync-sapphire_studio-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/sapphire_studio~building-permits-feed/run-sync": {
      "post": {
        "operationId": "run-sync-sapphire_studio-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",
        "required": [
          "cities"
        ],
        "properties": {
          "cities": {
            "title": "Cities and counties",
            "minItems": 1,
            "type": "array",
            "description": "The permit datasets to read, one per city or county. Every row carries the city_id, so you can mix several in one run. Unknown entries produce one invalid_input row each and are never charged.",
            "items": {
              "type": "string",
              "enum": [
                "austin-tx",
                "chicago-il",
                "new-york-ny",
                "los-angeles-ca",
                "san-francisco-ca",
                "seattle-wa",
                "new-orleans-la",
                "cincinnati-oh",
                "mesa-az",
                "montgomery-county-md",
                "montgomery-county-md-commercial",
                "baton-rouge-la",
                "cambridge-ma",
                "orlando-fl",
                "norfolk-va",
                "marin-county-ca",
                "corona-ca",
                "college-station-tx",
                "everett-wa",
                "collin-county-tx",
                "pierce-county-wa",
                "san-diego-county-ca",
                "boston-ma",
                "philadelphia-pa",
                "raleigh-nc"
              ],
              "enumTitles": [
                "Austin, TX",
                "Chicago, IL",
                "New York, NY",
                "Los Angeles, CA",
                "San Francisco, CA",
                "Seattle, WA",
                "New Orleans, LA",
                "Cincinnati, OH",
                "Mesa, AZ",
                "Montgomery County (residential), MD",
                "Montgomery County (commercial), MD",
                "Baton Rouge (East Baton Rouge Parish), LA",
                "Cambridge, MA",
                "Orlando, FL",
                "Norfolk, VA",
                "Marin County, CA",
                "Corona, CA",
                "College Station, TX",
                "Everett, WA",
                "Collin County (all cities, appraisal district), TX",
                "Pierce County (unincorporated), WA",
                "San Diego County (unincorporated), CA",
                "Boston, MA",
                "Philadelphia, PA",
                "Raleigh, NC"
              ]
            }
          },
          "daysBack": {
            "title": "Issued in the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Permits issued in the last N days, counting today. Ignored when \"Issued from\" is filled in.",
            "default": 30
          },
          "dateFrom": {
            "title": "Issued from",
            "type": "string",
            "description": "Optional. First issue date to include (YYYY-MM-DD). Overrides \"Issued in the last N days\"."
          },
          "dateTo": {
            "title": "Issued to",
            "type": "string",
            "description": "Optional. Last issue date to include (YYYY-MM-DD). Defaults to today; future dates are capped at today."
          },
          "workClasses": {
            "title": "Work classes",
            "type": "array",
            "description": "Optional. Keep only permits whose primary work_class is one of these, for example roof or solar. Leave empty for all permits. The class is derived from the permit type and description; every match is also listed in work_tags.",
            "items": {
              "type": "string",
              "enum": [
                "new_residential",
                "new_commercial",
                "adu",
                "demolition",
                "solar",
                "pool",
                "roof",
                "hvac",
                "generator",
                "ev_charger",
                "windows_doors",
                "siding",
                "fire_protection",
                "electrical",
                "plumbing",
                "sign",
                "fence",
                "addition_alteration",
                "other"
              ],
              "enumTitles": [
                "New residential construction",
                "New commercial construction",
                "Accessory dwelling unit (ADU)",
                "Demolition",
                "Solar (PV) installation",
                "Swimming pool or spa",
                "Roof or re-roof",
                "HVAC and mechanical",
                "Standby generator",
                "EV charger",
                "Windows and doors",
                "Siding",
                "Fire sprinkler and alarm",
                "Electrical",
                "Plumbing and gas",
                "Sign",
                "Fence",
                "Addition, alteration or remodel",
                "Other"
              ]
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Optional. Keep only permits whose type or description contains at least one of these words or phrases (case-insensitive), for example \"generator\" or \"heat pump\".",
            "items": {
              "type": "string"
            }
          },
          "minValuation": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only permits with a declared job valuation of at least this many US dollars. Permits without a valuation are dropped when this is set."
          },
          "maxItemsPerCity": {
            "title": "Max permits per city",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of permits returned for each city, newest first. Only rows with status ok are charged.",
            "default": 200
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since the last run",
            "type": "boolean",
            "description": "For scheduled lead feeds: skip permits that an earlier run with the same feed name already delivered. The first run returns the whole date window.",
            "default": false
          },
          "feedName": {
            "title": "Feed name",
            "pattern": "^[A-Za-z0-9_-]{1,40}$",
            "type": "string",
            "description": "Used with \"Only new since the last run\" to keep separate memories for separate schedules, for example roofing-austin. Letters, digits, - and _ only.",
            "default": "default"
          },
          "maxConcurrency": {
            "title": "Parallel cities",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Number of cities read in parallel. Each city is read one page at a time to stay well within the portals' fair-use limits.",
            "default": 4
          },
          "debug": {
            "title": "Save debug data",
            "type": "boolean",
            "description": "When enabled, the first raw record of each city is saved to the run's key-value store for troubleshooting. The dataset rows are the same either way.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}