1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "rawData": "[{\"name\": \"John Doe\", \"email\": \"john@example.com\", \"phone\": \"5551234567\"}, {\"name\": \"Jane Smith\", \"email\": \"jane@test.org\", \"phone\": \"+1-555-987-6543\"}]",
10 "targetExample": {
11 "full_name": "Jane Doe",
12 "email": "jane@example.com",
13 "phone": "+1 (555) 123-4567",
14 "company": "Acme Corp",
15 "signup_date": "2026-01-15",
16 "is_active": True,
17 },
18 "targetSchema": { "fields": {
19 "email": {
20 "type": "string",
21 "format": "email",
22 "required": True,
23 "description": "Contact email",
24 },
25 "full_name": {
26 "type": "string",
27 "required": True,
28 "description": "Full name",
29 },
30 "phone": {
31 "type": "string",
32 "description": "Phone number",
33 },
34 "signup_date": {
35 "type": "date",
36 "description": "When they signed up",
37 },
38 "is_vip": {
39 "type": "boolean",
40 "description": "VIP customer flag",
41 },
42 } },
43 "fieldMappings": {
44 "email_address": "email",
45 "full_name": "firstname",
46 "company_name": "company",
47 "phone_number": "phone",
48 "city": "city",
49 },
50 "validationRules": {
51 "email": { "pattern": "^[^@]+@[^@]+\\.[^@]+$" },
52 "country": { "enum": [
53 "US",
54 "GB",
55 "DE",
56 "FR",
57 "CA",
58 ] },
59 "age": {
60 "min": 0,
61 "max": 150,
62 },
63 },
64 "transformationRules": [
65 {
66 "sourceField": "full_name",
67 "targetField": "firstname",
68 "transform": "split_name",
69 "params": { "output": "first" },
70 },
71 {
72 "sourceField": "full_name",
73 "targetField": "lastname",
74 "transform": "split_name",
75 "params": { "output": "last" },
76 },
77 {
78 "sourceField": "signup_date",
79 "targetField": "created_at",
80 "transform": "date_normalize",
81 "params": { "target_format": "%Y-%m-%d" },
82 },
83 ],
84}
85
86
87run = client.actor("filip_cicvarek/data-bridge").call(run_input=run_input)
88
89
90print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
91for item in client.dataset(run["defaultDatasetId"]).iterate_items():
92 print(item)
93
94