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 "id": "pain1",
14 "title": "battery life complaint",
15 "mentions": 3400,
16 "complaintRate": 68,
17 "purchaseIntentPct": 44,
18 "urgencyPct": 73,
19 "featureRequestRate": 51
20 },
21 {
22 "id": "pain2",
23 "title": "color request",
24 "mentions": 820,
25 "complaintRate": 12,
26 "purchaseIntentPct": 18,
27 "urgencyPct": 15,
28 "featureRequestRate": 31
29 }
30 ],
31 "previousItems": [
32 {
33 "id": "pain1",
34 "title": "battery life complaint",
35 "mentions": 1900,
36 "complaintRate": 54,
37 "purchaseIntentPct": 30,
38 "urgencyPct": 52,
39 "featureRequestRate": 38
40 }
41 ]
42};
43
44
45const run = await client.actor("quanmatrix/reddit-consumer-painpoint-intelligence").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55