{
  "openapi": "3.0.1",
  "info": {
    "title": "Contractor License Scraper: New Contractor Leads (WA, OR, NY)",
    "description": "Search and monitor state contractor license registries (Washington L&I, Oregon CCB, New York DOL) from official open-data portals. Filter by trade, city, ZIP and date. Flat JSON with phone, address, owner, bond and insurance. 'Only new' mode for daily new-contractor lead alerts. No API key.",
    "version": "0.1",
    "x-build-id": "7YQeeu7JDxQk4fpfm"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/radiant_opuntia~contractor-license-alerts/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-radiant_opuntia-contractor-license-alerts",
        "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/radiant_opuntia~contractor-license-alerts/runs": {
      "post": {
        "operationId": "runs-sync-radiant_opuntia-contractor-license-alerts",
        "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/radiant_opuntia~contractor-license-alerts/run-sync": {
      "post": {
        "operationId": "run-sync-radiant_opuntia-contractor-license-alerts",
        "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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "Which state license registries to search. More states are added over time.",
            "items": {
              "type": "string",
              "enum": [
                "wa",
                "or",
                "ny"
              ],
              "enumTitles": [
                "Washington (L&I contractor licenses)",
                "Oregon (CCB contractor licenses)",
                "New York (DOL public-works contractor registry)"
              ]
            },
            "default": [
              "wa",
              "or"
            ]
          },
          "keyword": {
            "title": "Search text",
            "type": "string",
            "description": "Matches business name, owner, city and other record text. Examples: 'roofing', 'solar', 'smith construction'."
          },
          "categories": {
            "title": "License category",
            "type": "array",
            "description": "Leave empty for all. 'General' and 'specialty' contractors apply to WA and OR. Electrical, plumbing and elevator apply to WA. Lead paint, home inspector, locksmith and developer apply to OR.",
            "items": {
              "type": "string",
              "enum": [
                "general_contractor",
                "specialty_contractor",
                "electrical",
                "plumbing",
                "elevator",
                "lead_paint",
                "home_inspector",
                "locksmith",
                "developer",
                "public_works_contractor",
                "other"
              ],
              "enumTitles": [
                "General contractor",
                "Specialty contractor",
                "Electrical contractor",
                "Plumbing contractor",
                "Elevator contractor",
                "Lead-based paint renovator",
                "Home inspector",
                "Locksmith",
                "Developer",
                "Public works contractor (NY)",
                "Other"
              ]
            },
            "default": []
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Only licensees in these cities, e.g. 'Seattle', 'Portland'. Leave empty for all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Only licensees in these ZIP codes (first 5 digits). Leave empty for all.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "county": {
            "title": "County (Oregon only)",
            "type": "string",
            "description": "Only Oregon licensees in this county, e.g. 'Multnomah'."
          },
          "activeOnly": {
            "title": "Active licenses only",
            "type": "boolean",
            "description": "Skip expired, suspended or cancelled licenses (Washington and New York; Oregon's open dataset only lists active licenses).",
            "default": true
          },
          "issuedWithinDays": {
            "title": "Issued within last N days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Washington: license term started in this window (new licenses and renewals). Oregon: original registration date, so truly new contractors. New York: certificate issue date. 0 = no date filter. Ignored if a start date is set.",
            "default": 30
          },
          "startDate": {
            "title": "Issued from (optional)",
            "type": "string",
            "description": "YYYY-MM-DD. Overrides 'Issued within last N days'."
          },
          "endDate": {
            "title": "Issued until (optional)",
            "type": "string",
            "description": "YYYY-MM-DD."
          },
          "includeBondAndInsurance": {
            "title": "Add bond and insurance (Washington)",
            "type": "boolean",
            "description": "Adds bond company/amount and insurance company/amount for Washington licensees (Oregon already includes them).",
            "default": true
          },
          "onlyNew": {
            "title": "Only new since last run (alerts mode)",
            "type": "boolean",
            "description": "Remember which licensees were already returned and output only new ones. Use with a daily Schedule + email/Slack/webhook integration.",
            "default": false
          },
          "alertOn": {
            "title": "Alert on",
            "enum": [
              "newLicenses",
              "newOrRenewed"
            ],
            "type": "string",
            "description": "Used with 'Only new'. 'New licensees' alerts once per license number. 'New or renewed' also alerts again each time a license term starts (renewals).",
            "default": "newLicenses"
          },
          "stateKey": {
            "title": "Alert name (optional)",
            "type": "string",
            "description": "Separate memory for 'only new' mode. Defaults to a key derived from your filters."
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Not needed. A free app token from the state's data portal raises rate limits for very large pulls."
          },
          "maxResultsPerState": {
            "title": "Max results per state",
            "minimum": 1,
            "maximum": 200000,
            "type": "integer",
            "description": "Stop after this many licenses per state.",
            "default": 200
          },
          "maxResults": {
            "title": "Max results (total)",
            "minimum": 1,
            "maximum": 500000,
            "type": "integer",
            "description": "Stop after this many licenses in total.",
            "default": 1000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}