1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "profiles": ["tiktok"],
10 "includeRecentPosts": True,
11 "maxPostsPerProfile": 50,
12 "includeProfileAnalytics": True,
13 "videoUrls": ["https://www.tiktok.com/@tiktok/video/7234567890123456789"],
14 "includeRelatedVideos": True,
15 "maxRelatedVideos": 20,
16 "followersProfiles": ["tiktok"],
17 "scrapeFollowers": True,
18 "scrapeFollowing": False,
19 "maxItemsPerProfile": 1000,
20 "commentVideoUrls": ["https://www.tiktok.com/@tiktok/video/7234567890123456789"],
21 "includeCommentReplies": True,
22 "maxComments": 100,
23 "maxReplies": 20,
24 "creatorSearchKeywords": ["fitness"],
25 "videoSearchKeywords": ["ai"],
26 "maxSearchResultsPerQuery": 100,
27 "hashtags": ["fyp"],
28 "maxHashtagPosts": 50,
29 "musicUrlsOrIds": [],
30 "maxMusicPosts": 50,
31}
32
33
34run = client.actor("datadoping/tiktok-scraper").call(run_input=run_input)
35
36
37print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
38for item in client.dataset(run.default_dataset_id).iterate_items():
39 print(item)
40
41