# Kijiji.ca Apartments & Condos Scraper (Canada) (`stone_jadex/kijiji-ca-apartments-scraper`) Actor

Public Kijiji.ca long-term rental (apartments-condos) listings from search results: price (CAD), beds/baths, address, landlord/broker when public, amenities, photos, and optional detail page. No start fee.

- **URL**: https://apify.com/stone_jadex/kijiji-ca-apartments-scraper.md
- **Developed by:** [Stone Jade](https://apify.com/stone_jadex) (community)
- **Categories:** Real estate
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 list-tier listings

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## Kijiji Canada Apartments Scraper

Extract structured Canadian apartment and condo rental listings from public **Kijiji.ca** `apartments-condos` search and listing pages. Collect asking rent in CAD, bedrooms, bathrooms, square footage, street/city address, neighbourhood, amenities, photo URLs, coordinates, and public landlord or broker details into clean JSON, CSV, or Excel datasets without copying listings by hand.

Built for speed and low memory footprint (256 MB default container), the Actor reads Kijiji's embedded `__NEXT_DATA__` Apollo (`RealEstateListing`) JSON payload directly from public HTML pages—with an automatic URL fallback—and drops raw HTML immediately after parsing.

### Overview and use cases

- **Targeted Canadian rental coverage**: Focuses specifically on Kijiji.ca long-term rentals (`/b-apartments-condos/...`, category `37`), defaulting to Ontario (`/b-apartments-condos/ontario/c37l9004`) when `startUrls` is omitted, or accepting any Kijiji.ca `apartments-condos` province/city search or direct `/v-apartments-condos/.../{id}` listing URL.
- **Structured `__NEXT_DATA__` / Apollo parsing**: Normalizes Kijiji cent-denominated prices to CAD dollars (`169000` -> `1690`), decodes tenths-encoded bathroom attributes (`15` -> `1.5`), resolves neighbourhood references, maps boolean amenity flags, and records both `page` and `position`.
- **Two collection tiers (`listing` and `listing-detail`)**: Run in fast list-only mode (`scrapeDetails: false`, ~40–46 listings per search page) or enable `scrapeDetails: true` to fetch each listing page for full descriptions, richer amenities, availability dates, and public business contact numbers.
- **Privacy-first contact handling**: Public property-management and broker phone numbers and emails published on the listing are retained, while purely private owner (`Ownr` / `FSBO` / unknown seller) phone numbers and emails are stripped (`phones: []`, `emails: []`).
- **Built-in resilience and transparent diagnostics**: Enforces minimum request pacing (`>= 1200 ms`), deduplicates ads within a run (`duplicatesSkipped`), backs off cleanly on HTTP `403`/`412`/`429` or Cloudflare challenges, caps optional fallback residential proxy bandwidth at 5 MB per run, and writes a complete `OUTPUT` run summary plus an uncharged `run-notice` record if a run stops early.

#### Common use cases

- **Rental market benchmarking**: Track monthly CAD asking rents across Ontario, Alberta, British Columbia, and other Canadian provinces by bedroom count, unit type (`Apartment`, `Condo`, `Basement`), and neighbourhood.
- **Relocation & corporate housing shortlists**: Compare furnished vs. unfurnished inventory, square footage, included utilities (`Heat`, `Hydro`, `Water`), and pet-friendly or laundry amenities across target postal areas.
- **Property management & brokerage research**: Monitor competitor supply, featured/top-ad placement, and publicly listed leasing office contacts across regional `apartments-condos` feeds.
- **Automated downstream pipelines**: Export datasets via the Apify API or `ApifyClient` SDK directly into spreadsheets, BI dashboards, PostgreSQL, or analytics notebooks.

### Input parameters and JSON examples

Configure runs visually in the Apify Console using four grouped input sections (**Search & Target URLs**, **Limits & Detail Enrichment**, **Pacing & Runtime**, and **Proxy Configuration**) or pass JSON directly via the API.

| Parameter | Type | Default / Prefill | Constraints | Description |
| --- | --- | --- | --- | --- |
| `startUrls` | `array` | Prefill: Ontario search (`c37l9004`) | Must be `kijiji.ca` `/b-apartments-condos/...` or `/v-apartments-condos/.../{id}` | Optional array of URL strings or `{ "url": "..." }` objects. Empty input defaults to Ontario apartments-condos (`https://www.kijiji.ca/b-apartments-condos/ontario/c37l9004`). Non-apartments Kijiji verticals (cars, jobs, etc.) are rejected before any charge. |
| `maxItems` | `integer` | `50` / Prefill: `50` | `1` – `2000` | Maximum number of unique listings to store and charge in the dataset. Values above `2000` are clamped to `2000`. |
| `maxPages` | `integer` | `null` (unlimited) | `1` – `2000` | Optional limit on search result pages fetched per seed URL. Each search page typically contains ~40–46 Apollo listings. |
| `startPage` | `integer` | `1` / Prefill: `1` | `1` – `2000` | First search page to fetch when a search URL does not already include `/page-N/` or `?page=N`. |
| `scrapeDetails` | `boolean` | `false` / Prefill: `false` | Also accepts alias `includeDetails` | When `true`, opens each individual listing page to add full descriptions, enriched amenities, and public landlord/broker contacts. Charged as `listing-detail` instead of `listing`. If a detail fetch fails, the list row is preserved with `detailError` and charged as `listing`. |
| `requestDelayMs` | `integer` | `1200` / Prefill: `1200` | `>= 1200` (alias `requestIntervalMs`) | Minimum delay in milliseconds between request starts across all in-flight workers. A `Crawl-delay` directive in `robots.txt` can raise this interval further. |
| `concurrency` | `integer` | `1` / Prefill: `1` | `1` – `3` | Maximum concurrent page requests. Rows are still emitted in page order while respecting `requestDelayMs`. |
| `maxRunSeconds` | `integer` | `3600` / Prefill: `3600` | `30` – `86400` | Soft runtime deadline in seconds; stops cleanly before the earlier of `maxRunSeconds` and `ACTOR_TIMEOUT_AT - 20s`, writing `OUTPUT` and a `run-notice` if truncated. |
| `proxyConfiguration` | `object` | `{ "useApifyProxy": false }` | Apify Proxy config object | Direct connection is used by default. Residential proxy usage should only be configured with `useProxyFallback: true` and is hard-capped at `5 MB` per run. |
| `useProxyFallback` | `boolean` | `false` | Boolean | When `true` and a proxy is configured, requests start direct and switch to the configured proxy only after repeated HTTP `403` or `429` responses. |
| `allowDetailOnResidential` | `boolean` | `false` | Boolean | When a residential proxy group is configured, individual detail-page requests stay direct unless this option is explicitly enabled. |

#### Input examples

##### Example 1: Default Ontario list-only crawl (fast, low-cost)

```json
{
  "startUrls": [
    {
      "url": "https://www.kijiji.ca/b-apartments-condos/ontario/c37l9004"
    }
  ],
  "maxItems": 100,
  "maxPages": 5,
  "startPage": 1,
  "scrapeDetails": false,
  "requestDelayMs": 1200,
  "concurrency": 1,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

##### Example 2: Alberta search + direct listing URL with detail enrichment and proxy fallback

```json
{
  "startUrls": [
    {
      "url": "https://www.kijiji.ca/b-apartments-condos/alberta/c37l9003"
    },
    {
      "url": "https://www.kijiji.ca/v-apartments-condos/st-catharines/rare-loft-st-catharines-loft-one-bedroom/1745171670"
    }
  ],
  "maxItems": 50,
  "scrapeDetails": true,
  "requestDelayMs": 1500,
  "concurrency": 2,
  "maxRunSeconds": 1800,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"]
  },
  "useProxyFallback": true,
  "allowDetailOnResidential": false
}
```

### Output example and dataset schema reference

Each item written to the default dataset represents one unique Kijiji.ca `apartments-condos` listing (normalized against `.actor/dataset_schema.json`). When a run stops early due to `maxItems`, `max-charge-reached`, `run-time-limit`, `proxy-budget`, `cloudflare-challenge`, `empty-page`, or `errors`, a single uncharged summary record with `recordType: "run-notice"` is appended at the end of the dataset.

#### Illustrative JSON output

##### Listing record (`tier: "list"` example matching `dataset_schema.json`)

```json
{
  "adId": "1745171670",
  "title": "Rare Loft!  St. Catharines Loft One Bedroom",
  "price": 1690,
  "currency": "CAD",
  "pricePeriod": "month",
  "priceRaw": "$1,690",
  "beds": 1,
  "baths": 1,
  "address": "St. Catharines, ON L2R 2C7",
  "location": "St. Catharines, ON L2R 2C7",
  "neighbourhood": "The Haig",
  "unitType": "apartment",
  "categoryId": "37",
  "landlord": "Owner",
  "landlordId": "1001684937",
  "isPrivateOwner": true,
  "forRentBy": "Owner",
  "phones": [],
  "emails": [],
  "amenities": [
    "Yard",
    "Laundry (In Building)",
    "Fridge / Freezer",
    "Water",
    "Air Conditioning",
    "Storage Space"
  ],
  "areaSqft": 750,
  "furnished": false,
  "dateAvailable": "2026-11-01T00:00:00Z",
  "photos": [
    "https://media.kijiji.ca/api/v1/ca-prod-fsbo-ads/images/8b/8b730ee5-f5d0-49f8-b4f2-9a1a10f20d9f?rule=kijijica-200-jpg"
  ],
  "description": "1 Bedroom Loft Apartment! Available Nov 1 or Dec 1 . Located near downtown in well maintained low rise building.",
  "url": "https://www.kijiji.ca/v-apartments-condos/st-catharines/rare-loft-st-catharines-loft-one-bedroom/1745171670",
  "postedDate": "2026-10-22T17:44:24.000Z",
  "lat": 43.16378,
  "lon": -79.25877,
  "featured": true,
  "status": null,
  "page": 1,
  "position": 1,
  "listUrl": "https://www.kijiji.ca/b-apartments-condos/ontario/c37l9004",
  "tier": "list",
  "scrapedAt": "2026-11-21T00:00:00.000Z"
}
```

##### Truncation notice record (uncharged, emitted only on truncated runs)

```json
{
  "recordType": "run-notice",
  "truncatedAfter": 50,
  "reason": "maxItems"
}
```

#### Dataset fields reference

Every field defined in `.actor/dataset_schema.json` is listed below. Fields omitted by the source listing are stored as `null` (or `[]` for array fields).

| Field | Type | Description |
| --- | --- | --- |
| `adId` | `string \| null` | Stable Kijiji advert identifier as a string (e.g. `"1745171670"`). |
| `title` | `string \| null` | Listing headline as published on Kijiji. |
| `price` | `number \| null` | Asking rent in CAD after converting Kijiji's cent-based `price.amount` to dollars. |
| `currency` | `string \| null` | Currency code published with the price; defaults to `"CAD"` when omitted. |
| `pricePeriod` | `string \| null` | Rent period reported for the price (typically `"month"`). |
| `priceRaw` | `string \| null` | Formatted price string derived from the source amount (e.g. `"$1,690"`). |
| `beds` | `number \| null` | Number of bedrooms when published (`0` for bachelor/studio where reported). |
| `baths` | `number \| null` | Number of bathrooms, decoded from display values or tenths canonical values (e.g. `15` -> `1.5`). |
| `address` | `string \| null` | Street address or city/province/postal label when published. |
| `location` | `string \| null` | Full address when available, otherwise combined city and neighbourhood labels. |
| `neighbourhood` | `string \| null` | Resolved neighbourhood name from Apollo `neighbourhoodInfo` when published. |
| `unitType` | `string \| null` | Unit type label from listing attributes (e.g. `"Apartment"`, `"Condo"`). |
| `categoryId` | `string \| null` | Kijiji category identifier (`"37"` for `apartments-condos`). |
| `landlord` | `string \| null` | Public landlord or broker profile name, or `"Owner"` / `"Professional"` fallback label. |
| `landlordId` | `string \| null` | Public Kijiji poster identifier when published. |
| `isPrivateOwner` | `boolean \| null` | `true` for owner/FSBO or unknown sellers (defaulting private for contact protection); `false` for `reprofessional` / broker listings. |
| `forRentBy` | `string \| null` | Poster classification label (`"Owner"` or `"Professional"`). |
| `phones` | `string[] \| null` | Public business phone numbers for non-private landlords/brokers; always `[]` for private owners. |
| `emails` | `string[] \| null` | Public business emails extracted for non-private landlords/brokers; always `[]` for private owners. |
| `amenities` | `string[] \| null` | List of amenities marked `"yes"` / `"1"` (e.g. `"Balcony"`, `"Dishwasher"`, `"Heat"`, `"Hydro"`, `"Pet Friendly"`). |
| `areaSqft` | `number \| null` | Living area in square feet when published. |
| `furnished` | `boolean \| null` | `true` if furnished, `false` if unfurnished, or `null` when omitted. |
| `dateAvailable` | `string \| null` | Move-in or availability date string when published. |
| `photos` | `string[] \| null` | Public image URLs from `listing.imageUrls`. |
| `description` | `string \| null` | Listing description text (truncated snippet on list cards unless `scrapeDetails: true` fetches the full detail page). |
| `url` | `string \| null` | Canonical public listing URL (`https://www.kijiji.ca/v-apartments-condos/.../{adId}`). |
| `postedDate` | `string \| null` | Activation or sorting timestamp published by Kijiji. |
| `lat` | `number \| null` | Geographic latitude when published. |
| `lon` | `number \| null` | Geographic longitude when published. |
| `featured` | `boolean \| null` | `true` when flagged as a top ad (`flags.topAd`), `false` otherwise, or `null` if omitted. |
| `status` | `string \| null` | Listing status text when published (e.g. `"ACTIVE"`). |
| `page` | `integer \| null` | 1-based search page number for list-discovered rows; `null` for direct detail seeds. |
| `position` | `integer \| null` | 1-based position on the parsed search results page. |
| `listUrl` | `string \| null` | Search URL or direct seed URL from which the listing was collected. |
| `tier` | `string \| null` | `"list"` for search-card rows; `"detail"` for rows enriched or seeded from a detail page. |
| `scrapedAt` | `string \| null` | ISO 8601 timestamp recorded when the page was parsed. |
| `detailError` | `string \| null` | Error message attached only when `scrapeDetails: true` failed for a row and the list row was kept and charged as `listing`. |
| `recordType` | `string \| null` | `"run-notice"` on the single extra dataset row emitted when a run truncates; absent on normal listing rows. |
| `truncatedAfter` | `integer \| null` | Number of charged listing rows stored before truncation (present on `run-notice` rows). |
| `reason` | `string \| null` | Stop reason on `run-notice` rows, matching `OUTPUT.stopReason`. |

