{
  "openapi": "3.0.1",
  "info": {
    "title": "TDLR Texas Contractor & Trade License Scraper",
    "description": "Search TDLR Texas contractor and trade licenses — electrician, elevator, A/C, mold remediation, water well, cosmetology, and 80+ other types. Returns full business address, phone, owner contact, and live Active/Expired/Revoked status.",
    "version": "0.1",
    "x-build-id": "J8KI6xgYlVDOGCKbz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ws_tony~tdlr-texas-contractor-license-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ws_tony-tdlr-texas-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/ws_tony~tdlr-texas-contractor-license-scraper/runs": {
      "post": {
        "operationId": "runs-sync-ws_tony-tdlr-texas-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/ws_tony~tdlr-texas-contractor-license-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-ws_tony-tdlr-texas-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": {
          "searchMode": {
            "title": "Search mode",
            "enum": [
              "enriched",
              "api_only"
            ],
            "type": "string",
            "description": "Enriched adds the live Active / Expired / Revoked status from tdlr.texas.gov for every result — slower and more expensive but gives you fields the state's bulk data doesn't include. API-only is pure bulk data: cheapest, fastest, no live status.",
            "default": "enriched"
          },
          "licenseTypes": {
            "title": "License types",
            "uniqueItems": true,
            "type": "array",
            "description": "Only return licenses matching these types. Leave empty to include every TDLR license type. Use exact Socrata names. Types with full business address + phone: 'Electrical Contractor', 'Electrical Sign Contractor', 'Elevator Contractor', 'Appliance Installation Contractor', 'Service Contract Provider', 'Water Well Driller/Pump Installer', 'Full Service Establishment', 'Mini Establishment', 'Manicurist/Esthetician Establishment', 'Esthetician Establishment'. Types with thin records (name + county only): 'A/C Contractor', 'A/C Technician', 'Journeyman Electrician', 'Master Electrician', 'Residential Wireman'.",
            "items": {
              "type": "string"
            }
          },
          "licenseNumbers": {
            "title": "Specific license numbers",
            "uniqueItems": true,
            "type": "array",
            "description": "Look up specific license numbers directly. When provided, filters above still apply — use this together with a licenseTypes entry to disambiguate (the same number can exist across different license types).",
            "items": {
              "type": "string"
            }
          },
          "businessNameContains": {
            "title": "Business name contains",
            "type": "string",
            "description": "Case-insensitive substring filter on the business name. Example: 'HVAC'. Note: the state search also matches owner/personnel names — a hit on 'SMITH' can surface business 'Acme Inc.' with owner John Smith."
          },
          "ownerNameContains": {
            "title": "Owner name contains",
            "type": "string",
            "description": "Case-insensitive substring filter on the owner's name (last, first). Example: 'MURPHY, DAVID'."
          },
          "counties": {
            "title": "Counties",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by business county. Use full uppercase names: HARRIS, BEXAR, TRAVIS, DALLAS, TARRANT, etc.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by business city (case-insensitive). Matches the city portion of 'CITY, STATE ZIP'.",
            "items": {
              "type": "string"
            }
          },
          "zipPrefix": {
            "title": "ZIP prefix",
            "pattern": "^[0-9]{0,5}$",
            "type": "string",
            "description": "Business ZIP code prefix. '77' returns all Houston-area ZIPs; '78704' matches one specific ZIP. Max 5 digits."
          },
          "requireBusinessAddress": {
            "title": "Only return licenses with a business address (recommended for lead-gen)",
            "type": "boolean",
            "description": "When true, drops all records that don't have a business address in the state's open-data dataset. That filters to ~108k business-entity licenses (Electrical Contractor, Elevator Contractor, Appliance Installation Contractor, cosmetology establishments, etc.) — every returned record has full address + phone. Keep off to also include individual licenses (A/C Contractor, journeymen, technicians) which only have name + county.",
            "default": false
          },
          "expirationDateFrom": {
            "title": "Expiration date from",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Earliest license expiration date (inclusive). Format: YYYY-MM-DD."
          },
          "expirationDateTo": {
            "title": "Expiration date to",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string",
            "description": "Latest license expiration date (inclusive). Format: YYYY-MM-DD."
          },
          "activeOnly": {
            "title": "Active licenses only",
            "type": "boolean",
            "description": "Drop licenses that are Expired, Canceled, Revoked or Suspended. In enriched mode this uses the live site status; in API-only mode it uses expiration_date >= today as an approximation.",
            "default": true
          },
          "continuingEducationFlag": {
            "title": "Continuing-education filter",
            "enum": [
              "any",
              "Y",
              "N"
            ],
            "type": "string",
            "description": "Filter by whether the license has a continuing-education flag set in the bulk data.",
            "default": "any"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on records pushed to the dataset. Protects your account from runaway costs. Every returned record is a billable result under the per-result pricing model.",
            "default": 1000
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy (datacenter) is fine for TDLR. Only enable residential if you see a block rate."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Parallel enrichment requests to tdlr.texas.gov. Higher = faster but more likely to trigger rate limiting.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}