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