1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "twid": "u%3D1234567890",
12 "proxy": {
13 "ip": "http://proxy.example.com",
14 "port": "1080",
15 "username": "example_username",
16 "password": "example_password"
17 },
18 "maxCount": 10,
19 "guest_token": "2071493852049846302",
20 "twProfileUrl": "https://x.com/OpenAI",
21 "authorization": "Bearer ...",
22 "twExtractionMode": "IOh4aS6UdGWGJUYTqliQ7Q/Followers",
23 "user-agent": "Mozilla/5.0 ...",
24 "User-Agent": "Mozilla/5.0 ...",
25 "sec-ch-ua-platform": "macOS",
26 "txSmSelfProfileUrl": "https://twitter.com/example_self"
27};
28
29
30const run = await client.actor("automationagents/twitter-followers-following-export").call(input);
31
32
33console.log('Results from dataset');
34console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
35const { items } = await client.dataset(run.defaultDatasetId).listItems();
36items.forEach((item) => {
37 console.dir(item);
38});
39
40