1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "sampleData": True,
10 "market": "US",
11 "currency": "USD",
12 "windowDays": 7,
13 "maxProducts": 100,
14 "currentSnapshot": {
15 "shopId": "demo-shop",
16 "sourceId": "seller-export",
17 "coverage": "shop videos",
18 "contentDefinition": "unique linked video IDs",
19 "complete": True,
20 "observedAt": "2026-11-08T00:00:00Z",
21 },
22 "previousSnapshot": {
23 "shopId": "demo-shop",
24 "sourceId": "seller-export",
25 "coverage": "shop videos",
26 "contentDefinition": "unique linked video IDs",
27 "complete": True,
28 "observedAt": "2026-11-01T00:00:00Z",
29 },
30 "productsFile": { "rows": [
31 {
32 "shopId": "demo-shop",
33 "market": "US",
34 "currency": "USD",
35 "productId": "DEMO-1",
36 "observedAt": "2026-11-08T00:00:00Z",
37 "productName": "Synthetic tea tin",
38 "price": 12,
39 },
40 {
41 "shopId": "demo-shop",
42 "market": "US",
43 "currency": "USD",
44 "productId": "DEMO-2",
45 "observedAt": "2026-11-08T00:00:00Z",
46 "productName": "Synthetic cup",
47 "price": 9,
48 },
49 ] },
50 "contentFile": { "rows": [
51 {
52 "shopId": "demo-shop",
53 "market": "US",
54 "currency": "USD",
55 "productId": "DEMO-1",
56 "observedAt": "2026-11-01T00:00:00Z",
57 "contentId": "v1",
58 "creatorId": "c1",
59 },
60 {
61 "shopId": "demo-shop",
62 "market": "US",
63 "currency": "USD",
64 "productId": "DEMO-1",
65 "observedAt": "2026-11-08T00:00:00Z",
66 "contentId": "v1",
67 "creatorId": "c1",
68 },
69 {
70 "shopId": "demo-shop",
71 "market": "US",
72 "currency": "USD",
73 "productId": "DEMO-1",
74 "observedAt": "2026-11-08T00:00:00Z",
75 "contentId": "v2",
76 "creatorId": "c1",
77 },
78 {
79 "shopId": "demo-shop",
80 "market": "US",
81 "currency": "USD",
82 "productId": "DEMO-1",
83 "observedAt": "2026-11-08T00:00:00Z",
84 "contentId": "v3",
85 "creatorId": "c2",
86 },
87 ] },
88 "optionalSalesFile": { "rows": [{
89 "shopId": "demo-shop",
90 "market": "US",
91 "currency": "USD",
92 "productId": "DEMO-1",
93 "observedAt": "2026-11-08T00:00:00Z",
94 "basis": "cumulative",
95 "metric": "units",
96 "definition": "Seller-reported lifetime units",
97 "value": 58,
98 }] },
99 "optionalCommissionFile": { "rows": [
100 {
101 "shopId": "demo-shop",
102 "market": "US",
103 "currency": "USD",
104 "productId": "DEMO-1",
105 "observedAt": "2026-11-01T00:00:00Z",
106 "ratePercent": 5,
107 "eligibility": "Approved campaign A creators",
108 "offerId": "A",
109 },
110 {
111 "shopId": "demo-shop",
112 "market": "US",
113 "currency": "USD",
114 "productId": "DEMO-1",
115 "observedAt": "2026-11-08T00:00:00Z",
116 "ratePercent": 8,
117 "eligibility": "Approved campaign A creators",
118 "offerId": "A",
119 },
120 ] },
121}
122
123
124run = client.actor("afkdigital/tiktok-shop-product-momentum-intelligence").call(run_input=run_input)
125
126
127print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
128for item in client.dataset(run.default_dataset_id).iterate_items():
129 print(item)
130
131