{
  "openapi": "3.0.1",
  "info": {
    "title": "TDLR Texas Contractor Licenses — Active & New-License Export",
    "description": "Look up and export active (non-expired) Texas contractor licenses from TDLR open data (A/C, electrical, appliance installation, electrical sign contractors by default; other TDLR license types selectable). Filter by type and status, export CSV/JSON/Excel, or get only licenses new since the last run.",
    "version": "0.2",
    "x-build-id": "NQlvbxIkOoT0mZkSd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/leadforge-data~contractor-license-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-leadforge-data-contractor-license-leads",
        "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/leadforge-data~contractor-license-leads/runs": {
      "post": {
        "operationId": "runs-sync-leadforge-data-contractor-license-leads",
        "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/leadforge-data~contractor-license-leads/run-sync": {
      "post": {
        "operationId": "run-sync-leadforge-data-contractor-license-leads",
        "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": {
          "states": {
            "title": "States",
            "type": "array",
            "description": "Array of strings. Allowed values: \"TX\" (Texas TDLR licenses). \"FL\" is accepted but Florida is temporarily unavailable: it is skipped with a warning and returns no records. Default: [\"TX\"].",
            "default": [
              "TX"
            ],
            "items": {
              "type": "string"
            }
          },
          "sinceDate": {
            "title": "Newly issued since (YYYY-MM-DD)",
            "type": "string",
            "description": "String, date in YYYY-MM-DD format. Optional, no default. Florida only (filters on the original license date). Ignored for Texas, because the Texas source has no issue date; use newOnly for Texas. Because Florida is unavailable, this currently has no effect."
          },
          "activeOnly": {
            "title": "Active licenses only",
            "type": "boolean",
            "description": "Boolean. Default: true. When true, expired licenses are dropped. Texas: status is derived from expirationDate (expirationDate earlier than today = Expired, dropped; missing expirationDate = Unknown, kept). Florida (unavailable): keeps only DBPR status Current. Set false to also return expired Texas licenses.",
            "default": true
          },
          "txLicenseTypes": {
            "title": "TX TDLR license types",
            "type": "array",
            "description": "Array of strings. Texas only. Exact TDLR license_type names from data.texas.gov dataset 7358-krk7 (case-sensitive). Default: [\"A/C Contractor\", \"Electrical Contractor\", \"Appliance Installation Contractor\", \"Electrical Sign Contractor\"].",
            "default": [
              "A/C Contractor",
              "Electrical Contractor",
              "Appliance Installation Contractor",
              "Electrical Sign Contractor"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Integer, number of output records. Range 1 to 10000 (larger values are clamped to 10000). Default: 100.",
            "default": 100
          },
          "newOnly": {
            "title": "TX: only licenses new since last run",
            "type": "boolean",
            "description": "Boolean. Default: false. Texas only. When true, returns only licenses not present in the snapshot saved by the previous run (named key-value store 'contractor-license-leads-state' in the caller's Apify account, one snapshot per txLicenseTypes set). The first run with a given txLicenseTypes set only creates the baseline and returns 0 Texas records. firstSeenDate is the date this actor first saw the license, NOT the license issue date.",
            "default": false
          },
          "excludeQualifiedBusiness": {
            "title": "FL: exclude Qualified Business entities",
            "type": "boolean",
            "description": "Boolean. Default: true. Florida only (currently unavailable). When true, skips Qualified Business (QB) records, which DBPR publishes without a license number. When false, they are included and sorted after individual licensees.",
            "default": true
          },
          "includePhone": {
            "title": "Include phone (opt-in)",
            "type": "boolean",
            "description": "Boolean. Default: false. Texas only. When true, outputs the TDLR business_telephone in the phone field; when false, phone is null. For sole proprietors this is often a personal number. The caller is responsible for TCPA/DNC/CCPA compliance.",
            "default": false
          },
          "includePersonalNames": {
            "title": "Include personal names (opt-in)",
            "type": "boolean",
            "description": "Boolean. Default: false. When includePersonalNames=false (default), name is kept only if it contains a company word (LLC, L.L.C., LLP, LLLP, PLLC, Inc, Incorporated, Corp, Corporation, Co, Company, Ltd, Limited, LP, PC, Group, Holding(s), University, College, Institute, Foundation, Association, JV, Joint Venture, GmbH, PLC, Pty; whole word, case-insensitive) and is not flagged isSoleProprietor and is not in 'LAST, FIRST' format; otherwise name is null. Conservative: some real companies are nulled. nameStatus shows why. The same rule is applied to businessName (see businessNameStatus). When true, the license owner name is always output as published.",
            "default": false
          },
          "includeStreetAddress": {
            "title": "Include street address (opt-in)",
            "type": "boolean",
            "description": "Boolean. Default: false. When true, outputs street address lines in the address field; when false, address is null. City, state, ZIP and county are always output. Street addresses of individual licensees are often residential. The caller is responsible for privacy-law compliance.",
            "default": false
          },
          "txAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "String, secret. Optional, no default. A free data.texas.gov (Socrata) app token; only reduces throttling and does not change results. Leave empty if you do not have one."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}