1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "records": [
12 {
13 "id": "deal",
14 "title": "Tesla Model 3 2021",
15 "make": "Tesla",
16 "model": "Model 3",
17 "year": 2021,
18 "price": 15000,
19 "currency": "USD",
20 "publishedAt": "2026-08-20"
21 },
22 {
23 "id": "a",
24 "title": "Tesla Model 3 2021",
25 "make": "Tesla",
26 "model": "Model 3",
27 "year": 2021,
28 "price": 20500,
29 "currency": "USD"
30 },
31 {
32 "id": "b",
33 "title": "Tesla Model 3 2021",
34 "make": "Tesla",
35 "model": "Model 3",
36 "year": 2021,
37 "price": 21000,
38 "currency": "USD"
39 },
40 {
41 "id": "c",
42 "title": "Tesla Model 3 2021",
43 "make": "Tesla",
44 "model": "Model 3",
45 "year": 2021,
46 "price": 21500,
47 "currency": "USD"
48 }
49 ],
50 "minComparableCount": 3,
51 "minDiscountPercent": 10,
52 "maxResults": 20
53};
54
55
56const run = await client.actor("signal_lab/marketplace-deal-alerts").call(input);
57
58
59console.log('Results from dataset');
60console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
61const { items } = await client.dataset(run.defaultDatasetId).listItems();
62items.forEach((item) => {
63 console.dir(item);
64});
65
66