# 2dehands Car Listings Scraper ($0.8/1K) (`carabain-digital/2dehands-cars`) Actor

Scrape car listings from 2dehands (2dehands.be), Belgium's biggest classifieds site: make, model, price, mileage, year, fuel, gearbox, body, Car-Pass link, seller and photos. Filter by make, model, price, year, mileage, postcode. Add-ons: full details with dealer phone, price history.

- **URL**: https://apify.com/carabain-digital/2dehands-cars.md
- **Developed by:** [Carabain Digital](https://apify.com/carabain-digital) (community)
- **Categories:** E-commerce, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.48 / 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

#### What is 2dehands Car Listings Scraper?

**2dehands Car Listings Scraper** scrapes **car listings from 2dehands ([2dehands.be](https://www.2dehands.be))**, Belgium's biggest classifieds site (2ememain in French), with around 95,000 cars for sale from dealers and private sellers (plus vans, trucks and oldtimers). Search by **make, model, construction year, price, mileage, fuel, gearbox, body type, new or used, dealer or private, and postcode + radius**, or paste a car search URL from the site, and get clean, flat car data as JSON, CSV, Excel, XML or HTML: price and price type, mileage, year, fuel, gearbox, body, power, engine size, colour, seller name, city, coordinates, photos, newest first. Prefilled example: the 20 newest Volkswagen Golf listings, ready in about a second. Costs **$0.80 per 1,000 listings**. Add-ons: **Full details** (full description, all photos, trim, options list, seller type, dealer phone and postcode) and **Price history** (price changes over time), $1.00 per 1,000 listings each.

- 🔎 **Search like on the site**: make, model, year range, price range, max mileage, fuel, gearbox, body type, condition, dealer or private, postcode and distance, or paste a 2dehands search URL
- ⚡ **Fast and light**: 2dehands' own search API, 100 cars per request, no browser, no proxy needed
- 🆕 **Newest first**: the site's date order, ideal for alerts on fresh occasions
- 📚 **Full details on demand**: switch on **Full details** for the full text, options list, upholstery, maintenance history and the dealer's phone number
- 📈 **Track prices over time**: switch on **Price history** to compare every run with the last one and catch price drops
- 🧾 **Car-Pass links**: the public Car-Pass certificate (Belgian mileage history) when the seller linked one
- 🔌 **Connect anywhere**: API, schedules, webhooks, Google Sheets, Make, Zapier, MCP / AI agents

#### Use it from AI agents

This Actor has an agent skill for Claude Code, Codex, Cursor and other agents that read `SKILL.md`: it tells the agent when to use the Actor, every input field and the output. Install it with:

```bash
npx skills add carabain-digital/apify-agent-skills --skill 2dehands-cars
```

Or read the skill on GitHub: [carabain-digital/apify-agent-skills/skills/2dehands-cars](https://github.com/carabain-digital/apify-agent-skills/tree/main/skills/2dehands-cars).

#### What data can I extract from 2dehands?

<table>
<tr><td>🆔 Stable listing ID and listing URL</td><td>💶 Price, currency and price type (fixed, bids, on request)</td></tr>
<tr><td>🚗 Make, model and trim</td><td>📅 Construction year</td></tr>
<tr><td>🛣️ Mileage (km)</td><td>⛽ Fuel type and gearbox</td></tr>
<tr><td>🚙 Body type, doors and seats</td><td>🔧 Power (kW and hp) and engine size (cc)</td></tr>
<tr><td>🎨 Colour, interior colour, upholstery</td><td>🧾 Car-Pass mileage certificate link, Euro norm</td></tr>
<tr><td>🏢 Dealer or private, seller name, phone, website</td><td>📍 City, postcode, latitude and longitude</td></tr>
<tr><td>📷 Photo URLs</td><td>📝 Description and options list</td></tr>
<tr><td>⭐ Paid "Dagtopper" flag, views and favourites</td><td>🕒 Listing date and exact publication time</td></tr>
</table>

The search results carry price, make, model, year, mileage, fuel, gearbox, body, city, coordinates, seller name, the first lines of the description and up to 4 photos (power, colour, doors and seats when the seller filled them in). **Trim, the full description, all photos, options, seller type for every listing, dealer phone, website and postcode and the exact publication time** come from the listing page and are only filled with the **Full details** add-on. Values such as colour, fuel and body are in Dutch as on the site; `fuel_type`, `transmission` and `body_type` are normalised to English.

#### How do I scrape 2dehands car listings?

1. [Create a free Apify account](https://console.apify.com/sign-up) and open this Actor.
2. Enter a **Make** (for example `Volkswagen`) and, if you like, a **Model** (`Golf`), year and price range, fuel, gearbox or a **Postcode** with a radius. Or paste one or more **Search URLs** copied from 2dehands.be.
3. Set **Max listings** (the newest come first).
4. Click **Start**, then download the cars from the **Output** tab as JSON, CSV, Excel, XML or HTML.

#### How much does it cost to scrape 2dehands?

You pay per listing that ends up in your dataset: **$0.80 per 1,000 listings**, no subscription. The monthly credit of Apify's Free plan ($5) covers around 6,000 listings without add-ons. Paid plans get volume discounts.

- **Add-on: Full details, $1.00 per 1,000 listings** (off by default). Opens every listing's page and adds the full description, all photos, trim, colour, doors, seats, engine, gears, drive, options list, seller type, dealer phone, website and postcode, exact publication time, views and favourites. Charged only for listings that were actually enriched.
- **Add-on: Price history, $1.00 per 1,000 listings** (off by default). Adds `first_seen_at`, `previous_price`, `price_change`, `price_change_pct`, `status_changed` and `price_history`. Charged only for listings that already had history from an earlier run, so the first run is free. See the *Price history* section below.
- Failed runs and empty searches cost nothing; you can cap spending with **Maximum cost per run** in the run options.

See the **Pricing** tab for the current prices.

#### ⬇️ Input

| Field | Description |
|---|---|
| **Make** (`make`) | Make as 2dehands lists it: `Volkswagen`, `BMW`, `Mercedes-Benz` (`VW` and `Mercedes` work too); `Bestelwagens en Lichte vracht` for vans |
| **Model** (`model`) | Model within the make: `Golf`, `3 Reeks`, `A4`; an unknown model fails with the site's model list |
| **Minimum / maximum year** (`min_year`, `max_year`) | Construction year range |
| **Minimum / maximum price** (`min_price`, `max_price`) | In euro |
| **Maximum mileage** (`max_mileage`) | In km |
| **Fuel** (`fuel_type`) | `petrol`, `diesel`, `electric`, `hybrid`, `plugin_hybrid`, `lpg`, `cng`, `hydrogen`, `other` |
| **Gearbox** (`transmission`) | `manual` or `automatic` |
| **Body type** (`body_type`) | `hatchback`, `sedan`, `wagon`, `suv`, `coupe`, `convertible`, `minivan`, `other` |
| **Condition** (`condition`) | `used` or `new` |
| **Seller** (`seller_type`) | `dealer` or `private` |
| **Postcode** (`location`) + **Radius** (`radius_km`) | Belgian postcode (`9000`, `2000`, `1000`) and distance, default 25 km |
| **Search URLs** (`start_urls`) | Car search pages copied from 2dehands.be; they replace the filters above |
| **Max listings** (`limit`) | Stop after this many listings |
| **Full details** (`includeDetails`) | Paid add-on: full text, all photos, options, dealer phone and more |
| **Price history** (`trackHistory`) | Paid add-on: compare with your previous runs |
| **History store name** (`historyStoreName`) | Where the history is kept (default `cars-history`) |
| **Proxy** (`proxyConfiguration`) | Not needed; off by default |

```json
{
    "make": "Volkswagen",
    "model": "Golf",
    "limit": 20
}
```

A filtered search: BMW 3 Reeks diesels from 2016, up to 25,000 euro (192 cars in our test run):

```json
{
    "make": "BMW",
    "model": "3 Reeks",
    "min_year": 2016,
    "max_price": 25000,
    "fuel_type": "diesel",
    "limit": 100
}
```

With **Search URLs** paste a page like `https://www.2dehands.be/l/auto-s/bmw/f/diesel/474/#PriceCentsTo:2500000|constructionYearFrom:2018`; filters in the path and after the `#` (make, fuel, body, price, year, mileage, postcode and distance, search words) are kept, the page number is ignored and results always come newest first.

#### ⬆️ Output

Listings are stored in the default dataset, newest first. View them as a table in the **Output** tab or export JSON, CSV, Excel, XML or HTML. Fields a listing does not have are `null`; every item has the same keys.

##### A private listing with the Full details add-on

```json
{
    "id": "2dehands:m2466172676",
    "source": "2dehands",
    "url": "https://www.2dehands.be/v/auto-s/volkswagen/m2466172676-volkswagen-golf-gte-1-4-tsi-plug-in-hybrid-204-pk",
    "title": "Volkswagen Golf GTE 1.4 TSI Plug-in Hybrid – 204 pk –",
    "make": "Volkswagen",
    "model": "Golf",
    "variant": null,
    "condition": null,
    "price": 15800,
    "price_currency": "EUR",
    "price_type": "negotiable",
    "mileage": 40000,
    "mileage_unit": "km",
    "year": 2018,
    "first_registration": "2018",
    "fuel_type": "hybrid",
    "transmission": "automatic",
    "body_type": "sedan",
    "power_kw": 110,
    "power_hp": 150,
    "engine_cc": 1400,
    "color": "Zwart",
    "doors": null,
    "seats": null,
    "vin": null,
    "seller_type": "private",
    "seller_name": "M.X",
    "seller_phone": null,
    "seller_url": "https://www.2dehands.be/u/m-x/48316228/",
    "address": "Kruibeke",
    "city": "Kruibeke",
    "postcode": null,
    "region": null,
    "country": "BE",
    "lat": 51.157829016252,
    "lon": 4.2918088161331,
    "listed_at": "2026-11-15T14:15:43Z",
    "image_urls": [
        "https://images.2dehands.com/api/v1/hz-twh-pro-listing/images/4feff694-c614-485a-9245-3eb2859ac0ce?rule=ecg_mp_eps$_85.jpg",
        "https://images.2dehands.com/api/v1/hz-twh-pro-listing/images/54a232bc-a0ec-4da1-8617-eb1344a45f0d?rule=ecg_mp_eps$_85.jpg",
        "..."
    ],
    "description": "Volkswagen Golf GTE 1.4 TSI Plug-in Hybrid – 204 pk – 09/2018\n\n🇧🇪 Belgische wagen – Car-Pass aanwezig!\n\nPrachtige en sportieve Volkswagen Golf GTE in uitstekende staat, zowel vanbinnen als vanbuiten. ...",
    "seller_id": 48316228,
    "promoted": true,
    "reserved": false,
    "energy_label": null,
    "emission_class": "Euro 6",
    "car_pass_url": "https://public.car-pass.be/verify/3770-6181-5784",
    "fuel_type_original": "Hybride Elektrisch/Benzine",
    "body_type_original": "Berline",
    "equipment": ["Trekhaak"],
    "category": "Volkswagen",
    "details_fetched": true,
    "scraped_at": "2026-11-15T16:58:21Z",
    "gears": null,
    "drive": "Voorwiel",
    "apk_until": null,
    "new_price_text": null,
    "cylinders": 4,
    "previous_owners": null,
    "co2_g_km": 40,
    "empty_weight_kg": 1615,
    "imported": null,
    "license_plate": null,
    "nap_status": false,
    "seller_website": null,
    "seller_active_years": 3,
    "view_count": 93,
    "favorite_count": 3
}
```

##### Extra fields with the Price history add-on

```json
{
    "first_seen_at": "2026-11-08T07:00:12+00:00",
    "previous_price": 5995,
    "price_change": -440,
    "price_change_pct": -7.34,
    "status_changed": false,
    "price_history": [
        { "at": "2026-11-08T07:00:12+00:00", "price": 5995, "status": null },
        { "at": "2026-11-15T07:00:09+00:00", "price": 5555, "status": null }
    ]
}
```

#### What can I do with 2dehands car data?

- 🔔 **New occasion alerts**: schedule a run for a make and model (say a Toyota Yaris hybrid under 15,000 euro near Antwerpen) and push fresh listings to Slack, Telegram or e-mail
- 💶 **Used car price research**: compare asking prices by make, model, year and mileage to value a trade-in or price your own car
- 📉 **Price drop alerts**: add **Price history** and flag cars with a negative `price_change` before someone else buys them
- 🧑‍💼 **Dealer lead generation**: collect car dealers (`seller_type` dealer) with their phone, website, postcode and stock per region (Full details add-on)
- 🕵️ **Private seller sourcing for traders**: filter `seller_type` private and a postcode radius to find cars to buy before they reach the trade
- 🧠 **Market and AI datasets**: build a dataset of prices, mileage, year, fuel and power for depreciation models, EV adoption tracking or LLM pipelines

#### Tips for best results

- Results come in the site's date order. Paid "Dagtopper" ads (`promoted` true) are bumped to the top every day, so the first results of a broad search are mostly bumped ads; their `listed_at` is the bump date. **Full details** gives the real first publication time.
- The site serves about **2,000 listings per search**. For more, split the search (by make, model, year or price band) or add several **Search URLs**; one run takes them all and deduplicates.
- Locations are Belgian postcodes: 2dehands searches by postcode + distance and ignores city names.
- `price_type` `negotiable` means the seller accepts bids ("Bieden"); `price` is then the asking or minimum bid. `on_request` means "Zie omschrijving".
- Without **Full details** `seller_type` is only known for dealers that identify themselves and when you filter on **Seller**.
- Leave **Full details** off for counting, alerts and price monitoring; switch it on when you need the full text, options or dealer phone numbers.

#### Price history

Switch on **Price history** (`trackHistory`) and the Actor remembers every car between runs, so you can see price drops and how long a car has been for sale.

- **Where it lives.** History is kept in a *named key-value store in your own Apify account* (default name `cars-history`, change it with **History store name**). Named stores never expire, you own the data, and storage costs a fraction of a cent.
- **First run starts the series.** The first time a listing is seen there is nothing to compare with, so `previous_price` is `null` and you are not charged for the add-on on that listing. From the second run on, each listing gets `first_seen_at`, `previous_price`, `price_change`, `price_change_pct`, `status_changed` and `price_history` (the last 20 price points, one point per change).
- **Run it on a schedule.** History only grows when you run the Actor. Create a [schedule](https://docs.apify.com/platform/schedules) (daily is typical) with the same search and the same store name.
- **One store, several Actors.** Every car Actor we publish uses the same default store name, so a listing keeps one history even if you scrape it with a different one of our Actors. Item IDs start with the site (`2dehands:...`), so sites never clash.
- **Do not run two runs on the same store at the same time.** Records are updated per listing and the last writer wins. Run searches that share a store one after another.
- **If you delete the store,** the Actor starts a new empty history without an error.
- **Cost:** $1.00 per 1,000 listings that already had history (see pricing above).

#### Frequently asked questions

#### Can I use 2dehands Car Listings Scraper with the Apify API?

Yes. Every run has a dataset you can read through the [Apify API](https://docs.apify.com/api/v2). Python:

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("carabain-digital/2dehands-cars").call(run_input={
    "make": "Toyota",
    "model": "Yaris",
    "fuel_type": "hybrid",
    "max_price": 15000,
    "limit": 100,
})
for car in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(car["price"], car["year"], car["mileage"], car["city"], car["url"])
```

JavaScript:

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('carabain-digital/2dehands-cars').call({
    make: 'BMW',
    model: '3 Reeks',
    min_year: 2018,
    limit: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items.length, 'cars');
```

#### Can I use 2dehands Car Listings Scraper through an MCP server or with AI agents?

Yes. Add it to an AI agent through the [Apify MCP server](https://mcp.apify.com) (`https://mcp.apify.com?tools=carabain-digital/2dehands-cars`), or let the agent find it with `search-actors` and run it with `call-actor`. A small search (`limit` 20) finishes in about a second, and the items are flat, so agents can read them with `get-dataset-items`. Example prompt: *"Use 2dehands Car Listings Scraper to find the 20 newest Volkswagen Golf diesels from 2017 or newer under 15,000 euro within 25 km of Gent (postcode 9000) and tell me which has the lowest mileage."*

#### Can I integrate 2dehands data with other apps?

Yes: Google Sheets, Slack, Make, Zapier, n8n, Airtable or your own webhook, through Apify [integrations](https://apify.com/integrations) and [webhooks](https://docs.apify.com/platform/integrations/webhooks). Schedule a run and send new cars or price drops to your inbox or CRM.

#### Do I need a proxy?

No. 2dehands' search API answers without a proxy. The listing pages behind **Full details** are rate-limited per IP address (a few hundred pages within a few minutes), so the add-on moves to a fresh residential IP whenever that limit is hit; that proxy is included in the price.

#### Why is a field empty?

Without **Full details**, `variant`, `seller_phone`, `seller_url`, `postcode`, the options list and most of `doors`, `seats`, `power_hp` and `color` are `null`: 2dehands only shows them on the listing page, or the seller did not fill them in. Vans and trucks in the site's "Bestelwagens en Lichte vracht" and "Vrachtwagens" sections often have no `make`; `category` tells which section they are in. Private sellers rarely publish a phone number.

#### What is the Car-Pass link?

Belgian sellers must hand over a Car-Pass, the official mileage history of the car. Many 2dehands sellers link its public version; the Actor returns it in `car_pass_url` (already in the search results). The link opens the certificate on car-pass.be.

#### Does it cover 2ememain?

Yes. 2ememain.be is the French-language face of the same site with the same listings.

#### Does it cover vans, trucks and oldtimers?

Yes, they sit in the Auto's category: use **Make** `Bestelwagens en Lichte vracht` for vans or leave **Make** empty to get everything. Oldtimers get `condition` `classic`.

#### Is it legal to scrape 2dehands?

The Actor only collects publicly visible listings, the same data anyone can see on 2dehands.be. Listings can contain personal data (for example a private seller's name or a dealer's phone number), and rules such as GDPR may apply to how you store and use it. Check your use case with a lawyer. More background: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/)

#### 2dehands Car Listings Scraper not working? Feedback

Open an issue on the **Issues** tab of this Actor with the run link and we will look at it. Feature ideas are welcome there too.

#### Other scrapers by us

| Actor | Covers |
|---|---|
| [Marktplaats Car Listings Scraper](https://apify.com/carabain-digital/marktplaats-cars) | Netherlands: marktplaats.nl car listings, same data and filters plus licence plate and APK |
| [Immoweb Listings Scraper](https://apify.com/carabain-digital/immoweb-listings) | Belgium: immoweb.be, the largest Belgian property portal |
| [Belgium Real Estate Scraper](https://apify.com/carabain-digital/belgium-real-estate) | Zimmo, Immoweb and Immovlan in one run, deduplicated |
| [VDAB Jobs Scraper](https://apify.com/carabain-digital/vdab-jobs) | Belgium: vdab.be job postings |
| [TicketSwap Listings Scraper](https://apify.com/carabain-digital/ticketswap-listings) | Ticket resale listings from TicketSwap |

⭐ **Does it work well for you?** A review on the Store page helps others find this Actor and helps us keep it maintained.

# Actor input Schema

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

Car make as 2dehands lists it. Example: `Volkswagen`, `BMW`, `Mercedes-Benz` (also `VW`, `Mercedes`); `Bestelwagens en Lichte vracht` for vans. Leave empty for all makes.

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

Model within the make (needs `make`); an unknown model fails with the list of the site's models. Example: `Golf`, `3 Reeks`, `A4`.

## `min_year` (type: `integer`):

Oldest construction year. Example: `2015`.

## `max_year` (type: `integer`):

Newest construction year. Example: `2022`.

## `min_price` (type: `integer`):

Lowest asking price in euro. Example: `5000`.

## `max_price` (type: `integer`):

Highest asking price in euro. Example: `20000`.

## `max_mileage` (type: `integer`):

Highest odometer reading in km. Example: `150000`.

## `fuel_type` (type: `string`):

Fuel type. Example: `diesel`.

## `transmission` (type: `string`):

Gearbox. Example: `automatic`.

## `body_type` (type: `string`):

Body type. Example: `suv`. Vans are a make-like section on the site: use `make` for them.

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

New or used cars. Example: `used`.

## `seller_type` (type: `string`):

Dealers or private sellers. Example: `private`.

## `location` (type: `string`):

Belgian postcode (4 digits). Example: `9000` (Gent), `2000` (Antwerpen) or `1000` (Brussel). The site searches by postcode + distance only, so city names are rejected.

## `radius_km` (type: `integer`):

Distance around the postcode. Example: `25`. Only used with a postcode.

## `start_urls` (type: `array`):

Car search pages copied from 2dehands.be; they replace the filters above. Example: `https://www.2dehands.be/l/auto-s/bmw/f/diesel/474/#PriceCentsTo:2500000|constructionYearFrom:2018`. Filters in the path and after the `#` are kept; results always come newest first.

## `limit` (type: `integer`):

Stop after this many listings (newest first). Example: `100`. The site serves about 2,000 listings per search: narrow the filters (or add more search URLs) for more.

## `includeDetails` (type: `boolean`):

Also open each listing's page: full description, all photos, trim/version, colour, doors, seats, engine, gears, drive, options list, seller type, dealer phone, website and postcode, exact publication date, views and favourites. Adds $1.00 per 1,000 listings on top of the base price. One extra request per listing (about 6 s per 100 listings).

## `trackHistory` (type: `boolean`):

Keep the price of every listing in a named store in your own Apify account and add first_seen_at, previous_price, price_change, price_change_pct, status_changed and price_history to each item. Run it on a schedule: the first run only starts the series. Adds $1.00 per 1,000 listings that already had history. Do not run two runs on the same store at once.

## `historyStoreName` (type: `string`):

Name of the key-value store that holds the history (letters a-z, digits, dashes). All our car Actors use `cars-history` by default, so history is shared between them. Use another name to keep a separate series per search, e.g. `golf-watch`.

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

2dehands works without a proxy. If the site blocks the run it is retried through a residential proxy by itself; the details add-on switches to a fresh residential IP when the site rate-limits listing pages.

## Actor input object example

```json
{
  "make": "Volkswagen",
  "model": "Golf",
  "fuel_type": "any",
  "transmission": "any",
  "body_type": "any",
  "condition": "any",
  "seller_type": "any",
  "radius_km": 25,
  "limit": 20,
  "includeDetails": false,
  "trackHistory": false,
  "historyStoreName": "cars-history",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `listings` (type: `string`):

All scraped car listings, one item per car.

# 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 = {
    "make": "Volkswagen",
    "model": "Golf",
    "limit": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("carabain-digital/2dehands-cars").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 = {
    "make": "Volkswagen",
    "model": "Golf",
    "limit": 20,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("carabain-digital/2dehands-cars").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 '{
  "make": "Volkswagen",
  "model": "Golf",
  "limit": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call carabain-digital/2dehands-cars --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,carabain-digital/2dehands-cars"
        }
    }
}
```

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/KO2ce55aMeTfufQx6/builds/oo6GSTqRmxENtovYF/openapi.json
