# Complete Guide: How to Pull Czech Flats from Sreality Using Python

This guide shows how to extract Czech property listings from [sreality.cz](http://sreality.cz) with Python: flats for sale or rent, searched by category, region and price, returned as one structured row per listing. The tool is the **Sreality Scraper** Apify Actor (`reventadata/sreality-scraper`), and you drive it from Python with the official Apify API client.

By the end you will know which inputs the Actor accepts, how they shape the search, what a row contains, where the limits are, and how to repeat a search on a schedule. The prerequisites are minimal: Python 3.11 or newer, an Apify account and an API token. Every sample row in this guide is copied from one run I made on 18 November 2026 with a cap of 10 listings, and no value in it was edited. Each section builds on the one before it, so you can read the guide from top to bottom or jump to the part you need.

---

## TL;DR

In this tutorial you will run `reventadata/sreality-scraper` from Python with `apify-client`, pass a search (`offerType`, `category`, `maxItems` and `maxPages`), and read back rows with price in CZK, layout, city, area and agency. The script prints one summary line per listing.

---

## Prerequisites and setup

You need three things before the first run:

1. **Python 3.11 or newer** with `pip`.
2. A free **Apify account**, which you can create with an email address or a GitHub login.
3. Your **API token**, which you find in Apify Console.

Install the client and export the token in the same terminal you use to run the script:

```bash
pip install -U "apify-client~=3.0"
export APIFY_API_TOKEN="your_apify_token_here"
```

If you have not used a terminal before, those two lines are the only commands you type before the script. Nothing else is needed on your side. The Actor does the fetching, and the script only starts it and reads the results.

---

## Understanding Sreality Scraper

Sreality is the Czech real-estate portal, and the Actor reads its public listings. Each listing it returns carries the fields the site's own search results publish: title, asking price in CZK, price per square metre, category and layout, city, city part, district, region, street, coordinates, photo count and the agency's Sreality id.

Optional switches add more. With `fetchDetails` on, each listing also gets its full description, usable area, building data, and the agency and broker contact the listing publishes. That switch makes the run slower, so it is off by default. The Actor returns each listing id once, even when the site's total changes during a run, so the rows do not repeat. The row fields are listed in full in the Understanding your data section below.

The Actor has two enum inputs. `offerType` takes `sale` or `rent`, and `category` takes `flats`, `houses`, `land`, `commercial` or `other`. A value outside either list is refused before the run starts. Both default to `sale` and `flats`.

---

## Step-by-step walkthrough

### Step 1: Open the Actor

Open the Sreality Scraper page on Apify Store. This walkthrough calls the Actor from Python, so the only name you need is `reventadata/sreality-scraper`.

### Step 2: Choose the input

The input is a JSON object with the field names below. The one used for the run in this guide is shown after the list:

- `offerType`, `category`: the enum inputs described above.
- `regionId`: optional. Sreality's region (kraj) id. Every row carries its `regionId`.
- `priceFrom` and `priceTo`: optional price limits in CZK.
- `fetchDetails`: optional switch for the detail fields.
- `maxItems`: a cap on the rows pushed. The default is 1000.
- `maxPages`: an optional cap on pages of up to 100 listings each.

The proxy is handled for you, so there is nothing to set for it.

```json
{
    "offerType": "sale",
    "category": "flats",
    "maxItems": 10,
    "maxPages": 1
}
```

### Step 3: Run the Actor from Python

This script starts the Actor, waits for it to finish, reads the dataset and prints one summary line per listing:

```python
import os
from apify_client import ApifyClient

# 1. Initialise the client with your token from the environment
client = ApifyClient(os.environ["APIFY_API_TOKEN"])

# 2. Describe the search: flats for sale, ten listings, one page
run_input = {
    "offerType": "sale",
    "category": "flats",
    "maxItems": 10,
    "maxPages": 1,
}

# 3. Start the Actor and wait for it to finish
run = client.actor("reventadata/sreality-scraper").call(run_input=run_input)
if run is None or run.status != "SUCCEEDED":
    status = run.status if run else "unknown"
    raise SystemExit(f"Run did not succeed (status: {status}).")

# 4. Read the rows from the run's default dataset
items = client.dataset(run.default_dataset_id).list_items().items
print(f"Retrieved {len(items)} listings.\n")

# 5. Print one line per listing: title and price, then layout, price per m2 and photos
for item in items:
    print(f"{item.get('title')} | {item.get('price')} CZK | {item.get('city')}")
    print(f"  {item.get('subcategory')}, price per m2: {item.get('priceCzkPerM2')} CZK, photos: {item.get('imageCount')}")
```

### Step 4: Read one row

One row from the run's dataset is shown below. The detail columns that are null in this run are left out of the sample, and nothing else is cut.

```json
{
  "id": "2106564684",
  "url": "https://www.sreality.cz/detail/prodej/byt/2+1/x/2106564684",
  "title": "Prodej bytu 3+kk 62 m²",
  "offerType": "Prodej",
  "category": "Byty",
  "subcategory": "3+kk",
  "price": 4490000,
  "currency": "CZK",
  "priceCzk": 4490000,
  "priceUnit": "za nemovitost",
  "priceCzkPerM2": 72419,
  "areaFromTitleM2": 62,
  "city": "Uherský Brod",
  "cityPart": "Uherský Brod",
  "district": "Uherské Hradiště",
  "region": "Zlínský kraj",
  "regionId": 9,
  "street": "Horní Valy",
  "latitude": 49.02711769840923,
  "longitude": 17.649271503099705,
  "agencySlug": "g2-reality-s-r-o",
  "agencyId": 13566,
  "sellerUserId": 67719,
  "imageUrl": "https://d18-a.sdn.cz/d_18/c_img_qD_E/kQMlcCt5zmChFvGnEjHRPNLW/6962.png",
  "imageCount": 20,
  "hasVideo": false,
  "hasMatterport": false,
  "isDiscounted": false,
  "detailFetched": false
}
```

---

## Working with the API

The script above uses the official Apify API client for Python, and the client does two things for you. `call` starts the Actor with the input you pass and waits until the run reaches a final status. `dataset(...).list_items()` then reads the rows of the run's default dataset as Python dictionaries.

The script reads the rows through the run's `default_dataset_id`, so the rows come from that run and no other. The token is read from the environment variable `APIFY_API_TOKEN`, so it never appears in the script. Keep it out of version control and out of screenshots.

The run's status is the first thing to check. The script stops with a message when the status is not `SUCCEEDED`. A run that found no listings still succeeds, and its dataset is empty, so check the count as well as the status before you trust a result. When something looks wrong, print `run.status` and `len(items)` on their own, which shows whether the run or the read is the step that went wrong.

Each item the client returns is a plain dictionary. Missing values are `None` in Python, which is the `null` you see in the JSON above. Read them with `.get()`, as the script does, so a missing key never stops the loop.

---

## Advanced usage patterns

Sreality serves only the first 10,000 listings of any one search. To reach the rest of a larger search, split it. Run one search per region with `regionId`, or per price band with `priceFrom` and `priceTo`, and keep the rows of each run separate. The run logs a warning on its first page when the search matches more listings than it serves, so you can tell when a split is needed. Each split is a separate run, so each one has its own status and its own count to check.

To repeat a search without code, save its input as an Apify task and attach a schedule to the task. The schedule then runs the task at the times you set.

Turn `fetchDetails` on for a run that needs descriptions and contacts. It makes the run slower, so leave it off for a run that only needs prices and layouts.

Keep the input of each split in its own saved task, so you can run one part again without the others. When you compare listings of different sizes, use `priceCzkPerM2` rather than `price`. The per-square-metre value is set against the area in the title, so a 62 m² flat and a 95 m² flat can be read side by side.

---

## Understanding your data

Each row is one listing. Read the price fields together. In this run `currency` is `CZK` on all 10 rows, and `price` equals `priceCzk` on all 10. `priceCzkPerM2` equals `price` divided by `areaFromTitleM2`, rounded to a whole number, on all 10 rows.

`areaFromTitleM2` is the area number read from the listing title, such as 62 in "Prodej bytu 3+kk 62 m²". In this run every row has it. `priceUnit` reads "za nemovitost" on all 10 rows, which is Czech for "per property".

`imageCount` runs from 15 to 37 in this run, and `hasVideo` is `true` on 4 of the 10 rows. `hasMatterport` and `isDiscounted` are `false` on every row.

All 25 detail columns are null on all 10 rows in this run: the description, usable area, building and energy fields, and the agency and broker contact. `detailFetched` is `false` on each row. The columns are empty in this run only, and the schema lists them in full.

---

## Troubleshooting guide

**The script stops with "Run did not succeed".** The message prints the status the run reached. Open the run's log for the Actor's status message.

**The run is refused before it starts.** This happens when `offerType` or `category` holds a value outside its list. Fix the value and run again. The Actor does not start on a bad enum value.

**The run succeeds with zero rows.** The site answered and nothing matched. The status message says so. Widen the search, for example by removing a price limit or a region, and run again.

**The run is marked failed and no rows come back.** The Actor could not load any page, and its status message says that. Run it again with a small `maxItems`.

**A field is missing from your rows.** Every field is present on every row, with `null` where there is no value. A `null` in an optional column such as `description` is normal when `fetchDetails` is off.

**The count is lower than you expected.** `maxItems` is a hard cap, and `maxPages` limits the pages read. Check both values in your input before you read the count as a result.

---

## Best practices

Keep `maxItems` and `maxPages` small while you test, and raise them once the output looks right. Save the input you used next to the rows it produced, so you can repeat the run.

Treat `null` as no value, and never as zero. A price the site sends as zero comes out as `null` in this Actor.

Check the status and the row count together. A succeeded run with zero rows is an answer, not a failure, and a failed run is never a result.

Split large searches with `regionId` and price ranges rather than raising `maxItems` past what you need. Sreality serves only the first 10,000 listings of each search, so smaller searches reach more of the listings.

---

## Conclusion and next steps

You now have a Python script that starts Sreality Scraper, waits for the run, reads its rows and prints one line per flat. You know which fields hold the price, the price per square metre and the area, and you know which columns stay empty unless `fetchDetails` is on.

Next, change `regionId` or the price range to compare towns, or set `category` to `houses` for a second dataset. Then run the same script on each input and compare the rows.

For current pricing and details, see the [Store page](https://apify.com/reventadata/sreality-scraper).
