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": "m1",
14 "symbol": "NVDA",
15 "sentiment": "Bullish",
16 "body": "NVDA breakout and strong upside, bullish long setup",
17 "likes": 12,
18 "replies": 3
19 },
20 {
21 "id": "m2",
22 "symbol": "NVDA",
23 "sentiment": "Bullish",
24 "body": "NVDA momentum",
25 "likes": 8
26 },
27 {
28 "id": "m3",
29 "symbol": "TSLA",
30 "sentiment": "Bearish",
31 "body": "TSLA downside risk and bearish breakdown, short pressure",
32 "likes": 10,
33 "replies": 2
34 },
35 {
36 "id": "m4",
37 "symbol": "AAPL",
38 "sentiment": "Bullish",
39 "body": "AAPL constructive",
40 "likes": 2
41 }
42 ],
43 "previousItems": [
44 {
45 "id": "p1",
46 "symbol": "NVDA",
47 "sentiment": "Bearish",
48 "body": "NVDA bearish",
49 "likes": 3
50 },
51 {
52 "id": "p2",
53 "symbol": "TSLA",
54 "sentiment": "Bullish",
55 "body": "TSLA bullish",
56 "likes": 4
57 }
58 ]
59};
60
61
62const run = await client.actor("quanmatrix/stocktwits-sentiment-flow-intelligence").call(input);
63
64
65console.log('Results from dataset');
66console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
67const { items } = await client.dataset(run.defaultDatasetId).listItems();
68items.forEach((item) => {
69 console.dir(item);
70});
71
72