# Texas Department of Insurance License Scraper (`parseforge/tdi-texas-insurance-scraper`) Actor

Extract Texas Department of Insurance license records: 950K+ agents and 55K+ agencies with license numbers, NPN, types, status, dates, and locations. Filter by license type, city, or ZIP.

- **URL**: https://apify.com/parseforge/tdi-texas-insurance-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Lead generation, Business, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $18.75 / 1,000 records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

![ParseForge Banner](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)

## 🛡️ Texas Department of Insurance Scraper

> 🚀 **Pull every licensed Texas insurance agent and agency in seconds.** Filter by license type, state, city, ZIP, name, or NPN. No API key, no registration, no manual CSV wrangling.

> 🕒 **Last updated:** 2026-05-17 · **📊 17 fields** per record · **950K+ agent records** · **55K+ agency records** · **29 license types**

The Texas Department of Insurance (TDI) publishes one of the largest state insurance licensing files in the United States. Texas is the second-largest insurance market in the country, and every individual or business that sells, adjusts, or underwrites a policy in the state has to be licensed and renewed on file. That file covers life agents, property and casualty agents, adjusters, surplus lines brokers, public adjusters, title agencies, managing general agencies, and several other categories. This scraper turns the entire roster into a clean, queryable dataset.

Records include license numbers, National Producer Numbers (NPNs), license types, qualifications, issue and expiration dates, mailing city, state, and postal code, and active-status flags. Each query can target individual licensees (agents and adjusters) or organizational licensees (agencies and businesses). Server-side filters cut down the result set before any data crosses the wire, so a recruiter looking for active general lines agents in Houston or a compliance team auditing surplus lines brokers gets exactly what they need without paying to process the rest.

| 🎯 Target Audience | 💼 Primary Use Cases |
|---|---|
| Insurance carriers, MGAs, and IMOs recruiting producers | Sourcing licensed agents for appointment outreach |
| HR and staffing firms placing licensed talent | Verifying license status, type, and expiration |
| Compliance, audit, and regulatory teams | Monitoring portfolio license health across renewals |
| Lead generation, ALM, and InsurTech vendors | Building state-by-state licensee databases |

---

### 📋 What the Texas Department of Insurance Scraper does

- 🏷️ **License-type filter.** Pick from 29 agent license types or 21 agency license types and narrow to General Lines, Adjuster, Surplus Lines, Title Agency, and more.
- 🗺️ **Geographic filter.** Filter by state of mailing address, exact city, or ZIP code prefix to scope to a metro or region.
- 🔎 **Direct lookup.** Resolve a single license number or NPN to a full record in one call.
- 📛 **Name search.** Find every licensee whose name contains a substring, useful for individuals tied to multiple licenses.
- ⏳ **Active-only switch.** Skip expired licenses by default, or include them when you want a historical view.

Each record is a row in the TDI licensing system. It tells you who the licensee is, what they can sell or adjust, which Texas-recognized qualification backs that authority, when their license was issued, when it expires, where their address of record sits, and whether the license is currently active. Agency records add the organizational structure (Corporation, LLC, Sole Proprietor, etc.) and, for title agencies, the list of Texas counties they serve.

> 💡 **Why it matters:** Texas wrote over 200 billion dollars in direct insurance premiums in the most recent reporting year. The list of who is allowed to participate in that market is public, but the official lookup is one record at a time. Bulk access turns regulatory data into recruitment pipelines, audit trails, and market sizing.

---

### 🎬 Full Demo

🚧 Coming soon: a 3-minute walkthrough showing input setup, filter combinations, and exporting a 50,000-row dataset to CSV.

---

### ⚙️ Input

