# Turkish Real Estate Scraper (`olivine_lemur/turkish-real-estate-scraper`) Actor

Scrapes property listings from 6 major Turkish real estate portals: CB, Century21, ERA, RealtyWorld, Remax and Turyap. Extracts price, location, coordinates, room count, size and more. Resume-capable via checkpoints. Outputs normalized JSON ready for analysis.

- **URL**: https://apify.com/olivine\_lemur/turkish-real-estate-scraper.md
- **Developed by:** [Vide Supra](https://apify.com/olivine_lemur) (community)
- **Categories:** Real estate
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

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

## Turkish Real Estate Portal Scraper

Türkiye'nin 6 büyük emlak portalından konut ve ticari ilan verilerini toplayan **Apify Actor**.

| Portal | Yöntem | Kategoriler |
|---|---|---|
| [CB.com.tr](https://www.cb.com.tr) | HTTP/urllib | Konut Satılık, Kiralık, Devren |
| [Century21.com.tr](https://www.century21.com.tr) | HTTP/urllib | Konut Satılık, Kiralık |
| [ERA.com.tr](https://www.era.com.tr) | HTTP/urllib | Konut Satılık, Kiralık |
| [RealtyWorld.com.tr](https://www.realtyworld.com.tr) | HTTP/urllib | Tüm kategoriler |
| [Remax.com.tr](https://www.remax.com.tr) | Selenium | Konut/Ticari Satılık, Kiralık, Devren |
| [Turyap.com.tr](https://www.turyap.com.tr) | Selenium | Tüm kategoriler |

---

### Özellikler

- Her portaldan **CanonicalListing** formatında normalize veri
- JSON checkpoint sistemi → çökme/durdurma sonrası **kaldığı yerden devam**
- Remax için SQLite tabanlı 2-aşamalı scraping (URL toplama → detay çekme)
- Apify Dataset'e otomatik push
- Tüm kaynaklar bağımsız çalışır, istediğiniz kombinasyonu seçebilirsiniz

---

### Input Parametreleri

| Alan | Tip | Varsayılan | Açıklama |
|---|---|---|---|
| `sources` | `string[]` | tüm kaynaklar | Çalıştırılacak portal listesi |
| `maxPages` | `integer` | `0` (sınırsız) | Kategori sayfası limiti |
| `requestDelay` | `number` | `1.5` | İstekler arası bekleme (saniye) |
| `headless` | `boolean` | `true` | Selenium headless modu |

---

### Output Şeması

Her ilan aşağıdaki alanlarla Apify Dataset'e yazılır:

```json
{
  "source": "remax",
  "url": "https://www.remax.com.tr/ilan/...",
  "title": "3+1 Satılık Daire",
  "listing_no": "12345",
  "product_id": "12345",
  "category": "konut_satilik",
  "transaction_type": "satilik",
  "property_type": "Daire",
  "price": "2500000",
  "currency": "TL",
  "location": "İstanbul",
  "district": "Kadıköy",
  "neighborhood": "Moda",
  "m2_net": "120",
  "m2_brut": "140",
  "room_count": "3+1",
  "floor": "4",
  "total_floors": "7",
  "build_year": "2015",
  "heating": "Kombi",
  "description": "...",
  "latitude": 40.9854,
  "longitude": 29.0345,
  "scraped_at_utc": "2024-01-15T10:30:00+00:00"
}
````

***

### Yerel Geliştirme

#### Gereksinimler

- Python 3.11+
- Google Chrome + ChromeDriver (PATH'te)

#### Kurulum

```bash
git clone https://github.com/YOUR_USERNAME/turkish-real-estate-scraper.git
cd turkish-real-estate-scraper
pip install -r requirements.txt
```

#### Çalıştırma (Apify CLI ile)

```bash
pip install apify-cli
apify run
```

#### Çalıştırma (doğrudan Python)

```bash
python -m src.main
```

***

### Apify'e Yükleme

#### Yöntem 1: GitHub üzerinden (Önerilen)

1. Bu repoyu GitHub'a push edin
2. [Apify Console](https://console.apify.com) → **Actors** → **Create new Actor**
3. **Link Git repository** seçin
4. GitHub repo URL'nizi girin
5. **Build** butonuna basın

#### Yöntem 2: Apify CLI

```bash
apify login
apify push
```

***

### Proje Yapısı

```
.
├── .actor/
│   ├── actor.json          ## Actor metadata
│   └── input_schema.json   ## Input parametreleri
├── src/
│   ├── __init__.py
│   ├── main.py             ## Apify Actor giriş noktası
│   ├── models.py           ## CanonicalListing dataclass
│   ├── http_utils.py       ## HTTP yardımcıları
│   ├── checkpoint.py       ## JSON checkpoint sistemi
│   ├── cb_scraper.py
│   ├── century21_scraper.py
│   ├── era_scraper.py
│   ├── realtyworld_scraper.py
│   ├── remax_db.py         ## Remax SQLite yardımcıları
│   └── remax_scraper.py
│   └── turyap_scraper.py
├── Dockerfile
├── requirements.txt
└── README.md
```

***

### Lisans

Özel kullanım. Yeniden dağıtım yasaktır.

# Actor input Schema

## `sources` (type: `array`):

Taranacak portal listesi: cb, century21, era, realtyworld, remax, turyap. Boş bırakılırsa tümü çalışır.

## `maxPages` (type: `integer`):

Her kaynak için maksimum kategori sayfası sayısı. 0 = sınırsız.

## `requestDelay` (type: `number`):

İstekler arasındaki bekleme süresi. Site engellerini azaltır.

## `headless` (type: `boolean`):

Selenium scraperları (Remax, Turyap) için headless mod. Apify'de her zaman true bırakın.

## `concurrency` (type: `integer`):

HTTP scraperlar (CB, ERA, Century21, RealtyWorld) için her kaynaktaki paralel URL sayısı. Yüksek değerler daha hızlı ama site engellemesi riskini artırır.

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

Remax.com.tr Cloudflare korumasını aşmak için proxy ayarı. Boş bırakılırsa proxy kullanılmaz (Remax'ta CF engeli çıkabilir). Apify Residential Proxy veya harici proxy ile bypass yapılabilir.

## `remaxCookies` (type: `string`):

remax.com.tr'yi tarayıcınızda açın, EditThisCookie ile tüm çerezleri kopyalayın (‘Export’ düğmesi) ve buraya yapıştırın. cf\_clearance çerezi Cloudflare engeli geçmeyi sağlar. Çerez yaklaşık 30 dakika geçerlidir.

## Actor input object example

```json
{
  "sources": [
    "cb",
    "century21",
    "era",
    "realtyworld",
    "remax",
    "turyap"
  ],
  "maxPages": 0,
  "requestDelay": 1.5,
  "headless": true,
  "concurrency": 8,
  "proxyConfiguration": {},
  "remaxCookies": ""
}
```

# Actor output Schema

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

No description

# 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 = {
    "sources": [
        "cb",
        "century21",
        "era",
        "realtyworld",
        "remax",
        "turyap"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("olivine_lemur/turkish-real-estate-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 = { "sources": [
        "cb",
        "century21",
        "era",
        "realtyworld",
        "remax",
        "turyap",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("olivine_lemur/turkish-real-estate-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 '{
  "sources": [
    "cb",
    "century21",
    "era",
    "realtyworld",
    "remax",
    "turyap"
  ]
}' |
apify call olivine_lemur/turkish-real-estate-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Turkish Real Estate Scraper",
        "description": "Scrapes property listings from 6 major Turkish real estate portals: CB, Century21, ERA, RealtyWorld, Remax and Turyap. Extracts price, location, coordinates, room count, size and more. Resume-capable via checkpoints. Outputs normalized JSON ready for analysis.",
        "version": "1.0",
        "x-build-id": "JA0yw6gDsA24c3Oaa"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/olivine_lemur~turkish-real-estate-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-olivine_lemur-turkish-real-estate-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/olivine_lemur~turkish-real-estate-scraper/runs": {
            "post": {
                "operationId": "runs-sync-olivine_lemur-turkish-real-estate-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/olivine_lemur~turkish-real-estate-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-olivine_lemur-turkish-real-estate-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",
                "properties": {
                    "sources": {
                        "title": "Kaynaklar",
                        "type": "array",
                        "description": "Taranacak portal listesi: cb, century21, era, realtyworld, remax, turyap. Boş bırakılırsa tümü çalışır.",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "cb",
                            "century21",
                            "era",
                            "realtyworld",
                            "remax",
                            "turyap"
                        ]
                    },
                    "maxPages": {
                        "title": "Sayfa Limiti",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Her kaynak için maksimum kategori sayfası sayısı. 0 = sınırsız.",
                        "default": 0
                    },
                    "requestDelay": {
                        "title": "İstek Gecikmesi (saniye)",
                        "minimum": 0.5,
                        "type": "number",
                        "description": "İstekler arasındaki bekleme süresi. Site engellerini azaltır.",
                        "default": 1.5
                    },
                    "headless": {
                        "title": "Headless Tarayıcı",
                        "type": "boolean",
                        "description": "Selenium scraperları (Remax, Turyap) için headless mod. Apify'de her zaman true bırakın.",
                        "default": true
                    },
                    "concurrency": {
                        "title": "Eşzamanlı Worker Sayısı",
                        "minimum": 1,
                        "maximum": 32,
                        "type": "integer",
                        "description": "HTTP scraperlar (CB, ERA, Century21, RealtyWorld) için her kaynaktaki paralel URL sayısı. Yüksek değerler daha hızlı ama site engellemesi riskini artırır.",
                        "default": 8
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Yapılandırması (Remax için)",
                        "type": "object",
                        "description": "Remax.com.tr Cloudflare korumasını aşmak için proxy ayarı. Boş bırakılırsa proxy kullanılmaz (Remax'ta CF engeli çıkabilir). Apify Residential Proxy veya harici proxy ile bypass yapılabilir.",
                        "default": {}
                    },
                    "remaxCookies": {
                        "title": "Remax Cookie (EditThisCookie JSON)",
                        "type": "string",
                        "description": "remax.com.tr'yi tarayıcınızda açın, EditThisCookie ile tüm çerezleri kopyalayın (‘Export’ düğmesi) ve buraya yapıştırın. cf_clearance çerezi Cloudflare engeli geçmeyi sağlar. Çerez yaklaşık 30 dakika geçerlidir.",
                        "default": ""
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
