1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "profiles": [
12 "nasa"
13 ],
14 "resultsPerPage": 100,
15 "resultsPerHashtag": 100,
16 "commentsPerPost": 0,
17 "maxRepliesPerComment": 0,
18 "selectedFields": [
19 "id",
20 "webVideoUrl",
21 "text",
22 "createTime",
23 "createTimeISO",
24 "playCount",
25 "diggCount",
26 "commentCount",
27 "shareCount",
28 "collectCount",
29 "hashtags",
30 "mentions",
31 "authorMeta",
32 "musicMeta",
33 "videoMeta",
34 "input",
35 "fromProfileSection"
36 ]
37};
38
39
40const run = await client.actor("esdrasdw/tiktok-scraper").call(input);
41
42
43console.log('Results from dataset');
44console.log(`๐พ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50