1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "tweetIDs": [
12 "1846987139428634858"
13 ],
14 "twitterContent": "from:elonmusk make -\"live laugh love\"",
15 "searchTerms": [
16 "from:elonmusk since:2024-01-01_00:00:00_UTC until:2024-01-02_00:00:00_UTC",
17 "from:NASA starsince:2024-01-01_00:00:00_UTC until:2024-01-02_00:00:00_UTC"
18 ],
19 "lang": "en",
20 "from": "elonmusk",
21 "to": "",
22 "@": "",
23 "list": "",
24 "near": "",
25 "within": "",
26 "geocode": "",
27 "since": "2021-12-31_23:59:59_UTC",
28 "until": "2024-12-31_23:59:59_UTC",
29 "since_time": "",
30 "until_time": "",
31 "since_id": "",
32 "max_id": "",
33 "within_time": "",
34 "conversation_id": "",
35 "quoted_tweet_id": "",
36 "quoted_user_id": "",
37 "card_name": "",
38 "url": ""
39};
40
41
42const run = await client.actor("kaitoeasyapi/twitter-x-data-tweet-scraper-pay-per-result-cheapest").call(input);
43
44
45console.log('Results from dataset');
46console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
47const { items } = await client.dataset(run.defaultDatasetId).listItems();
48items.forEach((item) => {
49 console.dir(item);
50});
51
52