{
  "openapi": "3.0.1",
  "info": {
    "title": "Contractor License Lookup & Leads: New & Expiring, 7 US States",
    "description": "Verify contractor licences by number or business name, or get leads from seven state boards (CA CSLB, AZ ROC, TX, WA, OR, CT, NY): newly licensed contractors, or licences expiring in the weeks ahead for insurance, bond and renewal offers. Status, classifications, dates, address and phone.",
    "version": "0.1",
    "x-build-id": "aa6xcQ5YxgPWRXyGD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pikoulas~contractor-licenses/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pikoulas-contractor-licenses",
        "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/pikoulas~contractor-licenses/runs": {
      "post": {
        "operationId": "runs-sync-pikoulas-contractor-licenses",
        "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/pikoulas~contractor-licenses/run-sync": {
      "post": {
        "operationId": "run-sync-pikoulas-contractor-licenses",
        "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": "The boards to read. None means all seven.",
            "items": {
              "type": "string",
              "enum": [
                "CA",
                "AZ",
                "TX",
                "WA",
                "OR",
                "CT",
                "NY"
              ],
              "enumTitles": [
                "California (CSLB)",
                "Arizona (ROC)",
                "Texas (TDLR)",
                "Washington (L&I)",
                "Oregon (CCB)",
                "Connecticut (DCP)",
                "New York (DOL contractor registry)"
              ]
            }
          },
          "licenseNumbers": {
            "title": "Licence numbers",
            "type": "array",
            "description": "Licences to verify, as the board writes them (1064533, ROC 339306, HIC.0631057, ECOSTSC758NN), looked up in the states above. A number found in none of them, with the filters given, comes as a row with the status Not found, uncharged: the boards list only active licences, or in California those in good standing; Arizona gives a licence in any status, revoked or suspended too. California's list comes by classification, so a lookup there reads every classification of the trades given, or all of them.",
            "items": {
              "type": "string"
            }
          },
          "businessNames": {
            "title": "Business names",
            "type": "array",
            "description": "Business or trade names, or a part of one (Bright Sparks, Solar), matched in the business name and dba.",
            "items": {
              "type": "string"
            }
          },
          "trades": {
            "title": "Trades",
            "type": "array",
            "description": "Licences in any of these trades, by the board's own licence types and classifications. None means every contractor. Oregon's and New York's lists tell only general contractors apart, so they're left out of a search by other trades. Arizona gives active licences in a search by trade or city.",
            "items": {
              "type": "string",
              "enum": [
                "general",
                "remodeling",
                "electrical",
                "plumbing",
                "hvac",
                "roofing",
                "solar",
                "painting",
                "landscaping",
                "concrete",
                "flooring",
                "carpentry",
                "windows",
                "pools",
                "fencing",
                "excavation",
                "demolition",
                "fire",
                "elevator"
              ],
              "enumTitles": [
                "General contractors",
                "Home improvement and remodeling",
                "Electrical",
                "Plumbing",
                "Heating and air conditioning",
                "Roofing and gutters",
                "Solar",
                "Painting",
                "Landscaping and trees",
                "Concrete, masonry and paving",
                "Flooring and tile",
                "Carpentry and cabinets",
                "Windows, glass and doors",
                "Swimming pools",
                "Fencing",
                "Excavation and earthwork",
                "Demolition and asbestos",
                "Fire protection",
                "Elevators"
              ]
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Business cities, as the board writes them (Sacramento, Seattle). None means the whole state.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Five-digit business ZIP codes.",
            "items": {
              "type": "string"
            }
          },
          "issuedWithinDays": {
            "title": "Issued within (days)",
            "minimum": 1,
            "type": "integer",
            "description": "Only licences issued in the last this many days, for new businesses: the first issue in California, Oregon and Connecticut, the effective date in Washington, the current certificate's in New York. Arizona's search and Texas give no dates and are left out."
          },
          "expiresWithinDays": {
            "title": "Expires within (days)",
            "minimum": 1,
            "maximum": 730,
            "type": "integer",
            "description": "Only licences expiring from today to this many days ahead, for renewal leads: contractors about to renew their licence, and with it their bond, insurance or continuing education. The boards list only current licences, so a lapsed one isn't given. Arizona's search gives no dates and is left out."
          },
          "maxResultsPerState": {
            "title": "Max licences per state",
            "minimum": 0,
            "type": "integer",
            "description": "The most licences from each state; 0 for all. With only new licences, it counts the new ones.",
            "default": 1000
          },
          "onlyNew": {
            "title": "Only new licences",
            "type": "boolean",
            "description": "Give, and charge for, only the licences no earlier run with the same memory gave. Schedule it weekly or daily for leads on newly licensed contractors. The whole search is read to find them, but only the new ones are charged.",
            "default": false
          },
          "memory": {
            "title": "Memory name",
            "type": "string",
            "description": "One per alert, so two schedules don't share a memory. Kept in your account's key-value store contractor-licenses-memory; a licence no run reads for 60 days is forgotten.",
            "default": "default"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}