1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrls": [
12 {
13 "url": "https://www.hostelworld.com/hostels/europe/england/london/"
14 }
15 ],
16 "propertyType": "hostel",
17 "currency": "GBP",
18 "language": "en",
19 "maxListings": 200,
20 "maxCitiesPerCountry": 25,
21 "maxReviewsPerProperty": 10,
22 "includeDetails": true,
23 "includeReviews": true,
24 "concurrency": 8,
25 "maxExpansionCountries": 10,
26 "maxCountryProbes": 20,
27 "maxRequestsPerCrawl": 0,
28 "proxy": {
29 "useApifyProxy": false
30 }
31};
32
33
34const run = await client.actor("ahmed_jasarevic/hostelworld-scraper").call(input);
35
36
37console.log('Results from dataset');
38console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44