# US Insurance Agents Scraper (33 State DOI & NAIC Registries) (`vesper_studio/us-insurance-agents-leads`) Actor

Stream licensed US insurance agents, agencies, and surplus lines brokers from 33 official state DOI registries (TX, FL, ME & 30 NAIC SBS states). Extracts normalized lines of authority (LOAs), expiring license renewal triggers, E.164 phones & CAN-SPAM compliant emails in 512 MB RAM.

- **URL**: https://apify.com/vesper_studio/us-insurance-agents-leads.md
- **Developed by:** [Xavier Richard](https://apify.com/vesper_studio) (community)
- **Categories:** Lead generation, Business, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 us licensed insurance agent/agency leads

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

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

## What's an Apify Actor?

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

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

## How to integrate an Actor?

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

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

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

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

# README

## US Insurance Agents & Agencies Leads (`us-insurance-agents-leads`)

High-volume streaming extraction, filtering, and normalization of official US Department of Insurance (DOI) public producer and agency registries across **33 jurisdictions** — built for insurers, MGAs, insurtech SaaS platforms, and broker recruiters.

**Zero browsers. Zero proxies. Constant-memory streaming (~512 MB target).**

***

### Official Public Sources Covered (33 Jurisdictions)

| Source | Adapter | Jurisdictions | Published Contact Fields | Expiration / Renewal Signal |
| :--- | :--- | :--- | :--- | :--- |
| **Texas TDI (Socrata Open Data)** | `src/adapters/tx.py` | `TX` (`3yqc-fcdt` agencies, `kxv3-diwf` individuals, `7isd-ex6t` surplus lines) | Name, agency, NPN, license #, city, state, ZIP | `expiration_date` (SoQL server-side pushdown) |
| **Florida DFS (Bulk CSV Registry)** | `src/adapters/fl.py` | `FL` (`AllValidLicensesBusiness`, `AllValidLicensesIndividual`, `AllLicensesRequiringCE`) | Corporate & agent email, E.164 business phone, NPN, city, state, ZIP | `CE Due Date` (renewal cycle via `AllLicensesRequiringCE`) |
| **Maine Bureau of Insurance (PFR)** | `src/adapters/me.py` | `ME` (`active-nonres-producers.xlsx` nationwide non-resident producers) | Email, E.164 phone, NPN, license #, LOAs, city, state, ZIP | Issue dates (`FIRST_ISSUE_DATE`, `LICENSE_ISSUE_DATE`) |
| **NAIC State Based Systems (SBS)** | `src/adapters/sbs.py` | 30 states: `AL`, `AK`, `AZ`, `AR`, `CT`, `DC`, `DE`, `HI`, `ID`, `IL`, `IA`, `KS`, `MD`, `MA`, `MO`, `MT`, `NE`, `NH`, `NJ`, `NM`, `NC`, `ND`, `OK`, `OR`, `RI`, `SC`, `TN`, `VT`, `WV`, `WI` | Business email, business phone, NPN, LOAs, affiliated agency (`ABE`), city, state, ZIP | `licenseExpirationDate` |

> **Note:** States such as California (CDI), New York (DFS), and Colorado (DORA) do not publish free public bulk producer registries (only interactive single-record web forms or paid NAIC/NIPR data extracts) and are logged as unsupported if requested.

***

### CAN-SPAM B2B Compliance & Personal Email Handling

Public DOI registries sometimes include personal consumer webmail addresses (`gmail.com`, `yahoo.com`, `hotmail.com`, `aol.com`, `icloud.com`, residential ISP domains). To support compliant B2B outreach:

- **`personalEmailPolicy: "mask"` (default):** Keeps the licensed agent/agency record, sets `email: null` for personal/ISP addresses, and sets `emailMasked: true`. Corporate/agency domains (e.g. `r_garrett@insbusplan.com`) are preserved. Combine with `hasEmailOnly: true` to deliver **only** leads with a corporate/agency email.
- **`personalEmailPolicy: "exclude"`:** Drops any record whose published email is a personal webmail/ISP address.
- **`personalEmailPolicy: "include"`:** Retains personal email addresses unmasked (only use when you have an independent legal basis / opt-in).

***

### Input Filters

- `states`: Array of 2-letter DOI state codes (default: `["TX", "FL"]`).
- `linesOfAuthority`: Filter by normalized LOAs (`life`, `health`, `property`, `casualty`, `surplus_lines`, `personal_lines`, `variable_contracts`, `title`, `credit`, `adjuster`, `limited_lines`, `managing_general_agent`).
- `activeOnly`: Exclude inactive/expired/cancelled/revoked licenses (default: `true`).
- `expiringWithinDays`: Renewal/switch intent signal — keep only licenses (or FL CE cycles) expiring between today and `today + N` days.
- `hasEmailOnly`: Return only leads with a non-empty email after applying `personalEmailPolicy`.
- `hasAgencyNameOnly`: Return only licensed agencies/business entities or individuals with an affiliated `agencyName`.
- `personalEmailPolicy`: `"mask"` | `"exclude"` | `"include"`.
- `city`: City name or comma-separated list (case-insensitive).
- `zip`: 5-digit ZIP code or 3-digit ZIP prefix (or comma-separated list).
- `sbsEnrichDetails`: Fetch NAIC SBS summary endpoints for email, full LOAs, and affiliated agency name (default: `true`).
- `maxItems`: Maximum leads to deliver (default: `100`).

***

### Normalized Output Schema

```json
{
  "npn": "2099611",
  "licenseNumber": "100291275",
  "state": "IN",
  "licensingState": "IL",
  "entityType": "agency",
  "fullName": "INSURANCE & BUSINESS PLANNING INC",
  "agencyName": "INSURANCE & BUSINESS PLANNING INC",
  "licenseType": "BUSINESS ENTITY PRODUCER",
  "linesOfAuthority": ["property", "casualty"],
  "status": "Active",
  "issueDate": "2026-06-01",
  "expirationDate": "2028-05-31",
  "city": "EVANSVILLE",
  "zip": "47715",
  "email": "r_garrett@insbusplan.com",
  "emailMasked": false,
  "phone": "+18124777100",
  "sourceUrl": "https://sbs.naic.org/solar-external-lookup/lookup/licensee/summary/100291275?jurisdiction=IL&entityType=BEN"
}
```

***

### Streaming Architecture & Pay-Per-Event (PPE)

- **Constant-memory HTTP/2 streaming:** Socrata CSV (`tx.py`) and Florida 160+ MB CSVs (`fl.py`) are streamed line-by-line via `httpx` HTTP/2 with immediate stream termination when `maxItems` or the PPE budget cap is reached. Maine's 26 MB `.xlsx` (`me.py`) is streamed to disk and parsed via `xml.etree.ElementTree.iterparse` (~15 MB RAM). Multi-state runs prioritize fast registries first and run NAIC SBS enrichment with `Semaphore(24)`, per-state time budgets, and automatic `BEN -> IND` fallback.
- **Pay-Per-Event billing:** Uses `Actor.get_charging_manager()` to charge the `agent-lead` event in batches of **25 items**, enforcing `calculate_max_event_charge_count_within_limit('agent-lead')` (`affordable_leads()`) before every batch push.

# Actor input Schema

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

Two-letter US state/DC codes to extract from official public DOI registries: TX (Texas TDI Socrata), FL (Florida DFS Bulk CSV), ME (Maine Bureau of Insurance), and 30 NAIC State Based Systems (SBS) states. When multiple states are selected, maxItems is balanced across them.

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

Filter by normalized insurance lines of authority (e.g. life, health, property, casualty, surplus_lines). Leave empty to include all lines.

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

Exclude inactive, expired, cancelled, or revoked licenses.

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

Optional renewal/switch intent filter: keep only licenses (or FL CE renewal cycles) expiring between today and today + N days. Maine does not publish expiration dates and is skipped when this is set.

## `hasEmailOnly` (type: `boolean`):

Return only leads that have a non-empty email after applying personalEmailPolicy. Texas TDI does not publish emails and is skipped when this is enabled.

## `hasAgencyNameOnly` (type: `boolean`):

Return only licensed insurance agencies/entities or producers with an associated agencyName.

## `personalEmailPolicy` (type: `string`):

Controls handling of personal/consumer webmail & ISP addresses (gmail.com, yahoo.com, hotmail.com, aol.com, etc.) for B2B CAN-SPAM compliance. 'mask' (default) sets personal emails to null while keeping the license record; 'exclude' drops any record with a personal email; 'include' retains personal emails as published.

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

Optional city name or comma-separated city names (case-insensitive, e.g. "Houston" or "Miami, Tampa").

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

Optional 5-digit ZIP code or 3-digit ZIP prefix (or comma-separated list, e.g. "770" or "33101").

## `sbsEnrichDetails` (type: `boolean`):

For NAIC SBS states, fetch official licensee summary endpoints to retrieve corporate email, full lines of authority, and affiliated agency name. Automatically enabled when hasEmailOnly is true.

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

Maximum number of normalized agent/agency leads to deliver across all selected states. Strict Pay-Per-Event budget control via affordable_leads() may stop earlier.

## Actor input object example

```json
{
  "states": [
    "TX",
    "FL"
  ],
  "linesOfAuthority": [],
  "activeOnly": true,
  "hasEmailOnly": false,
  "hasAgencyNameOnly": false,
  "personalEmailPolicy": "mask",
  "sbsEnrichDetails": true,
  "maxItems": 100
}
```

# Actor output Schema

## `leads` (type: `string`):

Normalized JSON dataset of licensed insurance agents, agencies, and surplus lines brokers from official US DOI registries.

# 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 = {
    "states": [
        "TX",
        "FL"
    ],
    "maxItems": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("vesper_studio/us-insurance-agents-leads").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 = {
    "states": [
        "TX",
        "FL",
    ],
    "maxItems": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("vesper_studio/us-insurance-agents-leads").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "states": [
    "TX",
    "FL"
  ],
  "maxItems": 100
}' |
apify call vesper_studio/us-insurance-agents-leads --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,vesper_studio/us-insurance-agents-leads"
        }
    }
}
```

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

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/x3M8jxYd8yQ1uJ9dB/builds/fWG5hbbBzw1rDEjWK/openapi.json
