1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "symbols",
10 "symbols": ["AAPL"],
11 "sort": "all",
12 "usernames": ["Stocktwits"],
13 "messageUrls": [
14 "https://stocktwits.com/Franking71/message/666335354",
15 "https://stocktwits.com/StocktwitsNews/message/666343730",
16 ],
17 "startUrls": [
18 "https://stocktwits.com/symbol/AAPL",
19 "https://stocktwits.com/symbol/AAPL?filter=top",
20 "https://www.stocktwits.com/symbol/TSLA",
21 "https://stocktwits.com/symbol/BTC.X",
22 "https://stocktwits.com/symbol/BRK.B",
23 "https://stocktwits.com/Franking71",
24 "https://stocktwits.com/Franking71/message/666335354",
25 "https://stocktwits.com/symbol/AAPL/sentiment",
26 "https://stocktwits.com/symbol/AAPL/news",
27 "https://stocktwits.com/sentiment/trending",
28 "https://stocktwits.com/markets/trending",
29 "https://stocktwits.com/topic/earnings",
30 ],
31 "sentiment": "all",
32 "onlyPriceTargets": False,
33 "fetchReplies": False,
34 "maxItems": 20,
35 "proxyConfiguration": { "useApifyProxy": True },
36 "incrementalMode": False,
37 "emitUnchanged": False,
38 "emitExpired": False,
39 "ignoreFieldsForChanges": [],
40 "maxNotifyListings": 50,
41}
42
43
44run = client.actor("abotapi/stocktwits-com-scraper").call(run_input=run_input)
45
46
47print(f"πΎ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
48for item in client.dataset(run.default_dataset_id).iterate_items():
49 print(item)
50
51