{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permits Scraper - US Construction & Contractor Leads",
    "description": "US building permits scraper for construction and contractor leads: new permits from official open-data portals of 12 cities (NYC, LA, Chicago, SF, Seattle, Austin, DC...) - type, work description, address, project value, contractor, dates. $4 per 1,000 permits.",
    "version": "0.1",
    "x-build-id": "8RGu3Ym1S8AjVDHdr"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/offgrid-labs~building-permits-us/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-offgrid-labs-building-permits-us",
        "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/offgrid-labs~building-permits-us/runs": {
      "post": {
        "operationId": "runs-sync-offgrid-labs-building-permits-us",
        "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/offgrid-labs~building-permits-us/run-sync": {
      "post": {
        "operationId": "run-sync-offgrid-labs-building-permits-us",
        "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": "Cities to collect permits from (ids: new-york, los-angeles, chicago, san-francisco, seattle, austin, new-orleans, mesa, cincinnati, cambridge, nashville, washington-dc). Leave empty for all 12. Example: [\"austin\", \"seattle\"]",
            "items": {
              "type": "string",
              "enum": [
                "new-york",
                "los-angeles",
                "chicago",
                "san-francisco",
                "seattle",
                "austin",
                "new-orleans",
                "mesa",
                "cincinnati",
                "cambridge",
                "nashville",
                "washington-dc"
              ],
              "enumTitles": [
                "New York City, NY",
                "Los Angeles, CA",
                "Chicago, IL",
                "San Francisco, CA",
                "Seattle, WA",
                "Austin, TX",
                "New Orleans, LA",
                "Mesa, AZ",
                "Cincinnati, OH",
                "Cambridge, MA (new construction)",
                "Nashville, TN",
                "Washington, DC"
              ]
            }
          },
          "issuedWithinDays": {
            "title": "Issued within last N days",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Only permits issued in the last N days (1-3650). Default 30. Ignored when 'Issued on or after' is set. Cities publish with a 1-7 day delay, so use at least 2 for a daily schedule. Example: 7",
            "default": 30
          },
          "issuedAfter": {
            "title": "Issued on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional fixed start date in YYYY-MM-DD format; overrides 'Issued within last N days'. Example: 2026-10-01"
          },
          "permitTypeKeywords": {
            "title": "Permit type contains",
            "type": "array",
            "description": "Optional. Keep permits whose type, subtype or work class contains ANY of these words (case-insensitive). Filtered-out permits are not charged. Examples: new, demolition, solar, roof, electrical",
            "items": {
              "type": "string"
            }
          },
          "descriptionKeywords": {
            "title": "Work description contains",
            "type": "array",
            "description": "Optional. Keep permits whose work description contains ANY of these words (case-insensitive). Examples: pool, ADU, solar, restaurant",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Optional. 5-digit ZIP codes or prefixes (787 = central Austin). Permits without a ZIP (e.g. Chicago) are excluded when set. Example: [\"78701\", \"787\"]",
            "items": {
              "type": "string"
            }
          },
          "minValuation": {
            "title": "Minimum project value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional. Keep only permits with a declared job value of at least this many US dollars. Permits without a value (e.g. Washington DC) are excluded when set. Default 0 = no filter. Example: 100000",
            "default": 0
          },
          "maxItemsPerCity": {
            "title": "Max permits per city",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum permits saved per city, newest first; one permit = one dataset row = one charged result. Default 200. 0 = no limit. Example: 500",
            "default": 200
          },
          "includeRawRecord": {
            "title": "Include the original city record",
            "type": "boolean",
            "description": "If true, adds a raw field with every column the city publishes (varies by city; may include personal names). Default false.",
            "default": false
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free app token from any Socrata portal (e.g. data.cityofchicago.org > Developer Settings). Raises per-IP request limits for very large runs. Not needed for normal use."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}