1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "search": [
10 "anime",
11 "tiktok",
12 ],
13 "startUrls": [
14 "https://www.tiktok.com/search?q=%23music&t=1670685477846",
15 "https://www.tiktok.com/search?q=%23dance&t=1670685484412",
16 "https://www.tiktok.com/search?q=%23challenge&t=1670685494590",
17 ],
18 "maxItems": 1000,
19 "endPage": 1,
20 "extendOutputFunction": "($) => { return {} }",
21 "customMapFunction": "(object) => { return {...object} }",
22}
23
24
25run = client.actor("epctex/tiktok-hashtag-scraper").call(run_input=run_input)
26
27
28print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
29for item in client.dataset(run["defaultDatasetId"]).iterate_items():
30 print(item)
31
32