1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "profiles": [
12 "elonmusk",
13 "https://x.com/openai"
14 ],
15 "searchQueries": [
16 "openai",
17 "elon musk"
18 ],
19 "scrapeProfileSearch": false,
20 "maxSearchResults": 20,
21 "enrichSearchResults": true,
22 "scrapeProfileDetails": true,
23 "scrapePosts": false,
24 "scrapeReplies": false,
25 "scrapeFollowers": false,
26 "scrapeFollowing": false,
27 "scrapeMedia": false,
28 "maxPosts": 100,
29 "includeReposts": true,
30 "includeRepliesInPosts": false,
31 "includeMediaOnly": false,
32 "maxReplies": 100,
33 "replyScope": "author",
34 "maxFollowers": 100,
35 "maxFollowing": 100,
36 "maxMedia": 100
37};
38
39
40const run = await client.actor("datadoping/x-twitter-profile-scraper").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50