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