#### Dataset views and Key-Value Store `OUTPUT`

- **Dataset `overview` view**: Displays `adId`, `title`, `price`, `currency`, `beds`, `baths`, `unitType`, `address`, `landlord`, `tier`, and clickable `url` in the Apify Console table.
- **Key-Value Store `OUTPUT` record**: Written at the end of every normal, truncated, or invalid-input run (declared in `.actor/key_value_store_schema.json` and `.actor/output_schema.json`). Includes `startedAt`, `finishedAt`, normalized `input`, `pricing`, per-seed progress (`seeds`), `pushed` (`listing`, `listing-detail`), `duplicatesSkipped`, `pagesFetched`, `siteTotalEntries`, `errors`, `stopReason`, `truncated`, `unavailableFields`, `http` transfer/status counters, `robots` status, `robotsDisallowedHits`, `listSource` (`apollo` vs `htmlFallback`), and `notes`.

### Pricing and Store tier discounts

This Actor uses transparent **Pay-Per-Event (PPE)** billing in **USD** with **no Actor start fee** (`$0.00` start fee) and **no separate dataset-item charge**. Uncharged records such as `run-notice`, duplicate ads skipped during a run, and failed zero-item runs incur `$0.00` in event charges.

- **`listing`** (*List-tier listing*): Charged once per unique listing parsed from a public search page without opening its detail page (`$0.000475` base rate / `$0.475` per 1,000 listings).
- **`listing-detail`** (*Listing with detail page*): Charged when a listing is enriched from or seeded via its public detail page (`$0.000475` base rate / `$0.475` per 1,000 listings). Charged **instead of** `listing`, never in addition. If a detail page fails while `scrapeDetails: true`, the list row is preserved with `detailError` and charged at the `listing` rate.

