# KBB Cars for Sale Scraper - Kelley Blue Book Listings (`lulzasaur/kbb-scraper`) Actor

Scrape used and new car listings from Kelley Blue Book (KBB). Get price, mileage, VIN, dealer info, deal rating, and vehicle details for 46K+ vehicles nationwide.

- **URL**: https://apify.com/lulzasaur/kbb-scraper.md
- **Developed by:** [lulz bot](https://apify.com/lulzasaur) (community)
- **Categories:** E-commerce
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## KBB Scraper - Kelley Blue Book Cars for Sale

Scrape used and new car listings from [Kelley Blue Book](https://www.kbb.com/cars-for-sale/all/). Extract detailed vehicle data including VIN, pricing, KBB Fair Purchase Price, deal ratings, mileage, dealer info, and 30+ fields per listing.

### Features

- **46,000+ vehicles** nationwide from KBB's marketplace
- **KBB Fair Purchase Price** and deal rating (Great/Good/Fair/High)
- Filter by **make, model, year, price, mileage, location**
- Full vehicle specs: engine, transmission, drive type, fuel, MPG, colors
- Dealer info: name, phone, rating, reviews, city/state
- Listing metadata: days on site, hot deals, price reductions, newly listed flags

### Input Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `make` | string | - | Car make (e.g. toyota, honda, ford) |
| `model` | string | - | Car model (e.g. camry, civic). Requires make. |
| `zipCode` | string | 80202 | ZIP code for search location |
| `radius` | integer | 75 | Search radius in miles (10-500) |
| `yearFrom` | integer | - | Minimum model year |
| `yearTo` | integer | - | Maximum model year |
| `maxPrice` | number | - | Maximum listing price in USD |
| `maxMileage` | number | - | Maximum mileage in miles |
| `maxResults` | integer | 100 | Max listings to return (1-2000) |
| `proxyConfiguration` | object | none | Proxy settings |

### Output Fields

Each listing includes:

| Field | Description |
|-------|-------------|
| `id` | KBB listing ID |
| `title` | Full listing title |
| `vin` | Vehicle Identification Number |
| `year` | Model year |
| `make` | Manufacturer (Honda, Toyota, etc.) |
| `model` | Model name (Civic, Camry, etc.) |
| `trim` | Trim level (LX, EX, Sport, etc.) |
| `bodyStyle` | Body style (Sedan, SUV, Truck, etc.) |
| `listingType` | NEW or USED |
| `price` | Sale price in USD |
| `kbbFairPurchasePrice` | KBB Fair Purchase Price estimate |
| `kbbFairPriceLow` | KBB Fair Price range low |
| `kbbFairPriceHigh` | KBB Fair Price range high |
| `priceDelta` | Difference from KBB Fair Price |
| `dealRating` | KBB deal rating (Great/Good/Fair/High) |
| `mileage` | Odometer reading (formatted string) |
| `mileageNum` | Odometer reading (number) |
| `daysOnSite` | Days the listing has been active |
| `exteriorColor` | Exterior color |
| `interiorColor` | Interior color |
| `engine` | Engine type (4-Cylinder, V6, etc.) |
| `transmission` | Transmission type |
| `driveType` | Drive type (FWD, AWD, 4WD, RWD) |
| `fuelType` | Fuel type (Gasoline, Hybrid, Electric, etc.) |
| `mpgCity` | City fuel economy |
| `mpgHighway` | Highway fuel economy |
| `doors` | Number of doors |
| `isHot` | KBB "Hot" listing flag |
| `isNewlyListed` | Recently listed flag |
| `isReducedPrice` | Price recently reduced |
| `dealerName` | Dealer or seller name |
| `dealerPhone` | Dealer phone (if public) |
| `dealerRating` | Dealer rating (out of 5) |
| `dealerReviewCount` | Number of dealer reviews |
| `isPrivateSeller` | Whether seller is private (vs dealer) |
| `city` | Dealer city |
| `state` | Dealer state |
| `zip` | Dealer ZIP code |
| `distance` | Distance from search ZIP in miles |
| `imageUrl` | Primary listing image |
| `url` | Full KBB listing URL |

### Example Usage

#### Search all cars near Denver
```json
{
    "zipCode": "80202",
    "radius": 50,
    "maxResults": 100
}
````

#### Search for used Toyota Camry under $25K

```json
{
    "make": "toyota",
    "model": "camry",
    "maxPrice": 25000,
    "yearFrom": 2020,
    "maxResults": 200
}
```

#### Search for low-mileage SUVs

```json
{
    "maxMileage": 30000,
    "yearFrom": 2022,
    "maxResults": 500
}
```

### Use Cases

- **Car shopping** — Find the best deals using KBB Fair Purchase Price
- **Market analysis** — Track average prices by make/model/year
- **Dealer inventory monitoring** — Monitor dealer stock and pricing trends
- **Price comparison** — Compare asking prices vs KBB valuations
- **Automotive research** — Analyze vehicle market data at scale

### Technical Details

- Uses Cheerio (no browser needed) for fast, lightweight scraping
- Extracts data from KBB's Next.js server-side rendered `__NEXT_DATA__` JSON
- Handles 308/301 redirects automatically
- \~23 organic listings per page plus sponsored listings
- Respects rate limits with max concurrency of 2

# Actor input Schema

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

Filter by car make. Leave empty for all makes.

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

Filter by model (e.g. camry, civic, f-150). Requires make to be set.

## `condition` (type: `string`):

Filter by vehicle condition.

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

ZIP code for search center. Defaults to 80202 (Denver, CO).

## `distance` (type: `string`):

Search radius from ZIP code.

## `minPrice` (type: `integer`):

Minimum listing price in USD.

## `maxPrice` (type: `integer`):

Maximum listing price in USD.

## `minYear` (type: `integer`):

Minimum model year (e.g. 2018).

## `maxYear` (type: `integer`):

Maximum model year (e.g. 2025).

## `maxMileage` (type: `integer`):

Maximum mileage in miles.

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

Maximum number of listings to scrape. KBB returns ~23 per page.

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

Proxy settings for requests. KBB may work without proxies.

## Actor input object example

```json
{
  "make": "",
  "condition": "all",
  "zipCode": "80202",
  "distance": "nationwide",
  "maxResults": 200,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "zipCode": "80202",
    "maxResults": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("lulzasaur/kbb-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 = {
    "zipCode": "80202",
    "maxResults": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("lulzasaur/kbb-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "zipCode": "80202",
  "maxResults": 200
}' |
apify call lulzasaur/kbb-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=lulzasaur/kbb-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "KBB Cars for Sale Scraper - Kelley Blue Book Listings",
        "description": "Scrape used and new car listings from Kelley Blue Book (KBB). Get price, mileage, VIN, dealer info, deal rating, and vehicle details for 46K+ vehicles nationwide.",
        "version": "1.0",
        "x-build-id": "DRYlgw8hKfXT7b3me"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/lulzasaur~kbb-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-lulzasaur-kbb-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/lulzasaur~kbb-scraper/runs": {
            "post": {
                "operationId": "runs-sync-lulzasaur-kbb-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/lulzasaur~kbb-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-lulzasaur-kbb-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": {
                    "make": {
                        "title": "Car Make",
                        "enum": [
                            "",
                            "acura",
                            "alfa-romeo",
                            "aston-martin",
                            "audi",
                            "bentley",
                            "bmw",
                            "buick",
                            "cadillac",
                            "chevrolet",
                            "chrysler",
                            "dodge",
                            "ferrari",
                            "fiat",
                            "ford",
                            "genesis",
                            "gmc",
                            "honda",
                            "hyundai",
                            "infiniti",
                            "jaguar",
                            "jeep",
                            "kia",
                            "lamborghini",
                            "land-rover",
                            "lexus",
                            "lincoln",
                            "lucid",
                            "maserati",
                            "mazda",
                            "mercedes-benz",
                            "mini",
                            "mitsubishi",
                            "nissan",
                            "polestar",
                            "porsche",
                            "ram",
                            "rivian",
                            "rolls-royce",
                            "subaru",
                            "tesla",
                            "toyota",
                            "volkswagen",
                            "volvo"
                        ],
                        "type": "string",
                        "description": "Filter by car make. Leave empty for all makes.",
                        "default": ""
                    },
                    "model": {
                        "title": "Car Model",
                        "type": "string",
                        "description": "Filter by model (e.g. camry, civic, f-150). Requires make to be set."
                    },
                    "condition": {
                        "title": "Condition",
                        "enum": [
                            "all",
                            "used",
                            "new",
                            "certified"
                        ],
                        "type": "string",
                        "description": "Filter by vehicle condition.",
                        "default": "all"
                    },
                    "zipCode": {
                        "title": "ZIP Code",
                        "type": "string",
                        "description": "ZIP code for search center. Defaults to 80202 (Denver, CO).",
                        "default": "80202"
                    },
                    "distance": {
                        "title": "Search Distance",
                        "enum": [
                            "25",
                            "50",
                            "75",
                            "100",
                            "200",
                            "500",
                            "nationwide"
                        ],
                        "type": "string",
                        "description": "Search radius from ZIP code.",
                        "default": "nationwide"
                    },
                    "minPrice": {
                        "title": "Minimum Price",
                        "type": "integer",
                        "description": "Minimum listing price in USD."
                    },
                    "maxPrice": {
                        "title": "Maximum Price",
                        "type": "integer",
                        "description": "Maximum listing price in USD."
                    },
                    "minYear": {
                        "title": "Minimum Year",
                        "minimum": 1990,
                        "maximum": 2027,
                        "type": "integer",
                        "description": "Minimum model year (e.g. 2018)."
                    },
                    "maxYear": {
                        "title": "Maximum Year",
                        "minimum": 1990,
                        "maximum": 2027,
                        "type": "integer",
                        "description": "Maximum model year (e.g. 2025)."
                    },
                    "maxMileage": {
                        "title": "Maximum Mileage",
                        "type": "integer",
                        "description": "Maximum mileage in miles."
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum number of listings to scrape. KBB returns ~23 per page.",
                        "default": 200
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings for requests. KBB may work without proxies.",
                        "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
                                    }
                                }
                            },
                            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
