# Kelley Blue Book Vehicle Listing Scraper (`muhammadafzal/kelley-blue-book-scraper`) Actor

Extract public Kelley Blue Book vehicle listings with prices, mileage, seller details, badges, images, and source URLs for automotive research, inventory analysis, and AI-agent workflows.

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

## Pricing

from $3.00 / 1,000 vehicle listing 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

## Kelley Blue Book Scraper

Extract public vehicle listings from Kelley Blue Book cars-for-sale pages into an Apify dataset for automotive research, inventory analysis, and AI-agent workflows.

### Use it

Pass a public KBB search URL, for example:

```json
{
  "startUrls": [{ "url": "https://www.kbb.com/cars-for-sale/used" }],
  "maxItems": 25,
  "maxPages": 2
}
```

The actor collects one record per unique listing detail URL. Fields include the displayed title, year, make, model, trim, advertised price, mileage, price badge, seller text, distance, badges, image URL, source page, and normalized card text.

### Pricing

| Event | Price |
| --- | ---: |
| Actor start | $0.00005 per Apify start event (minimum one; memory-based synthetic event) |
| Vehicle listing extracted | $0.003 per unique listing |

With the Actor's 1 GB default, a run capped at 25 listings has a maximum event charge of $0.07505, excluding Apify platform usage. The run status and `SUMMARY` record report the charged listing-event count and estimated event total.

### Proxy configuration

The deployed actor uses encrypted runtime environment variables for the authorized DataImpulse proxy: `DATAIMPULSE_PROXY_USERNAME`, `DATAIMPULSE_PROXY_PASSWORD`, `DATAIMPULSE_PROXY_HOST`, and `DATAIMPULSE_PROXY_PORT`. Credentials are not part of the input schema or source code. KBB uses Akamai bot protection that blocks datacenter IPs, so a residential proxy is required for reliable extraction; the actor automatically retries on a fresh residential IP when it detects an access-denied challenge. If no DataImpulse credentials are configured, the actor falls back to its configured US Apify proxy, which may be blocked and will report the failure honestly instead of returning empty results.

### Scope and limitations

This actor reads publicly accessible KBB cars-for-sale pages. It does not provide KBB valuation data, dealer APIs, VIN-history reports, authenticated information, or a way to bypass access controls. KBB can change its page markup, so selectors are intentionally backed by detail-link discovery and visible-text parsing; review warnings and the `SUMMARY` record when a run returns no listings.

Start with a small `maxItems` value. Results reflect advertised listing data at collection time and should be refreshed before making purchasing decisions.

### Local development

```bash
npm install
npm run build
npm start
```

# Actor input Schema

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

Public Kelley Blue Book cars-for-sale or vehicle-search URLs. Example: https://www.kbb.com/cars-for-sale/used

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

Maximum unique vehicle listings to save across all pages.

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

Maximum number of paginated KBB result pages to visit for each starting URL.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.kbb.com/cars-for-sale/used"
    }
  ],
  "maxItems": 25,
  "maxPages": 2
}
```

# Actor output Schema

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

Normalized listing records in the default dataset.

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

Pages visited, cards seen, records saved, and warnings.

# 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/kelley-blue-book-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/kelley-blue-book-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/kelley-blue-book-scraper --silent --output-dataset

```

## MCP server setup

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