1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "videos",
12 "videoUrls": [
13 "https://www.tiktok.com/@tiktok/video/7673909736131038495"
14 ],
15 "usernames": [
16 "tiktok"
17 ],
18 "maxVideosPerUser": 10,
19 "minCommentLikes": 0,
20 "commentsSinceDays": 0,
21 "maxRepliesPerComment": 5,
22 "replyPatienceSeconds": 10,
23 "maxCommentsPerVideo": 20,
24 "maxPagesPerVideo": 0,
25 "pagePatienceSeconds": 120,
26 "maxAttemptsPerPage": 0,
27 "concurrency": 20,
28 "maxNotifyListings": 50,
29 "proxy": {
30 "useApifyProxy": true
31 }
32};
33
34
35const run = await client.actor("abotapi/tiktok-comments-scraper").call(input);
36
37
38console.log('Results from dataset');
39console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
40const { items } = await client.dataset(run.defaultDatasetId).listItems();
41items.forEach((item) => {
42 console.dir(item);
43});
44
45