#### Live Store subscription tier discounts

Apify Store subscription discounts apply automatically to both `listing` and `listing-detail` events:

| Apify Plan Tier | Discount | Price per `listing` / `listing-detail` | Effective Cost per 1,000 Listings |
| --- | --- | ---: | ---: |
| **Free** | Base rate | `$0.000475` | `$0.475` |
| **Bronze** | 5% off | `$0.00045125` | `$0.45125` |
| **Silver** | 10% off | `$0.0004275` | `$0.4275` |
| **Gold** | 15% off | `$0.00040375` | `$0.40375` |
| **Platinum** | 15% off | `$0.00040375` | `$0.40375` |
| **Diamond** | 15% off | `$0.00040375` | `$0.40375` |

#### Cost comparison

At the Free-tier rate of `$0.000475` per listing with zero start fee, 1,000 listings cost **`$0.475`** in Actor event charges (or as low as `$0.40375` on Gold/Platinum/Diamond plans)—compared with alternative Kijiji scrapers such as `memo23` (`$0.00095` per result + `$0.005` start fee = **`$0.955`** per 1,000 results). Platform compute and storage usage are billed separately by Apify according to your plan.

### Quickstart with JavaScript and Python SDKs

Call `Stone_JadeX/kijiji-ca-apartments-scraper` programmatically from Node.js or Python using the official Apify Client libraries.

