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

Extract public CarMax used-vehicle inventory from search and vehicle-detail URLs. Return structured records with price, mileage, VIN, stock number, specs, images, and public features for analysts and AI agents.

- **URL**: https://apify.com/muhammadafzal/carmax-scraper.md
- **Developed by:** [Muhammad Afzal](https://apify.com/muhammadafzal) (community)
- **Categories:** Automation, MCP servers
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 vehicle extracteds

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

## CarMax Scraper

Extract public used-vehicle inventory from CarMax search-result pages or individual vehicle URLs. The actor is designed for dealerships, automotive marketplaces, inventory analysts, lead researchers, and AI agents that need bounded vehicle records in a stable dataset shape.

### What it extracts

Each vehicle record can include the canonical URL, stock number, VIN, year, make, model, price, mileage, location, body type, fuel type, transmission, color, public description, image URLs, and publicly displayed features. CarMax may omit fields on some pages; missing values are returned as `null` and non-fatal limitations are listed in `warnings`.

### Input

Provide one or more absolute `https://www.carmax.com` URLs in `startUrls`. Search URLs such as `https://www.carmax.com/cars` are expanded across up to `maxPages` pages. Individual vehicle URLs such as `https://www.carmax.com/car/12345678` can be supplied directly. `maxResults` caps the number of vehicle records. `includeDetails` defaults to `true`; turn it off when you only need discovered vehicle URLs. Use `proxyConfiguration` when a cloud IP is challenged.

Example:

```json
{
  "startUrls": [{ "url": "https://www.carmax.com/cars" }],
  "maxResults": 25,
  "maxPages": 3,
  "includeDetails": true
}
```

### Output

```json
{
  "recordType": "vehicle",
  "url": "https://www.carmax.com/car/12345678",
  "stockNumber": "26123456",
  "vin": null,
  "year": 2022,
  "make": "Toyota",
  "model": "Camry SE",
  "price": 24998,
  "mileage": 32145,
  "location": "CarMax Austin North",
  "imageUrls": [],
  "features": [],
  "warnings": []
}
```

### Pricing

The intended PPE configuration charges $0.01 per run plus $0.005 per vehicle record. A run with no discovered vehicles returns a diagnostic summary instead of silently pretending that inventory was extracted.

### Reliability and limits

The crawler uses a real browser, bounded pagination, low concurrency, deduplication, selector fallbacks, and JSON-LD/visible-page parsing. It does not log in, bypass a CAPTCHA, or collect private customer information. CarMax inventory, pricing, and vehicle availability change frequently; use the source URL and `scrapedAt` timestamp for freshness.

Use the data in accordance with CarMax's terms, applicable law, and the rights of the website and vehicle owners. This actor is for publicly displayed inventory only.

# Actor input Schema

## `startUrls` (type: `array`):

Use this when you have a CarMax inventory search or vehicle-detail URL. Accepts absolute https://www.carmax.com URLs; example: https://www.carmax.com/cars.

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

Use this when you need a bounded number of vehicle records. Enter 1 to 200; default is 25. This is a vehicle cap, not a page count.

## `maxPages` (type: `integer`):

Use this when a CarMax search has multiple result pages. Enter 1 to 10; default is 3. Detail URLs do not use this setting.

## `includeDetails` (type: `boolean`):

Use this when you need VIN, stock number, features, images, and richer vehicle fields. Detail pages use extra requests; default is true.

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

Use this when the target blocks the default cloud IP. Provide an Apify proxy configuration object; an empty object uses the actor default.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.carmax.com/cars"
    }
  ],
  "maxResults": 25,
  "maxPages": 3,
  "includeDetails": true,
  "proxyConfiguration": {}
}
```

# Actor output Schema

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

Normalized public vehicle records returned by the actor.

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

The normalized vehicle records as CSV.

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

Terminal status, count, source URLs, and extraction mode.

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

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

```

## MCP server setup

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