{
  "openapi": "3.0.1",
  "info": {
    "title": "US Real Estate License Scraper - Agent & Broker Leads",
    "description": "Scrape official state real-estate license boards (NY, TX, CO): agents, brokers, brokerages/firms, appraisers, AMCs, mortgage loan originators & HOA managers. License number, status, brokerage affiliation, address, renewal/expiration dates & lead score. Filters + monitoring, keyless, no browser.",
    "version": "0.1",
    "x-build-id": "De9cE0OljdOkCzj0z"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~us-real-estate-license-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-us-real-estate-license-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-real-estate-license-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-us-real-estate-license-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-real-estate-license-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-us-real-estate-license-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 real-estate boards to query. Each is an open-data portal: <b>NY</b> (NYS Dept. of State — salespersons, brokers, offices, appraisers & AMCs, with brokerage + full business address), <b>TX</b> (TREC + TALCB — ~320K agents/brokers with sponsoring-broker affiliation + appraisers), <b>CO</b> (Division of Real Estate — brokers, firms, appraisers, AMCs, mortgage loan originators & HOA managers). Leave empty for all three.",
            "items": {
              "type": "string",
              "enum": [
                "NY",
                "TX",
                "CO"
              ],
              "enumTitles": [
                "New York (NYS DOS)",
                "Texas (TREC / TALCB)",
                "Colorado (DORA — Division of Real Estate)"
              ]
            },
            "default": [
              "NY",
              "TX",
              "CO"
            ]
          },
          "recordTypes": {
            "title": "Record types",
            "type": "array",
            "description": "Which kinds of real-estate licensees to return. Leave empty for ALL types. <code>agent</code> = real-estate salesperson; <code>broker</code> = licensed broker / associate broker; <code>brokerage</code> = real-estate office / firm / company; <code>appraiser</code> = real-estate appraiser; <code>appraisalManagementCompany</code> = AMC; <code>mortgageLoanOriginator</code> = MLO (CO); <code>communityAssociationManager</code> = HOA / community-association manager (CO).",
            "items": {
              "type": "string",
              "enum": [
                "agent",
                "broker",
                "brokerage",
                "appraiser",
                "appraisalManagementCompany",
                "mortgageLoanOriginator",
                "communityAssociationManager"
              ],
              "enumTitles": [
                "Agent (salesperson)",
                "Broker",
                "Brokerage / office / firm",
                "Appraiser",
                "Appraisal management company",
                "Mortgage loan originator (CO)",
                "HOA / community-association manager (CO)"
              ]
            },
            "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 or inactive records.",
            "default": true
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Filter by mailing/business city (case-insensitive, exact match). e.g. <code>Brooklyn</code>, <code>Austin</code>, <code>Denver</code>. Note: Texas TREC records carry county (not city), so a city filter excludes TX agent/broker rows.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes (prefix)",
            "type": "array",
            "description": "Filter by ZIP-code prefix — <code>112</code> matches all 112xx ZIPs, <code>11215</code> matches one. (Applies where the dataset publishes a ZIP.)",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Filter by county (case-insensitive, exact match). e.g. <code>Kings</code> (NY), <code>Travis</code> (TX). (Applies where the dataset publishes a county.)",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "nameQuery": {
            "title": "Name contains",
            "type": "string",
            "description": "Only licensees whose person or business name contains this text (case-insensitive)."
          },
          "brokerageQuery": {
            "title": "Brokerage contains",
            "type": "string",
            "description": "Only agents/brokers affiliated with a brokerage/office whose name contains this text — great for pulling an entire brokerage's roster or a competitor's agents. e.g. <code>Compass</code>, <code>Coldwell Banker</code>, <code>Keller Williams</code>."
          },
          "issuedAfter": {
            "title": "Issued on/after (newly licensed)",
            "type": "string",
            "description": "Only licenses first issued on or after this date (<code>YYYY-MM-DD</code>) — perfect for fresh, newly-licensed leads. Applies to TX & CO and NY appraisers/AMCs; NY salesperson/broker/office datasets carry no issue date and are skipped when this is set."
          },
          "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, brokerage switching)."
          },
          "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."
          },
          "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-recent first (newest issue / certification date, then expiration).",
            "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 licenses 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/brokers 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 / record type) 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}