1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "mode": "videos",
10 "videoUrls": [
11 "https://www.tiktok.com/@tiktok/video/7673909736131038495",
12 "https://www.tiktok.com/@scout2015/video/6718335390845095173",
13 ],
14 "usernames": ["tiktok"],
15 "maxVideosPerUser": 10,
16 "profileSorting": "latest",
17 "profileScrapeSections": ["videos"],
18 "excludePinnedPosts": False,
19 "minCommentLikes": 0,
20 "commentsSinceDays": 0,
21 "maxRepliesPerComment": 5,
22 "replyPatienceSeconds": 10,
23 "maxCommentsPerVideo": 20,
24 "topLevelCommentsPerPost": 0,
25 "maxPagesPerVideo": 0,
26 "pagePatienceSeconds": 120,
27 "maxAttemptsPerPage": 0,
28 "concurrency": 20,
29 "proxy": { "useApifyProxy": True },
30 "ignoreFieldsForChanges": [],
31 "maxNotifyListings": 50,
32}
33
34
35run = client.actor("abotapi/tiktok-comments-scraper").call(run_input=run_input)
36
37
38print(f"πΎ Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
39for item in client.dataset(run.default_dataset_id).iterate_items():
40 print(item)
41
42