1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "sourceMode": "sample",
10 "mode": "demo",
11 "startUrls": [
12 {
13 "url": "https://shop.tiktok.com/",
14 "sourceId": "TIKTOK-SHOP-PUBLIC",
15 "userData": { "sourceId": "TIKTOK-SHOP-PUBLIC" },
16 },
17 {
18 "url": "https://shop.tiktok.com/",
19 "sourceId": "TIKTOK-SHOP-CATEGORY",
20 "userData": { "sourceId": "TIKTOK-SHOP-CATEGORY" },
21 },
22 {
23 "url": "https://shop.tiktok.com/",
24 "sourceId": "TIKTOK-SHOP-SELLER",
25 "userData": { "sourceId": "TIKTOK-SHOP-SELLER" },
26 },
27 ],
28 "maxItems": 25,
29 "outputMode": "sample-records",
30}
31
32
33run = client.actor("zentrafoundry/tiktok-shop-product-intelligence-api").call(run_input=run_input)
34
35
36print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
37for item in client.dataset(run["defaultDatasetId"]).iterate_items():
38 print(item)
39
40