# Sahibinden Car Scraper (`lightkong/sahibinden-car-scraper`) Actor

The most advanced and stealthy scraper to extract car listings from sahibinden.com. Bypasses strict Cloudflare protections and mandatory login barriers. Extracts Make, Model, Year, KM, Price, and more to JSON.

- **URL**: https://apify.com/lightkong/sahibinden-car-scraper.md
- **Developed by:** [Lightkong](https://apify.com/lightkong) (community)
- **Categories:** E-commerce, Agents, Open source
- **Stats:** 61 total users, 7 monthly users, 92.9% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Sahibinden Car Scraper 🚗

### 🤖 Copy to your AI assistant
Copy this block into ChatGPT, Claude, Cursor, or any LLM to start using this actor.

```text
tyegen/sahibinden-car-scraper on Apify. Call: ApifyClient("TOKEN").actor("tyegen/sahibinden-car-scraper").call(run_input={"startUrls": [{"url": "URL_HERE"}]}), then client.dataset(run["defaultDatasetId"]).list_items().items for results.
````

> **🚨 CRITICAL REQUIREMENT FOR USERS: SESSION COOKIES 🚨**
>
> Sahibinden.com has extremely aggressive anti-bot protection and frequently redirects new proxy IPs to a mandatory login page.
>
> **To prevent constant TIMEOUTS or empty results, you MUST inject your personal Session Cookie into the actor's input.**
> Use an extension like `EditThisCookie` to export your session from a real browser and paste it into the `sessionCookies` field before running.

The ultimate Sahibinden Car Scraper to extract otomobil listings bypassing Cloudflare (tloading) challenges and mandatory login walls. Retrieves Make, Series, Model, Year, KM, Color, Price, Location & Date accurately. Requires TR Residential Proxies and verified Session Cookies to operate.

### Features

- ✅ **Cloudflare Bypass** — Puppeteer + Stealth plugin
- ✅ **Mandatory Login Bypass** — Supports injecting personal Session Cookies to evade IP login walls
- ✅ **Residential Proxy** — Required for Sahibinden.com (TR country code)
- ✅ **Detail Pages** — Optional: scrape full property details, photos, and seller info
- ✅ **Pagination** — Automatically navigates through all result pages
- ✅ **BaseRow Integration** — Optional: store data directly in BaseRow
- ✅ **Human-like Behavior** — Random delays, user agents, and viewport sizes

#### Input

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `startUrls` | Array | `vasita/otomobil` | Sahibinden.com category page URLs |
| `maxItems` | Integer | All | Maximum number of listings to scrape |
| `includeDetails` | Boolean | `false` | Scrape detail pages for full info |
| `maxConcurrency` | Integer | `3` | Max concurrent pages (3-5 recommended) |
| `proxyConfiguration` | Object | RESIDENTIAL/TR | Proxy settings |

#### Output (Basic - `includeDetails: false`)

```json
{
    "id": "1234567890",
    "url": "https://www.sahibinden.com/ilan/...",
    "title": "2018 Ford Focus",
    "make": "Ford",
    "series": "Focus",
    "model": "1.5 TDCi Titanium",
    "year": "2018",
    "km": "50.000",
    "color": "Beyaz",
    "price": 1200000,
    "price_currency": "TL",
    "location": "İstanbul / Kadıköy",
    "date": "21 Şubat 2026",
    "image": "https://...",
    "scrapedAt": "2026-02-21T12:00:00.000Z",
    "sourceUrl": "https://www.sahibinden.com/vasita/otomobil"
}
```

#### Output (Detailed - `includeDetails: true`)

Additional fields when detail scraping is enabled:

```json
{
    "description": "Boya, değişen, tramer yoktur...",
    "images": ["https://...", "https://..."],
    "seller": "Galeriden",
    "engineCapacity": "1401 - 1600 cm3",
    "enginePower": "101 - 125 HP",
    "fuel": "Dizel",
    "gear": "Otomatik",
    "damageRecord": "Yok",
    "warranty": "Evet",
    "info": {
        "Motor Hacmi": "1401 - 1600 cm3",
        "Motor Gücü": "101 - 125 HP",
        "...": "..."
    }
}
```

#### Supported URL Formats

```
## Category-based
https://www.sahibinden.com/vasita/otomobil/ford
https://www.sahibinden.com/vasita/otomobil/audi
https://www.sahibinden.com/vasita/arazi-suv-pickup

## With filters
https://www.sahibinden.com/vasita/otomobil/ford?sorting=date_desc&pagingSize=50
```

#### Usage Example (API)

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const input = {
    startUrls: [
        { url: 'https://www.sahibinden.com/vasita/otomobil/ford?sorting=date_desc' }
    ],
    maxItems: 100,
    includeDetails: false,
    maxConcurrency: 3,
    proxyConfiguration: {
        useApifyProxy: true,
        apifyProxyGroups: ['RESIDENTIAL'],
        countryCode: 'TR'
    },
    sessionCookies: [
        // Paste your exported EditThisCookie JSON here
    ]
};

// Run the actor and wait for it to finish
const run = await client.actor('YOUR_USERNAME/sahibinden-car-scraper').call(input);
```

#### ⚠️ Important Notes

- **Session Cookies are highly recommended** — Sahibinden.com frequently redirects scraper proxy IPs to the mandatory login page (`/giris`). You must provide your own exported Session Cookies to bypass this wall. **Do not save your cookies when publishing the actor publicly.** Provide them only when running your own tasks.
- **RESIDENTIAL proxy is required** — Sahibinden.com blocks datacenter IPs.
- **Keep `maxConcurrency` at 3-5** — Higher values increase the risk of your session cookies or proxy being banned.
- **Country code `TR`** — Turkish residential proxies work best for latency and stealth.
- **Selectors may change** — Sahibinden.com updates their HTML periodically to break automated extraction.

# Actor input Schema

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

URLs of Sahibinden.com car category pages. Example: https://www.sahibinden.com/vasita/otomobil

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

Maximum number of listings to scrape. Leave empty to scrape all available listings.

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

If true, it will open each listing's detail page to extract description, all properties, photos, and owner info. If false, it only extracts basic info from the list page.

## `maxConcurrency` (type: `integer`):

Maximum number of pages to open concurrently. High values increase the risk of getting banned. Recommended: 3-5.

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

Proxy settings. Sahibinden.com requires RESIDENTIAL proxies.

## `baseRowApiToken` (type: `string`):

Optional: BaseRow API token to save data directly to a BaseRow table.

## `baseRowTableId` (type: `string`):

Optional: BaseRow Table ID.

## `baseRowDatabaseId` (type: `string`):

Optional: BaseRow Database ID.

## `sessionCookies` (type: `array`):

Paste your active Session Cookies JSON (exported from your browser using EditThisCookie or similar) to bypass the mandatory Sahibinden.com login screen.

## `debugMode` (type: `boolean`):

Enable debug mode to save screenshots and HTML snapshots to the Key-Value store whenever the scraper is blocked or encounters a challenge. Useful for diagnosing Cloudflare/PerimeterX issues. Disable in production.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.sahibinden.com/vasita/otomobil?sorting=date_desc"
    }
  ],
  "includeDetails": false,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "countryCode": "TR"
  },
  "sessionCookies": [],
  "debugMode": false
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://www.sahibinden.com/vasita/otomobil?sorting=date_desc"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "countryCode": "TR"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("lightkong/sahibinden-car-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 = {
    "startUrls": [{ "url": "https://www.sahibinden.com/vasita/otomobil?sorting=date_desc" }],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "countryCode": "TR",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("lightkong/sahibinden-car-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 '{
  "startUrls": [
    {
      "url": "https://www.sahibinden.com/vasita/otomobil?sorting=date_desc"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "countryCode": "TR"
  }
}' |
apify call lightkong/sahibinden-car-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Sahibinden Car Scraper",
        "description": "The most advanced and stealthy scraper to extract car listings from sahibinden.com. Bypasses strict Cloudflare protections and mandatory login barriers. Extracts Make, Model, Year, KM, Price, and more to JSON.",
        "version": "0.0",
        "x-build-id": "L0kZQU3AyTv3pOSAN"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/lightkong~sahibinden-car-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-lightkong-sahibinden-car-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/lightkong~sahibinden-car-scraper/runs": {
            "post": {
                "operationId": "runs-sync-lightkong-sahibinden-car-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/lightkong~sahibinden-car-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-lightkong-sahibinden-car-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": [
                    "startUrls"
                ],
                "properties": {
                    "startUrls": {
                        "title": "Start URLs",
                        "type": "array",
                        "description": "URLs of Sahibinden.com car category pages. Example: https://www.sahibinden.com/vasita/otomobil",
                        "items": {
                            "type": "object",
                            "required": [
                                "url"
                            ],
                            "properties": {
                                "url": {
                                    "type": "string",
                                    "title": "URL of a web page",
                                    "format": "uri"
                                }
                            }
                        }
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 1,
                        "type": "integer",
                        "description": "Maximum number of listings to scrape. Leave empty to scrape all available listings."
                    },
                    "includeDetails": {
                        "title": "Include Details",
                        "type": "boolean",
                        "description": "If true, it will open each listing's detail page to extract description, all properties, photos, and owner info. If false, it only extracts basic info from the list page.",
                        "default": false
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrency",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Maximum number of pages to open concurrently. High values increase the risk of getting banned. Recommended: 3-5.",
                        "default": 3
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Proxy settings. Sahibinden.com requires RESIDENTIAL proxies.",
                        "default": {
                            "useApifyProxy": true,
                            "apifyProxyGroups": [
                                "RESIDENTIAL"
                            ],
                            "countryCode": "TR"
                        }
                    },
                    "baseRowApiToken": {
                        "title": "BaseRow API Token",
                        "type": "string",
                        "description": "Optional: BaseRow API token to save data directly to a BaseRow table."
                    },
                    "baseRowTableId": {
                        "title": "BaseRow Table ID",
                        "type": "string",
                        "description": "Optional: BaseRow Table ID."
                    },
                    "baseRowDatabaseId": {
                        "title": "BaseRow Database ID",
                        "type": "string",
                        "description": "Optional: BaseRow Database ID."
                    },
                    "sessionCookies": {
                        "title": "Session Cookies (JSON)",
                        "type": "array",
                        "description": "Paste your active Session Cookies JSON (exported from your browser using EditThisCookie or similar) to bypass the mandatory Sahibinden.com login screen.",
                        "default": []
                    },
                    "debugMode": {
                        "title": "Debug Mode",
                        "type": "boolean",
                        "description": "Enable debug mode to save screenshots and HTML snapshots to the Key-Value store whenever the scraper is blocked or encounters a challenge. Useful for diagnosing Cloudflare/PerimeterX issues. Disable in production.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
