1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "symbols",
12 "symbols": [
13 "AAPL"
14 ],
15 "sort": "all",
16 "usernames": [
17 "Stocktwits"
18 ],
19 "messageUrls": [
20 "https://stocktwits.com/Franking71/message/666335354",
21 "https://stocktwits.com/StocktwitsNews/message/666343730"
22 ],
23 "startUrls": [
24 "https://stocktwits.com/symbol/AAPL",
25 "https://stocktwits.com/symbol/AAPL?filter=top",
26 "https://www.stocktwits.com/symbol/TSLA",
27 "https://stocktwits.com/symbol/BTC.X",
28 "https://stocktwits.com/symbol/BRK.B",
29 "https://stocktwits.com/Franking71",
30 "https://stocktwits.com/Franking71/message/666335354",
31 "https://stocktwits.com/symbol/AAPL/sentiment",
32 "https://stocktwits.com/symbol/AAPL/news",
33 "https://stocktwits.com/sentiment/trending",
34 "https://stocktwits.com/markets/trending",
35 "https://stocktwits.com/topic/earnings"
36 ],
37 "sentiment": "all",
38 "onlyPriceTargets": false,
39 "fetchReplies": false,
40 "maxItems": 20,
41 "proxyConfiguration": {
42 "useApifyProxy": true
43 },
44 "incrementalMode": false,
45 "emitUnchanged": false,
46 "emitExpired": false,
47 "ignoreFieldsForChanges": [],
48 "maxNotifyListings": 50
49};
50
51
52const run = await client.actor("abotapi/stocktwits-com-scraper").call(input);
53
54
55console.log('Results from dataset');
56console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
57const { items } = await client.dataset(run.defaultDatasetId).listItems();
58items.forEach((item) => {
59 console.dir(item);
60});
61
62