1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "service": "flights",
12 "market": "skyscanner.net",
13 "origin": "bkk",
14 "destination": "sin",
15 "place": "",
16 "placeSlug": "",
17 "entityId": "",
18 "geoId": "",
19 "hotelUrl": "",
20 "flightUrl": "",
21 "departureDate": "",
22 "returnDate": "",
23 "checkin": "",
24 "checkout": "",
25 "tripType": "roundtrip",
26 "adults": 1,
27 "children": 0,
28 "childrenv2": "",
29 "rooms": 1,
30 "cabinclass": "economy",
31 "driverAge": 30,
32 "preferDirects": false,
33 "dropoffGeoId": "",
34 "sort": "",
35 "includeDetail": false,
36 "maxResults": 1,
37 "workerBaseUrl": ""
38};
39
40
41const run = await client.actor("lentic_clockss/skyscanner-scraper").call(input);
42
43
44console.log('Results from dataset');
45console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51