{
  "openapi": "3.0.1",
  "info": {
    "title": "Alabama Contractor License Lookup & Verify (LBGC)",
    "description": "Verify any Alabama general contractor by license number or name — specialty/classification, city, phone, address, and expiration — from the official LBGC registry.",
    "version": "0.0",
    "x-build-id": "76Qv9YpR6cZ6bjPDI"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapebench~alabama-contractor-license-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapebench-alabama-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~alabama-contractor-license-lookup/runs": {
      "post": {
        "operationId": "runs-sync-scrapebench-alabama-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~alabama-contractor-license-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-scrapebench-alabama-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": "Search query",
            "minLength": 1,
            "type": "string",
            "description": "An Alabama LBGC general-contractor license number (exact) or a business name (substring). The board publishes a numeric license number; anything non-numeric is treated as a name search. Leave this and 'Search query (batch)' empty to export the whole LBGC roster instead, narrowed by the filters below."
          },
          "queries": {
            "title": "Search query (batch)",
            "type": "array",
            "description": "Look up many in ONE run instead of starting a run per lookup. Takes the same values as 'Search query'. Combined with 'Search query' if you fill both, and duplicates are removed. Billing is unchanged: you are charged per record returned, not per entry submitted.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "classification": {
            "title": "Classification (statewide export)",
            "type": "string",
            "description": "Statewide export only. An LBGC classification code (BC, BCU4, MU, H/RR, HS, E, M, D, SP, EV, SC, ADM, REP, SUBCONTRACTOR, or a '-S' subclassification such as BC-S) matched exactly, or a word from the classification description, e.g. 'roofing', 'plumbing', 'electrical'. Empty = every classification. An unrecognised value is ignored with a log line; if nothing you gave is recognised, the run returns a free row saying so instead of the whole state."
          },
          "classifications": {
            "title": "Classifications (batch)",
            "type": "array",
            "description": "Several classifications in ONE run (a licensee matching any of them is returned once). Combined with 'Classification' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Licence status (statewide export)",
            "type": "string",
            "description": "Statewide export only: active (default; includes licences LBGC lists as extended past their expiry), inactive, or all."
          },
          "statuses": {
            "title": "Licence statuses (batch)",
            "type": "array",
            "description": "Several statuses in ONE run. Combined with 'Licence status' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "addressState": {
            "title": "Mailing-address state (statewide export)",
            "type": "string",
            "description": "Statewide export only. Two-letter state of the licensee's mailing address, e.g. AL for Alabama-based firms. LBGC licenses many out-of-state contractors (4,222 of 8,993 licensees had an Alabama address on 2026-10-09), so leave empty for every licensee."
          },
          "addressStates": {
            "title": "Mailing-address states (batch)",
            "type": "array",
            "description": "Several mailing-address states in ONE run. Combined with 'Mailing-address state' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "city": {
            "title": "City (statewide export)",
            "type": "string",
            "description": "Statewide export only. Mailing-address city, exact match ignoring case and punctuation. LBGC publishes no county, so filter by city or ZIP."
          },
          "cities": {
            "title": "Cities (batch)",
            "type": "array",
            "description": "Several cities in ONE run. Combined with 'City' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zip": {
            "title": "ZIP code (statewide export)",
            "type": "string",
            "description": "Statewide export only. Mailing-address ZIP, 5 digits (a ZIP+4 is matched on its first 5)."
          },
          "zips": {
            "title": "ZIP codes (batch)",
            "type": "array",
            "description": "Several ZIPs in ONE run. Combined with 'ZIP code' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "With a search query: cap on matches PER QUERY (default 50), so a batch cannot silently return only the first rows overall and read as 'no match'; with detail pages on, each match costs one page fetch. Statewide export: cap for the whole run (default 500, a spend control). The full roster is 8,993 licensees (measured 2026-10-09), so 100000 returns everything that matches; the run log states how many matched when the cap cuts it short."
          },
          "includeDetails": {
            "title": "Include detail pages",
            "type": "boolean",
            "description": "Search queries only: fetch each match's detail page to add address, ZIP, and expiration date. Disable for a faster, roster-only run. The statewide export reads LBGC's roster file, which already carries address, ZIP, phone, fax, bid limit and expiry, so no detail pages are fetched there.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. The Alabama LBGC site is reachable directly; a proxy is not needed.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}