# BG Rentals Properties and Details Scraper (`realestateapi/bg-rentals-properties-and-details-scraper`) Actor

BG Rentals Properties and Details Scraper — Extract bounded imot.bg rental fields only when applicable data-reuse authorization is confirmed; default runs skip all source requests.

- **URL**: https://apify.com/realestateapi/bg-rentals-properties-and-details-scraper.md
- **Developed by:** [Real Estate API](https://apify.com/realestateapi) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## BG Rentals Properties and Details Scraper

This Actor extracts bounded rental-listing fields from [imot.bg](https://www.imot.bg/obiavi/naemi), one of Bulgaria's real-estate listing sites. It reads the site's Windows-1251 listing HTML, follows rental pagination, and can enrich listing fields from a public detail page when you already have applicable data-reuse authorization.

The Actor returns one normalized `listing` record per unique advertisement. Records can include the listing ID and URL, title, property type, location, rent and currency, area, floor, advertised features, listing status, images, description, views, and update text when the source supplies them. New records omit personal contact details, seller identity, and raw page text. Only records with an official listing URL, identity, title, and at least one property-specific fact enter the dataset. Diagnostics and failure details are kept in the `OUTPUT` key-value summary. The dataset schema includes an optional `browserVerification` object for dated, manually checked public-page observations; it does not change the historical Actor `scrapedAt` value.

### Input

The checked-in [`INPUT.json`](./INPUT.json) is a small local verification input. The main input fields are:

- `start_urls`: HTTPS `imot.bg` rental collection, city/region, pagination, or detail URLs.
- `max_items`: maximum unique listing records across all sources.
- `max_list_pages_per_source`: bounded public pagination per source.
- `max_detail_pages` and `include_details`: detail-page enrichment controls.
- `data_use_authorized`: default-false operator attestation that you already hold applicable rights to collect and reuse the requested data.
- `request_delay_ms` and `request_timeout_seconds`: polite request and timeout controls.

The default input uses `https://www.imot.bg/obiavi/naemi`, but makes zero source requests because `data_use_authorized` defaults to `false`. Set it to `true` only if you already hold applicable permission; the checkbox is an operator attestation and does not grant permission. The crawler deduplicates by the stable advertisement ID and does not collect seller contact information, submit contact forms, log in, call private endpoints, fetch image/CDN resources, or use a proxy.

### Local development

```bash
npm test
npm run lint
apify validate-schema
npm run validate:storage
```

Do not use `--purge` for local checks: it deletes saved Actor storage. The saved datasets are historical snapshots, and the current browser comparison is documented separately in [`BROWSER_REVIEW.md`](./BROWSER_REVIEW.md).

The implementation is split into configuration/input normalization, an HTTPS transport with redirect validation, HTML/JSON-LD parsing, record shaping, crawling, run-status classification, and the Apify lifecycle entrypoint. `OUTPUT` stores a bounded run summary and diagnostic details; the dataset contains normalized listing records only.

Run summaries use `SUCCEEDED` / `COMPLETED` for clean bounded or empty results, `SUCCEEDED` / `PARTIAL` when at least one listing is saved before a later failure, and `FAILED` / `FAILED` when failures leave no saved listing. The native exit code is 0 for successful and partial runs, and 1 for failures with no saved listings.

### Source access and data use

The General Terms page was reviewed in Chrome on 2026-09-30. The visible text contained no explicit automated-collection restriction, but this review did not find a specific data-reuse license. Public visibility is not permission for bulk reuse, so the Actor skips by default. Only HTTPS pages on `imot.bg` and `www.imot.bg` are accepted, and redirect destinations are validated against the same allowlist. The Actor does not bypass authentication, paywalls, CAPTCHAs, rate limits, or other access controls.

### Access boundary

This review sampled only public rendered pages. It did not submit contact forms, log in, open contact-information controls, or store personal contact details. New runs omit phone numbers, seller names, and raw page text. Historical local snapshots are preserved as historical data and can contain legacy fields that the current runtime no longer emits.

### Dependency security and HTTP caching

The locked dependencies require Node.js 20.18.1 or later. Implemented Actor Cloud builds use Node.js 22.

HTTP response caching is disabled throughout the SDK dependency graph by a project-owned, tested non-caching policy replacement. Responses are always fetched afresh; stale cached responses and serialized cache headers cannot be reused. This replaces the vulnerable package rather than suppressing its advisory. The locked FTP client is 6.2.1; the SDK keeps its supported interface.

The original unpatched-cache advisory is [GHSA-ch52-4w7c-c8xp](https://github.com/advisories/GHSA-ch52-4w7c-c8xp). The FTP patch is documented in [GHSA-c475-qrg2-pj4r](https://github.com/advisories/GHSA-c475-qrg2-pj4r). Project tests include actual localhost HTTP requests with a shared cache and distinct user headers. These tests make no target-site requests and do not qualify extraction.

# Actor input Schema

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

HTTPS imot.bg rental collection, city/region, pagination, or detail URLs. The default collection is the public all-rentals page.

## `max_items` (type: `integer`):

Maximum unique listing records across all supplied sources.

## `max_list_pages_per_source` (type: `integer`):

Maximum pagination pages followed from each start URL.

## `max_detail_pages` (type: `integer`):

Maximum public listing detail pages fetched for enrichment. Set to zero for list-only output.

## `include_details` (type: `boolean`):

Fetch each listing's public detail page while respecting max_detail_pages.

## `data_use_authorized` (type: `boolean`):

Required before any source request. Set true only if you already hold permission to collect and reuse the requested imot.bg data. This operator attestation does not grant permission. The current review found no specific data-reuse license.

## `request_delay_ms` (type: `integer`):

Polite delay before each public page request.

## `request_timeout_seconds` (type: `integer`):

Timeout for each public HTML request.

## Actor input object example

```json
{
  "start_urls": [
    "https://www.imot.bg/obiavi/naemi"
  ],
  "max_items": 25,
  "max_list_pages_per_source": 2,
  "max_detail_pages": 25,
  "include_details": true,
  "data_use_authorized": false,
  "request_delay_ms": 250,
  "request_timeout_seconds": 30
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("realestateapi/bg-rentals-properties-and-details-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("realestateapi/bg-rentals-properties-and-details-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 '{}' |
apify call realestateapi/bg-rentals-properties-and-details-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,realestateapi/bg-rentals-properties-and-details-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/HOL9SXmpfWnUt9Rcj/builds/j0fNg0uzaFbRljPUh/openapi.json
