# US Insurance Agent & Agency License Leads Scraper (`scrapesage/us-insurance-agent-leads-scraper`) Actor

Scrape official state Department of Insurance registries (TX TDI + IL DOI) for insurance agent, adjuster & agency leads: NPN, license number, lines of authority, status, address, issue/expiration dates, carrier appointments & lead score. Filters + monitoring, keyless, no browser.

- **URL**: https://apify.com/scrapesage/us-insurance-agent-leads-scraper.md
- **Developed by:** [Scrape Sage](https://apify.com/scrapesage) (community)
- **Categories:** Lead generation, Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $6.00 / 1,000 insurance agent / adjuster 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/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/docs.md):

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

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.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/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

## US Insurance Agent & Agency License Leads Scraper — Producers, Adjusters, NPN & Carrier Appointments

Export **bulk insurance agent, adjuster & agency leads** straight from official **state Department of Insurance** registries — the licensed-producer rolls that power IMO/FMO recruiting, E&O insurance, agency software, and Medicare/annuity/final-expense lead programs. Every record carries the **NPN (National Producer Number)**, license number, license type, **lines of authority** (Life, Health, Property, Casualty, Annuity, Adjuster…), status, mailing/business address and issue/expiration dates — plus, on demand, the **carrier appointments** that show exactly which insurance companies each producer represents.

No login, no cookies, no browser, no API key — fast, reliable extraction from clean government open data with **99%+ reliability**.

### Why this insurance agent scraper?

Other "insurance license" tools are single-state, one-NPN-at-a-time **verification lookups** or thin Google-Maps captive-agent scrapers. This actor reads the official state registries directly and ships the **richest dataset in the category** — bulk, multi-state, and joined with the carrier-appointment tables nobody else exposes.

| Data | Typical tools | This actor |
|---|---|---|
| Bulk export (thousands of producers per run) | ❌ one lookup at a time | ✅ |
| Multi-state in one unified schema | ❌ | ✅ TX + IL |
| **NPN (National Producer Number)** | partial | ✅ |
| License number, type & status | ✅ | ✅ |
| **Lines of authority** (Life/Health/P&C/Adjuster…) normalized | ❌ | ✅ |
| **Carrier appointments** — companies the producer represents | ❌ | ✅ opt-in (TX) |
| NAIC ID + appointment type + active date per carrier | ❌ | ✅ |
| Newly-licensed feed (fresh recruiting targets) | ❌ | ✅ |
| Renewal / expiration timing | ❌ | ✅ |
| Mailing **street address** | partial | ✅ where published (IL) |
| Lead score (0–100) + signals | ❌ | ✅ |
| Monitoring mode (only new producers) | ❌ | ✅ |

### Use cases

- **IMO / FMO / agency recruiting** — pull **newly-licensed agents** (`isNewlyLicensed`, `issuedWithinDays`) by line of authority and reach them before competitors. Life & Health producers for Medicare/annuity/final-expense, P&C producers for personal & commercial lines.
- **Carrier & competitor poaching** — use `carrierContains` to find every producer appointed with a specific insurance company (e.g. agents already selling Aetna, Allstate or Progressive), or `minAppointments` to target active, multi-carrier producers.
- **E&O insurance & bonds** — licensed agents and agencies need errors-&-omissions coverage; filter by `expiringWithinDays` to time renewal outreach.
- **Agency-management & insurtech software** — sell CRMs, comparative raters, AMS, quoting and CE platforms to agencies and producers, segmented by lines of authority and carrier mix.
- **Data enrichment & verification** — the NPN is the universal cross-state key; use it to enrich your CRM, dedupe, or validate a producer's licensing and appointments.
- **Market intelligence** — measure carrier appointment footprints, line-of-authority distribution, and new-license velocity by city and state.

### How to use

