{
  "openapi": "3.0.1",
  "info": {
    "title": "US Active Contractors - Permits + License, Phone",
    "description": "Contractors who pulled a building permit in the last 90 days in Seattle, Orlando, Cincinnati or Marin County, matched to their state licence: status, expiry date, phone. One row per contractor with permit count, total job value and lead score. 74 % matched in Seattle, measured.",
    "version": "1.0",
    "x-build-id": "svULMAscCXnzPeosH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/wellbuilt_zythem~us-active-contractors/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-wellbuilt_zythem-us-active-contractors",
        "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/wellbuilt_zythem~us-active-contractors/runs": {
      "post": {
        "operationId": "runs-sync-wellbuilt_zythem-us-active-contractors",
        "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/wellbuilt_zythem~us-active-contractors/run-sync": {
      "post": {
        "operationId": "run-sync-wellbuilt_zythem-us-active-contractors",
        "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": "Leave empty for all five cities. Only cities where the state board actually licenses the trades that pull permits are offered, which is what makes the join work (Seattle 67%, Orlando 71%, Cincinnati 62%, Marin County 71%, Austin 76% of permit contractors matched, measured September 2026).",
            "items": {
              "type": "string",
              "enum": [
                "seattle",
                "orlando",
                "cincinnati",
                "marin_county",
                "austin"
              ],
              "enumTitles": [
                "Seattle, WA (L&I licences)",
                "Orlando, FL (DBPR licences)",
                "Cincinnati, OH (OCILB licences)",
                "Marin County, CA (CSLB licences)",
                "Austin, TX (TDLR and TSBPE licences)"
              ]
            },
            "default": []
          },
          "lastNDays": {
            "title": "Permits issued in the last N days",
            "minimum": 7,
            "maximum": 365,
            "type": "integer",
            "description": "The activity window. 90 days is a good picture of who is working right now; 30 days is who is working this month.",
            "default": 90
          },
          "trades": {
            "title": "Permit trades",
            "type": "array",
            "description": "Count only permits of these trades. Leave empty for every trade, except in Cincinnati and Austin, where empty means electrical, HVAC and plumbing: Ohio and Texas do not license general or roofing contractors, so those cannot be matched (9% measured) and are skipped unless you pick them.",
            "items": {
              "type": "string",
              "enum": [
                "roofing",
                "solar",
                "hvac",
                "electrical",
                "plumbing",
                "remodel",
                "new_construction",
                "demolition",
                "pool",
                "fence",
                "other"
              ],
              "enumTitles": [
                "Roofing",
                "Solar",
                "HVAC",
                "Electrical",
                "Plumbing",
                "Remodel and alterations",
                "New construction",
                "Demolition",
                "Pool and spa",
                "Fence",
                "Other"
              ]
            },
            "default": []
          },
          "minPermits": {
            "title": "Minimum permits in the window",
            "minimum": 1,
            "type": "integer",
            "description": "2 or more drops the one-off jobs and keeps the contractors who are busy.",
            "default": 1
          },
          "minJobValue": {
            "title": "Minimum total job value (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Sum of the declared values of the contractor's permits in the window. 0 for no minimum.",
            "default": 0
          },
          "onlyLicensed": {
            "title": "Only contractors matched to a state licence",
            "type": "boolean",
            "description": "Off to also get the contractors the board does not list (a trade it does not license, or a name that does not match); those rows carry the permit data and no licence columns.",
            "default": true
          },
          "onlyActive": {
            "title": "Only active licences",
            "type": "boolean",
            "description": "Off to also see expired or suspended licences that are still pulling permits.",
            "default": true
          },
          "onlyWithPhone": {
            "title": "Only rows with a phone number",
            "type": "boolean",
            "description": "For calling lists. Washington and Ohio publish a phone on most licences; Florida publishes none, so in Orlando the phone comes only from the permit when the city records one.",
            "default": false
          },
          "maxContractorsPerCity": {
            "title": "Maximum contractors checked per city",
            "minimum": 1,
            "type": "integer",
            "description": "Contractors are checked against the board from the largest total job value down. Florida and Washington are checked one contractor at a time, so this caps the run time.",
            "default": 300
          },
          "maxResults": {
            "title": "Maximum rows",
            "minimum": 0,
            "type": "integer",
            "description": "0 for no limit.",
            "default": 0
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "A free token from any city's open-data portal raises the permit API rate limit. Not needed for normal runs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}