# Autotrader Scraper (`datascrapers/autotrader-scraper`) Actor

Autotrader.com vehicle listing dataset from search URLs or filters, including prices, mileage, dealer information, and vehicle specifications.

- **URL**: https://apify.com/datascrapers/autotrader-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 car listings

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

**Autotrader Scraper** creates a structured dataset of vehicle listings collected from [Autotrader.com](https://www.autotrader.com), the US automotive marketplace. Each dataset item represents one vehicle listing and can include identifiers, price and KBB values, mileage, specifications, colors, body style, listing type, dealer location, and listing URLs. Query the source with an Autotrader search URL and/or individual filters such as ZIP, make, model, price, year, and mileage. 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 | autotrader.com (US automotive marketplace) |
| Record unit | One vehicle listing |
| Input methods | Autotrader search URL (`searchUrl`) and/or filter fields (`zip`, make, model, price, year, and others) |
| Main identifiers | `listingId`, `vin` |
| Delivery | Apify Dataset and API |
| Export formats | JSON, CSV, Excel, XML, HTML (Apify dataset exports) |
| Update model | Fresh records per Actor run |
| Pricing | Actor start $0.00005 per run; Car Listing $0.001 per record ($1 per 1,000) |

### Coverage and available records

The Actor collects vehicle listings from public Autotrader.com search results. You can start from a copied search URL, from individual filter fields, or from both.

- **Search URL**: Pass an Autotrader search URL in `searchUrl`. Query parameters are merged with the individual filter fields; when both set the same parameter, the individual field wins.
- **Filter fields**: Set `zip` (required unless `searchUrl` already contains a zip), optional `city` / `state` / `dmaCode` overrides, radius, and the make, model, price, year, mileage, listing-type, and seller filters in the input reference.
- **Listing category**: `allListingType` accepts `all-cars`.
- **Result cap**: `maxItems` limits how many listings are written (`0` means unlimited for that run). Autotrader returns at most about 330 listings per search query, regardless of the source result count. Use narrower filters or multiple runs for larger coverage.

Known exclusions: login-only Autotrader content; historical snapshots; paging past the ~330-listing source cap.

### Data dictionary

Field names below match dataset record JSON properties exactly. Values that Autotrader does not publish for a listing are omitted or returned as null rather than fabricated. `listingId` or `vin` is the recommended deduplication key.

| Field | Type | Nullable | Description | Example |
|---|---|---:|---|---|
| `listingId` | number | No | Autotrader listing identifier; recommended deduplication key | `782603846` |
| `vin` | string | Yes | Vehicle identification number; alternate deduplication key | `5N1AZ2MG7JN124151` |
| `year` | number | Yes | Model year | `2018` |
| `title` | string | Yes | Listing title | `Used 2018 Nissan Murano Platinum` |
| `make` | string | Yes | Manufacturer name | `Nissan` |
| `makeCode` | string | Yes | Autotrader make code | `NISSAN` |
| `model` | string | Yes | Model name | `Murano` |
| `modelCode` | string | Yes | Autotrader model code | `MURANO` |
| `trim` | string | Yes | Trim level | `Platinum` |
| `price` | number | Yes | Display price in USD | `18875` |
| `kbbFppAmount` | number | Yes | Kelley Blue Book Fair Purchase Price | `19470.0` |
| `kbbFppLowAmount` | number | Yes | KBB Fair Purchase Price low | `18570.0` |
| `kbbFppHighAmount` | number | Yes | KBB Fair Purchase Price high | `20420.0` |
| `dealIndicator` | string | Yes | Deal rating as published (for example `Great`) | `Great` |
| `mileage` | string | Yes | Odometer reading as published | `69,189` |
| `engine` | string | Yes | Engine description | `6-Cylinder` |
| `transmission` | string | Yes | Transmission description | `Automatic` |
| `driveType` | string | Yes | Drivetrain | `FWD` |
| `fuelType` | string | Yes | Fuel type | `Gasoline` |
| `exteriorColor` | string | Yes | Exterior color | `Pearl White` |
| `interiorColor` | string | Yes | Interior color | `Cashmere` |
| `bodyStyle` | string | Yes | Body style | `Sport Utility` |
| `doors` | string | Yes | Door count as published | `4` |
| `imageUrl` | string | Yes | Primary listing image URL | `https://images.autotrader.com/hn/c/a3478bdf2fe841eab855da99f06dd241.jpg` |
| `url` | string | No | Autotrader listing URL | `https://www.autotrader.com/cars-for-sale/vehicle/782603846` |
| `listingType` | string | Yes | Listing type (for example `USED`) | `USED` |
| `dealerName` | string | Yes | Selling dealer or owner name | `McLarty Nissan of North Little Rock` |
| `dealerCity` | string | Yes | Dealer city when published | — |
| `dealerState` | string | Yes | Dealer state when published | — |
| `distance` | number | Yes | Distance from the search ZIP, in miles | `6.65` |

### Example dataset record

Representative record from a public Autotrader search near ZIP `72076`:

```json
{
  "listingId": 782603846,
  "vin": "5N1AZ2MG7JN124151",
  "year": 2018,
  "title": "Used 2018 Nissan Murano Platinum",
  "make": "Nissan",
  "makeCode": "NISSAN",
  "model": "Murano",
  "modelCode": "MURANO",
  "trim": "Platinum",
  "price": 18875,
  "kbbFppAmount": 19470.0,
  "kbbFppLowAmount": 18570.0,
  "kbbFppHighAmount": 20420.0,
  "dealIndicator": "Great",
  "mileage": "69,189",
  "engine": "6-Cylinder",
  "transmission": "Automatic",
  "driveType": "FWD",
  "fuelType": "Gasoline",
  "exteriorColor": "Pearl White",
  "interiorColor": "Cashmere",
  "bodyStyle": "Sport Utility",
  "doors": "4",
  "dealerName": "McLarty Nissan of North Little Rock",
  "distance": 6.65,
  "listingType": "USED",
  "imageUrl": "https://images.autotrader.com/hn/c/a3478bdf2fe841eab855da99f06dd241.jpg",
  "url": "https://www.autotrader.com/cars-for-sale/vehicle/782603846"
}
```

The record above was produced with this class of input:

```json
{
  "zip": "72076",
  "searchRadius": 50,
  "makeCodes": ["NISSAN"],
  "modelCodes": ["MURANO"],
  "listingTypes": ["USED"],
  "maxItems": 50,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

### Query and input reference

`searchUrl` is optional. When both a URL and individual fields are set, the URL query is merged with the fields and the individual fields win. `zip` is required unless `searchUrl` already includes a zip.

#### Search entry and location

| Input | Type | Required | Default | Accepted values | Description |
|---|---|---|---|---|---|
| `searchUrl` | string | No | — | Autotrader search URL | Search URL from the browser; query params are merged with the fields below |
| `allListingType` | string | No | `all-cars` | `all-cars` | Listing category path segment |
| `zip` | string | No\* | — | US ZIP code | Location for the search; required unless `searchUrl` includes a zip |
| `city` | string | No | — | Free text | Optional city override; normally resolved from ZIP |
| `state` | string | No | — | Free text (for example `AR`) | Optional state override; normally resolved from ZIP |
| `dmaCode` | string | No | — | Free text | Optional designated market area code; normally resolved from ZIP |
| `searchRadius` | integer | No | `50` | `0`–`500` | Search radius in miles from the ZIP |

\* Provide `zip`, or a `searchUrl` that already contains a zip.

#### Vehicle and listing filters

| Input | Type | Required | Default | Accepted values | Description |
|---|---|---|---|---|---|
| `makeCodes` | string\[] | No | — | Autotrader make codes (for example `BMW`, `TOYOTA`, `FORD`) | Makes to include; empty means all makes |
| `modelCodes` | string\[] | No | — | Autotrader model codes (for example `3-Series`, `Camry`) | Models to include; empty means all models |
| `minPrice` | integer | No | — | `0` or greater | Minimum price in USD |
| `maxPrice` | integer | No | — | `0` or greater | Maximum price in USD |
| `maxMileage` | integer | No | — | `0` or greater | Maximum mileage |
| `startYear` | integer | No | — | `1980`–`2030` | Earliest model year |
| `endYear` | integer | No | — | `1980`–`2030` | Latest model year |
| `listingTypes` | string\[] | No | — | `NEW`, `USED`, `CERTIFIED`, `3P_CERT` | Listing types to include |
| `sellerTypes` | string\[] | No | — | `d`, `p` | Seller types: `d` (dealer), `p` (private) |
| `transmissionCodes` | string\[] | No | — | `AUT`, `MAN` | Transmission: `AUT` (automatic), `MAN` (manual) |
| `driveGroups` | string\[] | No | — | `AWD4WD`, `FWD`, `RWD` | Drivetrain group |
| `vehicleStyleCodes` | string\[] | No | — | `CONVERT`, `COUPE`, `HATCH`, `SEDAN`, `SUVCROSS`, `TRUCKS`, `VANMV`, `WAGON` | Body style |
| `engineCodes` | string\[] | No | — | Autotrader engine codes (for example `3CLDR`, `4CLDR`, `6CLDR`, `8CLDR`) | Engine cylinder codes |
| `fuelTypeGroups` | string\[] | No | — | `DSL`, `ELE`, `GSL`, `HYB`, `PIH` | Fuel type group |
| `doorCodes` | string\[] | No | — | `2`, `3`, `4`, `5` | Door count |
| `exteriorColors` | string\[] | No | — | Autotrader exterior color codes (for example `BLACK`, `WHITE`, `BLUE`, `RED`, `SILVER`) | Exterior color filter |
| `interiorColors` | string\[] | No | — | Autotrader interior color codes (for example `BLACK`, `BEIGE`, `GRAY`) | Interior color filter |
| `mpgRanges` | string\[] | No | — | `0`, `10-MPG`, `20-MPG`, `30-MPG`, `40-MPG` | Fuel-economy range |
| `featureCodes` | string\[] | No | — | Codes copied from a filtered Autotrader search URL (for example `1013`, `1033`, `AT0001`) | Feature and option codes |
| `dealType` | string | No | — | Value copied from an Autotrader search URL (for example `greatprice`) | Deal-indicator filter |
| `dateRange` | string | No | — | Value copied from an Autotrader search URL (for example `last-7-days`) | Listing-age filter |
| `vin` | string | No | — | VIN | Restrict the search to one vehicle identification number |
| `listingId` | string | No | — | Autotrader listing ID | Restrict the search to one listing |

#### Run controls

| Input | Type | Required | Default | Accepted values | Description |
|---|---|---|---|---|---|
| `newSearch` | boolean | No | `true` | `true` / `false` | Send a new-search session signal on the first request |
| `sortBy` | string | No | `relevance` | `relevance`, `price_desc`, `price_asc`, `newest`, `mileage_asc`, `year_desc`, `year_asc` | Result sort order |
| `maxItems` | integer | No | `0` | `0` or any positive integer | Maximum listings to collect; `0` = unlimited for the run, still subject to the ~330-per-search cap |
| `proxyConfiguration` | object | No | Apify proxy, `RESIDENTIAL` group | Apify proxy groups or custom proxies | Residential proxies are recommended |

Minimal request:

```json
{ "zip": "72076", "maxItems": 50 }
```

Advanced request (URL merged with overrides):

```json
{
  "searchUrl": "https://www.autotrader.com/cars-for-sale/all-cars?zip=72076&searchRadius=50",
  "makeCodes": ["NISSAN"],
  "modelCodes": ["MURANO"],
  "listingTypes": ["USED"],
  "minPrice": 10000,
  "maxPrice": 25000,
  "maxMileage": 80000,
  "startYear": 2016,
  "endYear": 2020,
  "sortBy": "price_asc",
  "maxItems": 100,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  }
}
```

### Retrieve the data through the API

The Actor is published at <https://apify.com/datascrapers/autotrader-scraper>.

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 = {
    "zip": "72076",
    "makeCodes": ["NISSAN"],
    "maxItems": 50,
}

run = client.actor("datascrapers/autotrader-scraper").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["listingId"], item["title"], item["price"], item["mileage"])
```

