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 "texAuVariables": {
22 "yourFullName": "Example Person",
23 "yourDescription": "Example role",
24 "yourCompanyDescription": "Example company",
25 "yourUsp": "Example USP"
26 },
27 "connectedAccountId": "example_connected_account_id",
28 "authorization": "Bearer ...",
29 "twExtractionMode": "IOh4aS6UdGWGJUYTqliQ7Q/Followers",
30 "user-agent": "Mozilla/5.0 ...",
31 "User-Agent": "Mozilla/5.0 ...",
32 "sec-ch-ua-platform": "macOS",
33 "txSmSelfProfileUrl": "https://twitter.com/example_self"
34};
35
36
37const run = await client.actor("automationagents/twitter-followers-following-export").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47