{
  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}