1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "datasetIds": [],
12 "csvUrls": [],
13 "inlineRecords": [
14 {
15 "businessName": "Acme Coffee Roasters",
16 "email": "Hello@AcmeCoffee.com",
17 "phone": "(415) 555-2671",
18 "city": "San Francisco"
19 },
20 {
21 "name": "Acme Coffee",
22 "emails": [
23 "hello@acmecoffee.com"
24 ],
25 "website": "https://www.acmecoffee.com",
26 "city": "San Francisco"
27 },
28 {
29 "businessName": "Bluebird Bakery",
30 "email": "info@bluebirdbakery.co",
31 "phoneNumber": "+1 212 555 0188"
32 },
33 {
34 "title": "Bluebird Bakery",
35 "email": "INFO@bluebirdbakery.co",
36 "website": "bluebirdbakery.co"
37 },
38 {
39 "name": "Sunrise Yoga Studio",
40 "email": "contact@sunriseyoga.com",
41 "city": "Austin"
42 }
43 ],
44 "dedupeKeys": [
45 "email"
46 ],
47 "mergeStrategy": "most_complete",
48 "defaultCountry": "US"
49};
50
51
52const run = await client.actor("jurassic_jove/lead-deduplicator-merger").call(input);
53
54
55console.log('Results from dataset');
56console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
57const { items } = await client.dataset(run.defaultDatasetId).listItems();
58items.forEach((item) => {
59 console.dir(item);
60});
61
62