# Hostelz Hostel Listings Scraper (`muhammadafzal/hostelz-hostel-listings-scraper`) Actor

Scrape public Hostelz.com hostel listings by city or URL. Extract hostel names, ratings, reviews, prices, addresses, coordinates, descriptions, photos, and source links for travel research, accommodation discovery, price comparison, and hostel market analysis.

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

## Pricing

from $3.00 / 1,000 hostel listing scrapeds

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?

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

## Hostelz Hostel Listings Scraper

Scrape public Hostelz.com hostel listings by city or URL and export structured hostel data for travel research, accommodation discovery, price comparison, and hostel market analysis.

The default Store smoke run is intentionally bounded to one Bangkok search page and one listing with detail enrichment disabled. Increase `maxResults` or `maxPages`, or enable `includeDetails`, for larger collection jobs.

### Extracted fields

Each dataset record can include the hostel name, canonical URL, country, city, neighborhood, address, latitude, longitude, rating, review count, price text, currency, description, amenities, image URL, source URL, timestamp, and extraction warnings.

Use `locations` such as `Thailand/Bangkok`, or supply `startUrls` for a Hostelz city page or hostel detail URL. Set `includeDetails` to visit public detail pages for addresses, coordinates, descriptions, images, and structured data. The Actor supports bounded pagination, deduplication, session cookies, and optional Apify Proxy.

### Input examples

City search:

```json
{"locations":["Thailand/Bangkok"],"maxResults":25,"maxPages":3,"includeDetails":true}
```

Direct detail page:

```json
{"startUrls":[{"url":"https://www.hostelz.com/hostel/531360-Bedd-Hostel"}],"maxResults":1,"includeDetails":true}
```

### Pricing and limits

Pay per event pricing is $0.003 per schema-valid hostel record plus a $0.00005 run-start event. `maxResults` accepts 1–500 and `maxPages` accepts 1–20. A one-result run costs at most $0.00305 in Actor events, excluding any platform compute or optional proxy charges.

### Reliability and compliance

Hostelz may return a Cloudflare challenge. The Actor reports a truthful `BLOCKED` diagnostic, writes no fabricated records, and charges no result events when public access is denied. It does not bypass CAPTCHA, authentication, paywalls, or other access controls. Use only public pages and comply with Hostelz.com terms and applicable law.

### Example input

```json
{
  "locations": ["Thailand/Bangkok"],
  "maxResults": 25,
  "maxPages": 3,
  "includeDetails": true,
  "proxyConfiguration": { "useApifyProxy": true, "apifyProxyGroups": ["RESIDENTIAL"], "countryCode": "TH" }
}
```

Use only public pages and comply with Hostelz.com terms and applicable law.

# Actor input Schema

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

Use this for public Hostelz search or hostel detail URLs, for example https://www.hostelz.com/hostels/Thailand/Bangkok. Non-Hostelz URLs are not supported.

## `locations` (type: `array`):

Use this to generate Hostelz city pages in Country/City format, for example Thailand/Bangkok. Use startUrls for a direct page or a special neighborhood URL.

## `maxResults` (type: `integer`):

Use this to cap hostel records and result-event cost. Accepts 1–500; defaults to 1.

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

Use this to bound pagination on each city page. Accepts 1–20; defaults to 1.

## `includeDetails` (type: `boolean`):

Use this to visit each public Hostelz hostel detail page for description, address, rating, image, and structured data. Disabled by default for fast, reliable runs; enable it when enrichment is needed.

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

Use this when the target challenges direct traffic; Apify residential proxy may improve access. Do not use this to bypass authentication or CAPTCHA.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://www.hostelz.com/hostels/Thailand/Bangkok"
    }
  ],
  "locations": [],
  "maxResults": 1,
  "maxPages": 1,
  "includeDetails": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `summary` (type: `string`):

No description

## `hostelListings` (type: `string`):

No description

# 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 = {
    "startUrls": [
        {
            "url": "https://www.hostelz.com/hostels/Thailand/Bangkok"
        }
    ],
    "locations": [],
    "maxResults": 1,
    "maxPages": 1,
    "includeDetails": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("muhammadafzal/hostelz-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 = {
    "startUrls": [{ "url": "https://www.hostelz.com/hostels/Thailand/Bangkok" }],
    "locations": [],
    "maxResults": 1,
    "maxPages": 1,
    "includeDetails": False,
}

# Run the Actor and wait for it to finish
run = client.actor("muhammadafzal/hostelz-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 '{
  "startUrls": [
    {
      "url": "https://www.hostelz.com/hostels/Thailand/Bangkok"
    }
  ],
  "locations": [],
  "maxResults": 1,
  "maxPages": 1,
  "includeDetails": false
}' |
apify call muhammadafzal/hostelz-hostel-listings-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,muhammadafzal/hostelz-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/fHG36hgOH1JmExedw/builds/6lndwymRiCc9ASyrA/openapi.json
