1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchTerms": [
12 "ai"
13 ],
14 "searchUrls": [],
15 "All_of_these_words": "",
16 "This_exact_phrase": "",
17 "Any_of_these_words": "",
18 "None_of_these_words": "",
19 "These_hashtags": "",
20 "From_these_accounts": "",
21 "To_these_accounts": "",
22 "Mentioning_these_accounts": "",
23 "Minimum_replies": 0,
24 "Minimum_likes": 0,
25 "Minimum_reposts": 0,
26 "startDate": "",
27 "endDate": "",
28 "splitMode": "day",
29 "sortBy": "Top",
30 "maxItems": 80,
31 "language": "any",
32 "mediaType": "any",
33 "geoNear": "",
34 "geoWithin": ""
35};
36
37
38const run = await client.actor("delicious_zebu/ultimate-x-twitter-advanced-search-scraper").call(input);
39
40
41console.log('Results from dataset');
42console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48