{
  "openapi": "3.0.1",
  "info": {
    "title": "Virginia Contractor License Lookup (DPOR Bulk)",
    "description": "Download and filter 50,000+ Virginia DPOR contractor licenses — Class A, B & C plus tradespeople — by name, or by county, city, ZIP and trade, direct from the official regulant lists. No CAPTCHA, no auth.",
    "version": "0.0",
    "x-build-id": "mYKl48do5xiHxe8ph"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapebench~virginia-contractor-license-lookup/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapebench-virginia-contractor-license-lookup",
        "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/scrapebench~virginia-contractor-license-lookup/runs": {
      "post": {
        "operationId": "runs-sync-scrapebench-virginia-contractor-license-lookup",
        "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/scrapebench~virginia-contractor-license-lookup/run-sync": {
      "post": {
        "operationId": "run-sync-scrapebench-virginia-contractor-license-lookup",
        "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": {
          "mode": {
            "title": "Mode",
            "enum": [
              "auto",
              "lookup",
              "export"
            ],
            "type": "string",
            "description": "auto (default): names below run a name search, a county / city / ZIP / trade runs the directory export, nothing exports the licence types picked. lookup: name search only. export: names ignored.",
            "default": "auto"
          },
          "queries": {
            "title": "Names (batch)",
            "type": "array",
            "description": "Same as 'Name filters': business or individual names, each matched as a case-insensitive substring. DPOR publishes no licence-number search.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Name",
            "type": "string",
            "description": "One name; same as 'Name filter'."
          },
          "licenseTypes": {
            "title": "License types",
            "uniqueItems": true,
            "type": "array",
            "description": "Which DPOR license categories to include. Leave empty for Class A, B, and C contractors. Valid values: class_a, class_a_legacy, class_b, class_c, temporary, residential_tradesman, backflow_prevention, elevator_mechanic, water_well_provider, accessibility_mechanic, energy_analyst, energy_analyst_firm, sprinkler_inspector.",
            "items": {
              "type": "string"
            },
            "default": [
              "class_a",
              "class_b",
              "class_c"
            ]
          },
          "nameFilter": {
            "title": "Name filter",
            "type": "string",
            "description": "Only return records where the individual or business name contains this text (case-insensitive). Leave blank for all."
          },
          "nameFilters": {
            "title": "Name filter (batch)",
            "type": "array",
            "description": "Look up many in ONE run instead of starting a run per lookup. Takes the same values as 'Name filter'. Combined with 'Name filter' if you fill both, and duplicates are removed. Billing is unchanged: you are charged per record returned, not per entry submitted.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "cityFilter": {
            "title": "City filter",
            "type": "string",
            "description": "Only return records where the city contains this text (case-insensitive). Leave blank for all."
          },
          "maxResults": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Cap on the number of records returned PER ENTRY, not per run — so a batch cannot silently return only the first 500 rows overall and read as 'the rest don't exist'.",
            "default": 500
          },
          "county": {
            "title": "County or independent city",
            "type": "string",
            "description": "Directory export (by place and trade, with county derived from the ZIP): A Virginia county or independent city, e.g. 'Fairfax County', 'Richmond city', 'City of Fairfax', 'Loudoun'. Fairfax, Franklin, Richmond and Roanoke are each both a county and a city, so say which. APPROXIMATE: DPOR records no county, so it is derived from the mailing ZIP (each row's county_method says how). For an exact match use City or ZIP. An unrecognised name returns the free county and trade lists instead of failing."
          },
          "counties": {
            "title": "Counties (batch)",
            "type": "array",
            "description": "Directory export (by place and trade, with county derived from the ZIP): Several counties or independent cities in ONE run. Combined with 'County' if you fill both.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "city": {
            "title": "Mailing city (exact)",
            "type": "string",
            "description": "Directory export (by place and trade, with county derived from the ZIP): The city on the licence's mailing address, e.g. 'Vienna', 'Virginia Beach'. Exact match, case-insensitive."
          },
          "cities": {
            "title": "Mailing cities (batch)",
            "type": "array",
            "description": "Directory export (by place and trade, with county derived from the ZIP): Several mailing cities in ONE run, each searched separately.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "zip": {
            "title": "ZIP code (exact)",
            "type": "string",
            "description": "Directory export (by place and trade, with county derived from the ZIP): A 5-digit ZIP code, matched exactly against the licence's mailing ZIP, e.g. '22182'."
          },
          "zips": {
            "title": "ZIP codes (batch)",
            "type": "array",
            "description": "Directory export (by place and trade, with county derived from the ZIP): Several ZIP codes in ONE run, each searched separately.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "trade": {
            "title": "Trade",
            "type": "string",
            "description": "Directory export (by place and trade, with county derived from the ZIP): A DPOR trade, by name or code, e.g. 'Roofing', 'Electrical', 'HVAC', 'Home Improvement', 'ROC'. A word from the name works too: 'roof' finds Roofing. Leave it empty to get every trade in the place."
          },
          "trades": {
            "title": "Trades (batch)",
            "type": "array",
            "description": "Directory export (by place and trade, with county derived from the ZIP): Several trades in ONE run, e.g. Roofing and Electrical. Combined with 'Trade' if you fill both. A contractor holding two of them is returned (and billed) once.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "licenseClasses": {
            "title": "Licence classes",
            "type": "array",
            "description": "Directory export (by place and trade, with county derived from the ZIP): Which DPOR licence classes to include: A, B, C, and RETR (residential tradesman). Only those files are downloaded. Empty = A, B and C; when empty, the License types above pick the classes.",
            "items": {
              "type": "string"
            }
          },
          "inVirginiaOnly": {
            "title": "Virginia addresses only",
            "type": "boolean",
            "description": "Directory export (by place and trade, with county derived from the ZIP): Keep only licences with a Virginia mailing address. About 20% of DPOR's licences have an out-of-state address; turn this off to include them on a statewide trade search. Unset = on."
          },
          "listOptionsOnly": {
            "title": "Discovery Mode: list counties and trades only",
            "type": "boolean",
            "description": "Directory export (by place and trade, with county derived from the ZIP): If true, skip the download and return Virginia's 95 counties and 35+ independent cities plus every trade DPOR's Board for Contractors licenses, with its code. Free, not charged.",
            "default": false
          },
          "expiresAfter": {
            "title": "Expires on or after",
            "type": "string",
            "description": "Only licences expiring on or after this date (YYYY-MM-DD). With 'Expires on or before' it lists licences due for renewal in a window. Works on exports and name searches."
          },
          "expiresBefore": {
            "title": "Expires on or before",
            "type": "string",
            "description": "Only licences expiring on or before this date (YYYY-MM-DD)."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. DPOR's files are reachable directly; a proxy is not needed.",
            "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}