{
  "openapi": "3.0.1",
  "info": {
    "title": "Building Permits & Contractor License Intel",
    "description": "Unifies US building-permit + contractor-license portals into one schema: type, valuation, status, contractor, address. Value layer: contractor linking, property clustering, and scored high-intent trade signals (solar/roofing/HVAC) that cross-sell into trades lead-gen. Logged-out public records.",
    "version": "0.1",
    "x-build-id": "dVfAbPtkqjc9zcP5d"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/seibs.co~building-permits-intel/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-seibs.co-building-permits-intel",
        "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/seibs.co~building-permits-intel/runs": {
      "post": {
        "operationId": "runs-sync-seibs.co-building-permits-intel",
        "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/seibs.co~building-permits-intel/run-sync": {
      "post": {
        "operationId": "run-sync-seibs.co-building-permits-intel",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "permit_search",
              "permit_profile",
              "contractor_lookup",
              "trade_signals"
            ],
            "type": "string",
            "description": "permit_search = fetch recent/filtered permits per jurisdiction with contractor links + property clusters. permit_profile = direct lookup for specific permits by number. contractor_lookup = resolve a contractor's permit footprint across jurisdictions. trade_signals = score permits into ranked, cross-sell-ready buying signals for the trades (solar/roofing/HVAC/pool/electrical/plumbing).",
            "default": "permit_search"
          },
          "jurisdictions": {
            "title": "Jurisdictions to query",
            "maxItems": 40,
            "type": "array",
            "description": "Jurisdiction codes. 5 fully-parsed feeds return real data: CHICAGO, AUSTIN, NYC, SF, SEATTLE (the default set, all open Socrata feeds). A national catalog of major metros/counties (Houston, Phoenix, Dallas, Denver, Boston, DC, Philadelphia, ...) and state contractor-license boards (CSLB, FL DBPR, AZ ROC, OR CCB, ...) is registered with the correct portal + access method (parser pending - they return a documented jurisdiction_pending note). Pass ['FULL'] for the verified metros or ['ALL'] for every catalog jurisdiction.",
            "default": [
              "CHICAGO",
              "AUSTIN",
              "NYC",
              "SF",
              "SEATTLE"
            ],
            "items": {
              "type": "string"
            }
          },
          "all_jurisdictions": {
            "title": "Query every catalog jurisdiction",
            "type": "boolean",
            "description": "Shortcut to query every registered jurisdiction (overrides the list). Fully-parsed jurisdictions return permits; catalog jurisdictions return a documented jurisdiction_pending note.",
            "default": false
          },
          "query": {
            "title": "Keyword query (permit type / work description)",
            "type": "string",
            "description": "Optional free-text keyword matched against each feed's permit type + work description, e.g. 'roof', 'solar', 'pool', 'new construction'. Leave empty in permit_search/trade_signals to pull the most recent permits.",
            "default": ""
          },
          "address": {
            "title": "Address contains",
            "type": "string",
            "description": "Optional street-name / address fragment to filter permits to a corridor or block, e.g. 'BROADWAY'.",
            "default": ""
          },
          "trades": {
            "title": "Target trades (trade_signals + permit_search filter)",
            "type": "array",
            "description": "Trades to score/keep, e.g. ['solar','roofing','hvac','pool','electrical','plumbing']. In trade_signals mode these are the trades scored; in permit_search they filter the permits. Leave empty to use the high-intent default set (solar, roofing, pool, hvac, electrical, plumbing).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "permit_numbers": {
            "title": "Direct permit references (jurisdiction + permit number)",
            "maxItems": 50,
            "type": "array",
            "description": "Look up specific permits directly (permit_profile mode). Each item: {\"jurisdiction\": \"SF\", \"permit_number\": \"202409060229\"}. Hard cap of 50.",
            "default": []
          },
          "contractors": {
            "title": "Contractor names (contractor_lookup)",
            "maxItems": 25,
            "type": "array",
            "description": "Contractor/business names to resolve a permit footprint for in contractor_lookup mode, e.g. ['KangaRoof', 'Turner Construction']. Hard cap of 25.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "date_from": {
            "title": "Issued on/after (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional lower bound on the permit issue date.",
            "default": ""
          },
          "date_to": {
            "title": "Issued on/before (YYYY-MM-DD)",
            "type": "string",
            "description": "Optional upper bound on the permit issue date.",
            "default": ""
          },
          "min_value": {
            "title": "Minimum declared valuation (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional: keep only permits whose declared job valuation is at least this many dollars. Drops permits with no reported valuation.",
            "default": 0
          },
          "include_valuation": {
            "title": "Charge + emit valuation signals",
            "type": "boolean",
            "description": "When on (default), each permit that carries a parsed dollar valuation charges a valuation_signal. Turn off for a value-free permit-count run.",
            "default": true
          },
          "max_results_per_jurisdiction": {
            "title": "Max permits per jurisdiction",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Hard cap on permits returned per jurisdiction. Default 25.",
            "default": 25
          },
          "contact_email": {
            "title": "Contact email (optional)",
            "type": "string",
            "description": "Optional operator contact added to request headers. Good-citizen practice; not required.",
            "default": ""
          },
          "monitor_webhook_url": {
            "title": "Monitor webhook URL (Slack / email, optional)",
            "type": "string",
            "description": "When this actor runs under an Apify Schedule (monitor mode), post the change digest (new permits, status changes, finals) to this Slack-compatible webhook URL.",
            "default": ""
          },
          "use_apify_proxy": {
            "title": "Use Apify Proxy",
            "type": "boolean",
            "description": "Route portal requests through Apify Proxy. The DATACENTER tier handles the open Socrata feeds; a RESIDENTIAL tier is provisioned for the anti-bot escalation legs.",
            "default": true
          },
          "use_browser_fallback": {
            "title": "Anti-bot escalation (curl_cffi + browser)",
            "type": "boolean",
            "description": "When a portal serves a Cloudflare/CAPTCHA/403 challenge, automatically escalate: switch to the RESIDENTIAL proxy and retry with curl_cffi Chrome TLS impersonation, then (if available) a headless browser. The open Socrata feeds never need this; the catalog Accela/EnerGov jurisdictions do.",
            "default": true
          },
          "browser_cdp_url": {
            "title": "Warm browser CDP endpoint (for browser-required jurisdictions)",
            "type": "string",
            "description": "Optional. CDP/WebSocket endpoint of an already-running anti-detect (UC-mode / real Chrome) browser. When set, the browser tier connects to it so it passes the Cloudflare-fronted Accela/EnerGov catalog jurisdictions. Can also be set as the BROWSER_CDP_URL env var. CAPTCHA-gated portals additionally need an opt-in solver: set CAPTCHA_SOLVER_PROVIDER (2captcha|capsolver) + CAPTCHA_SOLVER_KEY as actor env secrets - off by default.",
            "default": ""
          },
          "apify_proxy_groups": {
            "title": "Proxy groups (optional override)",
            "type": "array",
            "description": "Override the auto-selected proxy group. Leave empty to let the actor pick DATACENTER for the open feeds.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "concurrency": {
            "title": "Max concurrent requests",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Parallel jurisdiction fetches. Gov portals are rate-sensitive; default 4.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}