{
  "openapi": "3.0.1",
  "info": {
    "title": "Arizona Contractor License Lookup & Leads Scraper (ROC)",
    "description": "Look up an Arizona ROC contractor license by license number or name, or export all 50,000+ active licenses by classification, city or ZIP: status, class, qualifying party, principals, phone, address, expiry. $0.004 per license; no-match is free.",
    "version": "0.0",
    "x-build-id": "66DMH80q3h1r7lDJD"
  },
  "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "auto",
              "lookup",
              "export"
            ],
            "type": "string",
            "description": "auto (default): a name or number below runs a lookup, none runs an export. lookup: find licences by ROC number or business/person name, every status. export: active licences statewide by the filters below (classification, city, ZIP, expiry), names and numbers ignored.",
            "default": "auto"
          },
          "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'). Prefer 'queries' (a list). Leave both empty to run an export instead."
          },
          "queries": {
            "title": "License numbers or names (batch)",
            "type": "array",
            "description": "ROC licence numbers, business names or person names (FIRST LAST) to look up, several in ONE run. Combined with 'query' 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"
            }
          },
          "licenseTypes": {
            "title": "Licence types (export)",
            "type": "array",
            "description": "Same as Classifications (ROC's licence types are its classes): codes like 'R-42' or words like 'roofing' (every *-42 Roofing class: C-42, R-42, CR-42).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "licenseType": {
            "title": "Licence type (export)",
            "type": "string",
            "description": "One licence type; same as Classification."
          },
          "statuses": {
            "title": "Statuses",
            "type": "array",
            "description": "Keep only licences with these ROC statuses ('Active', 'Revoked', 'Expired', 'Suspended' ...). Lookups search every status unless this is set; the statewide export holds Active licences only.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Status",
            "type": "string",
            "description": "One status; same as Statuses."
          },
          "expiresAfter": {
            "title": "Expires on or after (export)",
            "type": "string",
            "description": "ISO date, e.g. 2026-12-01. With 'Expires on or before', lists licences due for renewal in a window. Export rows only (the lookup source shows no expiry date)."
          },
          "expiresBefore": {
            "title": "Expires on or before (export)",
            "type": "string",
            "description": "ISO date, e.g. 2027-02-28."
          },
          "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: about 16% of active licences 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 have no phone or principals.",
            "default": true
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Each licence returned is billed ($0.004). EXPORT: cap on licences for the WHOLE run — your spend control (50,000+ active licences; 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}