1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "leftItems": [
12 {
13 "order_id": 1001,
14 "email": "Ana.Lopez@Example.com ",
15 "amount": 120.5
16 },
17 {
18 "order_id": 1002,
19 "email": " ben@example.com",
20 "amount": 75
21 },
22 {
23 "order_id": 1003,
24 "email": "CARLA@EXAMPLE.COM",
25 "amount": 42.99
26 },
27 {
28 "order_id": 1004,
29 "email": "dev@example.com",
30 "amount": 300
31 },
32 {
33 "order_id": 1005,
34 "email": "zoe@other.org",
35 "amount": 18
36 }
37 ],
38 "rightItems": [
39 {
40 "email": "ana.lopez@example.com",
41 "name": "Ana Lopez",
42 "plan": "pro"
43 },
44 {
45 "email": "ben@example.com",
46 "name": "Ben Jones",
47 "plan": "free"
48 },
49 {
50 "email": "carla@example.com",
51 "name": "Carla Diaz",
52 "plan": "pro"
53 },
54 {
55 "email": "dev@example.com ",
56 "name": "Dev Patel",
57 "plan": "team"
58 },
59 {
60 "email": "eve@example.com",
61 "name": "Eve Chen",
62 "plan": "free"
63 }
64 ],
65 "leftKeys": [
66 "email"
67 ]
68};
69
70
71const run = await client.actor("data-done-right/dataset-join-vlookup").call(input);
72
73
74console.log('Results from dataset');
75console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
76const { items } = await client.dataset(run.defaultDatasetId).listItems();
77items.forEach((item) => {
78 console.dir(item);
79});
80
81