1. [Sign up for Apify](https://console.apify.com/sign-up) — the free plan is enough to try this actor.
2. Open the **US Insurance Agent & Agency License Leads Scraper**, pick your **states**, **record types** and **lines of authority** (or leave defaults), and click **Start**.
3. Watch results stream into the dataset table.
4. **Export** as JSON, CSV, Excel, XML, or RSS — or pull results programmatically via the [Apify API](https://docs.apify.com/api/v2).

### Input

```json
{
    "states": ["TX", "IL"],
    "recordTypes": ["agent", "agency"],
    "linesOfAuthority": ["Life", "Health"],
    "statusActiveOnly": true,
    "issuedWithinDays": 30,
    "includeAppointments": true,
    "maxResults": 1000
}
````

- **states** — official state DOI registries to query: `TX` (Texas — ~958K agents/adjusters + ~56K agencies + 4.3M carrier appointments), `IL` (Illinois — ~628K producers with mailing street address). Leave empty for both.
- **recordTypes** — `agent` (producer), `adjuster` (claims adjuster, TX), `agency` (business entity). Empty = all.
- **linesOfAuthority** — filter by line(s): `Life`, `Health`, `Property`, `Casualty`, `Annuity`, `Title`, `Adjuster`, `Surplus Lines`, `Workers Compensation`… A record matches if it holds **any** selected line.
- **statusActiveOnly** *(default true)* — only currently-active / non-expired licenses.
- **cities / zipCodes / nameQuery** — location & name filters.
- **issuedAfter / issuedWithinDays** — **newly-licensed** producers (prime recruiting targets). TX.
- **expiringBefore / expiringWithinDays** — renewal-timing targets (E\&O, CE). TX.
- **includeAppointments** *(default false)* — attach every active carrier appointment (NAIC ID, company name, appointment type/lines, active date) joined on the NPN. TX. No extra charge.
- **carrierContains** — only producers appointed with a company whose name contains this text (auto-enables appointments).
- **minAppointments** — only producers with at least N active appointments (auto-enables appointments).
- **withStreetAddressOnly** — only records with a mailing street address (mostly IL).
- **minLeadScore** — minimum 0–100 lead score.
- **maxResults / maxResultsPerState** — caps.
- **monitorMode / monitorKey** — emit only producers new since the last run (see below).

### Output

One record per licensee (`recordType`: `agent`, `adjuster` or `agency`):

```json
{
    "recordType": "agency",
    "source": "Texas Department of Insurance (TDI) — data.texas.gov",
    "jurisdiction": "TX",
    "regulator": "Texas Department of Insurance (TDI)",
    "npn": "1336809",
    "licenseNumber": "1789012",
    "name": "Lay & Williams Insurance Services",
    "organizationName": "Lay & Williams Insurance Services",
    "isAgency": true,
    "entityType": "Agency / Business",
    "licenseType": "General Lines Agency",
    "qualification": "Life, Accident, Health & HMO",
    "linesOfAuthority": ["Life", "Health"],
    "primaryLine": "Life",
    "status": "Active",
    "active": true,
    "licenseIssueDate": "2018-04-02",
    "expirationDate": "2027-04-30",
    "daysUntilExpiration": 313,
    "expiringSoon": false,
    "licenseAgeDays": 2972,
    "isNewlyLicensed": false,
    "street": null,
    "city": "Houston",
    "state": "TX",
    "postalCode": "77002",
    "addressFull": "Houston, TX 77002",
    "appointments": [
        { "carrier": "Companion Life Insurance Company", "naicId": "77828", "appointmentType": "Life, Accident, Health and HMO", "lines": ["Life", "Health"], "activeDate": "2026-01-28" },
        { "carrier": "Pan-American Life Insurance Company", "naicId": "67539", "appointmentType": "Life, Accident, Health and HMO", "lines": ["Life", "Health"], "activeDate": "2026-01-27" }
    ],
    "appointmentCount": 58,
    "carriers": ["Companion Life Insurance Company", "Pan-American Life Insurance Company", "Standard Insurance Company"],
    "carrierCount": 58,
    "leadScore": 70,
    "leadSignals": ["active_license", "city_zip", "has_npn", "agency_entity", "life_health_annuity_lines", "appointed_58_carriers"],
    "verifyUrl": "https://txapps.texas.gov/NASApp/tdi/TdiARManager",
    "scrapedAt": "2026-06-21T23:56:14.727Z"
}
```

Every record also includes a `sourceFields` object with the raw source row, so no upstream data is ever lost.

#### What to expect (field coverage)

These are **public licensing registries**, so a few fields exist only where the state publishes them. Verified across both sources:

| Field | TX (TDI) | IL (DOI) |
|---|---|---|
| NPN | ✅ ~100% | — (not published) |
| License number, type, status | ✅ | license type only |
| Lines of authority | ✅ | ✅ |
| Issue / expiration dates | ✅ | — |
| City / state / ZIP | ✅ | ✅ |
| **Mailing street address** | — | ✅ |
| **Carrier appointments** | ✅ opt-in | — |

A blank field means the registry doesn't publish it for that record — never that scraping failed. Nothing is dropped: you always get the richest dataset available, plus the raw `sourceFields`. These registries carry no email addresses or phone numbers — the NPN is the key to enrich those from your own data partners.

### Monitoring mode — only new producers

Turn on **monitorMode** and the actor remembers (in a named key-value store) which producers it has already returned, then emits **only licenses that are new since the last run** — each tagged `monitorEvent: "new"`. A renewal (new expiration date) surfaces as new too. Combined with a daily [Schedule](https://docs.apify.com/platform/schedules), this is a hands-off **fresh-licensee feed** — exactly what agency recruiters and IMOs pay for. Monitoring works *alongside* Apify Schedules: the schedule starts the run; monitoring decides what's new. Use a distinct `monitorKey` per saved watch (e.g. per state or line of authority).

### Automate & schedule

Run this actor on autopilot and pull results into your own stack:

- **[Apify API](https://docs.apify.com/api/v2)** — start runs, fetch datasets, and manage schedules over REST.
- **[apify-client for JavaScript](https://docs.apify.com/api/client/js/)** and **[apify-client for Python](https://docs.apify.com/api/client/python/)** — official SDKs.
- **[Schedules](https://docs.apify.com/platform/schedules)** — run it daily/weekly with `monitorMode` to capture newly-licensed agents as fresh leads.
- **[Webhooks](https://docs.apify.com/platform/integrations/webhooks)** — trigger downstream actions (CRM import, Slack alert, email sequence) the moment a run finishes.

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

const client = new ApifyClient({ token: 'MY_APIFY_TOKEN' });

const run = await client.actor('scrapesage/us-insurance-agent-leads-scraper').call({
    states: ['TX', 'IL'],
    linesOfAuthority: ['Life', 'Health'],
    issuedWithinDays: 30,
    includeAppointments: true,
    maxResults: 2000,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Got ${items.length} insurance producer leads`);
```

### Integrate with any app

Connect the dataset to 5,000+ apps — no code required:

- **[Make](https://docs.apify.com/platform/integrations/make)** — multi-step automation scenarios.
- **[Zapier](https://docs.apify.com/platform/integrations/zapier)** — push new producer leads straight into your CRM.
- **[Slack](https://docs.apify.com/platform/integrations/slack)** — get notified when a monitored search finds new agents.
- **[Google Drive / Sheets](https://docs.apify.com/platform/integrations/drive)** — auto-export every run to a spreadsheet.
- **[Airbyte](https://docs.apify.com/platform/integrations/airbyte)** — pipe results into your data warehouse.
- **[GitHub](https://docs.apify.com/platform/integrations/github)** — trigger runs from commits or releases.

### Use with AI assistants (MCP)

The output is clean, LLM-ready JSON. Call this actor from Claude, ChatGPT, or any agent framework through the **[Apify MCP server](https://docs.apify.com/platform/integrations/mcp)** — ask your assistant to "find Life & Health insurance agents licensed in Texas this month and list the carriers they're appointed with" and let it run the scraper for you.

### Agent-ready: autonomous payments (x402 & Skyfire)

This actor is **agent-ready** — AI agents can discover it, run it, and **pay for it autonomously**, with no Apify account and no human in the loop. It uses [pay-per-event](https://docs.apify.com/platform/actors/publishing/monetize/pay-per-event) pricing and [limited permissions](https://docs.apify.com/platform/actors/development/permissions), so it qualifies for Apify's agentic-payment standards:

- **[x402](https://docs.apify.com/platform/integrations/x402)** — an open, HTTP-native payment protocol. Agents pay per run in USDC on the Base network directly through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp) — no account, no API key.
- **[Skyfire](https://docs.apify.com/platform/integrations/skyfire)** — agent-to-service payments for fully autonomous AI-agent workflows.

Building an AI agent, MCP tool, or autonomous data pipeline? This scraper is ready to plug in and pay as it goes.

### More scrapers from scrapesage

Build a complete **financial-services & insurance lead-gen stack**:

- **[Insurance Agent Scraper](https://apify.com/scrapesage/insurance-agent-scraper)** — State Farm & Farmers captive-agent leads (complements this official-registry actor).
- **[Financial Advisor & Broker Scraper](https://apify.com/scrapesage/financial-advisor-scraper)** — RIAs & brokers from FINRA + SEC.
- **[BrokerCheck Scraper](https://apify.com/scrapesage/brokercheck-scraper)** — financial advisors, brokers & firms.
- **[Form 5500 ERISA Scraper](https://apify.com/scrapesage/form-5500-erisa-scraper)** — 401(k) & benefit-plan leads for advisors and brokers.
- **[TaxBuzz Scraper](https://apify.com/scrapesage/taxbuzz-scraper)** — tax preparers, CPAs & accountant leads.
- **[US Professional License Scraper](https://apify.com/scrapesage/us-professional-license-scraper)** — licensed-pro leads from state boards.
- **[NPI Registry Scraper](https://apify.com/scrapesage/npi-nppes-scraper)** — healthcare provider leads (for health-insurance verticals).
- **[US Business Formation Scraper](https://apify.com/scrapesage/us-business-formation-scraper)** — new LLC & company leads for commercial-lines prospecting.

### Tips

- **Recruit fresh agents**: set `issuedWithinDays: 30` + `linesOfAuthority: ["Life","Health"]` + `monitorMode` for a daily feed of brand-new producers in your niche.
- **Poach a carrier's book**: set `carrierContains` to a competitor company name to surface every producer appointed with it.
- **Find producers, not paper**: `minAppointments: 3` filters to active, multi-carrier agents and skips dormant licenses.
- **Mailable leads**: `withStreetAddressOnly: true` keeps records (mostly IL) that include a street address.
- **Cost control**: leave proxy off (gov open data needs none), and keep `includeAppointments` off unless you need carrier data.

### FAQ

**Where does the data come from?** Official state Department of Insurance open-data portals: Texas DOI (`data.texas.gov`) and Illinois DOI (`illinois-edp.data.socrata.com`). It's public licensing data — no login or API key.

**What is the NPN?** The National Producer Number — a unique ID assigned to every insurance producer that stays the same across states. It's the universal key for deduping and enriching insurance leads.

**Are emails or phone numbers included?** No — these public registries don't publish them. You get NPN, license, lines, address and (for TX) carrier appointments. Use the NPN to enrich contact data from your own sources.

**What are "carrier appointments"?** An appointment is the legal authorization for a producer to sell a specific insurance company's products. The `appointments` array shows exactly which carriers each Texas producer represents — unique competitive intelligence for recruiting and market analysis.

**Can I export to Google Sheets, CSV, or Excel?** Yes — one click in the dataset view, or automatically on every run via the [Google Drive integration](https://docs.apify.com/platform/integrations/drive).

**How do I monitor newly-licensed agents automatically?** Turn on `monitorMode`, set `issuedWithinDays`, and create a daily [Schedule](https://docs.apify.com/platform/schedules) — you'll get only the new producers each run.

**A field is empty — why?** Some states don't publish street addresses, dates, or NPNs. Fields are blank only when the registry didn't publish that data — never because the scraper skipped it.

**Is scraping this data legal?** This actor collects publicly available government licensing data only. You're responsible for using it in compliance with applicable laws (e.g. TCPA/CAN-SPAM/state DNC rules for outreach) and each portal's terms.

### Need help?

Open an issue on the actor's **Issues** tab, or visit the [Apify help center](https://help.apify.com/). Feature requests — more states, contact enrichment, line-of-business analytics — are welcome; this actor is actively maintained.

# Actor input Schema

## `states` (type: `array`):

Which official state Department of Insurance registries to query. <b>TX</b> (Texas DOI — ~958K agents/adjusters + ~56K agencies, NPN + license type + lines of authority + issue/expiration dates + 4.3M carrier appointments). <b>IL</b> (Illinois DOI — ~628K producers with mailing street address + lines of authority). Leave empty for both.

## `recordTypes` (type: `array`):

Which kinds of insurance licensees to return. Leave empty for ALL. <code>agent</code> = licensed insurance agent / producer; <code>adjuster</code> = claims adjuster (TX); <code>agency</code> = insurance agency / business entity.

## `statusActiveOnly` (type: `boolean`):

Only return currently-active / non-expired licenses (recommended for lead-gen). Turn off to include expired records (TX only — IL publishes active producers).

## `linesOfAuthority` (type: `array`):

Filter by line(s) of authority the producer is licensed for. e.g. <code>Life</code>, <code>Health</code>, <code>Property</code>, <code>Casualty</code>, <code>Annuity</code>, <code>Title</code>, <code>Adjuster</code>, <code>Surplus Lines</code>, <code>Workers Compensation</code>. A record matches if it holds ANY of the selected lines. Perfect for targeting (e.g. Life & Health agents for Medicare/annuity, P\&C agents for commercial).

## `cities` (type: `array`):

Filter by mailing/business city (case-insensitive, exact match). e.g. <code>Houston</code>, <code>Dallas</code>, <code>Chicago</code>.

## `zipCodes` (type: `array`):

Filter by ZIP-code prefix — <code>770</code> matches all 770xx ZIPs, <code>77002</code> matches one.

## `nameQuery` (type: `string`):

Only licensees whose person or agency name contains this text (case-insensitive).

## `issuedAfter` (type: `string`):

Only licenses first issued on or after this date (<code>YYYY-MM-DD</code>) — ideal for fresh, newly-licensed agents (prime recruiting targets for IMOs/FMOs). Applies to TX; IL carries no issue date and is skipped when this is set.

## `issuedWithinDays` (type: `integer`):

Convenience alternative to "Licensed on/after": only producers licensed within this many days from now (TX).

## `expiringBefore` (type: `string`):

Only licenses expiring before this date (<code>YYYY-MM-DD</code>) — perfect for renewal-timing offers (E\&O insurance, CE courses, agency switching). TX only.

## `expiringWithinDays` (type: `integer`):

Convenience alternative to "Expiring before": only licenses expiring within this many days from now (TX).

## `includeAppointments` (type: `boolean`):

For Texas agents & agencies, attach every active insurance-company appointment the producer holds — the carriers they represent (NAIC ID + company name + appointment type/lines + active date) joined on the NPN. This is unique competitive intelligence: see exactly which companies each agent sells for. Adds a few extra requests; no extra charge.

## `carrierContains` (type: `string`):

Only producers appointed with an insurance company whose name contains this text — e.g. <code>Aetna</code>, <code>Allstate</code>, <code>State Farm</code>, <code>Progressive</code>. Great for poaching a competitor carrier's agents. Automatically enables carrier appointments (TX).

## `minAppointments` (type: `integer`):

Only producers with at least this many active carrier appointments — a proxy for active, productive agents. Automatically enables carrier appointments (TX).

## `withStreetAddressOnly` (type: `boolean`):

Only return records that include a mailing street address (mostly IL producers). Turn on when you need mailable leads.

## `minLeadScore` (type: `integer`):

Only return records with a lead score (0-100) at or above this value.

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

Maximum number of license records to return in this run (across all selected states and types).

## `maxResultsPerState` (type: `integer`):

Cap how many records are pulled from each individual source dataset before the global limit and newest-first sorting are applied. Leave blank to use the same value as Max results.

## `sortNewestFirst` (type: `boolean`):

Sort the output by most-recently-issued first (TX). Turn off for license-number order.

## `deduplicateResults` (type: `boolean`):

Drop duplicate license records within a single run.

## `monitorMode` (type: `boolean`):

Remember which producers were already returned (in a named key-value store) and emit ONLY licenses that are new since the last run — each tagged <code>monitorEvent: "new"</code>. A renewal (new expiration date) also surfaces as new. Run on a Schedule to capture newly-licensed agents as fresh leads. Works alongside Apify Schedules — the schedule starts the run; monitoring decides what's new.

## `monitorKey` (type: `string`):

Names the memory used by monitoring mode. Use a distinct key per saved watch (e.g. per state / line of authority) so different monitors don't share state.

## `socrataAppToken` (type: `string`):

Optional Socrata app token for higher rate limits on very large runs. Not required — leave blank for normal use. Free at any state open-data portal.

## `proxyConfiguration` (type: `object`):

Optional proxy. State open data is fetched directly and needs no proxy — leave this off for the fastest, cheapest runs. Enable Apify Proxy only if your network requires it.

## Actor input object example

```json
{
  "states": [
    "TX",
    "IL"
  ],
  "recordTypes": [],
  "statusActiveOnly": true,
  "linesOfAuthority": [],
  "cities": [],
  "zipCodes": [],
  "includeAppointments": false,
  "withStreetAddressOnly": false,
  "maxResults": 1000,
  "sortNewestFirst": true,
  "deduplicateResults": true,
  "monitorMode": false,
  "monitorKey": "default",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `results` (type: `string`):

All scraped insurance agent, adjuster & agency license records as JSON items in the default dataset.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapesage/us-insurance-agent-leads-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("scrapesage/us-insurance-agent-leads-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 '{}' |
apify call scrapesage/us-insurance-agent-leads-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "US Insurance Agent & Agency License Leads Scraper",
        "description": "Scrape official state Department of Insurance registries (TX TDI + IL DOI) for insurance agent, adjuster & agency leads: NPN, license number, lines of authority, status, address, issue/expiration dates, carrier appointments & lead score. Filters + monitoring, keyless, no browser.",
        "version": "0.1",
        "x-build-id": "FmnBBkf7BQW9c9sk6"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/scrapesage~us-insurance-agent-leads-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-scrapesage-us-insurance-agent-leads-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/scrapesage~us-insurance-agent-leads-scraper/runs": {
            "post": {
                "operationId": "runs-sync-scrapesage-us-insurance-agent-leads-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/scrapesage~us-insurance-agent-leads-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-scrapesage-us-insurance-agent-leads-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": {
                    "states": {
                        "title": "States",
                        "type": "array",
                        "description": "Which official state Department of Insurance registries to query. <b>TX</b> (Texas DOI — ~958K agents/adjusters + ~56K agencies, NPN + license type + lines of authority + issue/expiration dates + 4.3M carrier appointments). <b>IL</b> (Illinois DOI — ~628K producers with mailing street address + lines of authority). Leave empty for both.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "TX",
                                "IL"
                            ],
                            "enumTitles": [
                                "Texas (TDI)",
                                "Illinois (DOI)"
                            ]
                        },
                        "default": [
                            "TX",
                            "IL"
                        ]
                    },
                    "recordTypes": {
                        "title": "Record types",
                        "type": "array",
                        "description": "Which kinds of insurance licensees to return. Leave empty for ALL. <code>agent</code> = licensed insurance agent / producer; <code>adjuster</code> = claims adjuster (TX); <code>agency</code> = insurance agency / business entity.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "agent",
                                "adjuster",
                                "agency"
                            ],
                            "enumTitles": [
                                "Agent / producer",
                                "Adjuster",
                                "Agency / business"
                            ]
                        },
                        "default": []
                    },
                    "statusActiveOnly": {
                        "title": "Active licenses only",
                        "type": "boolean",
                        "description": "Only return currently-active / non-expired licenses (recommended for lead-gen). Turn off to include expired records (TX only — IL publishes active producers).",
                        "default": true
                    },
                    "linesOfAuthority": {
                        "title": "Lines of authority",
                        "type": "array",
                        "description": "Filter by line(s) of authority the producer is licensed for. e.g. <code>Life</code>, <code>Health</code>, <code>Property</code>, <code>Casualty</code>, <code>Annuity</code>, <code>Title</code>, <code>Adjuster</code>, <code>Surplus Lines</code>, <code>Workers Compensation</code>. A record matches if it holds ANY of the selected lines. Perfect for targeting (e.g. Life & Health agents for Medicare/annuity, P&C agents for commercial).",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "cities": {
                        "title": "Cities",
                        "type": "array",
                        "description": "Filter by mailing/business city (case-insensitive, exact match). e.g. <code>Houston</code>, <code>Dallas</code>, <code>Chicago</code>.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "zipCodes": {
                        "title": "ZIP codes (prefix)",
                        "type": "array",
                        "description": "Filter by ZIP-code prefix — <code>770</code> matches all 770xx ZIPs, <code>77002</code> matches one.",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "nameQuery": {
                        "title": "Name contains",
                        "type": "string",
                        "description": "Only licensees whose person or agency name contains this text (case-insensitive)."
                    },
                    "issuedAfter": {
                        "title": "Licensed on/after (newly licensed)",
                        "type": "string",
                        "description": "Only licenses first issued on or after this date (<code>YYYY-MM-DD</code>) — ideal for fresh, newly-licensed agents (prime recruiting targets for IMOs/FMOs). Applies to TX; IL carries no issue date and is skipped when this is set."
                    },
                    "issuedWithinDays": {
                        "title": "Licensed within last N days",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Convenience alternative to \"Licensed on/after\": only producers licensed within this many days from now (TX)."
                    },
                    "expiringBefore": {
                        "title": "Expiring before",
                        "type": "string",
                        "description": "Only licenses expiring before this date (<code>YYYY-MM-DD</code>) — perfect for renewal-timing offers (E&O insurance, CE courses, agency switching). TX only."
                    },
                    "expiringWithinDays": {
                        "title": "Expiring within N days",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Convenience alternative to \"Expiring before\": only licenses expiring within this many days from now (TX)."
                    },
                    "includeAppointments": {
                        "title": "Include carrier appointments (TX)",
                        "type": "boolean",
                        "description": "For Texas agents & agencies, attach every active insurance-company appointment the producer holds — the carriers they represent (NAIC ID + company name + appointment type/lines + active date) joined on the NPN. This is unique competitive intelligence: see exactly which companies each agent sells for. Adds a few extra requests; no extra charge.",
                        "default": false
                    },
                    "carrierContains": {
                        "title": "Appointed with carrier (contains)",
                        "type": "string",
                        "description": "Only producers appointed with an insurance company whose name contains this text — e.g. <code>Aetna</code>, <code>Allstate</code>, <code>State Farm</code>, <code>Progressive</code>. Great for poaching a competitor carrier's agents. Automatically enables carrier appointments (TX)."
                    },
                    "minAppointments": {
                        "title": "Minimum carrier appointments",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Only producers with at least this many active carrier appointments — a proxy for active, productive agents. Automatically enables carrier appointments (TX)."
                    },
                    "withStreetAddressOnly": {
                        "title": "Only records with a street address",
                        "type": "boolean",
                        "description": "Only return records that include a mailing street address (mostly IL producers). Turn on when you need mailable leads.",
                        "default": false
                    },
                    "minLeadScore": {
                        "title": "Minimum lead score",
                        "minimum": 0,
                        "maximum": 100,
                        "type": "integer",
                        "description": "Only return records with a lead score (0-100) at or above this value."
                    },
                    "maxResults": {
                        "title": "Max results",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of license records to return in this run (across all selected states and types).",
                        "default": 1000
                    },
                    "maxResultsPerState": {
                        "title": "Max results per dataset (optional)",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Cap how many records are pulled from each individual source dataset before the global limit and newest-first sorting are applied. Leave blank to use the same value as Max results."
                    },
                    "sortNewestFirst": {
                        "title": "Newest licenses first",
                        "type": "boolean",
                        "description": "Sort the output by most-recently-issued first (TX). Turn off for license-number order.",
                        "default": true
                    },
                    "deduplicateResults": {
                        "title": "Deduplicate within a run",
                        "type": "boolean",
                        "description": "Drop duplicate license records within a single run.",
                        "default": true
                    },
                    "monitorMode": {
                        "title": "Monitoring mode — only new licenses",
                        "type": "boolean",
                        "description": "Remember which producers were already returned (in a named key-value store) and emit ONLY licenses that are new since the last run — each tagged <code>monitorEvent: \"new\"</code>. A renewal (new expiration date) also surfaces as new. Run on a Schedule to capture newly-licensed agents as fresh leads. Works alongside Apify Schedules — the schedule starts the run; monitoring decides what's new.",
                        "default": false
                    },
                    "monitorKey": {
                        "title": "Monitor key",
                        "type": "string",
                        "description": "Names the memory used by monitoring mode. Use a distinct key per saved watch (e.g. per state / line of authority) so different monitors don't share state.",
                        "default": "default"
                    },
                    "socrataAppToken": {
                        "title": "Socrata app token (optional)",
                        "type": "string",
                        "description": "Optional Socrata app token for higher rate limits on very large runs. Not required — leave blank for normal use. Free at any state open-data portal."
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Optional proxy. State open data is fetched directly and needs no proxy — leave this off for the fastest, cheapest runs. Enable Apify Proxy only if your network requires it.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
