# Washington State Electric Vehicle Population Scraper (`muhammadafzal/washington-state-ev-population-scraper`) Actor

Scrape Washington State official Electric Vehicle Population Data API for structured BEV and PHEV registration records. Filter by county, city, make, model, EV type, model year, CAFV eligibility, and electric range.

- **URL**: https://apify.com/muhammadafzal/washington-state-ev-population-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Automation, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 vehicle records

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Washington State Electric Vehicle Population Scraper

Query the official Washington State Data.WA **Electric Vehicle Population Data** API and return structured records for registered battery-electric vehicles (BEVs) and plug-in hybrid electric vehicles (PHEVs).

The source is a public Socrata endpoint; no API key, login, browser session, or proxy is required. Each output item represents one source vehicle record. The actor does not infer ownership, location beyond the source fields, or current vehicle availability.

### What you can filter

- County, city, registered-owner state, make, and model
- Electric vehicle type and CAFV eligibility
- Inclusive model-year range
- Minimum electric-only range in miles
- Result ordering and a starting offset for pagination

The default run returns up to 100 records ordered by newest model year. `maxResults` is capped at 10,000 per run. For larger exports, run multiple jobs with increasing `offset` values and keep the same filter and sort settings.

### Output

The dataset contains normalized camelCase fields such as `modelYear`, `make`, `model`, `evType`, `electricRange`, `county`, `city`, `state`, `electricUtility`, and `dolVehicleId`. `sourceUrl` points to the official dataset page and `retrievedAt` records the extraction time.

The `OUTPUT` key-value record contains counts, pagination state, source identifiers, and warnings. A successful query with no matches returns an empty dataset and a warning summary; an unavailable official API is reported as an error rather than fabricated data.

### Example input

```json
{
  "county": "King",
  "evType": "Battery Electric Vehicle (BEV)",
  "minModelYear": 2020,
  "maxResults": 25,
  "orderBy": "electric_range",
  "orderDirection": "desc"
}
```

### Source and limitations

Source: [Washington State Electric Vehicle Population Data](https://data.wa.gov/Transportation/Electric-Vehicle-Population-Data/f6w7-q2d2), provided by the Washington State Department of Licensing. The source dataset can change over time, may contain records with missing fields, and includes some registered-owner addresses outside Washington.

This Actor is read-only and intended for data analysis, market research, fleet research, and public-sector or academic workflows. Respect the source's terms and rate limits when scheduling repeated runs.

# Actor input Schema

## `county` (type: `string`):

Optional exact county filter, for example King.

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

Optional exact registered-owner city filter, for example Seattle.

## `state` (type: `string`):

Optional two-letter state filter. Leave blank to include all records in the source dataset, including out-of-state addresses.

## `make` (type: `string`):

Optional exact manufacturer filter, for example Tesla, Ford, or Nissan.

## `model` (type: `string`):

Optional exact vehicle model filter, for example Model 3.

## `evType` (type: `string`):

Optional filter for battery-electric or plug-in hybrid vehicles.

## `cafvEligibility` (type: `string`):

Optional exact Clean Alternative Fuel Vehicle eligibility text filter.

## `minModelYear` (type: `integer`):

Optional inclusive minimum model year.

## `maxModelYear` (type: `integer`):

Optional inclusive maximum model year.

## `minElectricRange` (type: `number`):

Optional inclusive minimum electric-only range in miles.

## `maxResults` (type: `integer`):

Maximum vehicle records to return. The actor caps this at 10,000 to keep runs bounded.

## `offset` (type: `integer`):

Number of matching source rows to skip before collecting results. Use this for controlled pagination across runs.

## `orderBy` (type: `string`):

Source field used to order results.

## `orderDirection` (type: `string`):

Sort direction applied to the selected source field.

## Actor input object example

```json
{
  "county": "King",
  "city": "Seattle",
  "state": "WA",
  "make": "Tesla",
  "model": "Model 3",
  "cafvEligibility": "Clean Alternative Fuel Vehicle Eligible",
  "minModelYear": 2020,
  "maxModelYear": 2026,
  "minElectricRange": 200,
  "maxResults": 100,
  "offset": 0,
  "orderBy": "model_year",
  "orderDirection": "desc"
}
```

# Actor output Schema

## `dataset` (type: `string`):

Normalized BEV and PHEV registration records returned by the official Data.WA source.

## `datasetCsv` (type: `string`):

The normalized vehicle records as CSV.

## `summary` (type: `string`):

Record counts, pagination state, warnings, and source metadata.

## `consoleRun` (type: `string`):

Live run status, logs, and dataset preview.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/washington-state-ev-population-scraper").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/washington-state-ev-population-scraper").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 '{}' |
apify call muhammadafzal/washington-state-ev-population-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/washington-state-ev-population-scraper"
        }
    }
}

```

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/EPApYK2no08sfLCpE/builds/Nv2lBpxRnNnaCvyrk/openapi.json
