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