{
  "openapi": "3.0.1",
  "info": {
    "title": "Arizona Contractor License Lookup & Leads Scraper (ROC)",
    "description": "Look up any Arizona ROC contractor licence by number or name, or export every active licence statewide (58,184 on 2026-10-07) with phone, street address, class, qualifying party and principals.",
    "version": "0.0",
    "x-build-id": "Wn0hH8Dy8KBZn7lF7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapebench~arizona-contractor-license-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapebench-arizona-contractor-license-lookup",
        "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/scrapebench~arizona-contractor-license-lookup/runs": {
      "post": {
        "operationId": "runs-sync-scrapebench-arizona-contractor-license-lookup",
        "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/scrapebench~arizona-contractor-license-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-scrapebench-arizona-contractor-license-lookup",
        "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": {
          "query": {
            "title": "License number or name",
            "type": "string",
            "description": "An ROC licence number ('333473' or 'ROC 333473'), a business name ('Arcadia Roofing'), or a person's name written FIRST then LAST ('Tommy Leale'). Leave empty to run an export instead."
          },
          "queries": {
            "title": "License numbers or names (batch)",
            "type": "array",
            "description": "Several lookups in ONE run, one per line. Combined with the field above if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "classification": {
            "title": "Classification (export)",
            "type": "string",
            "description": "An ROC class code ('R-42', 'CR-11', 'B', 'KB-1') or a word from the class name ('roofing' = every *-42 Roofing class, 'electrical', 'swimming pools'). A value that matches no class on the list is dropped and logged."
          },
          "classifications": {
            "title": "Classifications (batch, export)",
            "type": "array",
            "description": "Several classifications in ONE export, e.g. R-39 and CR-39.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "licenseClassType": {
            "title": "License type (export)",
            "type": "string",
            "description": "Residential, Commercial, Dual, General or Specialty — matched against ROC's class type ('Specialty Dual', 'General Residential', ...)."
          },
          "licenseClassTypes": {
            "title": "License types (batch, export)",
            "type": "array",
            "description": "Several license types in ONE export.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "city": {
            "title": "City (export)",
            "type": "string",
            "description": "Mailing-address city, exact match ignoring case and punctuation, e.g. 'Scottsdale'. ROC lists licences by mailing address, not by where the contractor works."
          },
          "cities": {
            "title": "Cities (batch, export)",
            "type": "array",
            "description": "Several cities in ONE export.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zipCode": {
            "title": "ZIP code (export)",
            "type": "string",
            "description": "5-digit mailing ZIP, e.g. '85018'."
          },
          "zipCodes": {
            "title": "ZIP codes (batch, export)",
            "type": "array",
            "description": "Several ZIP codes in ONE export.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "nameFilter": {
            "title": "Name contains (export)",
            "type": "string",
            "description": "Case-insensitive text in the business name, DBA or qualifying party."
          },
          "nameFilters": {
            "title": "Names (batch, export)",
            "type": "array",
            "description": "Several name fragments in ONE export; a licence matching any of them is returned once.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "arizonaAddressesOnly": {
            "title": "Arizona mailing addresses only (export)",
            "type": "boolean",
            "description": "Out-of-state contractors can hold an ROC licence: 9,336 of 58,184 active licences (16%, 2026-10-07) have a mailing address outside Arizona. Tick to drop them.",
            "default": false
          },
          "includePhone": {
            "title": "Add phone + principals (export)",
            "type": "boolean",
            "description": "The posting list has no phone column. When ticked, each exported licence is matched to ROC's contractor search for its phone and the people on the licence (owners, officers, qualifying party). Adds time, not cost. Rows that could not be matched say so in enrichment_status.",
            "default": true
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "EXPORT: cap on licences for the WHOLE run — your spend control (58,184 active licences on 2026-10-07; set 100000 to take everything that matches). LOOKUP: cap per name or number (default 50)."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Used only to download the statewide posting list in EXPORT mode, and only if the direct download is refused (ROC's Cloudflare blocks datacenter IPs). Residential is the setting that works; lookups never use it.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "US"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}