{
  "openapi": "3.0.1",
  "info": {
    "title": "Construction Permit Leads - Scored Daily Call List",
    "description": "Monitors newly issued building permits across US metros, classifies each by trade (roofing, HVAC, plumbing, electrical, foundation, remodel), scores lead quality, and emits only permits you have not seen before.",
    "version": "0.1",
    "x-build-id": "yrpVSuZzHb3NBWveQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/oldbie~construction-permit-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-oldbie-construction-permit-leads",
        "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/oldbie~construction-permit-leads/runs": {
      "post": {
        "operationId": "runs-sync-oldbie-construction-permit-leads",
        "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/oldbie~construction-permit-leads/run-sync": {
      "post": {
        "operationId": "run-sync-oldbie-construction-permit-leads",
        "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 to monitor",
            "type": "array",
            "description": "Which metro permit sources to pull. All open-data cities are verified live and return results with no further setup. NOTE: Houston is the only city that REQUIRES ZIP codes — its report cannot be swept city-wide, so selecting Houston without filling in 'ZIP codes' below returns nothing.",
            "items": {
              "type": "string",
              "enum": [
                "houston_tx",
                "austin_tx",
                "chicago_il",
                "nyc_ny",
                "seattle_wa",
                "los_angeles_ca",
                "new_orleans_la",
                "montgomery_md",
                "cincinnati_oh",
                "baton_rouge_la",
                "norfolk_va"
              ],
              "enumTitles": [
                "Houston, TX - permit portal, same/next day (ZIPs REQUIRED)",
                "Austin, TX - open data, 1 day",
                "Chicago, IL - open data, 1 day",
                "New York City, NY - open data, 1 day",
                "Seattle, WA - open data, 3 days",
                "Los Angeles, CA - open data, 3 days",
                "New Orleans, LA - open data, ~7 day lag (raise lookback)",
                "Montgomery County, MD - open data, 1 day",
                "Cincinnati, OH - open data, 2 days",
                "Baton Rouge, LA - open data, 1 day",
                "Norfolk, VA - open data, 1 day"
              ]
            },
            "default": [
              "chicago_il",
              "nyc_ny",
              "seattle_wa",
              "los_angeles_ca"
            ]
          },
          "lookbackDays": {
            "title": "Lookback window (days)",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "How far back to search from today. 5 is the safe default: it covers weekend gaps, late data entry, and the cities that publish on a 3-4 day delay (Los Angeles, Seattle). Deduplication means a wider window costs you nothing on a daily schedule - you are never charged twice for the same permit. Raise to 10+ for New Orleans.",
            "default": 5
          },
          "trades": {
            "title": "Trades to include",
            "type": "array",
            "description": "Filter permits by classified trade. Leave empty to return every trade.",
            "items": {
              "type": "string",
              "enum": [
                "roofing",
                "hvac",
                "plumbing",
                "electrical",
                "foundation",
                "remodel",
                "new_construction",
                "demolition",
                "pool",
                "solar",
                "fence_deck",
                "other"
              ]
            },
            "default": []
          },
          "minValuation": {
            "title": "Minimum job valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip permits below this declared value. Filters out $200 water-heater swaps. Set 0 to disable.",
            "default": 5000
          },
          "zipWhitelist": {
            "title": "ZIP codes (optional)",
            "type": "array",
            "description": "Only return permits in these ZIPs. REQUIRED FOR HOUSTON - Houston's report needs a search term and cannot be swept city-wide, so Houston returns nothing without ZIPs. Optional for all open-data cities. Note: Chicago publishes no job-site ZIP, so Chicago rows are excluded when this filter is set. Example: 77072, 77036, 77081",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "requireContractor": {
            "title": "Only permits with a named contractor",
            "type": "boolean",
            "description": "Turn ON if you sell to contractors (supply, subcontracting). Turn OFF if you sell to homeowners - owner-pulled permits are your best homeowner leads.",
            "default": false
          },
          "onlyNew": {
            "title": "Only emit permits not seen in previous runs",
            "type": "boolean",
            "description": "Deduplicates against this actor's persistent store. This is what makes scheduled daily runs useful instead of re-billing you for the same rows.",
            "default": true
          },
          "maxResults": {
            "title": "Max permits per run",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on results, as a cost guard.",
            "default": 500
          },
          "hotLeadThreshold": {
            "title": "Call-today list: minimum score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Leads scoring at or above this are written to a plain-text call sheet (hot-leads.txt) in the run's storage, so the good ones are visible without opening the dataset. 75 is 'call today'. Set 0 to turn the file off.",
            "default": 75
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Residential proxies are recommended for the Houston Accela portal. Socrata cities do not need a proxy.",
            "default": {
              "useApifyProxy": true
            }
          },
          "debugScreenshots": {
            "title": "Save debug screenshots",
            "type": "boolean",
            "description": "Saves a screenshot to the key-value store at each browser step. Use this when calibrating selectors after a portal redesign.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}