1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "search",
12 "query": "python programming",
13 "usernames": "",
14 "authTokens": "",
15 "maxResults": 100,
16 "maxEmptyPages": 3,
17 "since": "",
18 "until": "",
19 "displayType": "Top",
20 "tweetType": "all",
21 "lang": "",
22 "langs": "",
23 "minLikes": 0,
24 "minRetweets": 0,
25 "minReplies": 0,
26 "hasImages": false,
27 "hasVideos": false,
28 "hasLinks": false,
29 "hasMentions": false,
30 "hasHashtags": false,
31 "verifiedOnly": false,
32 "blueVerifiedOnly": false,
33 "allWords": "",
34 "anyWords": "",
35 "exactPhrases": "",
36 "excludeWords": "",
37 "hashtagsAny": "",
38 "hashtagsExclude": "",
39 "fromUsers": "",
40 "toUsers": "",
41 "mentioningUsers": "",
42 "place": "",
43 "geocode": "",
44 "near": "",
45 "within": "",
46 "includeSearchTerms": false,
47 "proxyUrl": ""
48};
49
50
51const run = await client.actor("celebrated-quadraphonic/x-twitter-scraper-v3").call(input);
52
53
54console.log('Results from dataset');
55console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
56const { items } = await client.dataset(run.defaultDatasetId).listItems();
57items.forEach((item) => {
58 console.dir(item);
59});
60
61