> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nexusfeed.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Texas TABC License Lookup API

> Verify Texas alcoholic beverage licenses via the Texas Alcoholic Beverage Commission — CAPTCHA solved server-side.

The Texas Alcoholic Beverage Commission (TABC) publishes a public license lookup at `apps.tabc.texas.gov/publicinquiry`. It's an ASP.NET WebForms application behind an image CAPTCHA on every submission. NexusFeed solves the CAPTCHA server-side via 2Captcha, drives the form in headless Chromium, captures the results popup, and parses the DOM — all in a single request.

## State overview

| Field                 | Value                                                                                |
| --------------------- | ------------------------------------------------------------------------------------ |
| **State code**        | TX                                                                                   |
| **Agency**            | Texas Alcoholic Beverage Commission                                                  |
| **Source URL**        | `https://apps.tabc.texas.gov/publicinquiry/StatusNewLayout.aspx`                     |
| **Authentication**    | None (public portal)                                                                 |
| **CAPTCHA**           | **Image CAPTCHA on every submission** — solved via 2Captcha in the NexusFeed backend |
| **Search supported**  | Yes (`dba_name`, `owner_name`, `city`)                                               |
| **Lookup supported**  | Yes                                                                                  |
| **Extraction method** | `structured_parse`                                                                   |
| **Cache TTL**         | 24 hours                                                                             |

## How the CAPTCHA pipeline works

<Steps>
  <Step title="Load the form in headless Chromium">
    NexusFeed opens the TABC public inquiry page and waits for the CAPTCHA image element to render.
  </Step>

  <Step title="Fetch the CAPTCHA as base64">
    A `page.evaluate(fetch('/publicinquiry/Captcha.aspx'))` call downloads the CAPTCHA image directly inside the page context — this preserves the ASP.NET session cookie that the image is bound to. Fetching the image from the server side would produce a mismatched session and an incorrect solve.
  </Step>

  <Step title="Send to 2Captcha">
    The base64 image is posted to 2Captcha's `method=base64` endpoint. Typical solve time is 5-15 seconds. Cost is roughly \$1-3 per 1,000 solves.
  </Step>

  <Step title="Submit the form">
    The solved text is typed into the CAPTCHA field along with the search parameters, and the form is submitted. TABC opens a results popup.
  </Step>

  <Step title="Capture the popup and parse">
    Playwright captures the popup page via `page.context.expect_page()` and NexusFeed parses the result DOM into structured records.
  </Step>
</Steps>

<Warning>
  TX endpoints require `TWOCAPTCHA_API_KEY` to be configured on the server. If it isn't, the API returns:

  ```json theme={null}
  {
    "detail": {
      "error": "CAPTCHA_SOLVER_NOT_CONFIGURED",
      "message": "TX TABC requires TWOCAPTCHA_API_KEY env var to be set"
    }
  }
  ```

  Production deployments always have a 2Captcha key active. This only matters if you are self-hosting NexusFeed.
</Warning>

## Search example

```bash theme={null}
curl "https://api.nexusfeed.dev/v1/abc/search?state=TX&dba_name=WHATABURGER" \
  -H "X-API-Key: YOUR_KEY"
```

## Lookup example

```bash theme={null}
curl "https://api.nexusfeed.dev/v1/abc/license/BG123456?state=TX" \
  -H "X-API-Key: YOUR_KEY"
```

## Performance note

TX requests are slower than other states because the CAPTCHA solve adds 5-15 seconds to the round-trip. NexusFeed caches results aggressively (24 hours) so repeat lookups do not incur the CAPTCHA cost. The first request for a given query takes a few seconds; subsequent cached requests return in tens of milliseconds.

## Texas license types (most common)

| Code | Type                                      |
| ---- | ----------------------------------------- |
| `MB` | Mixed Beverage Permit                     |
| `BG` | Wine & Beer Retailer's Permit             |
| `BQ` | Wine & Beer Retailer's Off-Premise Permit |
| `BE` | Brewpub License                           |
| `P`  | Package Store Permit                      |
| `BF` | Beer Retailer's On-Premise License        |

## Use cases

* Verifying a Texas bar, restaurant, or retailer holds an active TABC license.
* Onboarding Texas liquor distributor accounts.
* Compliance checks against current license status and expiration.
* Due diligence during Texas hospitality business transactions.
