{
  "openapi": "3.0.1",
  "info": {
    "title": "Washington Contractor Directory & Leads Scraper (L&I)",
    "description": "Search Washington L&I contractor records by name, license or UBI. Export public registration status, business contacts, location, bond and insurance details.",
    "version": "1.0",
    "x-build-id": "RwEn5UAMbyU3ZMB0x"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/muhammadafzal~washington-contractor-directory-leads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-muhammadafzal-washington-contractor-directory-leads-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/muhammadafzal~washington-contractor-directory-leads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-muhammadafzal-washington-contractor-directory-leads-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/muhammadafzal~washington-contractor-directory-leads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-muhammadafzal-washington-contractor-directory-leads-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",
        "required": [
          "searchType",
          "searchTerm",
          "contractorTypes",
          "activeRegistrationOnly",
          "activeWorkersCompOnly",
          "maxResults",
          "maxPages"
        ],
        "properties": {
          "searchType": {
            "title": "Search by",
            "enum": [
              "NAME",
              "LICENSE",
              "UBI"
            ],
            "type": "string",
            "description": "Choose how the official L&I portal interprets searchTerm. Use NAME for a partial business or owner name, LICENSE for a contractor registration or tradesperson license, or UBI for an exact nine-digit Washington UBI.",
            "default": "NAME"
          },
          "searchTerm": {
            "title": "Name, license, or UBI",
            "minLength": 2,
            "maxLength": 32,
            "type": "string",
            "description": "Use this for a 2–32 character business/owner name or license search, such as `Cascade` or `CASCAAL962RW`. For UBI search, provide exactly 9 digits, such as `602156869`. This follows the L&I portal's search behavior; it is not a free-text address or trade filter.",
            "default": "Cascade"
          },
          "contractorTypes": {
            "title": "License and contractor types",
            "uniqueItems": true,
            "type": "array",
            "description": "Choose one or more official L&I contractor or tradesperson types. The Actor applies this filter locally to the public search results because the portal's optional type facet currently returns an error.",
            "items": {
              "type": "string",
              "enum": [
                "Construction Contractor",
                "Electrical Contractor",
                "Electrical Administrator",
                "Electrician",
                "Master Electrician",
                "Modified Trainee",
                "Asbestos Contractor",
                "Asbestos Supervisor",
                "Asbestos Worker",
                "Plumbing Contractor",
                "Medical Gas",
                "Plumber",
                "Plumber Trainee",
                "Modified Plumber Trainee",
                "Elevator Primary Contact",
                "Elevator Contractor",
                "Elevator Mechanic",
                "Elevator Mechanic Temporary",
                "Manufactured Home Installer"
              ]
            },
            "default": [
              "Construction Contractor"
            ]
          },
          "city": {
            "title": "City filter",
            "maxLength": 80,
            "type": "string",
            "description": "Use this for an exact city from the L&I search results, such as `SEATTLE` or `TACOMA`. Leave blank to include all cities returned for the search. This is the source mailing city, not a service-area claim."
          },
          "zipCode": {
            "title": "ZIP code filter",
            "pattern": "^[0-9]{5}$",
            "maxLength": 5,
            "type": "string",
            "description": "Use a five-digit ZIP code, such as `98101`. If L&I returns ZIP+4, the Actor matches its first five digits. Leave blank to include all ZIP codes returned for the search."
          },
          "activeRegistrationOnly": {
            "title": "Active registration only",
            "type": "boolean",
            "description": "When true, returns only details whose L&I registration status is ACTIVE. This is checked locally against each public detail record.",
            "default": true
          },
          "activeWorkersCompOnly": {
            "title": "Active workers’ comp only",
            "type": "boolean",
            "description": "When true, returns only businesses whose public L&I detail record reports a current workers’ compensation account. Records without a verifiable current account are excluded.",
            "default": false
          },
          "maxResults": {
            "title": "Maximum records (free users: max 5)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Use this to cap returned contractor records and event charges. Default 10; minimum 1 and maximum 100. Verified free-plan runs are capped at 5 delivered records even when a higher value is requested; paid and agentic runs are not capped by this rule.",
            "default": 10
          },
          "maxPages": {
            "title": "Maximum search pages",
            "minimum": 1,
            "maximum": 25,
            "type": "integer",
            "description": "Caps the number of public L&I search pages scanned. Each page contains up to 20 search rows. Increase this when local filters return fewer records than requested; the run summary reports when this cap stops the scan.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}