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