1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "csv": """SKU,Product Name,Details,Product URL,Image URL,Stock Status,Regular Price,Manufacturer,Part Number
10SUP-001,Oak desk,<p>Compact oak writing desk</p>,https://example.com/desk,https://example.com/desk.jpg,In stock,129.00,Example Studio,OAK-1
11SUP-002,Reading lamp,<p>Adjustable & warm light</p>,https://example.com/lamp,https://example.com/lamp.jpg,Out of stock,39.00,Example Studio,LAMP-2""",
12 "mapping": {
13 "id": "SKU",
14 "title": "Product Name",
15 "description": "Details",
16 "link": "Product URL",
17 "image_link": "Image URL",
18 "availability": "Stock Status",
19 "price": "Regular Price",
20 "brand": "Manufacturer",
21 "gtin": "",
22 "mpn": "Part Number",
23 "condition": "",
24 "sale_price": "",
25 "availability_date": "",
26 "item_group_id": "",
27 "color": "",
28 "size": "",
29 },
30 "options": {
31 "currency": "EUR",
32 "stripHTML": True,
33 "normalizeAvailability": True,
34 },
35}
36
37
38run = client.actor("onixcatalogdesk/onix-catalog-mapper").call(run_input=run_input)
39
40
41print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
42for item in client.dataset(run.default_dataset_id).iterate_items():
43 print(item)
44
45