<table>
<thead>
<tr><th>Field</th><th>Type</th><th>Required</th><th>Description</th></tr>
</thead>
<tbody>
<tr><td><code>maxItems</code></td><td>integer</td><td>No</td><td>Cap on results. Free plan caps at 10 automatically. Paid plan up to 1,000,000.</td></tr>
<tr><td><code>dataset</code></td><td>enum</td><td>No</td><td><code>agents</code> for individuals, <code>agencies</code> for organizations. Default <code>agents</code>.</td></tr>
<tr><td><code>licenseTypeAgent</code></td><td>enum</td><td>No</td><td>One of 29 agent license types (General Lines Agent, Adjuster, Life Agent, etc.). Leave blank for all.</td></tr>
<tr><td><code>licenseTypeAgency</code></td><td>enum</td><td>No</td><td>One of 21 agency license types (General Lines Agency, Title Agency, etc.). Leave blank for all.</td></tr>
<tr><td><code>state</code></td><td>enum</td><td>No</td><td>USPS state code of mailing address. 50 states plus territories. Leave blank for all.</td></tr>
<tr><td><code>city</code></td><td>string</td><td>No</td><td>Exact city match, case insensitive. Example: <code>HOUSTON</code>.</td></tr>
<tr><td><code>postalCode</code></td><td>string</td><td>No</td><td>ZIP prefix. Example: <code>770</code> returns every record with a postal code starting 770.</td></tr>
<tr><td><code>nameContains</code></td><td>string</td><td>No</td><td>Substring match on licensee name, case insensitive. Example: <code>SMITH</code>.</td></tr>
<tr><td><code>licenseNumber</code></td><td>string</td><td>No</td><td>Direct lookup by Texas license number.</td></tr>
<tr><td><code>npn</code></td><td>string</td><td>No</td><td>Direct lookup by National Producer Number.</td></tr>
<tr><td><code>activeOnly</code></td><td>boolean</td><td>No</td><td>If true (default), only records whose expiration date is in the future.</td></tr>
</tbody>
</table>

Example: all active General Lines Agents in Houston, capped at 500.

```json
{
  "dataset": "agents",
  "licenseTypeAgent": "General Lines Agent",
  "state": "TX",
  "city": "HOUSTON",
  "activeOnly": true,
  "maxItems": 500
}
````

Example: all active Title Agencies statewide.

```json
{
  "dataset": "agencies",
  "licenseTypeAgency": "Title Agency",
  "state": "TX",
  "activeOnly": true,
  "maxItems": 1000
}
```

> ⚠️ **Good to Know:** TDI mailing addresses are not always Texas addresses. A non-resident adjuster licensed in Texas may show an Ohio or Florida mailing address. Use the <code>state</code> filter on mailing state, not on jurisdiction of license.

***

### 📊 Output

Each item is a single licensee record. Agent and agency rows share the same field set, with a <code>recordType</code> discriminator.

#### 🧾 Schema

| Field | Type | Example |
|---|---|---|
| 🪪 `licenseNumber` | string | `728736` |
| 🔢 `npn` | string | `1000033` |
| 👤 `name` | string | `JONATHAN BERNAL` |
| 🏷️ `recordType` | string | `agent` |
| 📋 `licenseType` | string | `General Lines Agent` |
| ⭐ `qualification` | string | `Life, Accident, Health & HMO` |
| 🏢 `agencyType` | string | `Corporation` |
| ✅ `isActive` | boolean | `true` |
| 📅 `licenseIssueDate` | date | `1988-01-11T00:00:00.000Z` |
| ⏳ `expirationDate` | date | `2026-09-30T00:00:00.000Z` |
| 🏙️ `city` | string | `FORT WORTH` |
| 🗺️ `state` | string | `TX` |
| 🌎 `province` | string | `Ontario` |
| 🏛️ `county` | string | `Harris, Dallas, Bexar` |
| 📮 `postalCode` | string | `761073222` |
| 🔗 `sourceUrl` | string | `https://www.tdi.texas.gov/agent/agent-lookup.html` |
| 🕒 `scrapedAt` | date | `2026-05-17T00:33:54.624Z` |

#### 📦 Sample records

<details>
<summary><strong>Typical:</strong> active Texas General Lines Agent</summary>

```json
{
  "licenseNumber": "728736",
  "npn": "1000033",
  "name": "JONATHAN BERNAL",
  "recordType": "agent",
  "licenseType": "General Lines Agent",
  "qualification": "Life, Accident, Health & HMO",
  "agencyType": null,
  "isActive": true,
  "licenseIssueDate": "1988-01-11T00:00:00.000Z",
  "expirationDate": "2026-09-30T00:00:00.000Z",
  "city": "FORT WORTH",
  "state": "TX",
  "province": null,
  "county": null,
  "postalCode": "761073222",
  "sourceUrl": "https://www.tdi.texas.gov/agent/agent-lookup.html",
  "scrapedAt": "2026-05-17T00:33:54.624Z"
}
```

