1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "from": "AMM",
12 "to": "LHR",
13 "departDate": "+45d",
14 "routes": [
15 {
16 "from": "DXB",
17 "to": "CAI",
18 "departDate": "+30d",
19 "returnDate": "+37d",
20 "adults": 2,
21 "targetPrice": 350
22 }
23 ],
24 "currency": "USD",
25 "mode": "watch",
26 "proxyConfiguration": {
27 "useApifyProxy": true
28 }
29};
30
31
32const run = await client.actor("almoutasem_nabil/google-flights-price-watch").call(input);
33
34
35console.log('Results from dataset');
36console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
37const { items } = await client.dataset(run.defaultDatasetId).listItems();
38items.forEach((item) => {
39 console.dir(item);
40});
41
42