1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "records": [
12 {
13 "company": "Example Labs",
14 "name": "Alex Example",
15 "email": "alex@example.com",
16 "phone": "+1 415 555 2671",
17 "website": "https://example.com"
18 },
19 {
20 "company": "Example Labs",
21 "name": "Alex Example",
22 "email": "ALEX@example.com",
23 "phone": "415-555-2671",
24 "website": "example.com"
25 },
26 {
27 "company": "Temporary Inbox",
28 "email": "hello@mailinator.com",
29 "website": "not a url"
30 }
31 ],
32 "defaultCountry": "US",
33 "dedupeBy": [
34 "email",
35 "phone"
36 ],
37 "maxItems": 100
38};
39
40
41const run = await client.actor("opendatadesk/lead-list-cleaner").call(input);
42
43
44console.log('Results from dataset');
45console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51