1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "currentItems": [
12 {
13 "flightKey": "AA-JFK-LAX-1",
14 "origin": "JFK",
15 "destination": "LAX",
16 "carrier": "AA",
17 "seats": 220,
18 "date": "2026-10-01"
19 },
20 {
21 "flightKey": "AA-JFK-LAX-2",
22 "origin": "JFK",
23 "destination": "LAX",
24 "carrier": "AA",
25 "seats": 220,
26 "date": "2026-10-01"
27 },
28 {
29 "flightKey": "DL-JFK-LAX-1",
30 "origin": "JFK",
31 "destination": "LAX",
32 "carrier": "DL",
33 "seats": 180,
34 "date": "2026-10-01"
35 }
36 ],
37 "previousItems": [
38 {
39 "flightKey": "AA-JFK-LAX-1",
40 "origin": "JFK",
41 "destination": "LAX",
42 "carrier": "AA",
43 "seats": 180,
44 "date": "2026-09-01"
45 },
46 {
47 "flightKey": "DL-JFK-LAX-1",
48 "origin": "JFK",
49 "destination": "LAX",
50 "carrier": "DL",
51 "seats": 180,
52 "date": "2026-09-01"
53 }
54 ]
55};
56
57
58const run = await client.actor("quanmatrix/airline-route-capacity-change-intelligence").call(input);
59
60
61console.log('Results from dataset');
62console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
63const { items } = await client.dataset(run.defaultDatasetId).listItems();
64items.forEach((item) => {
65 console.dir(item);
66});
67
68