1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "conversions": [
10 {
11 "value": 16,
12 "fromUnit": "px",
13 "label": "Body font size",
14 },
15 {
16 "value": 1.5,
17 "fromUnit": "rem",
18 "label": "H2 heading",
19 },
20 {
21 "value": 100,
22 "fromUnit": "vh",
23 "label": "Full-screen height",
24 },
25 {
26 "value": 72,
27 "fromUnit": "pt",
28 "label": "Print heading",
29 },
30 ],
31 "baseFontSizePx": 16,
32 "contextFontSizePx": 16,
33 "viewportWidthPx": 1440,
34 "viewportHeightPx": 900,
35 "targetUnits": [],
36 "precision": 4,
37}
38
39
40run = client.actor("automation-lab/css-unit-converter").call(run_input=run_input)
41
42
43print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
44for item in client.dataset(run["defaultDatasetId"]).iterate_items():
45 print(item)
46
47