# Kijiji.ca Scraper (`haketa/kijiji-scraper`) Actor

Scrape Kijiji.ca — Canada's #1 classifieds — with a vertical-aware structured schema across all 5 verticals: Autos, Real Estate, Jobs, Services, Marketplace. Per-vertical fields (make/model/VIN, bedrooms/rent/utilities), FSBO vs dealer detection, bilingual EN/FR. Pure HTTP, no browser.

- **URL**: https://apify.com/haketa/kijiji-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** Developer tools, Real estate, Automation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.50 / 1,000 results

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/platform/actors/running/actors-in-store#pay-per-event

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

## Kijiji.ca Scraper

Extract classified listings from **[Kijiji.ca](https://www.kijiji.ca)** — Canada's #1 classifieds site (Adevinta Group) — with a **vertical-aware structured schema**. Most Kijiji scrapers flatten everything into one generic table; this one understands that Autos, Real Estate, Jobs, Services and Marketplace each need their own fields.

[![Apify Actor](https://img.shields.io/badge/Apify-Actor-blue)](https://apify.com)
[![No Browser](https://img.shields.io/badge/Engine-HTML%20%2B%20__NEXT_DATA__-green)]()
[![Verticals](https://img.shields.io/badge/Verticals-5-orange)]()

---

### What Makes This Different

The Kijiji scraper market is crowded but shallow — 12+ actors that all do "search URL → flat listing." This one differentiates with:

- **Vertical-aware schema** — Autos get `make/model/year/mileageKm/VIN/CARFAX`, Real Estate gets `bedrooms/rent/utilitiesIncluded/amenities`, Jobs get `salaryMin/Max/jobType`, etc.
- **FSBO vs Dealer detection** — derives `adSource` (fsbo / dealer / professional / ebay) from the image CDN path, so flippers and dealer-monitors get the split they need
- **Bilingual EN/FR handling** — detects `descriptionLang` via French hint-word density (Quebec listings are French)
- **Paid placement tiers** — flags `isTopAd / isShowcase / isHighlighted` (a seller-seriousness signal)
- **Kijiji price grammar** — parses `Please Contact`, `Free`, `Swap/Trade`, `$X OBO`, `$X firm` into structured `priceType` + `isNegotiable`

---

### How It Works

Kijiji.ca is a React/Next.js SPA. Listing data is hydrated into the page as JSON. This actor:

1. Fetches the search/category result page HTML
2. Extracts the hydration JSON (`__NEXT_DATA__`, Apollo state, or JSON-LD — tolerant)
3. Deep-searches that JSON for listing arrays
4. Parses each listing with the vertical-aware schema
5. Optionally visits each listing's detail page (VIP) for full data
6. Follows pagination

No browser, no headless Chrome — pure HTTP.

---

### Input

#### Search URLs mode (recommended)

Search on Kijiji.ca, copy the result page URL, paste it in:

```json
{
  "mode": "search-urls",
  "searchUrls": [
    "https://www.kijiji.ca/b-cars-trucks/gta-greater-toronto-area/c174l1700272",
    "https://www.kijiji.ca/b-apartments-condos/city-of-toronto/c37l1700273"
  ],
  "fetchDetails": true,
  "maxItems": 100
}
````

#### Keyword search mode

```json
{
  "mode": "keyword-search",
  "keyword": "toyota camry",
  "categoryCode": "c174",
  "provinces": ["ON", "QC"],
  "maxItems": 100
}
```

#### Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `mode` | string | `search-urls` | `search-urls` or `keyword-search` |
| `searchUrls` | array | `[]` | Kijiji result page URLs (search-urls mode) |
| `vertical` | string | `auto` | `auto` / `marketplace` / `autos` / `real-estate` / `jobs` / `services` |
| `keyword` | string | `""` | Free-text search (keyword-search mode) |
| `categoryCode` | string | `""` | Category code e.g. `c174`, `c37`, `c10` (keyword-search mode) |
| `provinces` | array | `["ON"]` | Province codes (keyword-search mode) |
| `minPrice` / `maxPrice` | integer | 0 | CAD price filter |
| `sortBy` | string | `dateDesc` | `relevance` / `dateDesc` / `priceAsc` / `priceDesc` |
| `adSourceFilter` | string | `all` | `all` / `fsbo-only` / `dealer-only` / `exclude-ebay` |
| `language` | string | `both` | `both` / `en` / `fr` |
| `fetchDetails` | boolean | `true` | Visit each VIP page for full data (slower, richer) |
| `maxItems` | integer | 100 | Total listing cap (0 = unlimited) |
| `maxPages` | integer | 10 | Pages per search URL |
| `requestDelay` | integer (ms) | 500 | Delay between requests |
| `maxConcurrency` | integer | 3 | Parallel requests |
| `maxRetries` | integer | 3 | Retries on 403/503/429 |
| `proxyConfiguration` | object | CA residential | Proxy settings |
| `debugMode` | boolean | `false` | Verbose parser logging (hydration structure, listing keys, attribute dumps) for the first page of each search — for troubleshooting |

***

### Category Codes

Codes verified against live Kijiji. The actor also auto-detects the vertical from the search-URL slug, so an exact code match isn't required.

| Code | Category | Vertical |
|---|---|---|
| `c174` | Cars & Trucks | autos |
| `c30` | Motorcycles | autos |
| `c27` | Cars & Vehicles (parent) | autos |
| `c37` | Apartments & Condos | real-estate |
| `c34` | Real Estate (parent) | real-estate |
| `c10` | Buy & Sell | marketplace |
| `c45` | Jobs | jobs |
| `c72` | Services | services |

> Tip: the simplest path is to browse Kijiji.ca to the category/city you want and paste the result-page URL into `searchUrls` — the vertical is inferred automatically.

***

### Provinces

| Code | Province | Code | Province |
|---|---|---|---|
| `ON` | Ontario | `MB` | Manitoba |
| `QC` | Quebec | `SK` | Saskatchewan |
| `BC` | British Columbia | `NS` | Nova Scotia |
| `AB` | Alberta | `NB` | New Brunswick |
| `NL` | Newfoundland | `PE` | Prince Edward Island |

***

### Output

Common fields appear on every record; vertical-specific fields are populated based on the listing's vertical.

#### Autos listing example

```json
{
  "listingId": "1733059633",
  "vertical": "autos",
  "categoryCode": "c174",
  "title": "2023 Ford Edge SEL No Accident Leather Radar Cruise Navigation",
  "url": "https://www.kijiji.ca/v-cars-trucks/mississauga-peel-region/2023-ford-edge.../1733059633",
  "descriptionLang": "en",
  "priceAmount": 23995,
  "priceCurrency": "CAD",
  "priceType": "fixed",
  "locationCity": "Mississauga",
  "locationProvince": "ON",
  "latitude": 43.6449207,
  "longitude": -79.6509123,
  "adSource": "dealer",
  "posterId": "COMMERCIAL_7108",
  "make": "ford",
  "model": "edge",
  "trim": "SEL",
  "year": 2023,
  "mileageKm": 76402,
  "transmission": "Automatic",
  "fuelType": "Gasoline",
  "drivetrain": "AWD",
  "bodyType": "SUV / Crossover",
  "color": "white",
  "condition": "used",
  "vin": "2FMPK4J95PBA28054",
  "forSaleBy": "Dealer",
  "features": ["Bluetooth", "Alloy Wheels"],
  "imageCount": 25,
  "isTopAd": true,
  "priceDropped": null,
  "scrapedAt": "2026-05-14T12:49:00Z"
}
```

> `make` / `model` come straight from Kijiji's attribute data and are lower-cased (`ford`, `edge`); the human-readable name is in `title`. Some Kijiji model values are internal slugs (e.g. `crv`, `slvrd1500`).

#### Real estate listing example

```json
{
  "listingId": "1735361401",
  "vertical": "real-estate",
  "categoryCode": "c37",
  "title": "Modern, Newly Renovated 1 Bed+Den on the Danforth",
  "priceAmount": 2300,
  "priceType": "fixed",
  "locationCity": "Toronto",
  "locationProvince": "ON",
  "latitude": 43.67986,
  "longitude": -79.3389,
  "adSource": "fsbo",
  "listingType": "For Rent",
  "propertyType": "apartment",
  "bedrooms": "1.5",
  "bathrooms": "1",
  "rentMonthly": 2300,
  "utilitiesIncluded": ["Heat", "Water"],
  "furnished": "No",
  "petsAllowed": "No",
  "sizeText": "520 sq ft",
  "availableDate": "2026-06-01T00:00:00Z",
  "agreementType": "one-year",
  "buildingAmenities": ["Laundry (In-Unit)", "Air Conditioning"]
}
```

> Kijiji codes bathrooms as count×10 — the parser decodes `"10"` → `"1"`, `"15"` → `"1.5"`. `furnished` / `petsAllowed` are decoded to `Yes` / `No` / `Limited`. `utilitiesIncluded` and `buildingAmenities` are collected from Kijiji's separate boolean attributes.

#### Notes

- `adSource` is derived from the image CDN path (`ca-prod-fsbo-ads` → fsbo) with a poster-type fallback
- `descriptionLang` is auto-detected; Quebec listings are usually `fr`
- `priceType`: `fixed` / `contact` (Please Contact) / `free` / `swap`
- `isRepost`, `priceDropped`, `underpricedFlag`, `categoryMedian` require cross-run state and are reserved for a future version (currently `null`)
- `motivatedSeller` is detected from urgency keywords in the title/description

***

### Use Cases

- **Auto dealers & used-car pricing** — Kijiji Autos benchmark, FSBO sourcing, VIN + mileage + trim valuation input
- **Resellers & flippers** — FSBO filter + motivated-seller signal + price tracking pipeline
- **Real estate investors & property managers** — rental price trends, utilities-included analysis, competitor pricing (CAPREIT, Minto, Boardwalk)
- **Retail arbitrage & pricing intelligence** — second-hand price vs retail, demand proxy by listing volume
- **Local recruitment analysis** — Kijiji Jobs blue-collar/local segment that Indeed/SEEK miss
- **Academic & policy research** — Statistics Canada, Bank of Canada, CMHC: second-hand economy, housing affordability
- **Fraud & trust/safety** — abnormal pricing, repost patterns, "cash only" risk signals
- **Quebec/bilingual market specialists** — French content detection and normalization

***

### Cost & Performance

- **No browser** — pure HTTP, low CU consumption
- `fetchDetails: true` roughly doubles requests (1 search page + 1 VIP per listing) but yields full data
- Set `fetchDetails: false` for fast, summary-only scrapes
- Canadian residential proxy strongly recommended for sustained runs

***

### Limitations

- **Field discovery**: Kijiji's internal `__NEXT_DATA__` field names can change; the parser is tolerant (tries many field names + deep-search fallback) but a Kijiji frontend rewrite may need a parser update.
- **Kijiji Autos platform** (`autos.kijiji.ca`) is a separate frontend; this actor scrapes the classic Kijiji `/b-cars-trucks/` autos which are cross-linked.
- **Intelligence fields** (repost / price-drop / underpriced detection) need persistent cross-run state — reserved for a future release.
- **Anti-bot**: moderate. Datacenter IPs work partially; residential CA proxy is the reliable path.

***

### Changelog

| Version | Date | Notes |
|---|---|---|
| 1.0.0 | 2026-05-14 | Initial release — vertical-aware schema across all 5 verticals (Autos, Real Estate, Jobs, Services, Marketplace), calibrated against live Kijiji. Apollo-state hydration parsing with `__ref` denormalization, FSBO/dealer detection from image CDN, bilingual EN/FR detection, Kijiji price-grammar parsing, enum decoding (transmission/fuel/bodytype/bathrooms/furnished/pets), search-urls + keyword modes, optional VIP detail enrichment, `debugMode` for troubleshooting. |

# Actor input Schema

## `mode` (type: `string`):

'search-urls' = crawl the exact Kijiji search/category URLs you provide (most reliable). 'keyword-search' = build search URLs from a keyword + province/category.

## `searchUrls` (type: `array`):

Kijiji.ca search or category result page URLs. Examples: 'https://www.kijiji.ca/b-cars-trucks/gta-greater-toronto-area/c174l1700272', 'https://www.kijiji.ca/b-apartments-condos/city-of-toronto/c37l1700273'. Used in 'search-urls' mode.

## `vertical` (type: `string`):

Which vertical the listings belong to. Drives vertical-specific field extraction (autos → make/model/VIN, real-estate → bedrooms/rent, etc). Use 'auto' to infer from category code.

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

Free-text search keyword (e.g. 'macbook pro', 'toyota camry', '2 bedroom apartment'). Used in 'keyword-search' mode.

## `categoryCode` (type: `string`):

Kijiji category code for keyword-search mode. Examples: 'c174' (cars-trucks), 'c37' (apartments-condos), 'c10' (buy-and-sell), 'c30' (motorcycles), 'c45' (jobs), 'c72' (services). Leave empty for all categories.

## `provinces` (type: `array`):

Canadian province codes for keyword-search mode. Options: ON, QC, BC, AB, MB, SK, NS, NB, NL, PE. Leave empty for all of Canada.

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

Minimum price in Canadian dollars. 0 = no minimum.

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

Maximum price in Canadian dollars. 0 = no maximum.

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

Result ordering.

## `adSourceFilter` (type: `string`):

Filter by listing source. 'fsbo-only' = For Sale By Owner (private sellers, good for flippers/bargains). 'dealer-only' = professional/dealer listings. 'exclude-ebay' = drop eBay cross-listings.

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

Filter listings by detected description language. 'both' keeps EN and FR. Quebec listings are typically French.

## `fetchDetails` (type: `boolean`):

Visit each listing's detail page (VIP) for complete data — full description, all images, VIN, features, amenities. Slower but much richer. When false, only search-page summary fields are extracted.

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

Maximum total listings to scrape across all searches. Set 0 for unlimited.

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

Maximum result pages per search URL. Each page returns ~20-40 listings.

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

Canadian residential proxy recommended. Kijiji has moderate anti-bot — datacenter IPs work partially but inconsistently. Use Apify Proxy with RESIDENTIAL group and CA country for best results.

## `requestDelay` (type: `integer`):

Delay between requests in milliseconds.

## `maxConcurrency` (type: `integer`):

Parallel requests. Kijiji tolerates 3-8. Keep lower if hitting blocks.

## `maxRetries` (type: `integer`):

Retry attempts per failed request (403/503/429 errors).

## `debugMode` (type: `boolean`):

Verbose parser logging — dumps the hydration JSON structure, listing keys, and full attribute lists for the first page of each search. Useful for troubleshooting when Kijiji changes its page structure. Leave off for normal runs.

## Actor input object example

```json
{
  "mode": "search-urls",
  "searchUrls": [
    "https://www.kijiji.ca/b-cars-trucks/gta-greater-toronto-area/c174l1700272"
  ],
  "vertical": "auto",
  "provinces": [
    "ON"
  ],
  "minPrice": 0,
  "maxPrice": 0,
  "sortBy": "dateDesc",
  "adSourceFilter": "all",
  "language": "both",
  "fetchDetails": true,
  "maxItems": 100,
  "maxPages": 10,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CA"
  },
  "requestDelay": 500,
  "maxConcurrency": 3,
  "maxRetries": 3,
  "debugMode": false
}
```

# Actor output Schema

## `listingId` (type: `string`):

Kijiji 10-digit numeric listing ID

## `vertical` (type: `string`):

marketplace / autos / real-estate / jobs / services

## `category` (type: `string`):

Listing category name

## `categoryCode` (type: `string`):

Kijiji URL category code (c174, c37...)

## `subCategory` (type: `string`):

Sub-category name

## `title` (type: `string`):

Listing title

## `description` (type: `string`):

Full listing description

## `descriptionLang` (type: `string`):

Detected language: en / fr

## `url` (type: `string`):

Full listing URL

## `priceRaw` (type: `string`):

Original price string as shown

## `priceAmount` (type: `string`):

Parsed numeric price in CAD

## `priceCurrency` (type: `string`):

Always CAD

## `priceType` (type: `string`):

fixed / contact / free / swap / negotiable

## `isNegotiable` (type: `string`):

OBO / not firm

## `locationRaw` (type: `string`):

Location string as shown

## `locationCity` (type: `string`):

City name

## `locationProvince` (type: `string`):

Province code (ON, QC, BC...)

## `locationId` (type: `string`):

Kijiji URL location code (l1700272...)

## `latitude` (type: `string`):

Latitude coordinate

## `longitude` (type: `string`):

Longitude coordinate

## `adSource` (type: `string`):

fsbo / dealer / professional / ebay

## `posterId` (type: `string`):

Seller internal ID

## `posterName` (type: `string`):

Seller display name

## `posterType` (type: `string`):

Private / Business / Dealer

## `isTopAd` (type: `string`):

Paid top placement

## `isShowcase` (type: `string`):

Paid showcase placement

## `isHighlighted` (type: `string`):

Paid highlighted placement

## `activationDate` (type: `string`):

First publication date

## `sortingDate` (type: `string`):

Last bump/update date

## `imageCount` (type: `string`):

Number of photos

## `thumbnailUrl` (type: `string`):

First image URL

## `imageUrls` (type: `string`):

All photo URLs

## `hasPhone` (type: `string`):

Phone number available

## `phoneNumber` (type: `string`):

Contact phone if shown

## `make` (type: `string`):

Vehicle make (autos)

## `model` (type: `string`):

Vehicle model (autos)

## `trim` (type: `string`):

Vehicle trim (autos)

## `year` (type: `string`):

Vehicle year (autos)

## `mileageKm` (type: `string`):

Odometer in kilometers (autos)

## `transmission` (type: `string`):

Automatic / Manual (autos)

## `fuelType` (type: `string`):

Gas / Diesel / Hybrid / Electric (autos)

## `drivetrain` (type: `string`):

FWD / RWD / AWD / 4x4 (autos)

## `bodyType` (type: `string`):

Sedan / SUV / Truck (autos)

## `color` (type: `string`):

Exterior color (autos)

## `condition` (type: `string`):

New / Used / Certified (autos)

## `seats` (type: `string`):

Seat count (autos)

## `doors` (type: `string`):

Door count (autos)

## `vin` (type: `string`):

Vehicle Identification Number (autos)

## `carfaxLink` (type: `string`):

CARFAX/CARPROOF report URL (autos)

## `forSaleBy` (type: `string`):

Owner / Dealer (autos)

## `features` (type: `string`):

Vehicle features list (autos)

## `dealerName` (type: `string`):

Dealership name (autos)

## `listingType` (type: `string`):

For Rent / For Sale / Room (real estate)

## `propertyType` (type: `string`):

Apartment / Condo / House (real estate)

## `bedrooms` (type: `string`):

Bedroom count or Bachelor/Studio (real estate)

## `bathrooms` (type: `string`):

Bathroom count (real estate)

## `rentMonthly` (type: `string`):

Monthly rent in CAD (real estate)

## `utilitiesIncluded` (type: `string`):

Hydro/Heat/Water/Internet (real estate)

## `furnished` (type: `string`):

Furnished / Unfurnished (real estate)

## `petsAllowed` (type: `string`):

Pet policy (real estate)

## `parkingType` (type: `string`):

Street / Driveway / Garage (real estate)

## `sizeText` (type: `string`):

Unit size text e.g. 750 sqft (real estate)

## `availableDate` (type: `string`):

Move-in date (real estate)

## `agreementType` (type: `string`):

1 Year / Month-to-Month (real estate)

## `buildingAmenities` (type: `string`):

Gym/Pool/Laundry/Elevator (real estate)

## `managementCompany` (type: `string`):

Property management company (real estate)

## `jobTitle` (type: `string`):

Position title (jobs)

## `company` (type: `string`):

Employer name (jobs)

## `jobType` (type: `string`):

Full-Time / Part-Time / Contract (jobs)

## `salaryRaw` (type: `string`):

Original salary string (jobs)

## `salaryMin` (type: `string`):

Parsed minimum salary (jobs)

## `salaryMax` (type: `string`):

Parsed maximum salary (jobs)

## `remote` (type: `string`):

On-site / Remote / Hybrid (jobs)

## `serviceType` (type: `string`):

Cleaning / Moving / Tutoring (services)

## `serviceProvider` (type: `string`):

Provider name (services)

## `serviceArea` (type: `string`):

Service coverage area (services)

## `hourlyRate` (type: `string`):

Hourly rate in CAD (services)

## `isLicensed` (type: `string`):

Licensed provider flag (services)

## `itemCondition` (type: `string`):

New / Used / Open Box (marketplace)

## `brand` (type: `string`):

Item brand (marketplace)

## `isFirmPrice` (type: `string`):

Price is firm (marketplace)

## `swapAvailable` (type: `string`):

Will trade/swap (marketplace)

## `deliveryAvailable` (type: `string`):

Pickup / Ship / Deliver (marketplace)

## `isRepost` (type: `string`):

Detected repost of an earlier listing

## `priceDropped` (type: `string`):

Price reduced since first seen

## `underpricedFlag` (type: `string`):

Price below category median threshold

## `categoryMedian` (type: `string`):

Median price for the category in this run

## `motivatedSeller` (type: `string`):

Description signals urgency (must sell etc.)

## `searchUrl` (type: `string`):

Search URL this listing was found through

## `scrapedAt` (type: `string`):

ISO timestamp when scraped

# 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 = {
    "searchUrls": [
        "https://www.kijiji.ca/b-cars-trucks/gta-greater-toronto-area/c174l1700272"
    ],
    "keyword": "",
    "categoryCode": "",
    "provinces": [
        "ON"
    ],
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "CA"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/kijiji-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 = {
    "searchUrls": ["https://www.kijiji.ca/b-cars-trucks/gta-greater-toronto-area/c174l1700272"],
    "keyword": "",
    "categoryCode": "",
    "provinces": ["ON"],
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "CA",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/kijiji-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 '{
  "searchUrls": [
    "https://www.kijiji.ca/b-cars-trucks/gta-greater-toronto-area/c174l1700272"
  ],
  "keyword": "",
  "categoryCode": "",
  "provinces": [
    "ON"
  ],
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "CA"
  }
}' |
apify call haketa/kijiji-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Kijiji.ca Scraper",
        "description": "Scrape Kijiji.ca — Canada's #1 classifieds — with a vertical-aware structured schema across all 5 verticals: Autos, Real Estate, Jobs, Services, Marketplace. Per-vertical fields (make/model/VIN, bedrooms/rent/utilities), FSBO vs dealer detection, bilingual EN/FR. Pure HTTP, no browser.",
        "version": "0.0",
        "x-build-id": "fdSlAqEJfSY7BiXwM"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/haketa~kijiji-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-haketa-kijiji-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/haketa~kijiji-scraper/runs": {
            "post": {
                "operationId": "runs-sync-haketa-kijiji-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/haketa~kijiji-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-haketa-kijiji-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": {
                    "mode": {
                        "title": "Scrape Mode",
                        "enum": [
                            "search-urls",
                            "keyword-search"
                        ],
                        "type": "string",
                        "description": "'search-urls' = crawl the exact Kijiji search/category URLs you provide (most reliable). 'keyword-search' = build search URLs from a keyword + province/category.",
                        "default": "search-urls"
                    },
                    "searchUrls": {
                        "title": "Search URLs",
                        "type": "array",
                        "description": "Kijiji.ca search or category result page URLs. Examples: 'https://www.kijiji.ca/b-cars-trucks/gta-greater-toronto-area/c174l1700272', 'https://www.kijiji.ca/b-apartments-condos/city-of-toronto/c37l1700273'. Used in 'search-urls' mode.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "vertical": {
                        "title": "Vertical",
                        "enum": [
                            "auto",
                            "marketplace",
                            "autos",
                            "real-estate",
                            "jobs",
                            "services"
                        ],
                        "type": "string",
                        "description": "Which vertical the listings belong to. Drives vertical-specific field extraction (autos → make/model/VIN, real-estate → bedrooms/rent, etc). Use 'auto' to infer from category code.",
                        "default": "auto"
                    },
                    "keyword": {
                        "title": "Keyword",
                        "type": "string",
                        "description": "Free-text search keyword (e.g. 'macbook pro', 'toyota camry', '2 bedroom apartment'). Used in 'keyword-search' mode."
                    },
                    "categoryCode": {
                        "title": "Category Code",
                        "type": "string",
                        "description": "Kijiji category code for keyword-search mode. Examples: 'c174' (cars-trucks), 'c37' (apartments-condos), 'c10' (buy-and-sell), 'c30' (motorcycles), 'c45' (jobs), 'c72' (services). Leave empty for all categories."
                    },
                    "provinces": {
                        "title": "Provinces",
                        "type": "array",
                        "description": "Canadian province codes for keyword-search mode. Options: ON, QC, BC, AB, MB, SK, NS, NB, NL, PE. Leave empty for all of Canada.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "minPrice": {
                        "title": "Min Price (CAD)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Minimum price in Canadian dollars. 0 = no minimum.",
                        "default": 0
                    },
                    "maxPrice": {
                        "title": "Max Price (CAD)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum price in Canadian dollars. 0 = no maximum.",
                        "default": 0
                    },
                    "sortBy": {
                        "title": "Sort Order",
                        "enum": [
                            "relevance",
                            "dateDesc",
                            "priceAsc",
                            "priceDesc"
                        ],
                        "type": "string",
                        "description": "Result ordering.",
                        "default": "dateDesc"
                    },
                    "adSourceFilter": {
                        "title": "Ad Source Filter",
                        "enum": [
                            "all",
                            "fsbo-only",
                            "dealer-only",
                            "exclude-ebay"
                        ],
                        "type": "string",
                        "description": "Filter by listing source. 'fsbo-only' = For Sale By Owner (private sellers, good for flippers/bargains). 'dealer-only' = professional/dealer listings. 'exclude-ebay' = drop eBay cross-listings.",
                        "default": "all"
                    },
                    "language": {
                        "title": "Language Filter",
                        "enum": [
                            "both",
                            "en",
                            "fr"
                        ],
                        "type": "string",
                        "description": "Filter listings by detected description language. 'both' keeps EN and FR. Quebec listings are typically French.",
                        "default": "both"
                    },
                    "fetchDetails": {
                        "title": "Fetch Full Details",
                        "type": "boolean",
                        "description": "Visit each listing's detail page (VIP) for complete data — full description, all images, VIN, features, amenities. Slower but much richer. When false, only search-page summary fields are extracted.",
                        "default": true
                    },
                    "maxItems": {
                        "title": "Max Items",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum total listings to scrape across all searches. Set 0 for unlimited.",
                        "default": 100
                    },
                    "maxPages": {
                        "title": "Max Pages per Search",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Maximum result pages per search URL. Each page returns ~20-40 listings.",
                        "default": 10
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Canadian residential proxy recommended. Kijiji has moderate anti-bot — datacenter IPs work partially but inconsistently. Use Apify Proxy with RESIDENTIAL group and CA country for best results."
                    },
                    "requestDelay": {
                        "title": "Request Delay (ms)",
                        "minimum": 0,
                        "maximum": 15000,
                        "type": "integer",
                        "description": "Delay between requests in milliseconds.",
                        "default": 500
                    },
                    "maxConcurrency": {
                        "title": "Max Concurrency",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Parallel requests. Kijiji tolerates 3-8. Keep lower if hitting blocks.",
                        "default": 3
                    },
                    "maxRetries": {
                        "title": "Max Retries",
                        "minimum": 0,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Retry attempts per failed request (403/503/429 errors).",
                        "default": 3
                    },
                    "debugMode": {
                        "title": "Debug Mode",
                        "type": "boolean",
                        "description": "Verbose parser logging — dumps the hydration JSON structure, listing keys, and full attribute lists for the first page of each search. Useful for troubleshooting when Kijiji changes its page structure. Leave off for normal runs.",
                        "default": false
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