</details>

<details>
<summary><strong>Edge case:</strong> Texas Title Agency with multi-county service area</summary>

```json
{
  "licenseNumber": "1877031",
  "npn": "1009282",
  "name": "ROCKET CLOSE, LLC",
  "recordType": "agency",
  "licenseType": "Title Agency",
  "qualification": "Underwriter",
  "agencyType": "Corporation",
  "isActive": true,
  "licenseIssueDate": "2009-03-18T00:00:00.000Z",
  "expirationDate": "2027-04-01T00:00:00.000Z",
  "city": "FORT WORTH",
  "state": "TX",
  "province": null,
  "county": "Atascosa, Bastrop, Bell, Bexar, Blanco, Brazoria, Brazos, Burnet, Caldwell, Cameron, Chambers, Collin, Comal, Cooke, Coryell, Dallas, Denton, Ector, El Paso, Ellis, Fort Bend, Galveston, Grayson, Gregg, Guadalupe, Harris, Hays, Henderson, Hidalgo, Hood, Hunt, Jefferson, Johnson, Kaufman, Kendall, Liberty, Llano, McLennan, Medina, Midland, Montgomery, Nueces, Parker, Potter, Randall, Rockwall, San Patricio, Smith, Tarrant, Travis, Van Zandt, Victoria, Walker, Waller, Williamson, Wilson, Wise, Wood",
  "postalCode": "761771529",
  "sourceUrl": "https://www.tdi.texas.gov/agent/agent-lookup.html",
  "scrapedAt": "2026-05-17T00:33:54.624Z"
}
```

</details>

<details>
<summary><strong>Sparse:</strong> out-of-state non-resident adjuster</summary>

```json
{
  "licenseNumber": "1730686",
  "npn": "9543663",
  "name": "ROSS LAND",
  "recordType": "agent",
  "licenseType": "Adjuster",
  "qualification": "Adjuster - P&C",
  "agencyType": null,
  "isActive": true,
  "licenseIssueDate": "2012-01-18T00:00:00.000Z",
  "expirationDate": "2027-01-31T00:00:00.000Z",
  "city": "CINCINNATI",
  "state": "OH",
  "province": null,
  "county": null,
  "postalCode": "45202",
  "sourceUrl": "https://www.tdi.texas.gov/agent/agent-lookup.html",
  "scrapedAt": "2026-05-17T00:33:54.624Z"
}
```

</details>

***

### ✨ Why choose this Actor

| Emoji | Capability |
|---|---|
| 🛰️ | **Direct from source.** Pulls the same records the Texas regulator publishes, with no intermediary cache or stale snapshot. |
| ⚡ | **Server-side filters.** Filter by license type, state, city, ZIP, and active status before a single row is downloaded. |
| 🧱 | **Unified schema.** Agents and agencies share one shape, so downstream code does not branch on row type. |
| 🔍 | **Direct lookups.** License-number or NPN inputs resolve to a single record without a full scan. |
| 🪶 | **No proxies needed.** Uses the public open-data interface, so jobs run fast and cheap. |
| 📅 | **Active-only switch.** One flag to exclude expired licenses, on by default. |
| 🔁 | **Schedulable.** Pair with Apify Schedules to refresh your downstream warehouse daily or weekly. |

> 📊 The Texas insurance market wrote more than 200 billion dollars in direct premiums in the most recent reporting year, with hundreds of thousands of producers active at any time.

***

### 📈 How it compares to alternatives

| Approach | Cost | Coverage | Refresh | Filters | Setup |
|---|---|---|---|---|---|
| ⭐ **Texas Department of Insurance Scraper** *(this Actor)* | Pay per item | All agents + agencies (1M rows) | On demand | License type, state, city, ZIP, NPN, name | Minutes |
| Official lookup UI | Free | One record at a time | Live | Name or license number only | Manual |
| Paid live APIs | Subscription | Variable | Live | Vendor specific | Days |
| Legacy community dumps | Free | Stale | Annual or never | None | Hours of cleanup |

