1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "contacts": [
12 {
13 "email": "john@example.com",
14 "name": "John Smith",
15 "phone": "+1 555 123-4567",
16 "company": "Acme Corp"
17 },
18 {
19 "email": "john@example.com",
20 "name": "John SMITH",
21 "phone": "15551234567",
22 "company": "Acme Corp"
23 },
24 {
25 "email": "jane@other.com",
26 "name": "Jane Doe",
27 "phone": "+1 555 987-6543",
28 "company": "Beta Inc"
29 },
30 {
31 "email": "jane@other.com",
32 "name": "J. Doe",
33 "phone": "15559876543",
34 "company": "Beta Inc"
35 },
36 {
37 "email": "bob@company.com",
38 "name": "Robert Johnson",
39 "phone": "+1 555 111-2222",
40 "company": "Gamma LLC"
41 }
42 ]
43};
44
45
46const run = await client.actor("enosgb/crm-deduplication-tool").call(input);
47
48
49console.log('Results from dataset');
50console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
51const { items } = await client.dataset(run.defaultDatasetId).listItems();
52items.forEach((item) => {
53 console.dir(item);
54});
55
56