#### JavaScript (`apify-client`)

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });

const run = await client.actor('Stone_JadeX/kijiji-ca-apartments-scraper').call({
    startUrls: [
        { url: 'https://www.kijiji.ca/b-apartments-condos/ontario/c37l9004' },
    ],
    maxItems: 50,
    scrapeDetails: false,
    requestDelayMs: 1200,
    concurrency: 1,
    proxyConfiguration: { useApifyProxy: false },
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
const listings = items.filter((item) => item.recordType !== 'run-notice');
console.log(`Fetched ${listings.length} Kijiji listings`);
console.log(listings[0]);

const summary = await client.keyValueStore(run.defaultKeyValueStoreId).getRecord('OUTPUT');
console.log('Stop reason:', summary?.value?.stopReason);
```

#### Python (`apify-client`)

```python
import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])

run = client.actor("Stone_JadeX/kijiji-ca-apartments-scraper").call(
    run_input={
        "startUrls": [
            {"url": "https://www.kijiji.ca/b-apartments-condos/ontario/c37l9004"}
        ],
        "maxItems": 50,
        "scrapeDetails": False,
        "requestDelayMs": 1200,
        "concurrency": 1,
        "proxyConfiguration": {"useApifyProxy": False},
    }
)

dataset_items = client.dataset(run["defaultDatasetId"]).list_items().items
listings = [row for row in dataset_items if row.get("recordType") != "run-notice"]
print(f"Fetched {len(listings)} Kijiji listings")
if listings:
    print(listings[0])

