{
  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}