1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "items": [
10 {
11 "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
12 "title": "A Light in the Attic",
13 "price": 51.77,
14 "stock": {
15 "available": True,
16 "count": 22,
17 },
18 },
19 {
20 "url": "https://books.toscrape.com/catalogue/tipping-the-velvet_999/index.html",
21 "title": "Tipping the Velvet",
22 "price": 53.74,
23 "stock": {
24 "available": True,
25 "count": 20,
26 },
27 },
28 {
29 "url": "https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html",
30 "title": "A Light in the Attic",
31 "price": 51.77,
32 "stock": {
33 "available": True,
34 "count": 22,
35 },
36 },
37 {
38 "url": "https://books.toscrape.com/catalogue/soumission_998/index.html",
39 "title": "Soumission",
40 "price": 50.1,
41 "stock": {
42 "available": False,
43 "count": 0,
44 },
45 },
46 {
47 "url": "HTTPS://BOOKS.TOSCRAPE.COM/catalogue/soumission_998/index.html",
48 "title": "Soumission (copy)",
49 "price": 50.1,
50 "stock": {
51 "available": False,
52 "count": 0,
53 },
54 },
55 ],
56 "dedupFields": ["url"],
57 "caseInsensitive": True,
58}
59
60
61run = client.actor("innovative_cookie/dataset-merge-dedup").call(run_input=run_input)
62
63
64print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
65for item in client.dataset(run.default_dataset_id).iterate_items():
66 print(item)
67
68