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 "twid": "1234567890",
13 "user-agent": "Mozilla/5.0 ...",
14 "bearerToken": "Bearer example",
15 "guest_token": "1234567890",
16 "sec-ch-ua-platform": "macOS",
17 "authorization": "Bearer example",
18 "User-Agent": "Mozilla/5.0 ...",
19 "txSmSelfProfileUrl": "https://twitter.com/example_self",
20 "proxy": {
21 "ip": "http://proxy.example.com",
22 "port": "1080",
23 "username": "example_username",
24 "password": "example_password"
25 }
26};
27
28
29const run = await client.actor("automationagents/twitter-profile-scraper").call(input);
30
31
32console.log('Results from dataset');
33console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
34const { items } = await client.dataset(run.defaultDatasetId).listItems();
35items.forEach((item) => {
36 console.dir(item);
37});
38
39