{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permit Lead Scraper",
    "description": "Find recent public building permits with project value, address, work scope, contractor or applicant details, status, dates, and source links for local sales prospecting.",
    "version": "1.0",
    "x-build-id": "871QRwHJ4kUXQLCVR"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhammadafzal~building-permit-lead-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhammadafzal-building-permit-lead-scraper",
        "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/muhammadafzal~building-permit-lead-scraper/runs": {
      "post": {
        "operationId": "runs-sync-muhammadafzal-building-permit-lead-scraper",
        "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/muhammadafzal~building-permit-lead-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-muhammadafzal-building-permit-lead-scraper",
        "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": {
          "jurisdictions": {
            "title": "Supported cities",
            "maxItems": 5,
            "type": "array",
            "description": "Use this when you want ready-made permit sources. Select one or more of Chicago, San Francisco, Austin, Seattle, or New York City. Defaults to Chicago; custom sources can be added separately.",
            "items": {
              "type": "string",
              "enum": [
                "chicago-il",
                "san-francisco-ca",
                "austin-tx",
                "seattle-wa",
                "new-york-city-ny"
              ],
              "enumTitles": [
                "Chicago, IL",
                "San Francisco, CA",
                "Austin, TX",
                "Seattle, WA",
                "New York City, NY"
              ]
            },
            "default": [
              "chicago-il"
            ]
          },
          "customDatasetUrls": {
            "title": "Custom Socrata dataset URLs",
            "maxItems": 10,
            "type": "array",
            "description": "Use this when the city is not listed above. Enter public HTTPS Socrata dataset, API, or resource URLs such as https://data.example.gov/resource/abcd-1234.json. This is not for private APIs or ordinary web pages.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "lookbackDays": {
            "title": "Recent permit window (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Use this for a rolling lead window ending today. Defaults to 30 days; allowed range is 1–3650. Ignored when Start date is provided.",
            "default": 30
          },
          "startDate": {
            "title": "Start date",
            "type": "string",
            "description": "Use this for a fixed issue-date range in YYYY-MM-DD format, for example 2026-08-01. Overrides Recent permit window. This is not a free-form date."
          },
          "endDate": {
            "title": "End date",
            "type": "string",
            "description": "Use this to end the issue-date range in YYYY-MM-DD format, for example 2026-08-31. Defaults to today and cannot be before Start date."
          },
          "keywords": {
            "title": "Project keywords",
            "maxItems": 20,
            "type": "array",
            "description": "Use this to keep permits whose description, type, address, or company contains any term, for example solar, roof, or remodel. Matching is case-insensitive; empty means all projects.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "permitTypes": {
            "title": "Permit types",
            "maxItems": 20,
            "type": "array",
            "description": "Use this to keep permit types containing any supplied phrase, for example electrical or new construction. Values differ by city; empty means all types.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "statuses": {
            "title": "Permit statuses",
            "maxItems": 20,
            "type": "array",
            "description": "Use this to keep statuses containing any supplied phrase, for example issued or complete. Values differ by city; empty means all statuses.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "postalCodes": {
            "title": "ZIP/postal codes",
            "maxItems": 100,
            "type": "array",
            "description": "Use this to target exact property ZIP/postal codes, for example 60614. Empty means every location in the selected sources.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "minProjectValue": {
            "title": "Minimum project value",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Use this to keep permits with a reported or estimated project value at or above this USD amount, for example 100000. Zero includes permits with unknown value.",
            "default": 0
          },
          "maxResults": {
            "title": "Maximum leads",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Use this to cap normalized leads across all sources. Defaults to 100; allowed range is 1–5000. Free-plan runs are capped at 5 leads even when a higher value is requested. The Actor stops before exceeding the run charge limit.",
            "default": 100
          },
          "includeContactDetails": {
            "title": "Include public contact details",
            "type": "boolean",
            "description": "Use this when public contractor, permittee, applicant, or owner names and phone numbers are needed for lawful outreach. Defaults to true; turn off for location-only research.",
            "default": true
          },
          "includeRawData": {
            "title": "Include original source row",
            "type": "boolean",
            "description": "Use this for auditing or fields not covered by the normalized schema. Defaults to false because raw municipal rows are large and vary between portals.",
            "default": false
          },
          "maxRequestRetries": {
            "title": "Request retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Use this to control bounded retries for rate limits and temporary portal failures. Defaults to 2; allowed range is 0–5. This does not bypass access controls.",
            "default": 2
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}