1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "origins": [
13 "JFK"
14 ],
15 "destinations": [
16 "LHR"
17 ],
18 "cabin": "economy",
19 "passengers": 1,
20 "sortBy": "points",
21 "links": [
22 {
23 "url": "https://www.pointhound.com/flights?q=CiIKA0pGSxIbSm9obiBGIEtlbm5lZHkgSW50bCBBaXJwb3J0Eh4KA0xIUhIXTG9uZG9uIEhlYXRocm93IEFpcnBvcnQaCjIwMjYtMTItMTUoATAB"
24 },
25 {
26 "url": "https://www.pointhound.com/explore/search/ChgKA05ZQxIRTmV3IFlvcmssIE5ZIEFyZWESFgoDTE9OEg9Mb25kb24sIFVLIEFyZWEaGAoKMjAyNi0xMi0wMRIKMjAyNi0xMi0xNSABKAEwATgDYgBoAXgCgAEB"
27 },
28 {
29 "url": "https://www.pointhound.com/flight/off_dlnqlVV1Z2"
30 }
31 ],
32 "maxItems": 20,
33 "maxPages": 0,
34 "proxyConfiguration": {
35 "useApifyProxy": true
36 },
37 "incrementalMode": false,
38 "maxNotifyListings": 50
39};
40
41
42const run = await client.actor("abotapi/pointhound-award-flight-scraper").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52