# CarMax Scraper (`datascrapers/carmax-scraper`) Actor

Collect CarMax used-car listings from search URLs, including vehicle specs, pricing, store location, and optional zip-code inventory filtering.

- **URL**: https://apify.com/datascrapers/carmax-scraper.md
- **Developed by:** [Farhan Ali](https://apify.com/datascrapers) (community)
- **Categories:**
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 cars

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/actors/running/actors-in-store.md#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

**CarMax Scraper** creates a structured dataset of used-car listings collected from [CarMax](https://www.carmax.com). Each dataset item represents one vehicle and can include VIN and stock number, year, make, model, trim, price, mileage, specs, colors, store location, transfer information, and listing flags. Query the source with a CarMax search URL (`searchUrl` or `searchUrls`) and an optional zip code. Control the result limit with `maxItems`, and retrieve records through the Apify Dataset API or export them as JSON, CSV, Excel, XML, or another supported format.

### Dataset at a glance

| Property | Value |
|---|---|
| Source | carmax.com used-car search |
| Record unit | One CarMax vehicle listing |
| Input methods | Search URL (`searchUrl`) or multiple search URLs (`searchUrls`), optional `zipCode` |
| Main identifiers | `vin`, `stockNumber`, listing URL (`url`) |
| Delivery | Apify Dataset and API |
| Export formats | JSON, CSV, Excel, XML, HTML (Apify dataset exports) |
| Update model | Fresh records per Actor run |
| Pricing | $1 / 1,000 cars; Actor start $0.00005 |

### Coverage and available records

The Actor collects public CarMax search listings. Filters encoded in the search URL (make, model, body type, price, features) are applied as CarMax shows them.

- **Single URL**: `searchUrl` (for example `https://www.carmax.com/cars` or `https://www.carmax.com/cars/suvs/audi`).
- **Multiple URLs**: `searchUrls` overrides `searchUrl` when set.
- **Zip code**: `zipCode` scopes inventory to that area. Leave empty for a nationwide search. Schema default is `20760`.

Record types and limits:

- **Listing records** include identifiers, vehicle specs, pricing, store location, transfer fields, and listing flags as CarMax returns them.
- **Pagination**: the Actor continues through search pages until CarMax returns no further listings or `maxItems` is reached.
- **Result cap**: `maxItems` limits cars collected (`0` means unlimited; console prefill `20`).

Known exclusions: content CarMax only shows after login is not collected; each run captures inventory at run time (no historical snapshots); sold or reserved vehicles may still appear if they remain on the search page.

### Data dictionary

Field names below match dataset record JSON properties exactly. Values come from CarMax. Not every listing includes every spec (for example EV battery range on gasoline cars).

| Field | Type | Nullable | Description | Example |
|---|---|---:|---|---|
| `vin` | string | Yes | Vehicle identification number; recommended deduplication key | `4S4BTALCXR3155366` |
| `stockNumber` | number | Yes | CarMax stock number; secondary key | `28735752` |
| `url` | string | Yes | Listing URL | `https://www.carmax.com/car/28735752` |
| `heroImageUrl` | string | Yes | Primary listing image | `https://img2.carmax.com/assets/28735752/hero.jpg?width=400&height=300` |
| `year` | number | Yes | Model year | `2024` |
| `make` | string | Yes | Make | `Subaru` |
| `model` | string | Yes | Model | `Outback` |
| `body` | string | Yes | Body style | `4D Sport Utility` |
| `trim` | string | Yes | Trim level | `Onyx Edition` |
| `basePrice` | number | Yes | Current price in USD | `25998.0` |
| `originalPrice` | number | Yes | Prior price when CarMax shows a drop | `26998.0` |
| `hasPriceDrop` | boolean | Yes | Whether CarMax marks a price drop | `false` |
| `mileage` | number | Yes | Odometer reading (miles) | `56484` |
| `exteriorColor` | string | Yes | Exterior color as shown | `Black` |
| `interiorColor` | string | Yes | Interior color as shown | `Black` |
| `normalizedExteriorColor` | string | Yes | Normalized exterior color | `Black` |
| `normalizedInteriorColor` | string | Yes | Normalized interior color | `Black` |
| `transmission` | string | Yes | Transmission | `Automatic` |
| `driveTrain` | string | Yes | Drivetrain | `All Wheel Drive` |
| `engineType` | string | Yes | Engine type | `Gas` |
| `engineSize` | string | Yes | Engine size | `2.5L` |
| `cylinders` | number | Yes | Cylinder count | `4` |
| `horsepower` | number | Yes | Horsepower | `182` |
| `horsepowerRpm` | number | Yes | Horsepower RPM | `5800` |
| `engineTorque` | number | Yes | Torque | `176` |
| `engineTorqueRpm` | number | Yes | Torque RPM | `4400` |
| `mpgCity` | number | Yes | City MPG | `26` |
| `mpgHighway` | number | Yes | Highway MPG | `32` |
| `originalBatteryRangeInMiles` | number | Yes | EV battery range (miles) when listed | `null` |
| `fuelType` | string | Yes | Fuel type | `Gas` |
| `features` | array | Yes | Feature list | Feature strings from the listing |
| `highlightedFeatures` | string | Yes | Highlighted feature text | As shown by CarMax |
| `highlights` | array | Yes | Highlight tags | Tags from the listing |
| `storeId` | number | Yes | Store identifier | Store id from CarMax |
| `storeName` | string | Yes | Store name | `Greenwood` |
| `storeCity` | string | Yes | Store city | `Indianapolis` |
| `state` | string | Yes | Store state | `Indiana` |
| `stateAbbreviation` | string | Yes | State code | `IN` |
| `distance` | number | Yes | Distance from the zip filter (miles) | Distance when a zip is set |
| `averageRating` | number | Yes | Store rating | Store rating when shown |
| `numberOfReviews` | number | Yes | Store review count | Review count when shown |
| `isTransferable` | boolean | Yes | Whether the car can be transferred | Transfer flag |
| `transferFee` | number | Yes | Transfer fee in USD when listed | Fee when shown |
| `isSaleable` | boolean | Yes | Whether the listing is marked saleable | Saleable flag |
| `isComingSoon` | boolean | Yes | Coming-soon flag | Coming-soon flag |
| `isReserved` | boolean | Yes | Reserved flag | Reserved flag |
| `isAvailableToTransact` | boolean | Yes | Available-to-transact flag | Availability flag |
| `isEVTaxCreditEligible` | boolean | Yes | EV tax-credit eligibility flag | Eligibility flag |
| `priorUseDescriptions` | array | Yes | Prior-use labels (rental, fleet, and similar) | Labels when listed |

Additional store, transfer, package, finance, and RepairPal objects may appear when CarMax returns them (`store`, `badge`, `packages`, `bestFinanceDecision`, `repairPalData`).

### Example dataset record

Listing from `https://www.carmax.com/cars` with an empty zip code (nationwide search).

```json
{
  "heroImageUrl": "https://img2.carmax.com/assets/28735752/hero.jpg?width=400&height=300",
  "url": "https://www.carmax.com/car/28735752",
  "stockNumber": 28735752,
  "vin": "4S4BTALCXR3155366",
  "year": 2024,
  "make": "Subaru",
  "model": "Outback",
  "body": "4D Sport Utility",
  "trim": "Onyx Edition",
  "basePrice": 25998.0,
  "mileage": 56484,
  "exteriorColor": "Black",
  "transmission": "Automatic",
  "driveTrain": "All Wheel Drive",
  "engineSize": "2.5L",
  "horsepower": 182,
  "mpgCity": 26,
  "mpgHighway": 32,
  "storeName": "Greenwood",
  "storeCity": "Indianapolis",
  "state": "Indiana"
}
```

The record above was produced with this input:

```json
{
  "searchUrl": "https://www.carmax.com/cars",
  "zipCode": "",
  "maxItems": 20
}
```

### Query and input reference

| Input | Type | Required | Default | Accepted values | Description |
|---|---|---:|---|---|---|
| `searchUrl` | string | No | — (prefill `https://www.carmax.com/cars`) | CarMax search URL | Single search; filters in the URL are applied |
| `searchUrls` | array (requestListSources) | No | — | CarMax search URLs | Overrides `searchUrl` when set |
| `zipCode` | string | No | `20760` | US zip code or empty | Inventory area; empty = nationwide |
| `maxItems` | integer | No | `0` | `0` or any positive integer | Maximum cars; `0` = unlimited (console prefill `20`) |
| `proxyConfiguration` | object | No | Apify proxy, `RESIDENTIAL` | Apify proxy groups or custom proxies | Residential proxies are recommended |

Provide `searchUrl` and/or `searchUrls`. If both are omitted, the schema prefill `https://www.carmax.com/cars` is the usual console starting point.

Minimal request:

```json
{ "searchUrl": "https://www.carmax.com/cars/suvs/audi", "zipCode": "" }
```

Advanced request (multiple URLs, zip filter, cap):

```json
{
  "searchUrls": [
    { "url": "https://www.carmax.com/cars/suvs/audi" },
    { "url": "https://www.carmax.com/cars/trucks" }
  ],
  "zipCode": "90210",
  "maxItems": 50,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"] }
}
```

### Retrieve the data through the API

Records are delivered through the Apify Actor and Dataset APIs — not an official CarMax API.

1. Start the Actor with a JSON input (console or API).
2. Wait for the run to finish, or use a synchronous endpoint if you want the response inline.
3. Retrieve items from the run's default dataset.
4. Paginate or export the dataset.

Python example:

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR-APIFY-TOKEN")

run_input = {
    "searchUrl": "https://www.carmax.com/cars",
    "zipCode": "",
    "maxItems": 20,
}

run = client.actor("datascrapers/carmax-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item.get("vin"), item.get("year"), item.get("make"), item.get("basePrice"))
```

Apify generates ready-to-run Python, JavaScript, and cURL examples on the Actor's [API tab](https://apify.com/datascrapers/carmax-scraper/api). Do not put a real API token in shared code or URLs.

### Data quality and record handling

- **Incomplete specs**: engine, MPG, EV range, and transfer fields are omitted or null when CarMax does not list them.
- **Source changes**: CarMax inventory and field names can change; unreadable fields are omitted rather than fabricated.
- **Deduplication**: within a run, vehicles are identified by VIN or stock number. Across runs, records are appended. Use `vin` as the stable key.
- **Normalization**: `basePrice` and `mileage` are numeric. Colors may appear in both raw and normalized fields.
- **Zip filter**: `distance` is meaningful when `zipCode` is set.

### Export and pipeline examples

| Destination | Recommended method | Typical use |
|---|---|---|
| PostgreSQL / Supabase | Dataset API poll or webhook consumer | Store inventory and price history |
| Google Sheets | Apify Google Sheets integration | Share shortlists by make or zip |
| Pricing models | Dataset API JSON export | Comp sets and drop detection |
| S3 / cloud storage | Scheduled export via Apify scheduler + integration | Archival of inventory snapshots |

### Pricing and cost examples

The Actor uses pay-per-event pricing. Each run also charges a one-time Actor start. Residential proxies are recommended. Proxy and compute are billed by your Apify plan.

| Event | Trigger | Rate |
|---|---|---|
| Actor start | Once per run | $0.00005 |
| `apify-default-dataset-item` (car) | Each car written to the dataset | $0.001 / car ($1 / 1,000) |

Example costs (Actor start negligible; plan-tier discounts not applied):

| Records | Configuration | Estimated base cost |
|---:|---|---:|
| 1,000 | Cars | $1.00 |
| 10,000 | Cars | $10.00 |

Estimates depend on the verified pricing model and the number of cars collected.

### Limitations and responsible data use

- The Actor collects publicly accessible CarMax search listings only.
- Field availability depends on what CarMax renders at run time; some specs can be null.
- The Actor does not provide historical snapshots unless you store them yourself. Inventory changes continuously.
- Large runs should use residential proxies; without them, coverage may degrade.
- You are responsible for compliance with CarMax's terms of service, applicable privacy law, and any contractual obligations before using the data.

### Dataset questions

#### What does one dataset item represent?

One CarMax vehicle listing. Features, packages, and transfer details nest on that listing.

#### Which field should I use as a unique identifier?

`vin` is the recommended deduplication key. `stockNumber` and `url` are reasonable secondary keys.

#### Are fields nullable or conditional?

Yes. EV range, transfer fees, finance objects, and some engine specs appear only when CarMax lists them.

#### Can I retrieve the records as CSV or JSON?

Yes. The dataset can be exported as JSON, CSV, Excel, XML, or HTML from the Apify Console, and queried through the Dataset API.

#### Does the Actor return historical data?

No. Each run captures inventory at run time. To track price drops, schedule repeated runs and store the outputs yourself.

#### What counts as a billable result?

Two pay-per-event charges apply: Actor start once per run ($0.00005) and a car charge for every listing ($0.001, or $1 per 1,000).

### Related datasets from Data Scrapers

- **[Autotrader Scraper](https://apify.com/datascrapers/autotrader-scraper)** — US used-car listings that can be compared with CarMax prices.
- **[Cars.com Scraper](https://apify.com/datascrapers/cars-scraper)** — Additional US inventory for the same VIN-level comps.
- **[AutoScout24 Scraper](https://apify.com/datascrapers/autoscout24-scraper)** — European used-car listings for cross-market pricing.
- **[Facebook Marketplace Scraper](https://apify.com/datascrapers/facebook-marketplace)** — Private-party listings that sit beside dealer inventory.
- **[Gumtree Scraper](https://apify.com/datascrapers/gumtree-scraper)** — Classified vehicle listings for broader marketplace coverage.

### Data Scrapers support

Need an additional field, record type, or export workflow? Contact Data Scrapers at stardustspotlight@gmail.com. Include a sample source URL, required fields, expected record volume, and preferred delivery format.

# Actor input Schema

## `searchUrl` (type: `string`):

Full CarMax search URL, e.g. https://www.carmax.com/cars/suvs/audi. All filters from the URL are automatically applied.

## `searchUrls` (type: `array`):

Multiple search URLs to scrape (overrides searchUrl if set).

## `zipCode` (type: `string`):

Target zip code for inventory filtering. Leave empty for nationwide search.

## `maxItems` (type: `integer`):

Maximum number of cars to scrape (0 = unlimited).

## `proxyConfiguration` (type: `object`):

Proxy settings for anti-bot protection.

## Actor input object example

```json
{
  "searchUrl": "https://www.carmax.com/cars",
  "zipCode": "20760",
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset containing scraped CarMax car listings

# 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 = {
    "searchUrl": "https://www.carmax.com/cars",
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascrapers/carmax-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 = {
    "searchUrl": "https://www.carmax.com/cars",
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("datascrapers/carmax-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 '{
  "searchUrl": "https://www.carmax.com/cars",
  "maxItems": 20
}' |
apify call datascrapers/carmax-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,datascrapers/carmax-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/vOKdK9vcHeBKgtdqt/builds/J5rRABO663gJGvAUV/openapi.json
