# Hostelworld Hostel Listings Scraper (`devilscrapes/hostelworld-hostel-listings-scraper`) Actor

Search Hostelworld by city and get structured rows for every listed hostel — ratings breakdown, review count, shared/private pricing, city-center distance, badges, geo, and a direct detail-page link. No page-scraping guesswork, just clean JSON per city.

- **URL**: https://apify.com/devilscrapes/hostelworld-hostel-listings-scraper.md
- **Developed by:** [DevilScrapes](https://apify.com/devilscrapes) (community)
- **Categories:** Travel
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## Hostelworld Hostel Listings Scraper

**💰 $5.20 / 1 000 results**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Search Hostelworld by city and get structured rows for every listed hostel — ratings breakdown, review count, shared/private pricing, city-center distance, badges, geo, and a direct detail-page link. No page-scraping guesswork, just clean JSON per city.

</div>

***

### 🎯 What this scrapes

Hostelworld is the web's biggest budget-travel hostel marketplace, and its own city search is the only way to browse it. This Actor pastes your city list into that search box for you — feed it 1-N city names like "Barcelona", "Bangkok", or "New-York" and get back structured rows for every listed hostel: overall rating and the full 7-category ratings breakdown, review count, distance to city center, shared and private room pricing, badges, geo coordinates, and a direct detail-page link. Built on curl-cffi with rotating browser impersonation and Apify Proxy so a run finishes clean city after city.

### 🔥 What we handle for you

- 🛡️ **Browser fingerprint rotation** — `curl-cffi` impersonates real Chrome / Firefox TLS handshakes on every fetch, good hygiene on any target.
- 🔁 **Retries with exponential backoff** on `408 / 429 / 503` and network errors — up to 5 attempts per city, `Retry-After` honoured.
- 🧩 **Per-city fault isolation** — an unresolvable city or an unparseable page skips just that city with a logged warning; it never sinks the whole run.
- 🧊 **Clean, typed dataset rows** — Pydantic-validated, ISO-8601 timestamps, stable property IDs, JSON / CSV / Excel export straight from the Apify Console.
- 💰 **Pay-Per-Event pricing** — you only pay for results that hit your dataset. A city search that runs and matches nothing still succeeds — no data, no charge beyond the warm-up fee.

### 💡 Use cases

- Hostel-price monitoring — track shared/private pricing for a shortlist of cities before booking.
- Travel content/blog research — pull structured hostel data (ratings, badges, pricing) for city guides and roundups.
- Market research — compare hostel density, average ratings, and price bands across cities.
- Booking-site aggregation — feed structured hostel rows into a comparison tool or app.
- Alerting — diff successive runs to flag new listings or price changes for a given city set.

### ⚙️ How to use it

1. Click **Try for free** at the top of the page.
2. Fill in the input form — most fields have sensible defaults.
3. Click **Start**. Output streams into the run's dataset.
4. Export from **Storage → Dataset** as JSON, CSV, or Excel — or fetch via the API.

### 📥 Input

| Field | Type | Required | Default | Notes |
|---|---|:--:|---|---|
| `cities` | `array` | **yes** | \['Barcelona', 'Bangkok'] | 1-N free-text city names or slugs (e.g. Barcelona, Bangkok, New-York). Each city is a separate /hostels/{city} fetch;… |
| `maxResultsPerCity` | `integer` | no | 20 | Cap on rows returned per city, clamped to \[1, 30] (Hostelworld's confirmed single-page SSR ceiling). |
| `proxyConfiguration` | `object` | no | {'useApifyProxy': True, 'apifyProxyCountry': 'US'} | Apify Proxy spec. Country is pinned to US by default because Hostelworld's displayed currency is geo-sensitive. |

#### Example input

```json
{
  "cities": [
    "Barcelona",
    "Bangkok"
  ],
  "maxResultsPerCity": 5,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  }
}
```

### 📤 Output

Every row is one dataset item.

| Field | Type | Notes |
|---|---|---|
| `id` | `integer` | Hostelworld's internal numeric property ID. |
| `name` | `string` | Hostel / property display name. |
| `type` | `string` | Property type (e.g. HOSTEL). |
| `url_friendly_name` | `string` | URL-safe slug for the property name. |
| `address` | `string` | Street address. |
| `city` | `string` | City name as returned by Hostelworld. |
| `url_friendly_city` | `string` | URL-safe slug for the city. |
| `country` | `string` | Country name. |
| `url_friendly_country` | `string` | URL-safe slug for the country. |
| `continent` | `string` | Continent name. |
| `url_friendly_continent` | `string` | URL-safe slug for the continent. |
| `avg_rating` | `['number', 'null']` | Overall average guest rating (0-10 scale). |
| `number_reviews` | `integer` | Total number of guest reviews. |
| `city_center_distance` | `['number', 'null']` | Distance from city center in km. |
| `has_availability` | `boolean` | Whether the property currently shows availability. |
| `is_new` | `boolean` | Whether Hostelworld flags this as newly-listed. |
| `image_url` | `['string', 'null']` | Property image URL (medium, falling back to large then small). |
| `rating_breakdown` | `['object', 'null']` | Sub-scores: security, location, staff, atmosphere, cleanliness, value\_for\_money, facilities. |
| `shared_min_price` | `['object', 'null']` | Cheapest shared-dorm bed price (value + currency). |
| `private_min_price` | `['object', 'null']` | Cheapest private-room price (value + currency). |
| `detail_url` | `string` | Direct property detail-page URL, constructed without an extra fetch. |
| `badges` | `array` | Badge labels shown on the listing (e.g. Breakfast Included). |
| `search_city` | `string` | The input city query that produced this row. |
| `search_total_properties_count` | `integer` | Total properties Hostelworld reports for this city. |
| `scraped_at` | `string` | ISO-8601 UTC timestamp when this row's city was fetched. |

#### Example output

```json
{
  "id": 722,
  "name": "Kabul Party Hostel Barcelona",
  "type": "HOSTEL",
  "url_friendly_name": "kabul-party-hostel-barcelona",
  "address": "Plaza Real 17",
  "city": "Barcelona",
  "url_friendly_city": "barcelona",
  "country": "Spain",
  "url_friendly_country": "spain",
  "continent": "Europe",
  "url_friendly_continent": "europe",
  "avg_rating": 9.48,
  "number_reviews": 11584,
  "city_center_distance": 0.92,
  "has_availability": true,
  "is_new": false,
  "image_url": "https://a.hwstatic.com/...",
  "rating_breakdown": {
    "security": 9.72,
    "location": 9.75,
    "staff": 9.69,
    "atmosphere": 9.4,
    "cleanliness": 9.31,
    "value_for_money": 9.22,
    "facilities": 9.33
  },
  "shared_min_price": {
    "value": 18.63,
    "currency": "EUR"
  },
  "private_min_price": {
    "value": 30.3,
    "currency": "EUR"
  },
  "detail_url": "https://www.hostelworld.com/hostels/p/722/kabul-party-hostel-barcelona/",
  "badges": [
    "Breakfast Included"
  ],
  "search_city": "Barcelona",
  "search_total_properties_count": 112,
  "scraped_at": "2026-09-15T12:00:00.000Z"
}
```

### 💰 Pricing

Pay-Per-Event — you pay only when these events fire:

| Event | USD | What it is |
|---|---:|---|
| `actor-start` | $0.2 | One-off warm-up charge per run |
| `result-row` | $0.005 | Per unique dataset item |

Example: 1 000 results at the rates above ≈ **$5.20**. No subscription, no minimum, no card to start — Apify gives every new account $5 of free credit.

### 🚧 Limitations

Only page 1 of each city's listings is server-rendered (up to 30 properties) — `search_total_properties_count` on every row tells you how many more exist. Individual property detail pages (full amenities, room types, photo galleries) and booking/availability-calendar data are not scraped in v1.

### ❓ FAQ

**Is this legal?**

We only fetch content the source makes publicly available. Respect any platform terms of service before using output commercially.

**How do I export to Sheets?**

After the run, click *Storage → Dataset → Export* and pick CSV. Google Sheets imports it directly.

**Why is my run slow?**

Some sources rate-limit aggressively. The Actor backs off automatically. Lower the `maxResults` setting if you're testing.

### 💬 Your feedback

Spotted a bug, hit a weird edge case, or need a new field? Open an
issue on the Actor's **Issues** tab on Apify Console — we ship
fixes weekly and we read every report.

***

<div align="center">

Built by **[Devil Scrapes](https://apify.com/DevilScrapes)** 😈 — a small fleet of
opinionated public-data Actors. Honest pricing, real engineering, zero fine print.

</div>

# Actor input Schema

## `cities` (type: `array`):

1-N free-text city names or slugs (e.g. <code>Barcelona</code>, <code>Bangkok</code>, <code>New-York</code>). Each city is a separate <code>/hostels/{city}</code> fetch; an unresolvable city is skipped, not fatal.

## `maxResultsPerCity` (type: `integer`):

Cap on rows returned per city. Hostelworld server-renders at most 30 properties on a single city page (its confirmed single-page ceiling), so values above 30 are clamped, not rejected.

## `proxyConfiguration` (type: `object`):

Apify Proxy spec — mandatory field. Country is pinned to US by default because Hostelworld's displayed currency is geo-sensitive; a geo-random exit can return plausible-but-wrong pricing.

## Actor input object example

```json
{
  "cities": [
    "Barcelona",
    "Bangkok"
  ],
  "maxResultsPerCity": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "cities": [
        "Barcelona",
        "Bangkok"
    ],
    "maxResultsPerCity": 20,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/hostelworld-hostel-listings-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 = {
    "cities": [
        "Barcelona",
        "Bangkok",
    ],
    "maxResultsPerCity": 20,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("devilscrapes/hostelworld-hostel-listings-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 '{
  "cities": [
    "Barcelona",
    "Bangkok"
  ],
  "maxResultsPerCity": 20,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyCountry": "US"
  }
}' |
apify call devilscrapes/hostelworld-hostel-listings-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devilscrapes/hostelworld-hostel-listings-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/zjudQ5UXGbKdkauNS/builds/ioUNf1lecsufIe4ek/openapi.json