Apify generates ready-to-run Python, JavaScript, and cURL examples on the Actor's API tab. Do not put a real API token in shared code or URLs.

### Data quality and record handling

- **Conditional fields**: KBB amounts, deal indicator, colors, dealer fields, and several spec fields appear only when Autotrader publishes them.
- **Source changes**: unreadable fields are returned as null or omitted rather than fabricated.
- **Deduplication**: each run appends fresh records. Use `listingId` or `vin` and filter repeated runs against stored identifiers.
- **Normalization**: `price` and KBB amounts are numeric USD values; `mileage` and `doors` are published strings; `distance` is miles from the search ZIP.
- **Result cap**: one search query yields at most about 330 listings. Narrow filters or run additional queries for more records.

### Export and pipeline examples

| Destination | Recommended method | Typical use |
|---|---|---|
| PostgreSQL / Supabase | Dataset API poll or webhook consumer | Store inventory alongside pricing and VIN tables |
| Google Sheets | Apify Google Sheets integration | Share vehicle shortlists with buyers or analysts |
| CRM / lead pipeline | Webhook on run completion | Push new dealer listings into outreach workflows |
| S3 / cloud storage | Scheduled export via Apify scheduler + integration | Archival of inventory snapshots |

### Pricing and cost examples

The Actor uses pay-per-event pricing. A one-time Actor start charge applies to each run. Each vehicle record written to the default dataset is billed as a Car Listing (`apify-default-dataset-item`).

