# CarGurus Scraper - New US Car Listings by Make & ZIP (`sian.agency/cargurus-car-listings-scraper`) Actor

Scrape the newest CarGurus listings by make, model and ZIP. VIN, price, deal rating, market value, mileage, days on market and dealer phone, newest first.

- **URL**: https://apify.com/sian.agency/cargurus-car-listings-scraper.md
- **Developed by:** [SIÁN OÜ](https://apify.com/sian.agency) (community)
- **Categories:** E-commerce, Lead generation, Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.32 / 1,000 car listings

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## CarGurus Scraper - New US Car Listings by Make & ZIP 🚗

[![SIÁN Agency Store](https://img.shields.io/badge/Store-SI%C3%81N%20Agency-1AE392)](https://apify.com/sian.agency?fpr=sian) [![Craigslist Listings Scraper](https://img.shields.io/badge/Store-Craigslist%20Listings%20Scraper-613399)](https://apify.com/sian.agency/craigslist-scraper?fpr=sian) [![AutoZone Product Scraper](https://img.shields.io/badge/Store-AutoZone%20Product%20Scraper-D52B1E)](https://apify.com/sian.agency/autozone-product-scraper?fpr=sian) [![RockAuto Product Scraper](https://img.shields.io/badge/Store-RockAuto%20Product%20Scraper-1AE392)](https://apify.com/sian.agency/rockauto-product-scraper?fpr=sian)

#### 🎉 The newest CarGurus listings, newest first, with VIN, deal rating and dealer phone on every row

##### For dealers, car buyers and sourcing teams who want to see a good car the hour it goes up

***

### 🔎 What is the CarGurus Scraper — and when should you use it?

The **CarGurus Scraper** turns the newest CarGurus car listings for the makes and models you pick, around a US ZIP code into clean, structured rows you can filter, export and feed straight into a spreadsheet, database or AI agent. No account, no portal API key, no browser automation to maintain.

**Use it when you need:** the newest US car listings as rows, newest first: VIN, asking price, CarGurus deal rating and market value, mileage, days on market, the dealer's name, phone and location, distance from your ZIP and the main photo. Year, price and mileage filters are applied by CarGurus before results come back, and a day window turns a scheduled run into a new-listing alert feed.

**Use something else when:** you want private-seller cars, or listings outside the United States. Use [Craigslist Listings Scraper](https://apify.com/sian.agency/craigslist-scraper?fpr=sian) for private-seller cars and trucks, city by city. This actor covers the US site, cargurus.com, only: dealer and private listings that its search returns for a make or model around a US ZIP code. It does not open each listing page, so vehicle history reports, full photo galleries and dealer reviews are not part of a row.

### 🤖 Use with AI agents

Already connected to the [Apify MCP server](https://mcp.apify.com)? Just ask for this Actor by name: sian.agency/cargurus-car-listings-scraper

**Agentic payments:** Availability of [x402](https://www.x402.org/) and [Skyfire](https://www.skyfire.xyz/) depends on this Actor's current Store eligibility. Check the published listing for supported payment methods. Billing is per car listing returned, never for a search that finds nothing or for errors.

Otherwise copy this prompt into Claude, ChatGPT, Cursor or any MCP-enabled assistant:

```text
I want the newest car listings on CarGurus for the makes or models I care about, near my ZIP code using the Apify Actor `sian.agency/cargurus-car-listings-scraper`.

Use it when I need: the newest US car listings as rows, newest first: VIN, asking price, CarGurus deal rating and market value, mileage, days on market, the dealer's name, phone and location, distance from your ZIP and the main photo. Year, price and mileage filters are applied by CarGurus before results come back, and a day window turns a scheduled run into a new-listing alert feed.

Don't use it when: you want private-seller cars, or listings outside the United States — use craigslist-scraper instead.

How to call it: pick `makes` from the dropdown keys (`porsche`, `lexus`, `toyota`) and/or name models in `models` with the make first ("Lexus LS", "Toyota Land Cruiser"). Set `zipCode` to a 5-digit US ZIP and `searchRadius` to 25, 50, 100, 200, 500 or nationwide. For an alert feed set `maxDaysOnMarket` to 1; narrow with `minYear`, `maxYear`, `minPrice`, `maxPrice` and `maxMileage`, where 0 means no limit. `maxResultsPerSearch` caps each make or model search.

Start with this input:
{
  "makes": [
    "porsche"
  ],
  "zipCode": "90210",
  "searchRadius": "500",
  "maxDaysOnMarket": 1
}

Ask me which makes or models to watch, the ZIP code and radius, and any year, price or mileage limits, then run the Actor and summarise the results as a table.
```

**Things you can ask your agent for:**

- *Find every Porsche listed today within 500 miles of 90210 and sort them by how far below market value they are priced.*
- *Pull nationwide Lexus LS listings from 2000 or older with under 100,000 miles, with the dealer phone for each.*
- *Give me this morning's new Toyota listings within 100 miles of 10001 under $25,000 as a table with VINs.*

Machine-readable API, MCP config and OpenAPI definition for this Actor are published at [apify.com/sian.agency/cargurus-car-listings-scraper.md](https://apify.com/sian.agency/cargurus-car-listings-scraper.md).

### 📋 Overview

**This CarGurus scraper returns the newest US car listings for the makes and models you pick**, around any US ZIP code, sorted newest first. It is built for independent dealers, buyers' agents and car hunters who need new-listing alerts rather than a one-off export.

**What you get:**

- ✅ **Up to 37 fields per listing**: VIN, asking price, CarGurus deal rating, market value, mileage, days on market, dealer name and phone, photo
- ⚡ **48 listings per page**: a whole page of the newest cars comes back in one request, so a scheduled check stays fast
- 🎯 **Filters applied by CarGurus itself**: year, price and mileage are filtered before results come back, so you only pay for cars that match
- 💰 **Pay per listing returned**: a search that finds nothing costs nothing, and the same listing is never charged twice in a run
- 💎 **Every US make**: 71 makes in a dropdown, from Toyota and Ford to Porsche, Ferrari and Datsun, plus any CarGurus model by name
- ✨ **NEW**: "Only listings newer than" stops each search at the first older car, so an alert run reads one page and finishes

***

### ✨ Features

- 🆕 **Newest first**: the same order as "Newest listings first" on CarGurus, with days on market on every row
- 🚗 **Makes and models**: pick makes from a dropdown, or name a model such as "Lexus LS" or "Toyota Land Cruiser"
- 📍 **ZIP and radius**: 25, 50, 100, 200 or 500 miles, or nationwide
- 🏷️ **Deal rating and market value**: CarGurus' own rating plus the dollar gap to its market estimate
- 📞 **Dealer contact**: dealer name, phone, city, state, ZIP and distance from your ZIP
- 🔢 **VIN on every row**: ready for history, title or recall checks
- 🚚 **How to buy**: tells pick-up-only cars apart from cars a dealer will transfer or ship to you
- 🖼️ **Photo per listing**: the main listing photo renders right in the dataset table
- 🛡️ **No wrong cars billed**: a listing of another make or model never reaches your dataset
- 📄 **Run report**: a summary page with every listing link, the deals found and what the run cost

***

### 🎬 Quick Start

Pick a make, enter your ZIP and run. The Actor searches CarGurus newest first and saves one row per listing. Schedule it to get a new-listing feed.

```bash
curl -X POST "https://api.apify.com/v2/acts/sian.agency~cargurus-car-listings-scraper/runs?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"makes": ["porsche"], "zipCode": "90210", "searchRadius": "500", "maxDaysOnMarket": 1}'
```

***

### 🚀 Getting Started (3 Simple Steps)

#### Step 1: Pick what to watch

Choose one or more makes from the dropdown, or add models like "Porsche 911" under Models.

#### Step 2: Set where and how new

Enter a 5-digit US ZIP code, a search radius and, for an alert feed, "Only listings newer than" = 1 day.

#### Step 3: Run or schedule

Press Start, or add a schedule every 15 minutes and connect the dataset to Slack, email or a Google Sheet.

**That's it! In under a minute, you'll have:**

- The newest listings for every make and model you picked
- VIN, price, deal rating and dealer phone on each one
- A run report with every listing link, ready to share

***

### 📥 Input Configuration

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| makes | array | No | Makes to search, picked from a dropdown of 71 US makes. Each make is its own newest-first search |
| models | array | No | Make and model together, one per line, for example "Lexus LS" |
| zipCode | string | No | 5-digit US ZIP code the radius is measured from (default 90210) |
| searchRadius | string | No | 25, 50, 100, 200, 500 or nationwide (default 500) |
| maxDaysOnMarket | integer | No | Only listings from the last N days; 0 means no limit |
| minYear / maxYear | integer | No | Model year range; 0 means no limit |
| minPrice / maxPrice | integer | No | Asking price range in US dollars; 0 means no limit |
| maxMileage | integer | No | Highest odometer reading in miles; 0 means no limit |
| maxResultsPerSearch | integer | No | Stop each make or model search after this many listings (default 48) |

**Example: new Porsche listings near Los Angeles, listed today or yesterday**

```json
{
  "makes": ["porsche"],
  "zipCode": "90210",
  "searchRadius": "500",
  "maxDaysOnMarket": 1
}
```

**Example: classic Lexus LS and Land Cruisers nationwide, 2000 or older**

```json
{
  "models": ["Lexus LS", "Toyota Land Cruiser"],
  "zipCode": "90210",
  "searchRadius": "nationwide",
  "maxYear": 2000
}
```

***

### 📤 Output

Results are saved to the Apify dataset with **up to 37 fields** per listing (a field the dealer left blank is left out of that row), including:

| Field | Type | Description |
|-------|------|-------------|
| imageUrl | string | Main listing photo |
| listingTitle | string | Year, make, model and trim as CarGurus shows it |
| price | number | Asking price in US dollars; empty when the dealer asks you to call |
| dealRating | string | CarGurus deal rating, for example GREAT_PRICE or FAIR_PRICE |
| expectedPrice | number | CarGurus' market value estimate for this car |
| priceDifferential | number | Dollars below (or above) that market value |
| daysOnMarket | number | Days since the car was listed; 0 means today |
| mileage | number | Odometer reading in miles |
| vin | string | Vehicle identification number |
| dealerName | string | Selling dealer |
| dealerPhone | string | Dealer phone number |
| sellerCity / sellerState / sellerZip | string | Where the car is |
| distanceMiles | number | Distance from your ZIP code |
| howToShop | string | PICK_UP_ONLY, STORE_TRANSFER or NATIONWIDE_SHIPPING |
| url | string | The listing page on CarGurus |

**Example (a real row):**

```json
{
  "listingId": 462800883,
  "url": "https://www.cargurus.com/details/462800883",
  "listingTitle": "2026 Porsche 911 GT3 Coupe RWD",
  "make": "Porsche",
  "model": "911",
  "year": 2026,
  "trim": "GT3 Coupe RWD",
  "vin": "WP0AC2A93TS289372",
  "price": 338888,
  "totalPrice": 339010,
  "expectedPrice": 382607,
  "priceDifferential": 43719,
  "dealRating": "GREAT_PRICE",
  "mileage": 3010,
  "daysOnMarket": 0,
  "imageUrl": "https://static.cargurus.com/images/forsale/2026/10/28/15/21/2026_porsche_911-pic-5714630163100425558-1024x768.jpeg",
  "dealerName": "BMW of Carlsbad",
  "dealerPhone": "(760) 840-5251",
  "sellerType": "DEALER",
  "sellerCity": "Carlsbad, CA",
  "sellerState": "CA",
  "sellerZip": "92008",
  "distanceMiles": 91.8,
  "isCertifiedPreOwned": false,
  "howToShop": "PICK_UP_ONLY",
  "bodyType": "Coupe",
  "exteriorColor": "Gray",
  "transmission": "7-Speed Automatic",
  "drivetrain": "Rear-Wheel Drive",
  "fuelType": "Gasoline",
  "engine": "502 hp 4L H6",
  "options": ["Leather Seats", "Navigation System"],
  "stockNumber": "TS289372",
  "searchQuery": "Porsche",
  "searchZip": "90210",
  "status": "success"
}
```

Export as JSON, CSV or Excel, or read the rows over the API. Each run also saves an HTML report to the key-value store.

***

### 💼 Use Cases & Examples

#### 1. New-listing alerts for car buyers

**A buyer hunting one model wants to hear about a new listing before anyone else calls the dealer.**

**Input:** One model, your ZIP, a 200-mile radius, "Only listings newer than" = 1
**Output:** Only the cars listed today or yesterday, newest first
**Use:** Schedule every 15 minutes and send new rows to Slack or email

#### 2. Sourcing for independent dealers

**A used-car dealer buys Porsche, Lexus and Toyota inside a 500-mile buying radius.**

**Input:** Three makes, your lot's ZIP, year, price and mileage limits
**Output:** VIN, dealer name and phone and distance on every row
**Use:** Make sourcing calls straight from a Google Sheet that refills itself

#### 3. Deal hunting by market value

**A flipper wants cars priced well below what they are worth.**

**Input:** A make, a radius, a max price
**Output:** Deal rating, market value and the dollar gap on every listing
**Use:** Sort by priceDifferential and call the biggest gaps first

#### 4. Classic and vintage car tracking

**A classic-car buyer watches 1990s Lexus LS sedans and older Land Cruisers nationwide.**

**Input:** Models plus a max year of 2000, nationwide
**Output:** Every matching listing in the US, with photos and mileage
**Use:** Spot clean, low-mileage examples the day they appear

#### 5. Price and inventory research

**An analyst tracks asking prices and days on market for a model across a region.**

**Input:** A model, a 100-mile radius, no day limit
**Output:** Asking price, mileage and days on market per listing
**Use:** Build a weekly price index or see how fast a model sells

#### 6. VIN lists for history checks

**A buyers' agent screens every new listing before recommending it.**

**Input:** A make or model and a day window
**Output:** A VIN per listing
**Use:** Run the VINs through your own history, title or recall check

***

### 🔗 Integration Examples

#### JavaScript/Node.js

```javascript
import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: 'YOUR_TOKEN' });

const run = await client.actor('sian.agency/cargurus-car-listings-scraper').call({
  makes: ['porsche'],
  zipCode: '90210',
  searchRadius: '500',
  maxDaysOnMarket: 1,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]);
```

#### Python

```python
from apify_client import ApifyClient
client = ApifyClient('YOUR_TOKEN')

run = client.actor('sian.agency/cargurus-car-listings-scraper').call(
    run_input={'models': ['Lexus LS'], 'zipCode': '90210', 'searchRadius': 'nationwide'}
)

for item in client.dataset(run['defaultDatasetId']).iterate_items():
    print(item['listingTitle'], item.get('price'), item['url'])
```

#### cURL

```bash
curl -X POST 'https://api.apify.com/v2/acts/sian.agency~cargurus-car-listings-scraper/run-sync-get-dataset-items?token=YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"makes": ["toyota"], "zipCode": "10001", "searchRadius": "100", "maxDaysOnMarket": 1, "maxMileage": 30000}'
```

#### Automation Workflows (N8N / Zapier / Make)

1. **Trigger**: a schedule every 15 minutes
2. **HTTP Request**: call the Actor with your makes, ZIP and a 1-day window
3. **Process**: keep rows whose listingId you have not seen before
4. **Action**: post them to Slack, email or a Google Sheet

***

### 📊 Performance & Pricing

#### FREE Tier (Try It Now)

- **25 listings** per run, every field included
- No credit card required
- Enough to check the data on your own makes and ZIP

#### PAID Tier (Production Ready)

- **Unlimited** listings per run
- Pay per listing returned, with lower per-listing prices on higher Apify plans
- A search that finds nothing, and any input the run could not read, costs nothing

💰 A one-day alert run on one make usually reads a single page, so the cost of a scheduled feed stays small.

🔗 [View current pricing](https://apify.com/sian.agency/cargurus-car-listings-scraper?fpr=sian)

***

### ❓ Frequently Asked Questions

**Q: How fresh are the results?**
A: Every search is sorted newest first, the same as "Newest listings first" on CarGurus. daysOnMarket 0 means the car was listed today.

**Q: How many listings can I get?**
A: FREE tier: 25 per run. PAID tier: unlimited. "Max listings per search" caps each make or model.

**Q: Why do some listings have no price?**
A: Some dealers list a car without a price and ask buyers to call. Those rows come back with price empty, never a made-up number.

**Q: Why are some cars farther away than my radius?**
A: CarGurus mixes in cars a dealer will transfer to a nearby store or ship to you. Those rows say so in howToShop.

**Q: Can I search Canada or the UK?**
A: No. This Actor covers the US site only, with US ZIP codes and miles.

**Q: What happens if I type a model name wrong?**
A: The run stops before anything is charged and the log lists every model that make has, so you can copy the exact name.

**Q: What output formats are available?**
A: JSON, CSV and Excel from the Apify dataset, or the API.

**Q: Is this legal?**
A: The Actor reads public listings only. See the legal section below and check the site's terms for your use.

***

### 🐛 Troubleshooting

**"is not a CarGurus model name"**

- Open the run log: it lists every model of that make
- Copy the name exactly, with the make first, for example "Mercedes-Benz SL-Class"

**The run returned fewer listings than expected**

- Widen the search radius or raise "Only listings newer than"
- Loosen the year, price and mileage filters; a price filter also drops cars listed without a price

**Listings come from the wrong area**

- Check the ZIP code. CarGurus does not reject an unknown ZIP; it searches around a different place instead

**"CarGurus is temporarily unavailable"**

- Run the same input again in a few minutes. Failed searches are not charged

***

### ⚖️ Is it legal to scrape data?

Our actors are ethical and do not extract any private user data, such as email addresses, gender, or location. They only extract what the user has chosen to share publicly. We therefore believe that our actors, when used for ethical purposes by Apify users, are safe.

However, you should be aware that your results could contain personal data. Personal data is protected by the **GDPR** in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.

You can also read Apify's blog post on the [legality of web scraping](https://blog.apify.com/is-web-scraping-legal/).

CarGurus is a trademark of CarGurus, Inc. This Actor is not affiliated with, endorsed by or sponsored by CarGurus, Inc.

***

### 🤝 Support

**Join our active support community**

- For issues or questions, open an issue on the [Actor's issues tab](https://apify.com/sian.agency/cargurus-car-listings-scraper/issues)
- Check [SIÁN Agency Store](https://apify.com/sian.agency?fpr=sian) for more automation tools
- 📧 <apify@sian-agency.online>

***

**Built by [SIÁN Agency](https://www.sian-agency.online)** | **[More Tools](https://apify.com/sian.agency?fpr=sian)**

# Changelog

This Actor's version history is a separate document: https://apify.com/sian.agency/cargurus-car-listings-scraper/changelog.md

# Actor input Schema

## `operation` (type: `string`):

Find the newest car listings for the makes and models you pick, within a radius of a US ZIP code, sorted newest first.

## `makes` (type: `array`):

Pick one or more makes. Each make is its own search, newest listings first. To narrow a make down to one model, leave it out here and add the model under Models instead.

## `models` (type: `array`):

Optional. Make and model together, one per line, written the way CarGurus writes them: Lexus LS, Toyota Land Cruiser, Porsche 911, Mercedes-Benz SL-Class. A name that does not match a CarGurus model stops the run before anything is charged and lists the models that make has.

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

The 5-digit US ZIP code the search radius is measured from. Distance on every row is in miles from this ZIP. Use a real ZIP: CarGurus does not reject an unknown one, it quietly searches around a different location.

## `searchRadius` (type: `string`):

How far from the ZIP code to search. Rare cars usually need 500 miles or nationwide; everyday models fill a page within 50. CarGurus also mixes in cars from farther away that a dealer will transfer or ship to you; those rows say so in How to buy.

## `maxDaysOnMarket` (type: `integer`):

Only return cars listed within this many days. 1 returns cars listed today and yesterday. 0 means no limit. Results come newest first, so the run stops reading as soon as it reaches an older listing, which makes a short window both fast and cheap.

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

Oldest model year to include, for example 1990. 0 means no minimum.

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

Newest model year to include, for example 2005 for older cars only. 0 means no maximum.

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

Lowest asking price in US dollars. 0 means no minimum. Listings without a published price are left out by CarGurus when a price filter is set.

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

Highest asking price in US dollars. 0 means no maximum.

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

Highest odometer reading in miles, for example 30000 for low-mileage cars. 0 means no maximum.

## `maxResultsPerSearch` (type: `integer`):

Stop each make or model search after this many listings. One request returns up to 48, so 48 is the newest page and costs the least per listing.

## Actor input object example

```json
{
  "operation": "search",
  "makes": [
    "porsche"
  ],
  "models": [
    "Lexus LS",
    "Toyota Land Cruiser",
    "Porsche 911"
  ],
  "zipCode": "90210",
  "searchRadius": "500",
  "maxDaysOnMarket": 0,
  "minYear": 0,
  "maxYear": 0,
  "minPrice": 0,
  "maxPrice": 0,
  "maxMileage": 0,
  "maxResultsPerSearch": 48
}
```

# Actor output Schema

## `cargurusListings` (type: `string`):

Every listing this run returned.

## `scrapingSummary` (type: `string`):

HTML summary showing successful and failed results with key metrics

# 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 = {
    "operation": "search",
    "makes": [
        "porsche"
    ],
    "models": [],
    "zipCode": "90210",
    "searchRadius": "500",
    "maxDaysOnMarket": 0,
    "minYear": 0,
    "maxYear": 0,
    "minPrice": 0,
    "maxPrice": 0,
    "maxMileage": 0,
    "maxResultsPerSearch": 48
};

// Run the Actor and wait for it to finish
const run = await client.actor("sian.agency/cargurus-car-listings-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 = {
    "operation": "search",
    "makes": ["porsche"],
    "models": [],
    "zipCode": "90210",
    "searchRadius": "500",
    "maxDaysOnMarket": 0,
    "minYear": 0,
    "maxYear": 0,
    "minPrice": 0,
    "maxPrice": 0,
    "maxMileage": 0,
    "maxResultsPerSearch": 48,
}

# Run the Actor and wait for it to finish
run = client.actor("sian.agency/cargurus-car-listings-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 '{
  "operation": "search",
  "makes": [
    "porsche"
  ],
  "models": [],
  "zipCode": "90210",
  "searchRadius": "500",
  "maxDaysOnMarket": 0,
  "minYear": 0,
  "maxYear": 0,
  "minPrice": 0,
  "maxPrice": 0,
  "maxMileage": 0,
  "maxResultsPerSearch": 48
}' |
apify call sian.agency/cargurus-car-listings-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,sian.agency/cargurus-car-listings-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/cskzp5q8uC6bZuzG9/builds/DrAhZrS9Z74SIAz4e/openapi.json