output_record = client.key_value_store(run["defaultKeyValueStoreId"]).get_record("OUTPUT")
print("Stop reason:", (output_record or {}).get("value", {}).get("stopReason"))
```

### Is it legal to scrape Kijiji.ca?

Scraping publicly accessible web pages that do not require authentication is generally lawful in many jurisdictions, provided you respect applicable laws (including privacy rules such as PIPEDA in Canada and anti-circumvention / terms obligations) and evaluate your own use case. You are responsible for reviewing Kijiji.ca's Terms of Use and complying with local regulations for how collected data is stored and used.

How this Actor handles technical boundaries, `robots.txt`, and contact privacy:

- **Public pages only (`isLoginOrAccountUrl` refusal)**: The Actor only fetches public `/b-apartments-condos/` and `/v-apartments-condos/` pages. Any login, signup, auth, or account URL (`/login`, `/signin`, `/account`, `/mypage`, etc.) is strictly refused and never requested.
- **`robots.txt` transparency and warn-only tracking**: `https://www.kijiji.ca/robots.txt` is fetched at the start of every run and any `Crawl-delay` directive increases the minimum request spacing. Category-style VIP paths (`/v-*/*/*/c*`) and contact/AJAX endpoints appear in Kijiji's `robots.txt`: the Actor never constructs contact/AJAX URLs, while `/v-*/*/*/c*` is Disallow'd; a URL that robots.txt disallows is still requested, logged as a warning and counted in `robotsDisallowedHits`.
- **Contact privacy policy**: Phone numbers and email addresses are kept only for commercial/professional landlord or broker listings where business contact details are publicly posted; purely private owner (`Owner` / `FSBO` / unknown) contacts are always dropped (`phones: []`, `emails: []`). Note that Kijiji may partially mask public broker phone numbers (e.g., `905357xxxx`), which are preserved as published.