| Event | Trigger | Rate |
|---|---|---|
| Actor start | Once per run | $0.00005 |
| Car Listing (`apify-default-dataset-item`) | Every vehicle record pushed to the dataset | $0.001 ($1 per 1,000) |

Example costs (Actor start is $0.00005 per run):

| Records | Estimated base cost |
|---:|---:|
| 330 | $0.33 |
| 1,000 | $1.00 |
| 10,000 | $10.00 |

A 10,000-record target requires multiple narrower searches because one query returns at most about 330 listings. Compute units and proxy usage are billed by your Apify plan. Estimates depend on the verified pricing model and the options selected for the run.

### Limitations and responsible data use

- The Actor collects publicly accessible listing data from Autotrader.com only.
- Autotrader returns at most about 330 listings per search query. Use narrower filters or multiple runs for larger datasets.
- Some fields can be null or missing; site changes can alter available fields.
- The Actor does not provide historical snapshots unless you store them yourself.
- Residential proxies are recommended; without them, coverage may degrade.
- You are responsible for compliance with Autotrader's terms, applicable privacy law, and any contractual obligations before using the data.

### Dataset questions

#### What does one dataset item represent?

One vehicle listing from Autotrader.com. Pricing, specifications, dealer location, and media fields belong to that single listing.

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

