# NY & TX Liquor License & Hospitality Leads (`afkdigital/newapi14-ny-tx-hospitality-licenses`) Actor

Find traceable New York and Texas liquor-license records by location, raw class, status and dates. Conservative active-date screening, deduplication, JSON/CSV output, and per-record budget controls.

- **URL**: https://apify.com/afkdigital/newapi14-ny-tx-hospitality-licenses.md
- **Developed by:** [AFK Digital](https://apify.com/afkdigital) (community)
- **Categories:** Lead generation, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.50 / 1,000 unique license records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## NY & TX Liquor License & Hospitality Leads

Find New York and Texas liquor-license records with premises names, legal entities, addresses, state-specific license classes, source statuses, issue/expiration dates and a link back to the official source record.

**Price: $0.0045 per unique license record ($4.50 per 1,000 records).** One billable Dataset item represents one state + license ID in a run. There is no Actor-start fee and no separate event charge. Standard run platform usage is included in this record price.

### Supported sources

| State | Official source | Dataset ID | Coverage |
| --- | --- | --- | --- |
| NY | [New York State Liquor Authority — Current Liquor Authority Active Licenses](https://data.ny.gov/Economic-Development/Current-Liquor-Authority-Active-Licenses/9s3h-dpkz) | 9s3h-dpkz | Licenses and permits published in the current active dataset, including temporary and additional-bar records |
| TX | [Texas Alcoholic Beverage Commission — TABC License Information](https://data.texas.gov/dataset/TABC-License-Information/7hf9-qc9f) | 7hf9-qc9f | Approved/issued primary licenses, including source non-active records |

Only NY and TX are implemented. Every run selects one state and restricts premises to that state. The underlying sources include more than bars and restaurants: retail stores, manufacturers, temporary-event permits and other classes can appear. Choose suitable raw classes for your use case. A license record does **not** prove that a venue is currently open, that a new business has opened, or that a sale/contact opportunity exists.

Both sources describe their posting frequency as daily. This Actor reports the actual source update timestamp; it does not guarantee that an agency has published a fresh snapshot every day.

### Quick start

New York restaurant-class records:

```json
{
  "state": "NY",
  "city": "Albany",
  "licenseClasses": ["0340"],
  "status": "active",
  "maxResults": 100,
  "maxCostUsd": 0.45
}
```

Texas beverage-permit records:

```json
{
  "state": "TX",
  "city": "Austin",
  "licenseClasses": ["MB", "BG"],
  "status": "active",
  "maxResults": 100,
  "maxCostUsd": 0.45
}
```

NY class strings preserve leading zeros. NY 0340 and 0081 are useful restaurant/grocery examples. Texas MB and BG are Texas-specific codes. The Actor never treats either state's codes as a cross-state legal equivalence.

### How active selection works

The default `status: "active"` is a **conservative extraction rule**. It keeps the agency's raw fields separate from the Actor's date qualification.

- **NY:** the record is present in the active-license dataset, and its latest issue, effective and expiration dates are valid, nonempty and cover the observation date. NY does not publish a status column in this dataset, so `license_status_raw` is null.
- **TX:** `primary_status` must be exactly `Active`, and valid, nonempty current-issued/expiration dates must cover the observation date. Combined statuses such as `Active - Renewal Pending` remain intact in `license_status_raw`.
- Missing or invalid dates never qualify as active. A passed expiration date is classified as `expired` by the Actor's date comparison even when Texas's raw status says Active. Renewal rules may make agency status and expiration different; the Actor does not determine legal renewal/grace-period rights.
- `active_under_date_rules` describes this test, not current venue operations. `venue_operating_status` is always `not_verified`.
- Calendar-date strings are preserved without converting source dates into UTC instants. Date checks use America/New_York for NY and America/Chicago for TX. The exact `as_of_date` is provided in the run summary. One observation timestamp is pinned for the entire run and preserved on resume.

Choose `all` to inspect everything the selected source publishes. This does not create inactive NY history that its current dataset does not contain.

| Input status | Behavior |
| --- | --- |
| active | Conservative source/date checks above |
| all | No active/date-qualification filter; explicit location, class and date filters still apply |
| expired | Source expiration date is earlier than the observation date; raw status is preserved |
| inactive | TX only: nonempty source primary status is not Active; unsupported for NY |

An optional `licenseStatus` applies an exact match to Texas's combined raw `license_status`, for example `Surrendered` or `Active - Renewal Pending`. It is rejected for NY.

### Inputs

| Input | Default | Meaning |
| --- | --- | --- |
| state | required | NY or TX; one state per run |
| city | none | Exact premises city, case insensitive |
| zip | none | Five-digit premises ZIP; matches first five digits of longer source ZIPs |
| licenseClasses | \[] | Exact source class strings; empty selects all classes |
| status | active | Selection described above |
| licenseStatus | none | Exact combined TX source status only |
| issueDateFrom / issueDateTo | none | Inclusive YYYY-MM-DD range for the **latest/current issued date** |
| expirationDateFrom / expirationDateTo | none | Inclusive YYYY-MM-DD expiration range |
| maxResults | 100 | Total unique records in the run; 0–10,000 |
| maxCostUsd | 0.45 | Maximum record charge in USD |
| pageSize | 100 | Source rows per page, 1–500 |
| maxRequests | 100 | Total source HTTP attempts including metadata and retries, 1–500 |
| requestTimeoutSecs | 30 | Per-source-request timeout, 1–60 seconds |
| maxRuntimeSecs | 240 | Extraction deadline for source requests and output writes, 5–600 seconds; set the overall Actor timeout high enough |

`issue_date` and issue-date filters use NY `lastissuedate` and TX `current_issued_date`; these may represent renewals. `original_issue_date` is included separately. An issuance date is not a business-opening date.

The Actor rejects invalid dates, unsupported states, unsupported NY native-status filters, malformed budgets and unrecognized input names. All user text is escaped as a literal; arbitrary SoQL and arbitrary source URLs are not accepted.

### Output and provenance

The default Dataset supports Apify's JSON and CSV exports. Each record contains:

| Field | Meaning |
| --- | --- |
| state | Selected jurisdiction/premises state |
| license_permit_id | NY text ID or canonical integer-string TX license ID |
| premises_dba_name | Source DBA/trade name; null stays null |
| legal_entity_name | Source legal name/owner |
| street_address, city, zip | Premises address; mailing addresses are not substituted |
| license_class_raw | Exact state-specific class code |
| license_status_raw | TX combined raw status; null for NY |
| issue_date, expiration_date | Latest/current issued and expiration calendar dates, nullable |
| source_dataset | Official dataset identity |
| source_record_url | Public source API URL filtered to the returned source row |
| observed_at | UTC retrieval-session timestamp |

Additional evidence includes `street_address_additional`, `source_row_id`, `source_dataset_url`, `source_updated_at`, `original_issue_date`, `effective_date`, `primary_status_raw`, `secondary_status_raw`, `license_description_raw`, `record_status`, `active_under_date_rules` and `venue_operating_status`.

A missing DBA is never replaced with the legal entity name. Different licenses at the same venue are different records. Deduplication uses **state + license ID**, not company names, premises addresses or Texas master-file IDs. A fresh run can return the same license again and charges for its newly delivered result in that run.

The key-value store record `SUMMARY` reports output counts, duplicate/filter counts, source timestamps, source request/retry counts, effective budget limit, estimated record charges and termination reason.

### Spending limits and reliability

The result ceiling is the smallest of `maxResults`, the number of whole $0.0045 records affordable under `maxCostUsd`, and the platform run's maximum-charge limit. For example, $0.01 permits **two records**, and a budget below $0.0045 permits zero. Existing rows count toward the same limit when a run is resurrected.

The run uses a single automatically billed default-Dataset item event. It does not bill separate source requests, retries, duplicates or invalid/filtered rows. Developer-owned test runs still consume the developer account's platform resources under Apify's rules.

Source requests use explicit row-ID ordering and keyset pagination. Record IDs are opaque for paging. HTTP429, timeouts and transient server failures receive bounded backoff and retries; other source errors fail explicitly. The request/deadline caps prevent unbounded retries.

Source schema and `rowsUpdatedAt` are checked before and after extraction, and the snapshot is checked on resume. A changed source snapshot or ambiguous output-write failure stops the run instead of silently claiming a complete result. Records already delivered remain available. Output appends are serial and are not automatically retried; resume reconstructs saved license IDs from the Dataset before appending. This is not a claim of transactional exactly-once behavior across arbitrary storage faults.

A run that reaches its configured result/budget limit is a limited extract, not the full state's license inventory. A source failure is never converted into an apparently successful empty Dataset.

### Source attribution and reuse

**New York:** Source: Alcoholic Beverage Control, Division of (State Liquor Authority), Current Liquor Authority Active Licenses, OPEN NY. The [OPEN NY Terms of Use](https://data.ny.gov/dataset/OPEN-NY-Terms-Of-Use/77gx-ii52) govern the portal. They allow lawful reuse without a mandatory attribution condition; this Actor voluntarily includes source links and timestamps. The dataset metadata does not declare a named Creative Commons license. Agency names are used for source identification, without endorsement.

**Texas:** Source: Texas Alcoholic Beverage Commission, TABC License Information, Texas Open Data Portal. The metadata identifies TABC as the publisher and provides public API access but does not state a dataset-specific named reuse license. The portal links its [platform terms](https://www.socrata.com/terms-of-service), and TABC publishes its [site policies](https://www.tabc.texas.gov/about-us/tabc-site-policies/). Source credit and timestamps are included for traceability. Do not infer a CC0 license or agency endorsement.

This paid product provides extraction, normalization, filtering, provenance and automation over public government data; it is not affiliated with NY SLA, TABC or either state. No outreach or marketing messages are sent.

### Version and verification

Product code: **NEWAPI14**. Release: **1.0.0**. Actor source version: **1.0**. Node.js22, Apify SDK3.7.2.

Local release verification passed 42 unit/integration tests and 11 official-source live scenarios, including NY 0340/0081 and TX MB/BG. Verification covers two actual source classes per state, raw/source-status differences, expired and missing dates, missing DBA, state restrictions, quote escaping, pagination, duplicate license IDs, resume handling, 429/backoff, timeouts, request caps and fractional budgets. Run IDs, source snapshots and sample exports are recorded with the release evidence.

For local development:

```bash
npm ci
npm test
npm run test:live
```

For an issue, include the state, nonsecret input, run ID and source update timestamp.

# Actor input Schema

## `state` (type: `string`):

Select one licensing jurisdiction per run. Premises must be located in that state.

## `city` (type: `string`):

Optional exact city name, case insensitive.

## `zip` (type: `string`):

Optional 5-digit premises ZIP; matches the first five digits of ZIP+4.

## `licenseClasses` (type: `array`):

Exact source codes. NY examples: 0340 Restaurant, 0081 Grocery Store. TX examples: MB, BG. Codes are not equivalent between states.

## `status` (type: `string`):

Active requires valid nonempty current issue and expiration dates; NY also requires effective date. This is an extraction rule, not a legal or operating-status determination.

## `licenseStatus` (type: `string`):

Optional exact combined Texas license_status, for example Active - Renewal Pending or Surrendered. Unsupported for NY.

## `issueDateFrom` (type: `string`):

Inclusive YYYY-MM-DD. NY lastissuedate / TX current_issued_date. May represent renewals.

## `issueDateTo` (type: `string`):

Inclusive YYYY-MM-DD.

## `expirationDateFrom` (type: `string`):

Inclusive YYYY-MM-DD.

## `expirationDateTo` (type: `string`):

Inclusive YYYY-MM-DD.

## `maxResults` (type: `integer`):

Total limit including records already saved if this run is resumed.

## `maxCostUsd` (type: `number`):

Hard record-price budget at $0.0045 per record. $0.45 permits 100 records; $4.50 permits 1,000. The lower platform maximum also applies.

## `pageSize` (type: `integer`):

Advanced: number of source rows per request.

## `maxRequests` (type: `integer`):

Advanced: includes metadata and retries. Hitting this limit fails explicitly; already saved records remain available.

## `requestTimeoutSecs` (type: `integer`):

Advanced: each HTTP request has a timeout.

## `maxRuntimeSecs` (type: `integer`):

Advanced: bounds source requests and Dataset appends. Set below the overall Actor timeout to allow startup and final reporting.

## Actor input object example

```json
{
  "state": "NY",
  "zip": "10001",
  "licenseClasses": [
    "0081"
  ],
  "status": "active",
  "maxResults": 5,
  "maxCostUsd": 0.0225,
  "pageSize": 2,
  "maxRequests": 100,
  "requestTimeoutSecs": 30,
  "maxRuntimeSecs": 240
}
```

# Actor output Schema

## `json` (type: `string`):

No description

## `csv` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "state": "NY",
    "zip": "10001",
    "licenseClasses": [
        "0081"
    ],
    "status": "active",
    "maxResults": 5,
    "maxCostUsd": 0.0225,
    "pageSize": 2
};

// Run the Actor and wait for it to finish
const run = await client.actor("afkdigital/newapi14-ny-tx-hospitality-licenses").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "state": "NY",
    "zip": "10001",
    "licenseClasses": ["0081"],
    "status": "active",
    "maxResults": 5,
    "maxCostUsd": 0.0225,
    "pageSize": 2,
}

# Run the Actor and wait for it to finish
run = client.actor("afkdigital/newapi14-ny-tx-hospitality-licenses").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "state": "NY",
  "zip": "10001",
  "licenseClasses": [
    "0081"
  ],
  "status": "active",
  "maxResults": 5,
  "maxCostUsd": 0.0225,
  "pageSize": 2
}' |
apify call afkdigital/newapi14-ny-tx-hospitality-licenses --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,afkdigital/newapi14-ny-tx-hospitality-licenses"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/g5m5sn3ucoKcX0dWD/builds/4sNZq47sbD7L3ex8H/openapi.json
