{
  "openapi": "3.0.1",
  "info": {
    "title": "Virginia License Leads Scraper - Contractors, Realtors & Pros",
    "description": "Scrape Virginia DPOR licensed pros & businesses: contractors, tradesmen, realtors/brokers, appraisers, architects, engineers, home inspectors, HOA managers, cosmetologists & more. Get name, e-mail, address, license number, type, status & expiration. Filter by profession, city & renewal date.",
    "version": "0.1",
    "x-build-id": "j9pffdEXG11Qga7or"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapesage~virginia-license-leads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapesage-virginia-license-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~virginia-license-leads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapesage-virginia-license-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~virginia-license-leads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapesage-virginia-license-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": {
          "boards": {
            "title": "License boards / professions",
            "type": "array",
            "description": "Which Virginia DPOR regulant rosters to pull. Each board downloads its official Regulant List file(s), so add only what you need (bandwidth scales with selection). Real estate, contractors and cosmetology are the largest.",
            "items": {
              "type": "string",
              "enum": [
                "contractors",
                "real-estate",
                "real-estate-appraisers",
                "architects-engineers-surveyors",
                "asbestos-lead-home-inspectors",
                "community-association-managers",
                "barbers-cosmetologists",
                "auctioneers",
                "hearing-aid-opticians",
                "soil-scientists-geologists",
                "waterworks-wastewater",
                "waste-management",
                "cemetery",
                "branch-pilots",
                "polygraph-examiners",
                "athlete-agents",
                "boxing-wrestling-martial-arts",
                "fair-housing"
              ],
              "enumTitles": [
                "Contractors & Tradesmen (Class A/B/C, electrical, plumbing, HVAC, elevator, fire sprinkler)",
                "Real Estate — Brokers, Salespersons, Firms & Settlement Agents",
                "Real Estate Appraisers & Appraisal Management Companies (AMC)",
                "Architects, Engineers, Surveyors & Interior Designers",
                "Asbestos, Lead & Home Inspectors",
                "Community Association (HOA) Managers & Associations",
                "Barbers, Cosmetologists, Nail, Wax, Tattoo, Esthetics & Salons",
                "Auctioneers & Auction Firms",
                "Opticians & Hearing Aid Specialists",
                "Soil Scientists, Wetland Professionals & Geologists",
                "Waterworks, Wastewater & Onsite Sewage Operators/Installers",
                "Waste Management Facility Operators",
                "Cemetery Companies & Sales Staff",
                "Harbor Branch Pilots",
                "Polygraph Examiners",
                "Athlete Agents",
                "Boxing, Wrestling & Martial Arts",
                "Fair Housing Instructors & Certificate Holders"
              ]
            },
            "default": [
              "contractors"
            ]
          },
          "statusFilter": {
            "title": "License status",
            "enum": [
              "active",
              "all",
              "inactive"
            ],
            "type": "string",
            "description": "Which licenses to keep. Real estate & appraiser boards publish separate active/inactive rosters; other boards publish a current roster (expired records inside it are flagged).",
            "default": "active"
          },
          "recordTypes": {
            "title": "Record type",
            "type": "array",
            "description": "Keep only individuals, only businesses/firms, or both (default).",
            "items": {
              "type": "string",
              "enum": [
                "individual",
                "business"
              ],
              "enumTitles": [
                "Individuals",
                "Businesses / firms"
              ]
            }
          },
          "licenseCodes": {
            "title": "License codes",
            "type": "array",
            "description": "Filter to specific DPOR license codes (board + occupation), e.g. 2701 (Class A Contractor), 2710 (Tradesman), 0226 (Real Estate Firm), 4009 (AMC), 0402 (Professional Engineer). Leave empty for all license types in the selected boards.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "Keep only licensees in these cities (case-insensitive), e.g. Richmond, Virginia Beach, Norfolk, Arlington, Alexandria.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "Keep only licensees in these 5-digit ZIP codes.",
            "items": {
              "type": "string"
            }
          },
          "states": {
            "title": "States",
            "type": "array",
            "description": "Keep only licensees with these state codes (most are VA; some hold Virginia licenses from out of state).",
            "items": {
              "type": "string"
            }
          },
          "nameQuery": {
            "title": "Name contains",
            "type": "string",
            "description": "Keep only records whose licensee name or business name contains this text."
          },
          "businessNameQuery": {
            "title": "Business name contains",
            "type": "string",
            "description": "Keep only records whose business / firm name contains this text (e.g. a franchise or company name)."
          },
          "withEmailOnly": {
            "title": "Only records with an e-mail address",
            "type": "boolean",
            "description": "Keep only licensees that have a published e-mail address of record (most do).",
            "default": false
          },
          "withBusinessNameOnly": {
            "title": "Only records with a business / firm name",
            "type": "boolean",
            "description": "Keep only licensees that have an associated company name (B2B firms).",
            "default": false
          },
          "withStreetAddressOnly": {
            "title": "Only records with a street address",
            "type": "boolean",
            "description": "Drop records that only have a city/ZIP (no street).",
            "default": false
          },
          "expiringWithinDays": {
            "title": "License expiring within N days",
            "minimum": 1,
            "type": "integer",
            "description": "Keep only licenses that expire within this many days — ideal for renewal-timing, CE and insurance prospecting."
          },
          "issuedAfter": {
            "title": "Originally licensed after (YYYY-MM-DD)",
            "type": "string",
            "description": "Keep only licenses originally issued on/after this date — find newly-licensed pros and new businesses."
          },
          "minLeadScore": {
            "title": "Minimum lead score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Keep only records with a lead score (0–100) at or above this value."
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "leadScore",
              "expirationSoon",
              "newestIssued",
              "name",
              "source"
            ],
            "type": "string",
            "description": "Ordering of the (capped) output.",
            "default": "leadScore"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of license records to output (after filtering & sorting).",
            "default": 1000
          },
          "deduplicateResults": {
            "title": "Deduplicate",
            "type": "boolean",
            "description": "Collapse duplicate rows by license number + name (recommended).",
            "default": true
          },
          "includeRawFields": {
            "title": "Include raw source fields",
            "type": "boolean",
            "description": "Attach the raw DPOR record (sourceFields) to each output item for full transparency.",
            "default": true
          },
          "monitorMode": {
            "title": "Monitor mode (only new / changed)",
            "type": "boolean",
            "description": "Remember licenses across runs and emit only NEW or CHANGED ones (status, expiration, address or e-mail change). Great for tracking newly-issued and just-renewed licenses. Works independently of Apify Schedules — use a Schedule to run it on a cadence.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Namespace for monitor memory. Use a distinct key per saved search so their states don't collide.",
            "default": "default"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "DPOR files download cleanly from Apify datacenter IPs — the default Apify Proxy is recommended.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}