{
  "openapi": "3.0.1",
  "info": {
    "title": "US Building Permits Scraper - Contractor Leads, Verified Cities",
    "description": "Contractor leads from building permits: roofing, HVAC, solar, electrical, plumbing, remodel & new construction, classified by trade and lead-scored. 16 verified city feeds checked daily; contractor names, owner names, valuations, phones where published. From $3/1,000, source-direct government data.",
    "version": "0.1",
    "x-build-id": "ycMuiMcmIf9IeLOnt"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/permitdata~us-building-permits-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-permitdata-us-building-permits-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/permitdata~us-building-permits-scraper/runs": {
      "post": {
        "operationId": "runs-sync-permitdata-us-building-permits-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/permitdata~us-building-permits-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-permitdata-us-building-permits-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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "scrape",
              "monitor",
              "canary"
            ],
            "type": "string",
            "description": "scrape = pull a date range once. monitor = only NEW permits since your last run (stateful, deduped - ideal for schedules/webhooks). canary = coverage self-test, no charges.",
            "default": "scrape"
          },
          "sources": {
            "title": "Cities",
            "type": "array",
            "description": "Which verified sources to pull. Leave empty for ALL verified cities.",
            "items": {
              "type": "string",
              "enum": [
                "chicago",
                "detroit",
                "nyc",
                "san_francisco",
                "austin",
                "new_orleans",
                "cincinnati",
                "baton_rouge",
                "buffalo",
                "montgomery_county_md",
                "seattle",
                "san_jose",
                "philadelphia",
                "columbus",
                "dc",
                "nashville"
              ],
              "enumTitles": [
                "Chicago, IL",
                "Detroit, MI",
                "New York City, NY",
                "San Francisco, CA",
                "Austin, TX (contractor + phone)",
                "New Orleans, LA",
                "Cincinnati, OH",
                "Baton Rouge, LA",
                "Buffalo, NY",
                "Montgomery County, MD",
                "Seattle, WA",
                "San Jose, CA (contractor + owner)",
                "Philadelphia, PA (contractor + owner)",
                "Columbus, OH (applicant + valuation)",
                "Washington, DC (applicant + owner)",
                "Nashville, TN (contact + valuation)"
              ]
            },
            "default": []
          },
          "sinceDays": {
            "title": "Look-back window (days)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Scrape mode: how many days back from today. Ignored if 'Since date' is set.",
            "default": 7
          },
          "sinceDate": {
            "title": "Since date (YYYY-MM-DD)",
            "type": "string",
            "description": "Scrape mode: explicit start date. Overrides look-back window."
          },
          "untilDate": {
            "title": "Until date (YYYY-MM-DD)",
            "type": "string",
            "description": "Scrape mode: explicit end date (inclusive). Default: today."
          },
          "maxResultsPerSource": {
            "title": "Max results per city",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Safety cap per source per run.",
            "default": 5000
          },
          "trades": {
            "title": "Trade filter",
            "type": "array",
            "description": "Only return permits classified into these trades. Empty = all permits.",
            "items": {
              "type": "string",
              "enum": [
                "roofing",
                "hvac",
                "electrical",
                "plumbing",
                "solar",
                "demolition",
                "pool_spa",
                "fence_deck",
                "new_construction",
                "remodel_addition",
                "fire_systems",
                "sign",
                "other"
              ],
              "enumTitles": [
                "Roofing",
                "HVAC/Mechanical",
                "Electrical",
                "Plumbing",
                "Solar",
                "Demolition",
                "Pool & Spa",
                "Fence/Deck/Porch",
                "New construction",
                "Remodel/Addition",
                "Fire systems",
                "Signs",
                "Other/Unclassified"
              ]
            },
            "default": []
          },
          "minValuation": {
            "title": "Minimum project valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Only return permits with reported/estimated cost at or above this. Permits with no valuation are kept unless this is set above 0 and 'dropUnknownValuation' is on."
          },
          "dropUnknownValuation": {
            "title": "Drop permits with unknown valuation",
            "type": "boolean",
            "description": "Only applies when a minimum valuation is set.",
            "default": false
          },
          "leadScoring": {
            "title": "Lead scoring",
            "type": "boolean",
            "description": "Adds lead_score (0-100) + scoring_reasons to every permit. Items are then billed as 'scored lead' events instead of raw 'permit' events - see pricing.",
            "default": false
          },
          "monitorStateName": {
            "title": "Monitor state namespace",
            "type": "string",
            "description": "Monitor mode: name of the key-value store holding watermarks. Change it to run independent monitors (e.g. one per client).",
            "default": "building-permits-monitor"
          },
          "includeUnverified": {
            "title": "Include unverified sources (testing)",
            "type": "boolean",
            "description": "Also run sources still marked pending verification. Off by default - we only ship what the daily canary proves works.",
            "default": false
          },
          "discordWebhookUrl": {
            "title": "Discord webhook (canary alerts)",
            "type": "string",
            "description": "Canary mode: post the health summary to this Discord webhook."
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Raises Socrata rate limits for very large backfills. Not needed for normal use."
          },
          "accelaAppId": {
            "title": "Accela App ID (optional)",
            "type": "string",
            "description": "Only needed for Accela-backed cities (e.g. Grand Rapids). Register a free app at developer.accela.com to get an App ID + Secret."
          },
          "accelaAppSecret": {
            "title": "Accela App Secret (optional)",
            "type": "string",
            "description": "Paired secret for the Accela App ID above."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}