{
  "openapi": "3.0.1",
  "info": {
    "title": "Realtor.ca Scraper",
    "description": "Scrape Realtor.ca (Canada national MLS) — full property details, search listings by location/postal code/coordinates/polygon/URL, agent profiles, and search-box autocomplete. Backed by realtyapi.io real-time API.",
    "version": "1.0",
    "x-build-id": "dLF0ecJXsEZruGDI5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/one-api~realtorca-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-one-api-realtorca-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/one-api~realtorca-scraper/runs": {
      "post": {
        "operationId": "runs-sync-one-api-realtorca-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/one-api~realtorca-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-one-api-realtorca-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": {
          "property_inputs": {
            "title": "Property ID, Realtor.ca URL, or full Address (one per line)",
            "type": "array",
            "description": "Auto-detects each entry: digits → property_id, http(s) URL → listing URL, anything else → address. Each row = 1 property detail call.",
            "items": {
              "type": "string"
            }
          },
          "search_inputs": {
            "title": "Location, postal code, lat/lng radius, polygon, or Realtor.ca search URL (one per line)",
            "type": "array",
            "description": "Auto-detects each entry. Examples:\n• `Toronto, Ontario` (location)\n• `M5V 2T6` (postal code — Canadian format)\n• `43.6532,-79.3832,3` (lat,lng,radius_miles)\n• `-79.40 43.65,-79.35 43.65,-79.35 43.68,-79.40 43.68` (polygon, lon-lat pairs)\n• `https://www.realtor.ca/map#ZoomLevel=...` (search URL)\n\nFilters below apply to every search. Each LISTING is pushed as one dataset item.",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "Search Type",
            "enum": [
              "For_Sale",
              "For_Rent",
              "Sold"
            ],
            "type": "string",
            "description": "For_Sale (default) | For_Rent | Sold. Realtor.ca's TransactionTypeId is mapped internally.",
            "default": "For_Sale"
          },
          "propertyType": {
            "title": "Property Type",
            "type": "string",
            "description": "Comma-separated. Leave empty for all. Allowed: Residential, Recreational, Condo, Land, Agriculture, Parking, MultiFamily, Business, Retail, Industrial, Office, Hospitality, Institutional. Note: Realtor.ca only accepts ONE PropertySearchTypeId per call; if you supply multiple the first wins.",
            "default": ""
          },
          "priceRange": {
            "title": "Price Range",
            "type": "string",
            "description": "`min:500000`, `max:1500000`, or `min:500000,max:1500000`. Applied as PriceMin/Max for sales, RentMin/Max for rentals.",
            "default": ""
          },
          "beds": {
            "title": "Beds",
            "type": "string",
            "description": "Examples: `3` (3+), `3+`, `min:3,max:5`. Realtor.ca uses BedRange (e.g. `3-0` = 3 or more).",
            "default": ""
          },
          "baths": {
            "title": "Baths",
            "type": "string",
            "description": "Examples: `2` (2+), `2+`, `min:2,max:4`.",
            "default": ""
          },
          "sqftRange": {
            "title": "Interior Sqft Range",
            "type": "string",
            "description": "`min:800`, `max:2500`, `min:800,max:2500`",
            "default": ""
          },
          "lotSizeRange": {
            "title": "Lot Size Range (acres)",
            "type": "string",
            "description": "`min:0.25`, `max:1`, `min:0.25,max:1`",
            "default": ""
          },
          "yearBuiltRange": {
            "title": "Year Built Range",
            "type": "string",
            "description": "`min:1990`, `max:2024`, `min:1990,max:2024`",
            "default": ""
          },
          "sortOrder": {
            "title": "Sort Order",
            "enum": [
              "Newest",
              "Oldest",
              "Price_Low_to_High",
              "Price_High_to_Low",
              "Open_Houses_First",
              "More_Photos_First",
              "Virtual_Tour_First"
            ],
            "type": "string",
            "description": "How to sort search results.",
            "default": "Newest"
          },
          "pages": {
            "title": "Pages to fetch per search",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "1-based. Each page = up to `Result Count` listings.",
            "default": 1
          },
          "resultCount": {
            "title": "Results per page",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Min 1, Max 200. Default 50.",
            "default": 50
          },
          "ownership": {
            "title": "Ownership Type",
            "enum": [
              "Any",
              "Freehold",
              "Condo",
              "TimeShare",
              "Leasehold"
            ],
            "type": "string",
            "description": "Filter by ownership.",
            "default": "Any"
          },
          "soldWithinDays": {
            "title": "Sold within (days)",
            "enum": [
              "",
              "30",
              "90",
              "365"
            ],
            "type": "string",
            "description": "Only when searchType=Sold. Allowed: 30, 90, 365 (or empty for any).",
            "default": ""
          },
          "openHouseOnly": {
            "title": "Open House Only",
            "type": "boolean",
            "description": "Only listings with an upcoming open house.",
            "default": false
          },
          "hasGarage": {
            "title": "Has Garage",
            "type": "boolean",
            "description": "Only listings with a garage.",
            "default": false
          },
          "hasPool": {
            "title": "Has Pool",
            "type": "boolean",
            "description": "Only listings with a pool.",
            "default": false
          },
          "hasFireplace": {
            "title": "Has Fireplace",
            "type": "boolean",
            "description": "Only listings with a fireplace.",
            "default": false
          },
          "hasAirConditioning": {
            "title": "Has Air Conditioning",
            "type": "boolean",
            "description": "Only listings with air conditioning.",
            "default": false
          },
          "publicOffersOnly": {
            "title": "Public Offers Only",
            "type": "boolean",
            "description": "Only listings with public offer system enabled.",
            "default": false
          },
          "keywords": {
            "title": "Keywords",
            "type": "string",
            "description": "Free-text amenities (e.g. `waterfront, finished basement`).",
            "default": ""
          },
          "autocomplete_inputs": {
            "title": "Autocomplete query (one per line)",
            "type": "array",
            "description": "Realtor.ca search-box suggestions: cities, postal codes, MLS numbers, addresses.",
            "items": {
              "type": "string"
            }
          },
          "agent_search_inputs": {
            "title": "Agent search query — name or location (one per line)",
            "type": "array",
            "description": "Search Realtor.ca's IndividualSearch. Each query pushes one row per matching agent.",
            "items": {
              "type": "string"
            }
          },
          "agent_detail_inputs": {
            "title": "Agent ID (one per line)",
            "type": "array",
            "description": "Pulled from the `id` field on any agent search result. Pushes full agent profile (bio, specialties, areas served, listings).",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}