{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits Scraper: Construction Leads, 4 Cities",
    "description": "Returns US building permits newly issued in New York City, Chicago, San Francisco and Austin from official open data in one schema: work type, valuation, dates, status, contractor company and site address. Construction leads without personal data.",
    "version": "1.0",
    "x-build-id": "inhSzAFNNnf3op4pv"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/agents001~us-building-permits/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-agents001-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/agents001~us-building-permits/runs": {
      "post": {
        "operationId": "runs-sync-agents001-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/agents001~us-building-permits/run-sync": {
      "post": {
        "operationId": "run-sync-agents001-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 city permit datasets to read. Leave empty for all four.",
            "items": {
              "type": "string",
              "enum": [
                "nyc",
                "chicago",
                "san-francisco",
                "austin"
              ],
              "enumTitles": [
                "New York City (DOB NOW approved permits)",
                "Chicago (Department of Buildings permits)",
                "San Francisco (DBI building permits)",
                "Austin (issued construction permits)"
              ]
            }
          },
          "issuedWithinDays": {
            "title": "Issued in the last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Permits issued from N-1 days ago up to today (UTC), so 1 means today only and 7 means the last week. Ignored when you set an issue date range below. Cities publish with a delay of one to three days.",
            "default": 7
          },
          "issuedFrom": {
            "title": "Issued from (date range)",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Start of a fixed issue date range, YYYY-MM-DD. Overrides 'Issued in the last N days'. If you set only this, the range runs to today."
          },
          "issuedTo": {
            "title": "Issued to (date range)",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "End of a fixed issue date range, YYYY-MM-DD, inclusive. If you set only this, the range covers the 7 days up to it."
          },
          "workCategories": {
            "title": "Work categories",
            "type": "array",
            "description": "Only permits in these shared categories, which the Actor maps from each city's own permit and work types. Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "new-construction",
                "alteration",
                "demolition",
                "electrical",
                "plumbing",
                "mechanical",
                "fire-protection",
                "structural",
                "solar",
                "roofing",
                "sign",
                "elevator",
                "temporary-structure",
                "site-work",
                "other"
              ],
              "enumTitles": [
                "New construction",
                "Alteration, renovation or addition",
                "Demolition",
                "Electrical",
                "Plumbing",
                "Mechanical and HVAC",
                "Fire protection (sprinklers, standpipes, alarms)",
                "Structural, foundation and earthwork",
                "Solar",
                "Roofing",
                "Signs",
                "Elevators and escalators",
                "Temporary structures (scaffolds, sidewalk sheds, fences, tents)",
                "Site work (curb cuts, driveways, sidewalks, irrigation)",
                "Other"
              ]
            }
          },
          "permitTypes": {
            "title": "Permit or work type contains",
            "type": "array",
            "description": "Only permits whose city permit type or work type contains any of these words, for example 'Plumbing', 'New Construction', 'Sidewalk Shed' or 'Remodel'. Case-insensitive.",
            "items": {
              "type": "string"
            }
          },
          "descriptionKeywords": {
            "title": "Description contains",
            "type": "array",
            "description": "Only permits whose work description contains any of these words or phrases, for example 'solar', 'restaurant', 'ADU' or 'kitchen'. Case-insensitive.",
            "items": {
              "type": "string"
            }
          },
          "minValuation": {
            "title": "Minimum valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only permits with a stated job value or cost of at least this many US dollars. Permits with no stated value are dropped when this is above 0.",
            "default": 0
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Only permits for sites in these 5-digit ZIP codes. Chicago ZIP codes come from the City's ZIP boundary tagging of each permit.",
            "items": {
              "type": "string"
            }
          },
          "excludeRenewals": {
            "title": "Exclude renewals",
            "type": "boolean",
            "description": "Drop permit renewals (New York City) and reinstated permits (Chicago) so only first-time permits remain.",
            "default": false
          },
          "onlyNew": {
            "title": "Only permits not seen in previous runs",
            "type": "boolean",
            "description": "Remember which permits were already returned for this exact input and only return permits that are new since then. The first run returns everything that matches. Ideal for scheduled daily runs. Changing the cities or filters starts a fresh history.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum permit records",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many permit records in total, newest first, shared fairly across the chosen cities. 0 means no limit. You pay per permit record returned.",
            "default": 1000
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "A free app token from any Socrata open data portal (for example data.cityofnewyork.us, under Developer Settings). Without one the Actor still works, at a slower polite rate, because Socrata throttles requests without a token."
          },
          "stateStoreName": {
            "title": "State store name",
            "pattern": "^[a-zA-Z0-9-]{1,63}$",
            "type": "string",
            "description": "Only used when 'Only permits not seen in previous runs' is on. Name of the key-value store in your account that keeps the list of permits already returned. Each different input gets its own record inside it. Change it only to keep separate histories. If a run reports that it cannot open the store, enter a different name here.",
            "default": "agents001-us-building-permits-state"
          },
          "requestDelaySecs": {
            "title": "Delay between requests to the same portal",
            "minimum": 0.25,
            "maximum": 10,
            "type": "number",
            "description": "Minimum seconds between requests to the same city portal. Default 1 second without an app token and 0.25 seconds with one. Keep this polite: these are public government services."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}