# Complete SpareRoom Scraper (UK & US) + Alerts & Emails (`codingfrontend/spareroom-scraper`) Actor

Extracts public SpareRoom UK and US listing data from search or detail pages for rooms offered, rooms wanted, and buddy-up listings.

- **URL**: https://apify.com/codingfrontend/spareroom-scraper.md
- **Developed by:** [Coding Frontned](https://apify.com/codingfrontend) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### What this Actor does

This Actor collects listing details shown on public [SpareRoom UK](https://www.spareroom.co.uk/) and [SpareRoom US](https://www.spareroom.com/) search and listing pages. It can return room offered, room wanted, and buddy-up listings when those details are present on the page.

Use the results to compare advertised room prices, review listings in an area, or keep a dataset of the public listings returned by a search. The Actor reads public pages and does not sign in or bypass access controls.

### Get started

1. Open the Actor's **Input** tab.
2. Add one or more SpareRoom search or listing URLs. You can also enter a plain location and choose its country.
3. Choose how many listings and pages to collect. The defaults are suitable for a small first run.
4. Click **Start**.
5. Open the **Dataset** link to view results, or use the **Output summary** link for the run status and saved listing count.

The Actor opens each public listing page to collect the full description, availability date, and listing photo gallery when available. If a detail page cannot be read, it keeps the usable search result and marks the run as having limited results.

The Actor follows a next-page link only when it is present on the page. It removes duplicate listing URLs across your start URLs, ignoring click-tracking parameters. It does not provide filters or sorting controls; use a SpareRoom search URL with the filters you want.

### Input settings

All top-level input fields are optional. If `startUrls` is omitted or empty, the Actor uses its default London, UK search URL. Every entry in `startUrls` must contain a `url` string. You can enter an HTTPS URL on the official UK or US SpareRoom domain, or a plain location name.

#### Search settings

| Field | Type | Required? | Default | What it does |
| --- | --- | --- | --- | --- |
| `startUrls` | Array of objects with a `url` string | Optional | London, UK search URL | One or more public SpareRoom search/listing URLs or plain location names. Maximum 50 entries. Duplicate listings are saved once across all entries. |
| `country` | Text: `auto`, `UK`, or `US` | Optional | `auto` | Chooses the domain for plain location names. Full URLs keep their own domain. `auto` treats UK postcode areas such as `SW1A` as UK; other plain locations default to US. Choose `UK` or `US` for city names. |

#### Result limits

| Field | Type | Required? | Default | What it does |
| --- | --- | --- | --- | --- |
| `maxItems` | Integer, 1–500 | Optional | `50` | Maximum number of valid listing records to save across all start URLs. |
| `maxPages` | Integer, 1–20 | Optional | `1` | Maximum pages to follow for each start URL. Pagination uses an explicit next-page link found on the page. |

#### Advanced settings (Developer Options)

| Field | Type | Required? | Default | What it does |
| --- | --- | --- | --- | --- |
| `requestDelayMs` | Integer, 0–30,000 | Optional | `0` | Wait time in milliseconds between all search, pagination, and listing-detail requests. |
| `requestTimeoutSecs` | Integer, 5–120 | Optional | `30` | Maximum wait for each page response, in seconds. |
| `maxResponseBytes` | Integer, 100,000–20,000,000 | Optional | `5,000,000` | Maximum response size. A larger response is skipped. |

#### Input examples

A small search on SpareRoom UK:

```json
{
  "startUrls": [
    { "url": "https://www.spareroom.co.uk/flatshare/london/" }
  ],
  "maxItems": 10
}
```

Search more than one area. Duplicate listing URLs across these pages are saved once:

```json
{
  "startUrls": [
    { "url": "https://www.spareroom.co.uk/flatshare/london/" },
    { "url": "https://www.spareroom.co.uk/flatshare/manchester/" }
  ],
  "country": "UK",
  "maxItems": 40
}
```

Use a plain city name. Set the country because `auto` routes non-postcode city names to the US site:

```json
{
  "startUrls": [
    { "url": "London" }
  ],
  "country": "UK",
  "maxItems": 20
}
```

Follow more pages and add a pause between them:

```json
{
  "startUrls": [
    { "url": "https://www.spareroom.com/flatshare/new-york/" }
  ],
  "country": "US",
  "maxItems": 75,
  "maxPages": 3,
  "requestDelayMs": 1000
}
```

### Results

Each dataset item represents a listing. The example below is **illustrative**; its values are not verified live results. Optional fields may be absent when a page does not provide them. A failed detail request preserves any description, date, or thumbnail already available from the search page.

```json
{
  "recordId": "listing:e45f4b07e4e14b8d49dbae86",
  "category": "real-estate",
  "recordCategory": "room-listing",
  "canonicalUrl": "https://www.spareroom.co.uk/flatshare/london/18420123",
  "listingId": "18420123",
  "listingType": "room-offered",
  "title": "Bright double room near Camden",
  "url": "https://www.spareroom.co.uk/flatshare/london/18420123",
  "description": "Furnished double room in a shared flat, close to local transport. Shared kitchen and garden. Available from 1 November 2026.",
  "price": 950,
  "priceCurrency": "GBP",
  "location": "Camden, London",
  "availableFrom": "2026-11-01T00:00:00.000Z",
  "imageUrls": [
    "https://photos.spareroom.co.uk/listing/18420123/main.jpg",
    "https://photos.spareroom.co.uk/listing/18420123/kitchen.jpg"
  ]
}
```

| Field | Type | Required? | Meaning |
| --- | --- | --- | --- |
| `recordId` | Text | Required | Stable ID derived from the listing URL. |
| `category` | Text | Required | Broad category, currently `real-estate`. |
| `recordCategory` | Text | Required | Listing category, currently `room-listing`. |
| `canonicalUrl` | URL | Required | Canonical form of the listing URL. |
| `listingId` | Text | Optional | SpareRoom listing ID when it is visible in the page. |
| `listingType` | Text | Required | `room-offered`, `room-wanted`, or `buddy-up`. |
| `title` | Text | Required | Public listing title. |
| `url` | URL | Required | Link to the listing. |
| `description` | Text | Optional | Full public description from the listing page when available; otherwise the search teaser. |
| `price` | Number | Optional | Advertised rent, or a room-wanted listing's stated budget, when it can be read from the page. Prices retain the source's billing period; this field does not convert weekly rent to monthly rent. |
| `priceCurrency` | Text | Optional | Currency shown or identified with the advertised price. |
| `location` | Text | Optional | Public area or location text. A room-wanted detail page may provide several preferred areas, separated by semicolons. |
| `availableFrom` | Date and time | Optional | Availability date when the page provides an explicit date. “Available now” has no fixed date and is omitted. |
| `imageUrls` | Array of URLs | Optional | Public listing photo gallery when available; otherwise the search thumbnail. |

You can download the dataset in various formats such as JSON, HTML, CSV, or Excel.

### Run status

- **SUCCEEDED** means at least one valid listing was saved and collection completed normally.
- **SUCCEEDED with limited results** means at least one listing was saved before a later page, source, listing-detail request, or dataset write failed. Earlier saved listings remain available.
- **FAILED** means no valid listing was saved. Empty or blocked pages do not create placeholder dataset items.

### Output summary

The **Output summary** link opens the `OUTPUT_SUMMARY` record in the run's default **Key-value store**. It is separate from the listing dataset and contains only the run status, number of saved listings, and whether collection was partial.

```json
{
  "status": "SUCCEEDED",
  "itemsStored": 25,
  "isPartial": false
}
```

| Field | Type | Required? | Meaning |
| --- | --- | --- | --- |
| `status` | Text: `SUCCEEDED` or `FAILED` | Required | `SUCCEEDED` when one or more listing writes completed; otherwise `FAILED`. |
| `itemsStored` | Nonnegative integer | Required | Number of validated listing records whose dataset writes completed. |
| `isPartial` | Boolean | Required | `true` when a later collection or write failure occurred after listings were saved. |

### Tips and access

- Use the search page on SpareRoom to choose the location and search criteria before copying its URL into the input.
- Only publicly accessible pages on the official SpareRoom UK and US domains are accepted. The Actor does not log in or bypass access controls; a site restriction can leave a run with no results.
- For a small run, keep `maxItems` low. Increasing page and result limits can use more run time and network resources. Each search result adds one detail-page request; requests are made one at a time.
- Apify compute and network usage may incur charges according to your Apify plan and run settings. Check your plan for current rates; this README does not set a price.
- For help with a run, review its log and the results shown in the Dataset and Output summary links. Follow SpareRoom's terms and applicable privacy and data-protection rules when using listing data.

# Actor input Schema

## `startUrls` (type: `array`):

Public SpareRoom UK/US search or listing URLs, or plain location names. Plain locations use the country setting.

## `country` (type: `string`):

Used only for plain location names. Full SpareRoom URLs use their own country domain.

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

Maximum number of valid listing records to save.

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

Maximum pages to follow for each start URL. The Actor follows only an explicit next-page link.

## `requestDelayMs` (type: `integer`):

Pause between sequential search, pagination, and listing-detail requests.

## `requestTimeoutSecs` (type: `integer`):

Maximum time to wait for each page response.

## `maxResponseBytes` (type: `integer`):

Responses larger than this limit are skipped.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.spareroom.co.uk/flatshare/london/"
    }
  ],
  "country": "auto",
  "maxItems": 50,
  "maxPages": 1,
  "requestDelayMs": 0,
  "requestTimeoutSecs": 30,
  "maxResponseBytes": 5000000
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing the public listing records saved during the run.

## `runSummary` (type: `string`):

Three-field run status and saved-listing count from the default key-value store.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("codingfrontend/spareroom-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("codingfrontend/spareroom-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call codingfrontend/spareroom-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codingfrontend/spareroom-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/OB2L4eTgYYH5HiHOK/builds/EIVMNhprCLygPNw2V/openapi.json