Compared with the official one-record lookup or annual data dumps, this Actor returns thousands of structured records in a single job with full filter support.

***

### 🚀 How to use

1. 🆕 **Create an Apify account.** Sign up at [console.apify.com](https://console.apify.com/sign-up?fpr=vmoqkp). Free tier works for testing.
2. 🛠️ **Open the Actor page** and click "Try for free".
3. 🎚️ **Set the filters you need.** Pick the dataset (agents or agencies), a license type, and a state. Leave the rest blank to broaden the pull.
4. ▶️ **Run the Actor.** Watch the log for paging progress.
5. 📥 **Export the dataset.** CSV, JSON, Excel, or push directly to your storage of choice from the Apify UI.

> ⏱️ **Total time:** Under 5 minutes from sign-up to first export.

***

### 💼 Business use cases

<table>
<tr>
<td width="50%">

#### 🧲 Recruiters and MGAs

- Build prospect lists of licensed General Lines Agents by city
- Find active Surplus Lines Brokers for specialty placements
- Track newly licensed adjusters within a state region
- Target Personal Lines P\&C agents for appointment offers

</td>
<td width="50%">

#### 📋 Compliance and audit

- Verify a producer's license before commission payout
- Audit which carriers' appointed agents are active vs lapsed
- Monitor license expirations for a multi-state book
- Build internal Know-Your-Producer (KYP) records

</td>
</tr>
<tr>
<td width="50%">

#### 📊 Market research and InsurTech

- Map active Texas agent density by ZIP for footprint planning
- Compare share of life vs P\&C agents by metro
- Track growth in Adjuster - DHS Texas licenses after storms
- Power license-status widgets inside agency-management apps

</td>
<td width="50%">

#### 🎯 Lead generation

- Append license data to ABM lists for insurance verticals
- Enrich cold outbound with verified license type and expiration
- Source title agencies by county for a real-estate workflow
- Build segments of Managing General Agents for partnership outreach

</td>
</tr>
</table>

***

### 🌟 Beyond business use cases

Data like this powers more than commercial workflows. The same structured records support research, education, civic projects, and personal initiatives.

<table>
<tr>
<td width="50%">

#### 🎓 Research and academia

- Empirical datasets for papers, thesis work, and coursework
- Longitudinal studies tracking changes across snapshots
- Reproducible research with cited, versioned data pulls
- Classroom exercises on data analysis and ethical scraping

</td>
<td width="50%">

#### 🎨 Personal and creative

- Side projects, portfolio demos, and indie app launches
- Data visualizations, dashboards, and infographics
- Content research for bloggers, YouTubers, and podcasters
- Hobbyist collections and personal trackers

</td>
</tr>
<tr>
<td width="50%">

#### 🤝 Non-profit and civic

- Transparency reporting and accountability projects
- Advocacy campaigns backed by public-interest data
- Community-run databases for local issues
- Investigative journalism on public records

</td>
<td width="50%">

#### 🧪 Experimentation

- Prototype AI and machine-learning pipelines with real data
- Validate product-market hypotheses before engineering spend
- Train small domain-specific models on niche corpora
- Test dashboard concepts with live input

</td>
</tr>
</table>

***

### 🔌 Automating Texas Department of Insurance Scraper

You can trigger this Actor from any environment that can call an HTTP endpoint.

- [**Node.js SDK**](https://docs.apify.com/sdk/js) to call the Actor and pipe results into your app
- [**Python SDK**](https://docs.apify.com/sdk/python) for data-science and ETL workflows
- [**Apify API docs**](https://docs.apify.com/api/v2) for raw REST integrations

Use [**Apify Schedules**](https://docs.apify.com/platform/schedules) to run the Actor on a cron and keep a fresh dataset in your warehouse. A nightly job at 2:00 a.m. Central time is a sensible default for Texas data.

***

### ❓ Frequently Asked Questions

<details>
<summary>📜 <strong>Is this data public?</strong></summary>

Yes. The Texas Department of Insurance publishes licensee data through the state Open Data Portal as a public record under Texas Government Code Chapter 552.

</details>

<details>
<summary>💼 <strong>Can I use this data commercially?</strong></summary>

The underlying records are public. You are responsible for following the source's terms of use and applicable laws (CAN-SPAM, TCPA, state DNC rules) when contacting any licensee.

</details>

<details>
<summary>💳 <strong>Do I need a paid plan?</strong></summary>

Free plans run up to 10 items per job, ideal for testing. Paid plans unlock the full one-million-item ceiling. Sign up at [console.apify.com](https://console.apify.com/sign-up?fpr=vmoqkp).

</details>

<details>
<summary>🆘 <strong>What if my run fails?</strong></summary>

Open the run log, then file a ticket through [**our contact form**](https://tally.so/r/BzdKgA). Most failures are caused by an unrecognized license-type value or a malformed license number, and the log will say which.

</details>

<details>
<summary>⚖️ <strong>Is scraping this data legal?</strong></summary>

The Texas Department of Insurance publishes this data for public access. Pulling structured copies through the official open-data interface is consistent with that intent. Always consult counsel for jurisdiction-specific guidance.

</details>

<details>
<summary>🔢 <strong>Can I look up a single licensee?</strong></summary>

Yes. Set <code>licenseNumber</code> or <code>npn</code> to a known value and leave the other filters blank. The Actor returns a single record.

</details>

<details>
<summary>🏙️ <strong>How precise is the city filter?</strong></summary>

The city filter is an exact match on the mailing-address city, case insensitive. Cities are stored uppercase, so <code>Houston</code> and <code>HOUSTON</code> both work.

</details>

<details>
<summary>📮 <strong>How does the ZIP filter behave?</strong></summary>

The postal-code input is treated as a prefix. Pass <code>770</code> to capture every record whose ZIP starts with 770, useful for grouping by metro area.

</details>

<details>
<summary>⌛ <strong>Does it include expired licenses?</strong></summary>

Set <code>activeOnly</code> to false to include expired or surrendered licenses. The default is true, which restricts results to records whose expiration date is in the future.

</details>

<details>
<summary>🆕 <strong>How fresh is the data?</strong></summary>

The source dataset updates at the cadence published on the Texas Open Data Portal, typically daily. Each scrape pulls live records at run time.

</details>

<details>
<summary>📊 <strong>How many license types are there?</strong></summary>

29 distinct agent license types and 21 distinct agency license types, ranging from General Lines Agent and Life Agent to Surplus Lines Broker, Title Agency, and Reinsurance Manager.

</details>

<details>
<summary>🌎 <strong>Does it include non-resident licensees?</strong></summary>

Yes. About 57 percent of records are Texas-resident, with the remainder spread across all 50 states plus several US territories.

</details>

***

### 🔌 Integrate with any app

- [**Make**](https://www.make.com/en/integrations/apify) - no-code workflows and triggers
- [**Zapier**](https://zapier.com/apps/apify/integrations) - connect to 5,000+ apps
- [**n8n**](https://n8n.io/integrations/apify/) - self-hosted automation
- [**Airbyte**](https://airbyte.com/connectors/apify) - data-warehouse pipelines
- [**Google Sheets**](https://apify.com/apify/google-sheets) - push items directly into a spreadsheet
- [**Webhook**](https://docs.apify.com/platform/integrations/webhooks) - call any endpoint when a run finishes

***

### 🔗 Recommended Actors

- [**🛡️ FINRA BrokerCheck Scraper**](https://apify.com/parseforge/finra-brokercheck-scraper) - lookups for licensed brokers and investment advisors
- [**🏥 NPI/NPPES Healthcare Provider Scraper**](https://apify.com/parseforge/npi-nppes-scraper) - federal healthcare-provider identifier records
- [**🪪 California Contractor (CSLB) Scraper**](https://apify.com/parseforge/cslb-california-scraper) - California state contractor license lookups
- [**🔨 Texas State Licensed Contractor Scraper**](https://apify.com/parseforge/tdlr-texas-scraper) - other Texas state license records (TDLR)
- [**🏛️ Sunbiz Florida Business Scraper**](https://apify.com/parseforge/sunbiz-florida-business-scraper) - Florida business-entity records

> 💡 **Pro Tip:** browse the complete [ParseForge collection](https://apify.com/parseforge) for more state and federal regulatory datasets.

***

**🆘 Need Help?** Reach the ParseForge team through [**our contact form**](https://tally.so/r/BzdKgA). Custom enrichment, schedule tuning, and bulk-pricing questions all welcome.

***

> ⚖️ **Disclaimer:** ParseForge is not affiliated with, endorsed by, or sponsored by the Texas Department of Insurance. This Actor accesses publicly available licensing records published by the state. Users are responsible for compliance with applicable contact-rules, privacy, and data-protection laws when using the data downstream.

# Actor input Schema

## `maxItems` (type: `integer`):

Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000

## `dataset` (type: `string`):

Which TDI record set to scrape. Agents includes individual agents and adjusters. Agencies includes corporate licensees and businesses.

## `licenseTypeAgent` (type: `string`):

Filter agent records by license type. Leave blank to include all types. Only applies when dataset is 'agents'.

## `licenseTypeAgency` (type: `string`):

Filter agency records by license type. Leave blank to include all types. Only applies when dataset is 'agencies'.

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

Filter by licensee mailing address state. Leave blank to include all states.

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

Filter by city (exact match, case insensitive). Example: HOUSTON

## `postalCode` (type: `string`):

Filter by postal code prefix. Example: 770 returns all Houston-area ZIPs starting with 770.

## `nameContains` (type: `string`):

Filter by substring match on the licensee name (case insensitive). Example: SMITH

## `licenseNumber` (type: `string`):

Look up a single license by Texas license number. Example: 3340665

## `npn` (type: `string`):

Look up a single licensee by National Producer Number. Example: 7352575

## `activeOnly` (type: `boolean`):

If true, only return records whose expiration date is in the future. If false, includes expired licenses.

## Actor input object example

```json
{
  "maxItems": 10,
  "dataset": "agents",
  "licenseTypeAgent": "",
  "licenseTypeAgency": "",
  "state": "",
  "activeOnly": true
}
```

# Actor output Schema

## `overview` (type: `string`):

Key license and licensee fields in a table view.

## `fullData` (type: `string`):

Complete record set with every field.

# 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 = {
    "maxItems": 10,
    "dataset": "agents"
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/tdi-texas-insurance-scraper").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 = {
    "maxItems": 10,
    "dataset": "agents",
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/tdi-texas-insurance-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "maxItems": 10,
  "dataset": "agents"
}' |
apify call parseforge/tdi-texas-insurance-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=parseforge/tdi-texas-insurance-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Texas Department of Insurance License Scraper",
        "description": "Extract Texas Department of Insurance license records: 950K+ agents and 55K+ agencies with license numbers, NPN, types, status, dates, and locations. Filter by license type, city, or ZIP.",
        "version": "0.1",
        "x-build-id": "iLNeXx5t3chel7Vak"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/parseforge~tdi-texas-insurance-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-parseforge-tdi-texas-insurance-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/parseforge~tdi-texas-insurance-scraper/runs": {
            "post": {
                "operationId": "runs-sync-parseforge-tdi-texas-insurance-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/parseforge~tdi-texas-insurance-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-parseforge-tdi-texas-insurance-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": {
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Free users: Limited to 10 items (preview). Paid users: Optional, max 1,000,000"
                    },
                    "dataset": {
                        "title": "Dataset",
                        "enum": [
                            "agents",
                            "agencies"
                        ],
                        "type": "string",
                        "description": "Which TDI record set to scrape. Agents includes individual agents and adjusters. Agencies includes corporate licensees and businesses.",
                        "default": "agents"
                    },
                    "licenseTypeAgent": {
                        "title": "License type (agents)",
                        "enum": [
                            "",
                            "General Lines Agent",
                            "Adjuster",
                            "Life Agent",
                            "Pers Lines Prop and Cas Agent",
                            "Adjuster - DHS Texas",
                            "Surplus Lines Agent",
                            "Escrow Officer",
                            "Limited Lines Agent",
                            "Pre-Need Agent",
                            "County Mutual Agent",
                            "Public Insurance Adjuster",
                            "Life Agt Not Exceeding $25,000",
                            "Managing General Agent",
                            "Temp General Lines - LAH Agent",
                            "Risk Manager",
                            "Specialty Insurance Agent",
                            "Life Stlmt Bkr Regr - Life Agt",
                            "Temporary Life Agent",
                            "Life Stlmnt Broker",
                            "Reinsurance Broker",
                            "Temp General Lines - P&C Agent",
                            "Reinsurance Manager",
                            "Temp. Pers Lines Prop and Cas",
                            "Temporary Pre-Need Agent",
                            "Temporary Limited Lines Agent",
                            "Temporary County Mutual Agent",
                            "Temp Gen Lines- Emer P&C Agent",
                            "Life Stlmnt LE Estimator",
                            "Temp Life Ins Not Exceed $25K"
                        ],
                        "type": "string",
                        "description": "Filter agent records by license type. Leave blank to include all types. Only applies when dataset is 'agents'.",
                        "default": ""
                    },
                    "licenseTypeAgency": {
                        "title": "License type (agencies)",
                        "enum": [
                            "",
                            "General Lines Agency",
                            "Life Agency",
                            "Surplus Lines Agency",
                            "Specialty Insurance Agency",
                            "Pers Lines Prop and Cas Agency",
                            "Title Agency",
                            "Managing General Agency",
                            "Adjuster",
                            "Public Insurance Adjuster",
                            "Limited Lines Agency",
                            "Reinsurance Broker",
                            "Risk Manager Agency",
                            "Discount Hthcare Prgm Oper Reg",
                            "Life Stlmnt Broker",
                            "Reinsurance Manager",
                            "Pre-Need Agency",
                            "Life Stlmnt Provider",
                            "Title Direct Operations",
                            "County Mutual Agency",
                            "Life Stlmnt LE Estimator",
                            "LI Agy Not Exceeding $25,000"
                        ],
                        "type": "string",
                        "description": "Filter agency records by license type. Leave blank to include all types. Only applies when dataset is 'agencies'.",
                        "default": ""
                    },
                    "state": {
                        "title": "State",
                        "enum": [
                            "",
                            "TX",
                            "FL",
                            "CA",
                            "GA",
                            "OH",
                            "IL",
                            "AZ",
                            "NY",
                            "MA",
                            "PA",
                            "NC",
                            "CO",
                            "AL",
                            "AK",
                            "AR",
                            "CT",
                            "DC",
                            "DE",
                            "HI",
                            "IA",
                            "ID",
                            "IN",
                            "KS",
                            "KY",
                            "LA",
                            "MD",
                            "ME",
                            "MI",
                            "MN",
                            "MO",
                            "MS",
                            "MT",
                            "ND",
                            "NE",
                            "NH",
                            "NJ",
                            "NM",
                            "NV",
                            "OK",
                            "OR",
                            "RI",
                            "SC",
                            "SD",
                            "TN",
                            "UT",
                            "VA",
                            "VT",
                            "WA",
                            "WI",
                            "WV",
                            "WY",
                            "PR",
                            "VI",
                            "GU",
                            "AS",
                            "MP"
                        ],
                        "type": "string",
                        "description": "Filter by licensee mailing address state. Leave blank to include all states.",
                        "default": ""
                    },
                    "city": {
                        "title": "City",
                        "type": "string",
                        "description": "Filter by city (exact match, case insensitive). Example: HOUSTON"
                    },
                    "postalCode": {
                        "title": "Postal code",
                        "type": "string",
                        "description": "Filter by postal code prefix. Example: 770 returns all Houston-area ZIPs starting with 770."
                    },
                    "nameContains": {
                        "title": "Name contains",
                        "type": "string",
                        "description": "Filter by substring match on the licensee name (case insensitive). Example: SMITH"
                    },
                    "licenseNumber": {
                        "title": "License number",
                        "type": "string",
                        "description": "Look up a single license by Texas license number. Example: 3340665"
                    },
                    "npn": {
                        "title": "NPN",
                        "type": "string",
                        "description": "Look up a single licensee by National Producer Number. Example: 7352575"
                    },
                    "activeOnly": {
                        "title": "Active licenses only",
                        "type": "boolean",
                        "description": "If true, only return records whose expiration date is in the future. If false, includes expired licenses.",
                        "default": true
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
