1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "twid": "u%3D1234567890",
10 "proxy": {
11 "ip": "http://proxy.example.com",
12 "port": "1080",
13 "username": "example_username",
14 "password": "example_password",
15 },
16 "maxCount": 10,
17 "guest_token": "2071493852049846302",
18 "twProfileUrl": "https://x.com/OpenAI",
19 "authorization": "Bearer ...",
20 "twExtractionMode": "IOh4aS6UdGWGJUYTqliQ7Q/Followers",
21 "user-agent": "Mozilla/5.0 ...",
22 "User-Agent": "Mozilla/5.0 ...",
23 "sec-ch-ua-platform": "macOS",
24 "txSmSelfProfileUrl": "https://twitter.com/example_self",
25}
26
27
28run = client.actor("automationagents/twitter-followers-following-export").call(run_input=run_input)
29
30
31print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
32for item in client.dataset(run["defaultDatasetId"]).iterate_items():
33 print(item)
34
35