{
  "openapi": "3.0.1",
  "info": {
    "title": "Texas Contractor & Trade License Lookup & Export (TDLR)",
    "description": "Verify a Texas electrician, HVAC or trade license by number or name — or export every Electrical or A/C Contractor statewide, filtered by county, city, ZIP or expiry, from TDLR.",
    "version": "0.0",
    "x-build-id": "GlcUoJLQWDChbsr5C"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapebench~texas-contractor-license-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapebench-texas-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~texas-contractor-license-lookup/runs": {
      "post": {
        "operationId": "runs-sync-scrapebench-texas-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~texas-contractor-license-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-scrapebench-texas-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": "A Texas TDLR license number, business name, or owner name. Searches all three: exact license number, business-name substring, and owner-name substring — results are unioned and deduped by license #. TDLR keeps owner and business as separate columns and they disagree on 19,774 of its 983,494 records, so an owner search finds people a business-name search cannot. Leave this and the batch list empty to run a statewide export by licence type instead (see the statewide fields 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"
            }
          },
          "licenseType": {
            "title": "Licence type (statewide export)",
            "type": "string",
            "description": "Used only when no search query is given: export every TDLR licence of this type statewide. TDLR's own type name, case-insensitive, e.g. 'Electrical Contractor' (14,019 records, 2026-10-07) or 'A/C Contractor' (20,436). Leave empty for the default contractor set: Electrical Contractor, A/C Contractor, Appliance Installation Contractor, Electrical Sign Contractor and Elevator Contractor (36,312 records). An unknown type is dropped with a log line, never widened to the whole 1M-row register."
          },
          "licenseTypes": {
            "title": "Licence types (statewide export, list)",
            "type": "array",
            "description": "Several TDLR licence types in one export. Combined with 'Licence type'. Note: TDLR publishes address, city, ZIP and phone only for company/establishment types — Electrical Contractor, Appliance Installation Contractor, Electrical Sign Contractor and Elevator Contractor have them on ~99.8% of rows; A/C Contractor and every individually held licence (A/C Technician, Master Electrician, ...) have none.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "county": {
            "title": "County (statewide export)",
            "type": "string",
            "description": "Statewide mode only: keep licences whose business county is this Texas county, e.g. 'Travis' or 'Harris County'."
          },
          "counties": {
            "title": "Counties (statewide export, list)",
            "type": "array",
            "description": "Statewide mode only: several counties (OR). Combined with 'County'. Unknown names are dropped with a log line.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "city": {
            "title": "City (statewide export)",
            "type": "string",
            "description": "Statewide mode only: keep licences whose business city is this, e.g. 'Austin'. Only company/establishment types carry a city, so A/C Contractor rows never match."
          },
          "cities": {
            "title": "Cities (statewide export, list)",
            "type": "array",
            "description": "Statewide mode only: several cities (OR). Combined with 'City'.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zip": {
            "title": "ZIP (statewide export)",
            "type": "string",
            "description": "Statewide mode only: 5-digit business ZIP, e.g. '78701'. Same coverage caveat as City."
          },
          "zips": {
            "title": "ZIPs (statewide export, list)",
            "type": "array",
            "description": "Statewide mode only: several ZIPs (OR). Combined with 'ZIP'. Values that are not 5 digits are dropped with a log line.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeExpired": {
            "title": "Exclude expired licences",
            "type": "boolean",
            "description": "Statewide mode only: keep only licences whose expiration date is today or later. TDLR publishes no status column, so expiry is the only currency signal.",
            "default": false
          },
          "expiresAfter": {
            "title": "Expires on or after (YYYY-MM-DD)",
            "type": "string",
            "description": "Statewide mode only: keep licences expiring on or after this date."
          },
          "expiresBefore": {
            "title": "Expires on or before (YYYY-MM-DD)",
            "type": "string",
            "description": "Statewide mode only: keep licences expiring on or before this date — with 'Expires on or after' this gives a renewal-window list."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Search mode: cap PER ENTRY (default 50), so a batch cannot silently return only the first 50 rows overall. Statewide mode: cap on the whole export (default 500; up to 100,000). The log states how many records matched in total, so a capped export never reads as complete."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. The Texas TDLR open-data API 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}