# Autotrader Zipcode Scraper (`e-commerce/autotrader-zipcode-scraper`) Actor

Scrape used and new car listings from AutoTrader.com by ZIP code, radius, make, and condition - VIN, price, mileage, specs, dealer, and history flags as structured data

- **URL**: https://apify.com/e-commerce/autotrader-zipcode-scraper.md
- **Developed by:** [E Commerce](https://apify.com/e-commerce) (Apify)
- **Categories:** E-commerce
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.10 / 1,000 car details

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## AutoTrader Zipcode Search Scraper

Scrape used and new car listings from AutoTrader.com by US ZIP code, search radius, make, and condition. Each listing returns clean, structured data: VIN, make, model, year, trim, price, mileage, transmission, engine, drivetrain, fuel type, exterior and interior color, dealer name, accident and one-owner flags, photos, and a link back to the listing. Part of the automotive portfolio alongside the CarGurus, Cars.com, and CarMax scrapers.

### Features

- Search any US market by ZIP code and radius, filtered by make and condition (used, new, or certified).
- Full listing detail straight from the search results - no per-vehicle page fetch needed.
- Dealer name plus accident, one-owner, and clean-title signals on every listing.
- Returns the full result set across pages, not just the first page.

### Input

| Field | Type | Required | Default | Notes |
|-------|------|----------|---------|-------|
| `zips` | array of strings | yes | - | US ZIP codes to search from. |
| `makeCodes` | array of strings | no | all makes | AutoTrader make codes to filter by (e.g. TOYOTA, FORD, HONDA, BMW). Omit for all makes. |
| `radius` | integer | no | `50` | Search radius in miles around each ZIP. |
| `listingType` | array of strings | no | all | Filter by condition: `USED`, `NEW`, or `CERTIFIED`. |
| `maxRequestsPerCrawl` | integer | no | unlimited | Optional cap on total search pages. Useful for quick test runs. |

#### Example input

```json
{
  "zips": ["90210"],
  "makeCodes": ["TOYOTA"],
  "radius": 50,
  "listingType": ["USED"]
}
````

### Output

Each listing is one dataset record. The Overview view shows VIN, make, model, year, price, mileage, and dealer; export the full dataset for every field.

- Vehicle: `vin`, `makeName`, `modelName`, `year`, `trimName`, `listingType`, `bodyType`, `mileage`, `transmission`, `engine`, `driveType`, `fuelType`, `doors`, `exteriorColor`, `interiorColor`
- Price: `price`, `priceLabel`, `dealRating`
- History: `accidentsReported`, `oneOwner`, `cleanTitle`
- Dealer: `dealerName`, `ownerId`, `daysOnSite`
- Media and links: `mainPictureUrl`, `pictureCount`, `pictures`, `detailUrl`
- Provenance: `searchZip`, `dateOfScrape`

See `.actor/output_schema.json` for the complete field list and types.

### Standby HTTP endpoint

This Actor also runs in [Standby mode](https://docs.apify.com/platform/actors/development/programming-interface/standby) as a live HTTP endpoint for the automotive multi-site orchestrator. When the platform starts the Actor in Standby mode it serves one search page per HTTP request instead of running the batch crawl. The normal Input-form batch run is unaffected.

#### Request

`GET /` with these query parameters:

| Param | Required | Default | Notes |
|-------|----------|---------|-------|
| `zip` | yes | - | US ZIP code to search from. Missing ZIP returns `400`. |
| `radius` | no | `50` | Search radius in miles. |
| `make` | no | all makes | Generic make name, e.g. `Toyota`. Mapped to an AutoTrader make code (uppercased, spaces stripped). Unknown makes are passed through uppercased. |
| `condition` | no | all | `USED`, `NEW`, or `CERTIFIED`. Anything else is ignored. |
| `page` | no | `1` | 1-based page number. Each page is up to 100 listings. AutoTrader caps deep pagination at ~1,000 records. |

A bare `GET /` with no query parameters returns a `200` health-check body.

#### Response

`200` JSON envelope:

```json
{
  "site": "autotrader",
  "page": 1,
  "pageSize": 100,
  "total": 5450,
  "hasMore": true,
  "results": [ { "sourceSite": "autotrader", "vin": "...", "makeName": "Toyota", "...": "..." } ]
}
```

- `total` is the full result count for the search (`null` if AutoTrader does not report it).
- `hasMore` is `true` when more pages are available within AutoTrader's ~1,000-record pagination cap.
- Each `results` entry is a `UnifiedListing`: `sourceSite`, `listingId`, `vin`, `makeName`, `modelName`, `year`, `trim`, `bodyType`, `condition`, `price`, `priceLabel`, `mileage`, `exteriorColor`, `interiorColor`, `transmission`, `engine`, `driveType`, `fuelType`, `dealerName`, `dealerCity`, `dealerRegion`, `dealerZip`, `dealerPhone`, `accidentsReported`, `oneOwner`, `photos`, `mainPhotoUrl`, `detailUrl`, `searchZip`, `scrapedAt`. Fields AutoTrader does not expose on the search results page (dealer city/region/zip) are `null`.

Errors return `{ "error": "...", "site": "autotrader" }` with a `4xx`/`5xx` status.

#### Example

```
GET /?zip=90210&make=Toyota&radius=50&condition=USED&page=1
```

### How it works

AutoTrader serves its listing data in the page's embedded JSON, so the Actor fetches the search results over Apify Proxy and parses them directly - no browser needed, which keeps it fast and cheap. Provide ZIP codes and run it.

### Local development

```bash
npm install
npm run build
npm run start:dev
```

# Actor input Schema

## `zips` (type: `array`):

US ZIP codes to search from.

## `makeCodes` (type: `array`):

Optional AutoTrader make codes to filter by (e.g. TOYOTA, FORD, HONDA, BMW). Leave empty for all makes.

## `radius` (type: `integer`):

Search radius in miles around each ZIP.

## `listingType` (type: `array`):

Filter by listing condition. Leave empty for all.

## `maxRequestsPerCrawl` (type: `integer`):

Optional cap on total requests (search pages). Leave empty to scrape every page. Useful for test runs.

## Actor input object example

```json
{
  "zips": [
    "90210",
    "10001"
  ],
  "radius": 50
}
```

# 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 = {
    "zips": [
        "90210",
        "10001"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("e-commerce/autotrader-zipcode-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 = { "zips": [
        "90210",
        "10001",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("e-commerce/autotrader-zipcode-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 '{
  "zips": [
    "90210",
    "10001"
  ]
}' |
apify call e-commerce/autotrader-zipcode-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Autotrader Zipcode Scraper",
        "description": "Scrape used and new car listings from AutoTrader.com by ZIP code, radius, make, and condition - VIN, price, mileage, specs, dealer, and history flags as structured data",
        "version": "0.0",
        "x-build-id": "X1S5sw1k8Ocfi0FnP"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/e-commerce~autotrader-zipcode-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-e-commerce-autotrader-zipcode-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/e-commerce~autotrader-zipcode-scraper/runs": {
            "post": {
                "operationId": "runs-sync-e-commerce-autotrader-zipcode-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/e-commerce~autotrader-zipcode-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-e-commerce-autotrader-zipcode-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",
                "required": [
                    "zips"
                ],
                "properties": {
                    "zips": {
                        "title": "Zip codes",
                        "type": "array",
                        "description": "US ZIP codes to search from.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "makeCodes": {
                        "title": "Make codes",
                        "type": "array",
                        "description": "Optional AutoTrader make codes to filter by (e.g. TOYOTA, FORD, HONDA, BMW). Leave empty for all makes.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "radius": {
                        "title": "Search radius (miles)",
                        "minimum": 10,
                        "maximum": 500,
                        "type": "integer",
                        "description": "Search radius in miles around each ZIP.",
                        "default": 50
                    },
                    "listingType": {
                        "title": "Condition",
                        "type": "array",
                        "description": "Filter by listing condition. Leave empty for all.",
                        "items": {
                            "type": "string",
                            "enum": [
                                "USED",
                                "NEW",
                                "CERTIFIED"
                            ],
                            "enumTitles": [
                                "Used",
                                "New",
                                "Certified pre-owned"
                            ]
                        }
                    },
                    "maxRequestsPerCrawl": {
                        "title": "Max requests per crawl",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Optional cap on total requests (search pages). Leave empty to scrape every page. Useful for test runs."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
