1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 "+1 (415) 555-2671",
13 "jane@gmial.com",
14 "JOHN MCDONALD JR",
15 "1.234,56 €",
16 "Deutschland",
17 "4.91701234567E+11",
18 {
19 "type": "phone",
20 "value": "030 901820",
21 "country": "DE"
22 },
23 {
24 "type": "postalCode",
25 "value": "sw1a1aa",
26 "country": "United Kingdom"
27 },
28 {
29 "first_name": "mary",
30 "last_name": "O'BRIEN",
31 "email": "Mary.OBrien+crm@GMAIL.com",
32 "phone": "020 7946 0958",
33 "country": "UK",
34 "zip": "sw1a 1aa",
35 "deal_value": "£12.500,00"
36 },
37 {
38 "name": "Mary O'Brien",
39 "email": "maryobrien@gmail.com"
40 }
41 ]
42};
43
44
45const run = await client.actor("dodiabak/contact-data-cleaner").call(input);
46
47
48console.log('Results from dataset');
49console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55