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 "https://www.tiktok.com/@scout2015/video/6718335390845095173"
15 ],
16 "usernames": [
17 "tiktok"
18 ],
19 "maxVideosPerUser": 10,
20 "profileSorting": "latest",
21 "profileScrapeSections": [
22 "videos"
23 ],
24 "excludePinnedPosts": false,
25 "minCommentLikes": 0,
26 "commentsSinceDays": 0,
27 "maxRepliesPerComment": 5,
28 "replyPatienceSeconds": 10,
29 "maxCommentsPerVideo": 20,
30 "topLevelCommentsPerPost": 0,
31 "maxPagesPerVideo": 0,
32 "pagePatienceSeconds": 120,
33 "maxAttemptsPerPage": 0,
34 "concurrency": 20,
35 "proxy": {
36 "useApifyProxy": true
37 },
38 "ignoreFieldsForChanges": [],
39 "maxNotifyListings": 50
40};
41
42
43const run = await client.actor("abotapi/tiktok-comments-scraper").call(input);
44
45
46console.log('Results from dataset');
47console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
48const { items } = await client.dataset(run.defaultDatasetId).listItems();
49items.forEach((item) => {
50 console.dir(item);
51});
52
53