1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "profiles": ["khaby.lame"],
10 "resultsPerPage": 10,
11 "profileScrapeSections": ["videos"],
12 "maxFollowersPerProfile": 0,
13 "maxFollowingPerProfile": 0,
14 "commentsPerPost": 0,
15 "maxRepliesPerComment": 0,
16 "proxyCountryCode": "None",
17 "mcpMode": "perPost",
18 "mcpMessage": """*@{{authorMeta.name}}* — {{diggCount}} likes · {{playCount}} views
19{{text}}
20{{webVideoUrl}}""",
21 "mcpMaxItems": 50,
22}
23
24
25run = client.actor("harshmaur/tiktok-scraper").call(run_input=run_input)
26
27
28print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
29for item in client.dataset(run.default_dataset_id).iterate_items():
30 print(item)
31
32