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=music&t=1670685477846",
15 "https://www.tiktok.com/search?q=dance&t=1670685484412",
16 "https://www.tiktok.com/search?q=challenge&t=1670685494590",
17 ],
18 "maxItems": 1000,
19 "endPage": 1,
20 "dateRange": "DEFAULT",
21 "location": "US",
22 "sortType": "RELEVANCE",
23 "customMapFunction": "(object) => { return {...object} }",
24}
25
26
27run = client.actor("epctex/tiktok-search-scraper").call(run_input=run_input)
28
29
30print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
31for item in client.dataset(run["defaultDatasetId"]).iterate_items():
32 print(item)
33
34