`listingId` is the Autotrader listing identifier and the recommended deduplication key. `vin` is the recommended alternate key when you need a vehicle-level identifier across listings.

#### Why does a search return at most about 330 listings?

Autotrader returns at most about 330 listings per search query, even when `maxItems` is `0` and the source result count is higher. Narrow make, model, ZIP, price, year, or other filters, or run multiple queries, to collect more records.

#### Are fields nullable or conditional?

Yes. KBB amounts, deal indicator, colors, dealer city and state, and several spec fields appear only when Autotrader publishes them. Fields the listing does not render are returned as null or omitted.

#### 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 the state of the listings at run time. To track price or inventory changes, schedule repeated runs and store the outputs yourself.

#### What counts as a billable result?

A one-time Actor start charge of $0.00005 applies per run. Each vehicle record pushed to the dataset is one Car Listing event at $0.001 ($1 per 1,000 records).

### Related datasets from Data Scrapers

- **[Cars.com Scraper](https://apify.com/datascrapers/cars-scraper)** — US vehicle listings that can be compared with Autotrader records by VIN, make, model, or ZIP.
- **[AutoScout24 Scraper](https://apify.com/datascrapers/autoscout24-scraper)** — European vehicle listings for cross-market automotive research.
- **[Gumtree Scraper](https://apify.com/datascrapers/gumtree-scraper)** — UK classified listings, including cars-and-vehicles, for adjacent marketplace inventory.
- **[Realtor.com Scraper](https://apify.com/datascrapers/realtor-scraper)** — US property listings that can be joined with vehicle data by city or ZIP for local-market analysis.

### 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`):

Optional Autotrader search URL from your browser. Query params from this URL are merged with the individual filter fields below — individual fields override matching URL params when both are provided.

## `allListingType` (type: `string`):

Autotrader listing category path segment (usually all-cars)

## `zip` (type: `string`):

ZIP code for location-based search. Required unless searchUrl includes a zip.

## `city` (type: `string`):

Optional city override. Normally resolved automatically from ZIP via Autotrader markets API.

## `state` (type: `string`):

Optional state override (e.g., AR). Normally resolved automatically from ZIP.

## `dmaCode` (type: `string`):

Optional designated market area code. Normally resolved automatically from ZIP.

## `searchRadius` (type: `integer`):

Search radius in miles from the ZIP code

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

Car makes to include (e.g., BMW, TOYOTA, FORD). Leave empty for all makes.

## `modelCodes` (type: `array`):

Car models to include (e.g., 3-Series, Camry). Leave empty for all models.

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

Minimum price in USD

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

Maximum price in USD

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

Maximum mileage (e.g., 50000 for 50k miles)

## `startYear` (type: `integer`):

Earliest model year (e.g., 2020)

## `endYear` (type: `integer`):

Latest model year (e.g., 2025)

## `listingTypes` (type: `array`):

Types of listings: NEW, USED, CERTIFIED, 3P\_CERT

## `sellerTypes` (type: `array`):

Seller types: d (dealer), p (private)

## `transmissionCodes` (type: `array`):

Transmission types: AUT (Automatic), MAN (Manual)

## `driveGroups` (type: `array`):

Drivetrain: AWD4WD, FWD, RWD

## `vehicleStyleCodes` (type: `array`):

Body styles: CONVERT, COUPE, HATCH, SEDAN, SUVCROSS, TRUCKS, VANMV, WAGON

## `engineCodes` (type: `array`):

Engine codes: 3CLDR, 4CLDR, 6CLDR, 8CLDR, etc.

## `fuelTypeGroups` (type: `array`):

Fuel types: DSL, ELE, GSL, HYB, PIH

## `doorCodes` (type: `array`):

Number of doors: 2, 3, 4, 5

## `exteriorColors` (type: `array`):

Exterior colors: BLACK, WHITE, BLUE, RED, SILVER, etc.

## `interiorColors` (type: `array`):

Interior colors: BLACK, BEIGE, GRAY, etc.

## `mpgRanges` (type: `array`):

Fuel economy: 0, 10-MPG, 20-MPG, 30-MPG, 40-MPG

## `featureCodes` (type: `array`):

Feature/option codes from Autotrader (e.g., 1013, 1033, AT0001). Copy from a filtered search URL on autotrader.com.

## `dealType` (type: `string`):

Deal indicator filter such as greatprice

## `dateRange` (type: `string`):

Listing age filter from Autotrader (copy from a filtered search URL, e.g. last-7-days)

## `vin` (type: `string`):

Optional filter for a specific vehicle VIN

## `listingId` (type: `string`):

Optional filter for a specific Autotrader listing ID

## `newSearch` (type: `boolean`):

Send newSearch=true on the first listing API request (Autotrader default behavior)

## `sortBy` (type: `string`):

Sort order for results

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

Maximum number of listings to scrape (0 = all available from this search). Autotrader's API returns at most ~330 listings per search query regardless of totalResultCount — use narrower filters or multiple runs for more data.

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

Proxy settings for anti-bot protection. Use Apify Residential proxies for best results.

## Actor input object example

```json
{
  "searchUrl": "https://www.autotrader.com/cars-for-sale/all-cars?zip=72076&searchRadius=50",
  "allListingType": "all-cars",
  "zip": "72076",
  "searchRadius": 50,
  "makeCodes": [
    "BMW",
    "TOYOTA"
  ],
  "listingTypes": [
    "USED",
    "NEW",
    "CERTIFIED",
    "3P_CERT"
  ],
  "sellerTypes": [
    "d",
    "p"
  ],
  "newSearch": true,
  "sortBy": "relevance",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

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

Dataset containing scraped vehicle listings with full details

# 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.autotrader.com/cars-for-sale/all-cars?zip=72076&searchRadius=50",
    "allListingType": "all-cars",
    "zip": "72076",
    "searchRadius": 50,
    "makeCodes": [
        "BMW",
        "TOYOTA"
    ],
    "listingTypes": [
        "USED",
        "NEW",
        "CERTIFIED",
        "3P_CERT"
    ],
    "sellerTypes": [
        "d",
        "p"
    ],
    "newSearch": true,
    "sortBy": "relevance",
    "maxItems": 0,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("datascrapers/autotrader-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.autotrader.com/cars-for-sale/all-cars?zip=72076&searchRadius=50",
    "allListingType": "all-cars",
    "zip": "72076",
    "searchRadius": 50,
    "makeCodes": [
        "BMW",
        "TOYOTA",
    ],
    "listingTypes": [
        "USED",
        "NEW",
        "CERTIFIED",
        "3P_CERT",
    ],
    "sellerTypes": [
        "d",
        "p",
    ],
    "newSearch": True,
    "sortBy": "relevance",
    "maxItems": 0,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("datascrapers/autotrader-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.autotrader.com/cars-for-sale/all-cars?zip=72076&searchRadius=50",
  "allListingType": "all-cars",
  "zip": "72076",
  "searchRadius": 50,
  "makeCodes": [
    "BMW",
    "TOYOTA"
  ],
  "listingTypes": [
    "USED",
    "NEW",
    "CERTIFIED",
    "3P_CERT"
  ],
  "sellerTypes": [
    "d",
    "p"
  ],
  "newSearch": true,
  "sortBy": "relevance",
  "maxItems": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call datascrapers/autotrader-scraper --silent --output-dataset

```

## MCP server setup

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