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 "startUrls": [
20 "https://stocktwits.com/symbol/AAPL"
21 ],
22 "sentiment": "all",
23 "fetchReplies": false,
24 "maxItems": 20,
25 "incrementalMode": false,
26 "emitUnchanged": false,
27 "emitExpired": false,
28 "maxNotifyListings": 50,
29 "proxyConfiguration": {
30 "useApifyProxy": true
31 }
32};
33
34
35const run = await client.actor("abotapi/stocktwits-com-scraper").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45