{
  "openapi": "3.0.1",
  "info": {
    "title": "Arizona ROC Contractor License Scraper",
    "description": "Arizona ROC contractor license scraper & API: search the Arizona Registrar of Contractors and export license number, status, classification, business name, owner, phone, address, bond and issue/expiry dates. Contractor verification, compliance and B2B lead generation — fast, no login.",
    "version": "1.3",
    "x-build-id": "cmib8uhHUEDyLCdbj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/haketa~az-roc-contractor-license-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-haketa-az-roc-contractor-license-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/haketa~az-roc-contractor-license-scraper/runs": {
      "post": {
        "operationId": "runs-sync-haketa-az-roc-contractor-license-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/haketa~az-roc-contractor-license-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-haketa-az-roc-contractor-license-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",
        "properties": {
          "cities": {
            "title": "Cities (pick from list)",
            "type": "array",
            "description": "Choose one or more Arizona cities to pull contractors from. This is the easiest way to build a local contractor list. Leave blank to sample the most popular Arizona metros automatically.",
            "items": {
              "type": "string",
              "enum": [
                "Phoenix",
                "Tucson",
                "Mesa",
                "Chandler",
                "Scottsdale",
                "Glendale",
                "Gilbert",
                "Tempe",
                "Peoria",
                "Surprise",
                "Goodyear",
                "Flagstaff",
                "Yuma",
                "Avondale",
                "Buckeye",
                "Prescott",
                "Prescott Valley",
                "Casa Grande",
                "Maricopa",
                "Queen Creek",
                "Sedona",
                "Lake Havasu City",
                "Kingman",
                "Sierra Vista",
                "Bullhead City"
              ],
              "enumTitles": [
                "Phoenix",
                "Tucson",
                "Mesa",
                "Chandler",
                "Scottsdale",
                "Glendale",
                "Gilbert",
                "Tempe",
                "Peoria",
                "Surprise",
                "Goodyear",
                "Flagstaff",
                "Yuma",
                "Avondale",
                "Buckeye",
                "Prescott",
                "Prescott Valley",
                "Casa Grande",
                "Maricopa",
                "Queen Creek",
                "Sedona",
                "Lake Havasu City",
                "Kingman",
                "Sierra Vista",
                "Bullhead City"
              ]
            }
          },
          "companyNames": {
            "title": "Company / Business Names (search box)",
            "type": "array",
            "description": "Optional. Type any business names to search — partial matches work (e.g. 'Acme Plumbing'). Each name runs its own search and may return multiple contractors across multiple pages.",
            "items": {
              "type": "string"
            }
          },
          "qualifyingPartyNames": {
            "title": "Qualifying Party Names (search box)",
            "type": "array",
            "description": "Optional. Type the full name of a qualifying party — the individual responsible for the license (e.g. 'John Smith'). Partial names are accepted.",
            "items": {
              "type": "string"
            }
          },
          "licenseNumbers": {
            "title": "License Numbers (search box)",
            "type": "array",
            "description": "Optional. Enter one or more exact ROC license numbers to look up directly (e.g. '123456'). This is the fastest, most precise lookup. Leading zeros are handled automatically.",
            "items": {
              "type": "string"
            }
          },
          "licenseType": {
            "title": "License Type",
            "enum": [
              "ALL",
              "RESIDENTIAL",
              "COMMERCIAL",
              "DUAL"
            ],
            "type": "string",
            "description": "Filter results by license type. 'All Types' returns everything. 'Residential' covers home construction and repair, 'Commercial' covers non-residential projects, and 'Dual' covers both.",
            "default": "ALL"
          },
          "licenseStatus": {
            "title": "License Status",
            "enum": [
              "ALL",
              "ACTIVE",
              "SUSPENDED",
              "EXPIRED",
              "REVOKED",
              "CANCELLED"
            ],
            "type": "string",
            "description": "Filter by license standing. 'All Statuses' returns every record. 'Active' returns only contractors currently authorized to work — the best choice for lead lists.",
            "default": "ALL"
          },
          "licenseClassification": {
            "title": "Trade / Classification",
            "enum": [
              "",
              "B",
              "B-1",
              "B-2",
              "A",
              "A-11",
              "A-12",
              "C-11",
              "R-11",
              "CR-11",
              "C-37",
              "R-37",
              "CR-37",
              "C-39",
              "R-39",
              "CR-39",
              "C-42",
              "R-42",
              "CR-42",
              "C-9",
              "CR-9",
              "C-34",
              "CR-34",
              "C-36",
              "CR-36",
              "C-6",
              "CR-6",
              "C-16",
              "CR-16",
              "C-21",
              "CR-21"
            ],
            "type": "string",
            "description": "Optional. Narrow results to a specific trade classification. 'All Classifications' includes every trade. Pick a common trade from the list, or use the advanced box below for any other code.",
            "default": ""
          },
          "licenseClassificationCustom": {
            "title": "Custom Classification Code (advanced)",
            "type": "string",
            "description": "Optional, advanced. If the exact trade code you want is not in the dropdown above, type it here (e.g. 'C-45', 'R-40'). This overrides the dropdown when filled.",
            "default": ""
          },
          "scrapeDetailPage": {
            "title": "Scrape Full Detail Page",
            "type": "boolean",
            "description": "When enabled, the scraper opens each contractor's detail page to collect complete information including bond details, all license classifications and qualifying party details. This is much slower (one extra page load per contractor), so it is OFF by default — the fast list view already returns license number, business name, qualifying party, classification, status, city and phone. Turn this ON only when you need bond and complaint data.",
            "default": false
          },
          "scrapeComplaints": {
            "title": "Include Complaint History",
            "type": "boolean",
            "description": "When enabled (requires Scrape Full Detail Page), fetches the complaint history for each contractor. Only complaints from the prior two years are shown on the AZ ROC portal. OFF by default to keep runs fast and cheap.",
            "default": false
          },
          "maxResultsPerSearch": {
            "title": "Max Results per Search",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum contractor records to return per individual search (across all pages). Set to 0 for unlimited. Tip: keep a limit like 100 for quick, low-cost runs.",
            "default": 0
          },
          "resultsPerPage": {
            "title": "Results Per Page",
            "enum": [
              "10",
              "20",
              "50"
            ],
            "type": "string",
            "description": "How many rows to load per page while scraping. 50 is fastest because it minimises page turns.",
            "default": "50"
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings for connecting to the AZ ROC portal. Datacenter proxies are enough for this Actor.",
            "default": {
              "useApifyProxy": true
            }
          },
          "maxConcurrency": {
            "title": "Max concurrent requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many detail lookups to run in parallel when detail scraping is enabled. Higher is faster; 3–8 is a good range.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}