### Limitations, FAQ, and changelog

#### Limitations and FAQ

**Which Kijiji categories and locales are supported?**
This Actor is scoped strictly to Kijiji.ca long-term rentals under `/b-apartments-condos/...` and `/v-apartments-condos/.../{id}` (category `37`). Other Kijiji verticals such as cars, jobs, or buy-and-sell are rejected with a validation error before any request or charge occurs. French (Québec) pages are not a separate input mode in v0.1, though French URLs under `/b-apartments-condos/` that embed the same Apollo payload will parse when supplied in `startUrls`.

**Why is `maxItems` capped at 2,000 and what happens on early stops?**
To keep runs predictable inside the default 256 MB memory container and 1-hour timeout, `maxItems` and `maxPages` are capped at `2000`. If a run hits `maxItems`, `max-charge-reached`, `run-time-limit`, `proxy-budget`, `cloudflare-challenge`, or `empty-page`, it stops cleanly, writes `OUTPUT`, and appends an uncharged `{ "recordType": "run-notice", "truncatedAfter": ..., "reason": "..." }` item.

**How are anti-bot blocks and proxies handled?**
Direct connections are used by default (`useApifyProxy: false`) with at least `1200 ms` between request starts. On HTTP `403`, `412`, or `429` (including Cloudflare challenge pages), the Actor performs escalating 30 s / 60 s backoffs (up to 2 retries) without attempting to bypass challenges. If you configure an Apify residential proxy, enable `useProxyFallback: true` so direct requests are attempted first; residential proxy traffic is capped at a fixed **5 MB per run** (`RESIDENTIAL_MAX_MB = 5`, not user-overridable) and detail pages remain direct unless `allowDetailOnResidential: true` is set.

**Why does `description` look shorter when `scrapeDetails` is `false`?**
Search result cards embedded in `__NEXT_DATA__` / Apollo often contain an abbreviated description snippet and omit full amenity/contact fields. Set `scrapeDetails: true` (or pass direct `/v-apartments-condos/.../{id}` URLs in `startUrls`) to fetch full detail pages.

**Is this an official Kijiji tool or live monitoring service?**
No. This is an independent tool and is not affiliated with Kijiji. Each run captures a point-in-time snapshot; use Apify Schedules or webhooks for recurring comparisons.

#### Changelog

- **2026-11-21 (v0.1 Documentation & Schema Polish)**:
  - Added explicit `prefill` defaults (`startUrls`, `maxItems`, `startPage`, `scrapeDetails`, `requestDelayMs`, `concurrency`, `maxRunSeconds`, `proxyConfiguration`) and clean `sectionCaption` UI groupings in `.actor/input_schema.json`.
  - Upgraded `README.md` with full input/dataset schema tables, fixture-verified JSON examples, live Store subscription tier discounts (`Free` through `Diamond`), JavaScript and Python `ApifyClient` quickstarts, and updated `CHANGELOG.md`.
  - Restored `.actor/actor.json` `meta.generatedBy` consistency and brought all unit tests to 100% pass.
