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