1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "contract": {
10 "files": [
11 "supplier_a.csv",
12 "supplier_b.csv",
13 ],
14 "delimiter": ",",
15 "key": ["sku"],
16 "remove_exact_duplicates": True,
17 "columns": [
18 {
19 "source": "SKU",
20 "target": "sku",
21 "type": "text",
22 "trim": True,
23 },
24 {
25 "source": "Title",
26 "target": "title",
27 "type": "text",
28 "trim": True,
29 },
30 {
31 "source": "Price",
32 "target": "price",
33 "type": "decimal",
34 "trim": True,
35 },
36 {
37 "source": "Currency",
38 "target": "currency",
39 "type": "text",
40 "allowed": [
41 "GBP",
42 "USD",
43 "EUR",
44 ],
45 },
46 {
47 "source": "Stock",
48 "target": "stock",
49 "type": "integer",
50 },
51 {
52 "source": "Updated",
53 "target": "updated",
54 "type": "date",
55 "format": "%d/%m/%Y",
56 },
57 ],
58 },
59 "sources": [
60 {
61 "name": "supplier_a.csv",
62 "csv": """SKU,Title,Price,Currency,Stock,Updated
63 0001 , Example product ,12.5,GBP,03,19/10/2026
640002,\"Two-part, sample\",0,GBP,0,03/04/2026
650003,\"Quoted \"\"sample\"\"
66with two lines\",9.99,USD,10,18/10/2026
670003,\"Quoted \"\"sample\"\"
68with two lines\",9.99,USD,10,18/10/2026
69""",
70 },
71 {
72 "name": "supplier_b.csv",
73 "csv": """SKU,Title,Price,Currency,Stock,Updated
740004,Fourth example,100,EUR,1,17/10/2026
750005,Fifth example,2.00,GBP,5,16/10/2026
760006,Sixth example,3.00,GBP,6,15/10/2026
770005,Fifth example,2.00,GBP,5,16/10/2026
78""",
79 },
80 ],
81 "confirm_authorized_data": True,
82}
83
84
85run = client.actor("wellbuilt_orache/catalogue-import-rescue").call(run_input=run_input)
86
87
88print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
89for item in client.dataset(run.default_dataset_id).iterate_items():
90 print(item)
91
92