{
  "openapi": "3.0.1",
  "info": {
    "title": "OnTheMarket Property Scraper (UK)",
    "description": "Scrapes houses, flats and land for sale or to rent from OnTheMarket — the UK's #3 property portal after Rightmove and Zoopla. Search any town, city or outcode with price and bedroom filters; returns price, address, bedrooms, EPC, floorplans, full descriptions, photos and agent details.",
    "version": "0.1",
    "x-build-id": "w705JqQJqnXchMdpi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapyx~onthemarket-properties-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapyx-onthemarket-properties-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/scrapyx~onthemarket-properties-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapyx-onthemarket-properties-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/scrapyx~onthemarket-properties-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapyx-onthemarket-properties-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": {
          "searchType": {
            "title": "For sale or to rent",
            "enum": [
              "for-sale",
              "to-rent"
            ],
            "type": "string",
            "description": "Which side of the market to search.",
            "default": "for-sale"
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "property",
              "houses",
              "flats-apartments",
              "bungalows",
              "detached",
              "semi-detached",
              "terraced",
              "land",
              "farms-land",
              "mews",
              "character-property"
            ],
            "type": "string",
            "description": "Only these values are real OnTheMarket path segments — anything else returns HTTP 404. Use 'All property' unless you specifically want to narrow.",
            "default": "property"
          },
          "locations": {
            "title": "Locations",
            "type": "array",
            "description": "OnTheMarket location slugs — one search per entry, each with its own SEARCH_SUMMARY row. Towns, cities and outcodes all work: london, manchester, birmingham, bristol, leeds, edinburgh, sw1, greater-london. A human spelling like 'Milton Keynes' is slugified automatically. An unknown location returns a clean 404 reported as not_found, never silently-wrong results.\n\nBecause OnTheMarket caps each query at ~1,020 rows, several narrow locations return far more data than one broad one.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minPrice": {
            "title": "Minimum price (£)",
            "minimum": 0,
            "type": "integer",
            "description": "Leave empty or 0 for no minimum.",
            "default": 0
          },
          "maxPrice": {
            "title": "Maximum price (£)",
            "minimum": 0,
            "type": "integer",
            "description": "Leave empty or 0 for no maximum.",
            "default": 0
          },
          "minBedrooms": {
            "title": "Minimum bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Leave empty or 0 for any.",
            "default": 0
          },
          "maxBedrooms": {
            "title": "Maximum bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Leave empty or 0 for any.",
            "default": 0
          },
          "radius": {
            "title": "Search radius (miles)",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Widen the search around the location by this many miles. Leave empty or 0 for the location only.",
            "default": 0
          },
          "newHomesOnly": {
            "title": "New homes only",
            "type": "boolean",
            "description": "Restrict results to new-build properties.",
            "default": false
          },
          "sortField": {
            "title": "Sort by",
            "enum": [
              "",
              "update_date",
              "price",
              "keywords"
            ],
            "type": "string",
            "description": "Leave as default unless you need a specific order. Only these values work — OnTheMarket answers an unrecognised sort with HTTP 200 and ZERO results rather than an error, so anything else is refused before the run starts.",
            "default": ""
          },
          "sortOrder": {
            "title": "Sort direction",
            "enum": [
              "",
              "asc",
              "desc"
            ],
            "type": "string",
            "description": "Only applies when a sort field is chosen.",
            "default": ""
          },
          "propertyUrls": {
            "title": "Property URLs (direct mode)",
            "type": "array",
            "description": "Scrape specific listings directly, skipping search. Accepts a full URL (https://www.onthemarket.com/details/18956817/) or a bare numeric id. Can be combined with a location search in the same run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max properties per location",
            "minimum": 0,
            "type": "integer",
            "description": "Stop paginating a location after this many properties. Set to 0 for unlimited — note OnTheMarket itself stops at 1,020 rows per query (34 pages × 30) however many matches it reports, so unlimited means 'up to 1,020'. Split into smaller locations to reach the rest.",
            "default": 100
          },
          "includePropertyDetails": {
            "title": "Fetch full property details",
            "type": "boolean",
            "description": "Fetch the complete listing (full description, EPC, floorplans, key info, agent details, area stats, all photos) for each result via one extra request per property. Turn this off for a fast listing-only crawl — search rows already carry price, address, bedrooms, bathrooms, property type, features and photos.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrent requests",
            "minimum": 1,
            "maximum": 16,
            "type": "integer",
            "description": "Upper bound on requests in flight at once, across location pagination and detail fetches.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "OnTheMarket runs no active bot challenge and a direct connection works, but Residential is the default for cloud runs — container egress is a different posture than a home connection, and this portfolio has lost a full cloud run to that difference before.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}