1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "source_mode": "search",
12 "search_query": "from:elonmusk",
13 "profile_urls": [],
14 "relationship": "followers",
15 "search_sort": "Top",
16 "since": "",
17 "until": "",
18 "lang": "",
19 "all_words": [],
20 "any_words": [],
21 "exact_phrases": [],
22 "exclude_words": [],
23 "hashtags_any": [],
24 "hashtags_exclude": [],
25 "from_users": [],
26 "to_users": [],
27 "mentioning_users": [],
28 "tweet_type": "all",
29 "verified_only": false,
30 "blue_verified_only": false,
31 "has_images": false,
32 "has_videos": false,
33 "has_links": false,
34 "has_mentions": false,
35 "has_hashtags": false,
36 "min_likes": 0,
37 "min_replies": 0,
38 "min_retweets": 0,
39 "place": "",
40 "geocode": "",
41 "near": "",
42 "within": "",
43 "max_items": 1000
44};
45
46
47const run = await client.actor("altimis/scweet").call(input);
48
49
50console.log('Results from dataset');
51console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57