{
  "openapi": "3.0.1",
  "info": {
    "title": "Arizona ROC Contractor License Scraper",
    "description": "Scrape Arizona Registrar of Contractors (AZ ROC) license records. Search by license number, company name, qualifying party, city, license type and classification. Returns status, bond info, complaint history and full license details.",
    "version": "0.0",
    "x-build-id": "RU1rmFVZHGJ9P891X"
  },
  "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": {
          "licenseNumbers": {
            "title": "License Numbers",
            "type": "array",
            "description": "One or more ROC license numbers to look up directly (e.g. '123456'). This is the fastest and most precise search method. Leading zeros are handled automatically.",
            "items": {
              "type": "string"
            }
          },
          "companyNames": {
            "title": "Company / Business Names",
            "type": "array",
            "description": "Business names to search. Partial matches are supported (e.g. 'Acme Plumbing'). Each name triggers a separate search and may return multiple results across multiple pages.",
            "items": {
              "type": "string"
            }
          },
          "qualifyingPartyNames": {
            "title": "Qualifying Party Names",
            "type": "array",
            "description": "Full name of the qualifying party (the individual responsible for the license). Format: 'First Last' (e.g. 'John Smith'). Partial names are accepted.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Arizona city names to search by location (e.g. 'Phoenix', 'Tucson', 'Scottsdale'). Can be combined with license type or classification filters. For large cities pagination will be used to collect all results.",
            "items": {
              "type": "string"
            }
          },
          "licenseType": {
            "title": "License Type",
            "enum": [
              "ALL",
              "RESIDENTIAL",
              "COMMERCIAL",
              "DUAL"
            ],
            "type": "string",
            "description": "Filter results by license type. 'ALL' returns all types. 'RESIDENTIAL' covers home construction/repair. 'COMMERCIAL' covers non-residential projects. 'DUAL' covers both.",
            "default": "ALL"
          },
          "licenseStatus": {
            "title": "License Status Filter",
            "enum": [
              "ALL",
              "ACTIVE",
              "SUSPENDED",
              "EXPIRED",
              "REVOKED",
              "CANCELLED"
            ],
            "type": "string",
            "description": "Filter by license status. 'ALL' returns every record regardless of standing. 'ACTIVE' returns only contractors currently authorized to work.",
            "default": "ALL"
          },
          "licenseClassification": {
            "title": "License Classification",
            "type": "string",
            "description": "Optional classification code to filter results (e.g. 'B-1', 'R-11', 'C-37'). Leave blank to include all classifications.",
            "default": ""
          },
          "maxResultsPerSearch": {
            "title": "Max Results per Search Query",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of contractor records to return per individual search query (across all pages). Set to 0 for unlimited — the scraper will paginate through all available result pages.",
            "default": 0
          },
          "resultsPerPage": {
            "title": "Results Per Page",
            "minimum": 10,
            "maximum": 50,
            "type": "integer",
            "description": "Number of results to request per page from the AZ ROC portal. Valid values are 10, 25, or 50. Higher values mean fewer page loads and faster runs.",
            "default": 50
          },
          "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, complaint history and qualifying party details. Increases run time and cost but provides richer data.",
            "default": true
          },
          "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.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Proxy settings for browser requests to the AZ ROC portal. Apify residential proxies are recommended for production runs to avoid detection by Salesforce bot protection."
          },
          "maxConcurrency": {
            "title": "Max Concurrent Browsers",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum number of browser tabs running in parallel. Higher values speed up bulk runs but increase memory and proxy usage. Recommended: 2-5 for residential proxies.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}