1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "startUrl": "https://us.trip.com/hotels/list?city=228&provinceId=0&countryId=78&checkIn=2026-05-18&checkOut=2026-05-30&lat=0&lon=0&districtId=0&barCurr=PKR&searchType=CT&searchValue=undefined&crn=1&adult=2&children=0&searchBoxArg=t&ctm_ref=ix_sb_dl&travelPurpose=0&domestic=false",
12 "results_wanted": 20,
13 "max_pages": 3
14};
15
16
17const run = await client.actor("shahidirfan/trip-com-hotels-scraper").call(input);
18
19
20console.log('Results from dataset');
21console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
22const { items } = await client.dataset(run.defaultDatasetId).listItems();
23items.forEach((item) => {
24 console.dir(item);
25});
26
27