- **2026-10-26 (v0.1.0)**:
  - Initial release of `kijiji-ca-apartments-scraper` supporting `__NEXT_DATA__` / Apollo `RealEstateListing` list & detail extraction, HTML link fallback, cent-to-CAD price conversion, tenths bathroom decoding, privacy-filtered contacts, Pay-Per-Event billing (`listing` / `listing-detail`), warn-only `robots.txt` tracking (`robotsDisallowedHits`), login/account URL refusal, and 256 MB memory-safe HTML body disposal.

# Changelog

This Actor's version history is a separate document: https://apify.com/stone_jadex/kijiji-ca-apartments-scraper/changelog.md

# Actor input Schema

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

Optional. A Kijiji.ca apartments-condos search such as https://www.kijiji.ca/b-apartments-condos/ontario/c37l9004 or https://www.kijiji.ca/b-apartments-condos/alberta/c37l9003, or a listing URL /v-apartments-condos/.../{id}. Empty input uses Ontario. Other Kijiji verticals (cars, jobs, …) are rejected.

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

Stop after this many listings.

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

Optional. Each search page has about 40–46 listings (Apollo).

## `startPage` (type: `integer`):

First search page when the start URL does not already set /page-N/.

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

Adds the full description, richer amenities, and public landlord/broker contact when published. Charged as listing-detail instead of listing. Prefer list-only to stay within the cost gate. If a detail page fails, the list row is kept and charged as listing.

## `requestDelayMs` (type: `integer`):

At least 1.2 seconds between request starts. A Crawl-delay in robots.txt can only raise this.

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

How many search or detail pages may be requested at once. Rows are saved in page order. At least 1.2 seconds still pass between request starts.

## `maxRunSeconds` (type: `integer`):

Stops cleanly and writes the OUTPUT record before this limit.

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

Direct connection by default. Do not default to residential. A residential proxy is a fallback only (turn on useProxyFallback) and is capped at a fixed 5 MB per run.

## `useProxyFallback` (type: `boolean`):

When a proxy is configured, stay on a direct connection until repeated HTTP 403 or 429 responses, then switch to that proxy. A residential proxy is meant to be used this way, as a fallback — never as the default.

## `allowDetailOnResidential` (type: `boolean`):

Detail pages stay on a direct connection when the proxy group is residential. Turn this on only if those detail pages should use the residential proxy too.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.kijiji.ca/b-apartments-condos/ontario/c37l9004"
    }
  ],
  "maxItems": 50,
  "startPage": 1,
  "scrapeDetails": false,
  "requestDelayMs": 1200,
  "concurrency": 1,
  "maxRunSeconds": 3600,
  "proxyConfiguration": {
    "useApifyProxy": false
  },
  "useProxyFallback": false,
  "allowDetailOnResidential": false
}
```

# Actor output Schema

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

Public Kijiji.ca apartments-condos listings saved in the default dataset. When a run truncates, the last row is a run-notice record with the stored count and stop reason.

## `summary` (type: `string`):

Normalized input, dataset and charge counts, seed progress, error list, HTTP and robots statistics, and the stop reason saved to OUTPUT.

# 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.kijiji.ca/b-apartments-condos/ontario/c37l9004"
        }
    ],
    "maxItems": 50,
    "startPage": 1,
    "scrapeDetails": false,
    "requestDelayMs": 1200,
    "concurrency": 1,
    "maxRunSeconds": 3600,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("stone_jadex/kijiji-ca-apartments-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.kijiji.ca/b-apartments-condos/ontario/c37l9004" }],
    "maxItems": 50,
    "startPage": 1,
    "scrapeDetails": False,
    "requestDelayMs": 1200,
    "concurrency": 1,
    "maxRunSeconds": 3600,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("stone_jadex/kijiji-ca-apartments-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 '{
  "startUrls": [
    {
      "url": "https://www.kijiji.ca/b-apartments-condos/ontario/c37l9004"
    }
  ],
  "maxItems": 50,
  "startPage": 1,
  "scrapeDetails": false,
  "requestDelayMs": 1200,
  "concurrency": 1,
  "maxRunSeconds": 3600,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call stone_jadex/kijiji-ca-apartments-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,stone_jadex/kijiji-ca-apartments-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/wZH7bMGX2RuucuFVi/builds/G5fGx1jbe2kJcB1UE/openapi.json
