1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "rows": [
10 {
11 "text": "今天的新品很好用 #科技",
12 "demo": True,
13 },
14 {
15 "text": "支持中文和英文 🌟",
16 "demo": True,
17 },
18 {
19 "text": "物流速度很快",
20 "demo": True,
21 },
22 {
23 "text": "这个价格很合适",
24 "demo": True,
25 },
26 {
27 "text": "@demo 下次再来 #购物",
28 "demo": True,
29 },
30 ],
31 "fields": ["text"],
32 "targetLanguage": "en",
33 "glossary": {},
34 "batchSize": 5,
35 "includePinyin": True,
36 "scriptMode": "traditional",
37 "detectLanguage": True,
38 "maxItems": 5,
39 "baseUrl": "https://openrouter.ai/api/v1",
40 "model": "deepseek/deepseek-v4-flash",
41 "maxOutputTokens": 768,
42 "maxTotalTokens": 40000,
43 "temperature": 0.2,
44 "maxConcurrency": 1,
45}
46
47
48run = client.actor("zinin/chinese-social-media-dataset-translator").call(run_input=run_input)
49
50
51print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
52for item in client.dataset(run.default_dataset_id).iterate_items():
53 print(item)
54
55