{
  "openapi": "3.0.1",
  "info": {
    "title": "Realtor.ca Scraper - Canadian MLS Listings",
    "description": "Scrape Realtor.ca Canadian MLS listings by city. Extract for-sale and rental prices, beds, baths, sqft, MLS numbers, agents, and photos. A Realtor.ca / CREA API alternative for Excel, CSV, or JSON.",
    "version": "0.4",
    "x-build-id": "j3cr7bHOYPLhYE4Ap"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lentic_clockss~realtor-ca-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lentic_clockss-realtor-ca-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/lentic_clockss~realtor-ca-scraper/runs": {
      "post": {
        "operationId": "runs-sync-lentic_clockss-realtor-ca-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/lentic_clockss~realtor-ca-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-lentic_clockss-realtor-ca-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",
        "required": [
          "location"
        ],
        "properties": {
          "location": {
            "title": "Location",
            "maxLength": 200,
            "type": "string",
            "description": "Canadian city and province, e.g. 'Saskatoon, SK' or 'Toronto, ON'. Also accepts realtor.ca city URLs. Known metros use a curated bbox cache; other Canadian cities are geocoded automatically.",
            "default": "Saskatoon, SK"
          },
          "listingType": {
            "title": "Listing type",
            "enum": [
              "sale",
              "rent",
              "both"
            ],
            "type": "string",
            "description": "Scrape for-sale listings, rentals, or both.",
            "default": "sale"
          },
          "propertyTypeGroup": {
            "title": "Property type group",
            "enum": [
              "residential",
              "commercial",
              "all"
            ],
            "type": "string",
            "description": "Residential, commercial, or both groups (all splits maxResults across residential + commercial).",
            "default": "residential"
          },
          "propertySearchType": {
            "title": "Property search type",
            "enum": [
              "any",
              "residential",
              "recreational",
              "condo",
              "agriculture",
              "parking",
              "vacant_land",
              "multi_family"
            ],
            "type": "string",
            "description": "Residential subtype filter (CREA PropertySearchTypeId). Only valid with propertyTypeGroup=residential. Use 'any' for commercial or all.",
            "default": "any"
          },
          "maxResults": {
            "title": "Max results (max 200; free users capped at 200/run)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum listings to collect (1–200; split evenly across sale and rent when listingType is both). Console Test prefills 1 listing so a first run stays short. Free Apify plan users are limited to 200 results per run and 10 total runs of this Actor — limits set by the Actor developer.",
            "default": 1
          },
          "minPrice": {
            "title": "Min price ($ CAD)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional minimum list price or rent in CAD."
          },
          "maxPrice": {
            "title": "Max price ($ CAD)",
            "minimum": 0,
            "type": "integer",
            "description": "Optional maximum list price or rent in CAD."
          },
          "enrichDetails": {
            "title": "Enrich details",
            "type": "boolean",
            "description": "Fetch PropertyDetails for each listing (remarks, extra photos when available).",
            "default": true
          },
          "detailConcurrency": {
            "title": "Detail concurrency",
            "minimum": 1,
            "maximum": 4,
            "type": "integer",
            "description": "Parallel PropertyDetails fetches (1–4) on shared Camoufox cookies. Keep low under Imperva pressure. Console Test uses 1.",
            "default": 1
          },
          "maxDetailFailRatio": {
            "title": "Max detail fail ratio",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Fail the run when PropertyDetails failures exceed this ratio (after at least 2 attempts).",
            "default": 0.5
          },
          "applicationId": {
            "title": "ApplicationId override",
            "type": "string",
            "description": "Advanced: override CREA ApplicationId. Leave empty for default (1).",
            "default": ""
          },
          "workerBaseUrl": {
            "title": "Worker base URL (optional)",
            "type": "string",
            "description": "Override the Cloud Run worker origin for this run. Defaults to Actor env WORKER_BASE_URL. Use when testing a staging worker; production migrations should update WORKER_BASE_URL in Actor settings (no code change).",
            "default": ""
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}