1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "twPostUrl": "https://x.com/example/status/1234567890",
10 "auth_token": "example_auth_token",
11 "ct0": "example_ct0",
12 "kdt": "example_kdt",
13 "twid": "1234567890",
14 "user-agent": "Mozilla/5.0 ...",
15 "bearerToken": "Bearer example",
16 "guest_token": "1234567890",
17 "sec-ch-ua-platform": "macOS",
18 "authorization": "Bearer example",
19 "User-Agent": "Mozilla/5.0 ...",
20 "x-csrf-token": "example_x-csrf-token",
21 "txSmSelfProfileUrl": "https://twitter.com/example_self",
22 "proxy": {
23 "ip": "http://proxy.example.com",
24 "port": "1080",
25 "username": "example_username",
26 "password": "example_password",
27 },
28}
29
30
31run = client.actor("automationagents/twitter-tweet-scraper").call(run_input=run_input)
32
33
34print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
35for item in client.dataset(run["defaultDatasetId"]).iterate_items():
36 print(item)
37
38