# Realestate.com.kh Scraper: Cambodia Property Listings (`recordsdata/realestate-kh-scraper`) Actor

Scrape realestate.com.kh, the Cambodia property portal: sale and rent listings with USD prices, rooms, areas, GPS and photos, plus new developments, boreys, agencies, developers and area market stats. Export CSV, Excel, JSON, XML.

- **URL**: https://apify.com/recordsdata/realestate-kh-scraper.md
- **Developed by:** [RecordsData](https://apify.com/recordsdata) (community)
- **Categories:** Real estate, Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 property listings

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

![RecordsData](https://api.apify.com/v2/key-value-stores/AAm3a1h3Z9nYfrvh9/records/banner?v=3)

## 🏠 Realestate.com.kh Scraper: Cambodia Property Listings, Projects & Agencies

> **Realestate.com.kh Scraper exports Cambodia property listings from realestate.com.kh as structured data: sale and rent prices in USD, bedrooms, built and land area, GPS coordinates, photos and the agency behind each ad, plus new developments, boreys, agencies, developers and market statistics per area. Run it with a place and filters, or paste site URLs. Export CSV, Excel, JSON.**

The Realestate.com.kh Scraper turns the public search of Cambodia's largest property portal into a dataset you can sort, filter and join. Pick a section (for sale, for rent, new developments, boreys, agencies, developers or location profiles), name the places you care about, add filters, and get one clean row per record. It reads the site's own page data, so prices, coordinates and dates come exactly as the portal publishes them, and it needs no browser, no login and no API key.

### 🎯 What does the Realestate.com.kh scraper do?

- Scrapes **Cambodia properties for sale and for rent**: price in US dollars, price per m², bedrooms, bathrooms, built area, land area, floor, year built, parking, furnishing, title type and amenities.
- Searches **by place and property type**: Phnom Penh, Siem Reap, Sihanoukville, Kampot, Kep or any district or commune slug, with apartment, condo, house, villa, twin villa, shophouse, penthouse, land, commercial, office, warehouse, hotel and more.
- Filters by **price, bedrooms, bathrooms, floor area, land area, year built, parking, required features** (pool, gym, lift, garden, furnished, air conditioning, balcony), deal tag, seller type, keyword and publication date.
- Reads **new developments and boreys** (landed housing projects) with unit mix, payment plans, construction progress, sold rate, developer and available units.
- Builds **agency and developer profiles** with address, listing counts, sold and rented counts and business links, and **location profiles** with median prices, price bands, yield and sub-areas.
- Adds a **market comparison** to every detailed listing: how many similar listings exist, the median, 20th and 80th percentile price, and how far the ad sits from the median.
- Splits searches above the 10,000 results per query by price on its own.
- Has an **only-new mode** for scheduled runs, and a **language option** (English, Khmer, Chinese, French, Thai, Japanese, Russian).

### 📊 Cambodia real estate data: which fields do you get?

Every row is one record, and `recordType` tells which kind: `listing`, `project`, `agency`, `developer` or `location`. A detailed listing carries around 50 of the 129 columns, depending on what the advertiser filled in.

| Field | Columns |
|---|---|
| Identity | `recordType`, `listingId`, `url`, `sourceSite`, `country`, `language`, `title`, `referenceCode`, `status`, `scrapedAt` |
| Price | `price`, `currency`, `pricePeriod`, `priceText`, `salePrice`, `rentPrice`, `pricePerM2`, `pricePerLandM2`, `maintenanceFee`, `sinkingFund`, `priceChange` |
| Location | `address`, `street`, `neighborhood`, `city`, `region`, `postalCode`, `latitude`, `longitude`, `addressPrecision` |
| Property | `operation`, `propertyType`, `bedrooms`, `bathrooms`, `areaBuilt`, `areaLand`, `floor`, `floors`, `facing`, `yearBuilt`, `parkingSpaces`, `furnished`, `condition`, `titleType`, `decoration`, `amenities`, `views`, `security`, `highlights` |
| Media | `imageUrl`, `images`, `imageCount`, `videoUrl`, `virtualTourUrl`, `hasVideo`, `hasVirtualTour`, `floorPlanUrls`, `brochureUrls` |
| Dates and flags | `publishedAt`, `updatedAt`, `daysOnMarket`, `ribbon`, `isFeatured` |
| Seller | `isPrivateSeller`, `agencyId`, `agencyName`, `agencyUrl`, `agencyLogoUrl`, `agencyWebsite`, and `agencyPhone` and `agencyEmail` on request |
| Market comparison | `marketScope`, `marketListings`, `marketMedianPrice`, `marketP20Price`, `marketP80Price`, `marketMedianPricePerM2`, `marketGrossYield`, `priceVsMarketPercent`, `similarListings` |
| Project rows | `projectId`, `projectName`, `constructionProgress`, `soldRate`, `downpaymentRatio`, `totalUnits`, `unitTypes`, `bedroomsFrom`, `bedroomsTo`, `areaFrom`, `areaTo`, `unitMix`, `availableUnits`, `paymentPlans` |
| Agency and developer rows | `isDeveloper`, `agentCount`, `awardCount`, `socialLinks`, `forSaleCount`, `forRentCount`, `soldCount`, `rentedCount` |
| Location rows | `locationId`, `locationLevel`, `parentLocation`, `salePriceRange`, `rentPriceRange`, `medianSalePrice`, `salePriceP20`, `salePriceP80`, `medianRent`, `medianPricePerM2`, `grossYield`, `saleByPropertyType`, `rentByPropertyType`, `subAreas`, `keyInformation`, `thingsToDo` |
| Optional | `raw` (site fields without a column of their own, on request) |

Fields the advertiser leaves out are missing from the row, never filled with placeholders. On 37 listings from 13 searches (2026-10-11), title, description, city, images and dates were filled on 100 percent of rows, price and GPS on 97 percent, bedrooms on 73 percent and built area on 57 percent. Private sellers have no agency name, and their names and phones are never output.

### 🧾 Cambodia property listing example: what does a real result look like?

A real listing row from a cloud run on 2026-10-11 (description, photo list and similar listings left out):

```json
{
  "imageUrl": "https://images.realestate.com.kh/listings/2026-08/1-copy_he8Vbae.jpeg",
  "recordType": "listing",
  "listingId": "267669",
  "url": "https://www.realestate.com.kh/buy/kep/2-bed-2-bath-house-267669/",
  "sourceSite": "realestate.com.kh",
  "country": "KH",
  "language": "en",
  "operation": "sale",
  "propertyType": "House",
  "title": "🏦House Available for Urgent Sale at a Special Price (Negotiable).",
  "price": 75000,
  "currency": "USD",
  "pricePeriod": "total",
  "priceText": "$75,000",
  "pricePerM2": 610,
  "address": "Kep",
  "city": "Kep",
  "region": "Kep",
  "latitude": 10.493343,
  "longitude": 104.3,
  "addressPrecision": "locality",
  "bedrooms": 2,
  "bathrooms": 2,
  "areaBuilt": 123,
  "areaLand": 50,
  "floor": 2,
  "titleType": "Hard Title",
  "imageCount": 6,
  "publishedAt": "2026-08-12T09:40:43.905Z",
  "updatedAt": "2026-08-13T04:45:59.341Z",
  "daysOnMarket": 59,
  "status": "current",
  "isPrivateSeller": true,
  "marketListings": 17,
  "marketMedianPrice": 375000,
  "marketP20Price": 75000,
  "marketP80Price": 615000,
  "priceVsMarketPercent": -80,
  "scrapedAt": "2026-10-11T08:33:43.303Z"
}
```

Prices are US dollars: sale prices are totals and rent prices are monthly, as `pricePeriod` states. `priceVsMarketPercent` of -80 means the ad is 80 percent below the median of its market.

### 🚀 How to scrape realestate.com.kh in 4 steps

1. Create a free account at [console.apify.com](https://console.apify.com) and open this Actor.
2. Choose a **Section** (properties for sale, for rent, new developments, boreys, agencies, developers or location profiles), type the **Locations** you want, one per line, and add any filters.
3. Set **Max items** and press Start. A 3-result run finishes in about 5 seconds.
4. Download the dataset as CSV, Excel, JSON or XML, or read it through the Apify API.

### 📈 Realestate.com.kh scraper vs other Apify Actors

| Feature | This Actor | sian.agency | haketa |
|---|---|---|---|
| Price per 1,000 rows (read 2026-10-11) | $20 cards, $46.67 with details | from $1.32, $3 full | from $2.50 |
| Sale and rent filters | 17 types, 15 filters | 13 types, price, bedrooms | Type, city, URLs |
| Projects, agencies, area stats | Yes, own row types | Not shown | Projects only |
| Only-new monitor mode | Yes | Not shown | Not shown |

Prices and features were read on 2026-10-11 from the public Store pages of [sian.agency](https://apify.com/sian.agency/realestate-kh-property-scraper) and [haketa](https://apify.com/haketa/realestate-com-kh-scraper); a rival lacks a feature here only if its page does not show it. A third Actor, mai_amm, mixes this site with Khmer24 from $2.00 per 1,000 results. At $20 per 1,000 cards this Actor is priced above all three, several times each of their rates. Pick it only if you need the market comparison, project rows, agency and area profiles or scheduled new-listing runs. For a plain one-off list of listings, a cheaper rival is the better buy.

### 💼 Realestate.com.kh scraper use cases

- **Investors and buyers**: rank apartments, villas and land by `pricePerM2` and `priceVsMarketPercent` to find ads far below their market median.
- **Agents and brokers**: watch new listings in Phnom Penh or Siem Reap with the only-new mode and feed them into your CRM.
- **Developers and analysts**: follow unit mix, sold rate, construction progress and payment plans of competing projects.
- **Researchers and lenders**: build price history by area from scheduled runs and location profile rows.

### 💵 How much does it cost? Pricing with worked examples

Pay per event, no monthly fee. Prices read live on 2026-10-11: property listing $0.02, full listing details $0.02667 (added when the listing page is opened, on by default), new development or borey $0.04, agency $0.02, developer $0.02, location profile $0.03333. Error rows are free.

| Run | Events | Cost |
|---|---|---|
| 100 Phnom Penh rentals with details | 100 x ($0.02 + $0.02667) | $4.67 |
| 1,000 sale cards only (details off) | 1,000 x $0.02 | $20.00 |
| 1,000 sale listings with details | 1,000 x $0.04667 | $46.67 |
| 50 projects with details | 50 x ($0.04 + $0.02667) | $3.33 |
| All 15 location profiles | 15 x $0.03333 | $0.50 |

Apify platform usage is separate; a 10,000-row cards-only search used about $0.0035 of it in tests. A monitor run with nothing new charges $0.

### ⚙️ Input

| Field | Type | What it does |
|---|---|---|
| `section` | select | sale, rent, new-developments, boreys, agencies, developers, location-profiles |
| `locations` | list | Places as in site URLs, such as phnom-penh or kep; empty means the whole country |
| `propertyTypes` | list | apartment, house, villa, land, commercial and 12 more |
| `minPrice`, `maxPrice` | integer | USD; monthly rent for rent searches |
| `minBedrooms`, `minBathrooms`, `minArea`, `maxArea` | integer | Room and area limits |
| `features` | list | pool, garden, gym, lift, fullyfurnished, airconditioning, balcony |
| `searchMode` | select | search with filters, or catalog from the site map |
| `scrapeDetails` | boolean | Open each listing page (default on, adds the detail event) |
| `onlyNew`, `stateKey` | boolean, text | Monitor mode: deliver only listings not seen before |
| `startUrls` | list | Paste site pages instead of using the fields above |
| `maxItems` | integer | Total rows to deliver; 0 means no limit |

Example input:

```json
{
  "section": "sale",
  "locations": ["phnom-penh", "siem-reap"],
  "propertyTypes": ["villa"],
  "minBedrooms": 4,
  "features": ["swimmingpool"],
  "scrapeDetails": true,
  "maxItems": 100
}
```

### 🔌 Realestate.com.kh scraper API, MCP and integrations

Run it from any language through the Apify API:

```bash
curl -X POST "https://api.apify.com/v2/acts/RecordsData~realestate-kh-scraper/runs?token=YOUR_TOKEN"   -H "Content-Type: application/json"   -d '{"section":"rent","locations":["phnom-penh"],"propertyTypes":["apartment"],"minBedrooms":2,"maxItems":50}'
```

Connect it to Make, Zapier, n8n, Google Sheets or Slack with the standard Apify integrations.

#### MCP for AI agents

Add the Apify MCP server to Claude, Cursor or any MCP client with `https://mcp.apify.com?tools=RecordsData/realestate-kh-scraper`. The agent then sees one tool, `RecordsData-slash-realestate-kh-scraper`, described as: scrape realestate.com.kh property listings, projects, agencies, developers and area statistics for Cambodia, with place, price, bedroom and feature filters.

Example agent prompt: "Find furnished 2-bedroom apartments for rent in Phnom Penh under 800 USD a month, newest first, 20 results, and tell me which are priced below their market median." The agent calls the tool with `section: rent`, `locations: ["phnom-penh"]`, `propertyTypes: ["apartment"]`, `minBedrooms: 2`, `features: ["fullyfurnished"]`, `maxPrice: 800`, `maxItems: 20`, then reads `priceVsMarketPercent` from the rows.

### ⚖️ Is it legal to scrape realestate.com.kh?

The Actor reads the public pages that realestate.com.kh serves to every visitor, without logging in, at a few requests at a time with short pauses, and it does not touch the site's private API paths. Listing data (prices, areas, locations, photos) is public advertising information. Names and phone numbers of private sellers and individual agents are never output, and phone numbers typed inside ad texts are removed. Agency and developer phone numbers and e-mails are business contacts and are returned only when you switch on **Include business contact details**. You are responsible for how you use the data, including local data protection rules.

### FAQ: Realestate.com.kh scraper questions and answers

**Does the realestate.com.kh scraper need a proxy or an account on the site?**
No. It needs no login, no API key and no browser. The site checks the connection of the client, so the Actor uses a browser-like HTTP client and, if the site ever answers with a check page, it switches to the Apify datacenter proxy on its own. You can also force the proxy in the Proxy configuration field.

**How many properties does realestate.com.kh list?**
On 2026-10-11 the default sale search held 9,187 homes and the default rent search 32,357, plus 63 new developments and 115 boreys in the project searches, and the site map lists 667 agencies, 903 developers and 15 location profiles. These numbers move every day.

**The site only serves 10,000 results per search. How do I get more?**
The Actor splits a search that has more than 10,000 matches into price bands taken from the site's own market data and reads each band separately, so a rent search for all of Phnom Penh (about 30,000 matches) is covered. Narrower searches by district, type or price are faster and cheaper.

**What is the difference between searching and the catalog mode?**
Search mode reads the site's search pages and supports every filter. Catalog mode reads the site map, newest first, and opens each listing page: it has no filters except the place, and it is the way to sweep everything or find the very latest ads.

**Why do some rows have a project name or an extra price?**
The portal mixes units of new developments into normal searches, and many ads are offered for both sale and rent. The row shows the price of the operation you searched, and the other price is in `salePrice` or `rentPrice`. Project cards come out as `project` rows with their price range and unit mix.

**Does it return sold or rented listings?**
No. The site does not serve sold or leased listings on its public pages, so the Actor cannot return them. It does return the counts of sold and rented properties that agency and location pages publish, in the `soldCount` and `rentedCount` columns, which help you judge how active an agency or area is.

**Does it give phone numbers of agents or owners?**
No for private sellers and individual agents: their names and phone numbers are never output, and numbers typed inside ad texts are removed. For agencies and developers, the public business phone and e-mail are returned only when you switch on **Include business contact details**. It is off by default.

**How do I get only the new listings every day?**
Turn on **Only new results**, give the monitor a label, and schedule the Actor. It remembers the ids it already returned for the same search in a store of your own account and delivers only listings it has not seen, so each run returns just the new ones.

**Which currency and language are used?**
Prices are always in US dollars, which is the currency of the site. The Language option switches titles, descriptions and labels to Khmer, Chinese, French, Thai, Japanese or Russian when the advertiser provided a translation. Ids and URLs do not change.

**How much does the realestate.com.kh scraper cost?**
It is pay per event: $0.02 per property listing plus $0.02667 when the listing page is opened, which is the default, so a full listing costs $0.04667 and 1,000 cost $46.67. With Open each listing page switched off, 1,000 cards cost $20. Projects cost $0.04, agencies and developers $0.02, location profiles $0.03333. Prices were read on 2026-10-11 and platform usage is billed separately by Apify.

**Which export formats are available?**
CSV, Excel, JSON, XML, HTML table and RSS from the Apify dataset page or the API, plus direct delivery to Google Sheets, Slack or a webhook.

**How many results do free users get?**
Free Apify accounts get a preview of up to 10 results per run, enough to check the fields and the format before you pay. Paid accounts can set Max items to any number, or 0 for no limit, and the Apify max charge per run still caps the spend.

**What happens if the site changes?**
When a run gets no data because the site is blocking or has changed, the Actor ends with a clear failure message and charges nothing. Write to contact.punkrecordsdata@gmail.com with the input you used and we look at it. Runs that deliver nothing because of a block or a layout change do not charge, so a broken site costs you nothing while it is being fixed.

### 🔎 Want more real estate and market data?

Browse the complete [RecordsData collection](https://apify.com/RecordsData) for more scrapers.

### 💬 Support

Questions, a missing field or a feature request: **contact.punkrecordsdata@gmail.com**

Last updated: 2026-10-11

> **⚠️ Disclaimer:** independent tool, not affiliated with realestate.com.kh. It collects only publicly available data.

# Actor input Schema

## `section` (type: `string`):

What to collect. Sale and rent return property rows, new developments and boreys return project rows, agencies and developers return company rows, location profiles return market statistics per area. Ignored when you paste URLs in Start URLs.

## `locations` (type: `array`):

Places to cover, one per line, as they appear in realestate.com.kh URLs: "phnom-penh", "siem-reap", "sihanoukville", "kep", "kampot" or a district such as "bkk-1" or "sen-sok". Names with spaces and capitals are fine. Leave empty for the whole country. For location profiles, the profiles whose path contains the place are returned.

## `propertyTypes` (type: `array`):

Only for sale and rent. One search per type. Leave empty for the site default (all homes). Commercial covers every commercial type, the other commercial types narrow it.

## `searchMode` (type: `string`):

Search reads the pages of the site search with every filter below (the site serves up to 10,000 results per query; larger searches are split by price automatically). Catalog reads the site map newest first and opens every listing page, which has no filters except the place; use it to sweep everything or to find the newest listings.

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

Order of the results. Newest first is the default so that Max items returns the most recent listings and the only-new mode can stop early.

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

Lowest price in US dollars. For rent this is the monthly rent. 0 means no limit.

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

Highest price in US dollars. For rent this is the monthly rent. 0 means no limit.

## `minBedrooms` (type: `integer`):

Only properties with at least this many bedrooms. 0 means no limit.

## `minBathrooms` (type: `integer`):

Only properties with at least this many bathrooms. 0 means no limit.

## `minArea` (type: `integer`):

Only properties with at least this built area in square meters. 0 means no limit.

## `maxArea` (type: `integer`):

Only properties with at most this built area in square meters. 0 means no limit.

## `minLandArea` (type: `integer`):

Only properties on at least this much land in square meters. 0 means no limit.

## `minYearBuilt` (type: `integer`):

Only properties built in this year or later, for example 2020. 0 means no limit.

## `minParking` (type: `integer`):

Only properties with at least this many parking spaces. 0 means no limit.

## `features` (type: `array`):

Only properties that have all the selected features.

## `dealTag` (type: `string`):

Only listings the advertiser marked with this tag.

## `projectHighlight` (type: `string`):

Only for new developments and boreys: projects that carry this highlight.

## `sellerType` (type: `string`):

Agency listings only, private sellers only, or both. Private seller rows never contain names or phone numbers.

## `keyword` (type: `string`):

Free text matched by the site search, for example "riverside" or "pool". Leave empty for no keyword.

## `publishedWithinDays` (type: `integer`):

Only listings published in the last N days. With newest first sorting the scan stops as soon as older pages begin. 0 means no limit.

## `language` (type: `string`):

Language of titles, descriptions and labels. Prices stay in US dollars and ids and URLs do not change.

## `scrapeDetails` (type: `boolean`):

Open the page of every listing or project for the full description, all photos, amenities, floor plans, unit mix, payment plans and market comparison. Switch off for the cheaper search card data only.

## `includeAgencyProfiles` (type: `boolean`):

Also output one profile row for each agency or developer behind the listings (counted in Max items).

## `includeContactDetails` (type: `boolean`):

Add the public phone number and e-mail of agencies and developers. Private sellers are never included and phone numbers typed into listing texts are removed unless this is on.

## `includeRaw` (type: `boolean`):

Add a raw column with the site fields that have no column of their own (tags, flags, badges).

## `onlyNew` (type: `boolean`):

Skip listings delivered by an earlier run of the same search and charge only for new ones. The list of seen ids is kept in a named store of your account.

## `stateKey` (type: `string`):

Optional label to keep separate monitors for the same filters, for example "phnom-penh-weekly".

## `resetSeen` (type: `boolean`):

Forget what earlier runs delivered for this search before starting.

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

Paste realestate.com.kh pages instead of using the section and locations: search pages (/buy/..., /rent/..., /new-developments/search/, /boreys/search/, with their filters), listing and project pages, agency or developer pages (/offices/...) and location profile pages (/phnom-penh/).

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

Maximum number of rows to deliver in total (listings, projects, agencies, developers and locations). 0 means no limit; the Apify max charge per run still applies. Free plan runs are limited to 10 rows.

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

Optional. The site answers plain requests from Apify servers, and the actor switches to the Apify datacenter proxy by itself if it meets a browser check. Switch it on only to force a proxy from the first request.

## Actor input object example

```json
{
  "section": "sale",
  "locations": [
    "phnom-penh"
  ],
  "propertyTypes": [],
  "searchMode": "search",
  "sortBy": "date-desc",
  "minPrice": 0,
  "maxPrice": 0,
  "minBedrooms": 0,
  "minBathrooms": 0,
  "minArea": 0,
  "maxArea": 0,
  "minLandArea": 0,
  "minYearBuilt": 0,
  "minParking": 0,
  "features": [],
  "dealTag": "any",
  "projectHighlight": "any",
  "sellerType": "any",
  "keyword": "",
  "publishedWithinDays": 0,
  "language": "en",
  "scrapeDetails": true,
  "includeAgencyProfiles": false,
  "includeContactDetails": false,
  "includeRaw": false,
  "onlyNew": false,
  "stateKey": "",
  "resetSeen": false,
  "startUrls": [],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Key fields per record: listings, projects, agencies, developers and locations

## `fullData` (type: `string`):

Complete dataset with all fields

# 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 = {
    "locations": [
        "phnom-penh"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("recordsdata/realestate-kh-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 = { "locations": ["phnom-penh"] }

# Run the Actor and wait for it to finish
run = client.actor("recordsdata/realestate-kh-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 '{
  "locations": [
    "phnom-penh"
  ]
}' |
apify call recordsdata/realestate-kh-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,recordsdata/realestate-kh-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/Bic6fH0X64sjOVbEp/builds/r1dc7ct6Ii02BwKRB/openapi.json
