{
  "openapi": "3.0.1",
  "info": {
    "title": "Texas New Business Leads: New LLCs, Sales Tax & TABC",
    "description": "Fresh Texas new business leads from official state data: newly formed LLCs & corporations (SOS file number), new sales tax permits with NAICS industry, and pending & new TABC liquor licenses. Cross-source matching, 0-100 lead score, county/city/ZIP filters, monitor mode.",
    "version": "0.2",
    "x-build-id": "ikcb9COsuIPISXfIg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lonestar-leads~texas-new-business-leads/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lonestar-leads-texas-new-business-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/lonestar-leads~texas-new-business-leads/runs": {
      "post": {
        "operationId": "runs-sync-lonestar-leads-texas-new-business-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/lonestar-leads~texas-new-business-leads/run-sync": {
      "post": {
        "operationId": "run-sync-lonestar-leads-texas-new-business-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": {
          "sources": {
            "title": "Data sources",
            "type": "array",
            "description": "Which official Texas datasets to pull. salesTaxPermits = new Comptroller sales tax permits (new retail/service locations, with NAICS industry). tabcPendingApplications = pending TABC alcohol license applications (bars, restaurants, stores BEFORE they open). tabcNewLicenses = TABC primary licenses originally issued in the date window. newEntities = NEW: newly formed Texas LLCs/corporations and out-of-state entities registering in Texas (SOS file number, charter date, entity type) from the Comptroller franchise-tax file. If you leave this empty, the first three are used (same as before newEntities existed).",
            "items": {
              "type": "string",
              "enum": [
                "salesTaxPermits",
                "tabcPendingApplications",
                "tabcNewLicenses",
                "newEntities"
              ],
              "enumTitles": [
                "New sales tax permits (Comptroller)",
                "Pending TABC license applications",
                "Newly issued TABC licenses",
                "New LLCs & corporations (SOS charter / franchise tax)"
              ]
            },
            "default": [
              "salesTaxPermits",
              "tabcPendingApplications",
              "tabcNewLicenses"
            ]
          },
          "daysBack": {
            "title": "Days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Return records dated within the last N days (permit issue date, application submission date, or license original issue date). The newEntities source uses its own window (New LLCs: days back). Ignored if Start date is set.",
            "default": 7
          },
          "startDate": {
            "title": "Start date (optional)",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive start date, YYYY-MM-DD. Overrides Days back."
          },
          "endDate": {
            "title": "End date (optional)",
            "pattern": "^$|^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive end date, YYYY-MM-DD. Defaults to today."
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Texas county names, e.g. Lubbock, Harris, Travis. Leave empty for all 254 counties.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "City names, e.g. Lubbock, Wolfforth. Case-insensitive exact match. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit ZIP codes. Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "naicsPrefixes": {
            "title": "NAICS industry prefixes (sales tax permits only)",
            "type": "array",
            "description": "Keep only sales tax permits whose NAICS code starts with one of these, e.g. 722 (restaurants & bars), 2382 (building equipment contractors), 4411 (auto dealers), 8121 (personal care). TABC records are not filtered by NAICS.",
            "items": {
              "type": "string"
            }
          },
          "nameContains": {
            "title": "Business name contains (optional)",
            "type": "string",
            "description": "Case-insensitive substring match on business / owner name."
          },
          "onlyNew": {
            "title": "Monitor mode: only records not seen in previous runs",
            "type": "boolean",
            "description": "When enabled, the Actor remembers record IDs between runs (in a named key-value store) and outputs only records it has not returned before. Ideal for daily or weekly schedules.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Name for the monitor memory. Use different keys for different saved searches.",
            "default": "default"
          },
          "entityDaysBack": {
            "title": "New LLCs: days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Look-back window for the newEntities source, by SOS charter date. New entities usually appear in the Comptroller file about 2 weeks after they are chartered, so the default is 30 days. Use Monitor mode to get each new entity exactly once. Ignored if Start date is set.",
            "default": 30
          },
          "entityTypes": {
            "title": "New LLCs: entity types",
            "type": "array",
            "description": "Keep only these entity types for the newEntities source. Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "llc",
                "corporation",
                "professional",
                "partnership",
                "nonprofit",
                "other"
              ],
              "enumTitles": [
                "LLCs (Texas & foreign)",
                "Corporations (profit, Texas & foreign)",
                "Professional corporations / associations",
                "Partnerships (LP, LLP, GP, JV)",
                "Nonprofits",
                "Other (trusts, associations, unknown)"
              ]
            }
          },
          "enrichWithEntityData": {
            "title": "Add SOS/entity details to permits & TABC records",
            "type": "boolean",
            "description": "Looks up each sales-tax-permit holder (by Comptroller taxpayer number) and each TABC owner that is an LLC/Inc/etc. (by exact legal name) in the franchise-tax file, and adds entity type, SOS file number, charter date and right-to-transact status. Only fills empty fields.",
            "default": true
          },
          "mergeMatches": {
            "title": "One row per business (merge matches across sources)",
            "type": "boolean",
            "description": "When enabled, records that describe the same business (same taxpayer number, or same exact legal name) are merged into one row with an events list, firstEventDate and lastEventDate. When disabled (default), you get one row per source record, and matchedSources / relatedRecordIds show the links.",
            "default": false
          },
          "sortBy": {
            "title": "Sort results by",
            "enum": [
              "source",
              "leadScore",
              "date"
            ],
            "type": "string",
            "description": "source = by data source, newest first within each source (the original behaviour). leadScore = best leads first. date = newest event first across all sources.",
            "default": "source"
          },
          "minLeadScore": {
            "title": "Minimum lead score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Drop rows with a lead score below this value (0-100). The score is explained in leadScoreReasons on every row. 0 = keep everything.",
            "default": 0
          },
          "excludeAgentAddresses": {
            "title": "Exclude registered-agent / virtual-office addresses",
            "type": "boolean",
            "description": "For newEntities rows, drop entities whose address is shared by 10+ entities set up in the last year (typical of registered agents and virtual offices, so the address is not where the business operates).",
            "default": false
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum total records to output across all sources.",
            "default": 1000
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free data.texas.gov app token for higher API rate limits. Not required."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}