1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "stringTextfield": "prefilled value",
10 "stringTextfieldWithPattern": "abc123",
11 "stringJavascript": """// JavaScript code
12function hello() {
13 return 'Hello World!';
14}""",
15 "stringPython": """# Python code
16def hello():
17 return 'Hello World!'""",
18 "stringSelectSuggested": "suggested1",
19 "stringDateAbsolute": "2024-01-15",
20 "stringDateRelative": "7 days ago",
21 "stringDateAbsoluteOrRelative": "2024-01-01",
22 "stringSecret": "secret-value-123",
23 "arrayRequestListSources": [
24 { "url": "https://example.com" },
25 {
26 "url": "https://example.org",
27 "method": "POST",
28 },
29 ],
30 "arrayPseudoUrls": [{ "purl": "https://example.com/[.*]" }],
31 "arrayGlobs": [{ "glob": "https://example.com/**/*.html" }],
32 "arrayKeyValue": [{
33 "key": "Content-Type",
34 "value": "application/json",
35 }],
36 "arrayStringList": [
37 "value1",
38 "value2",
39 ],
40 "arraySelectSuggested": ["tag1"],
41 "schemaBasedStringArray": [
42 "string1",
43 "string2",
44 ],
45 "schemaBasedIntegerArray": [
46 1,
47 2,
48 3,
49 ],
50 "schemaBasedBooleanArray": [
51 True,
52 False,
53 True,
54 ],
55 "schemaBasedObjectArray": [{
56 "firstName": "John",
57 "lastName": "Doe",
58 "age": 30,
59 }],
60 "schemaBasedObjectArrayComplex": [{
61 "name": "Item 1",
62 "itemDescription": "First item description",
63 "count": 10,
64 "ratio": 0.5,
65 "enabled": True,
66 "category": "typeA",
67 }],
68 "nullableString": "optional value",
69 "fieldWithErrorMessage": "ABC",
70 "requiredField": "required value",
71}
72
73
74run = client.actor("gokdeniz_kaymak/integrations-input-test-actor").call(run_input=run_input)
75
76
77print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
78for item in client.dataset(run["defaultDatasetId"]).iterate_items():
79 print(item)
80
81