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 "title": "ACME PLUMBING LLC",
14 "email": "INFO@AcmePlumbing.com",
15 "phone": "(512) 555-0134",
16 "website": "http://www.acmeplumbing.com/?utm_source=maps",
17 "city": "Austin",
18 "country": "us"
19 },
20 {
21 "title": "Acme Plumbing",
22 "emails": [
23 "info@acmeplumbing.com"
24 ],
25 "website": "acmeplumbing.com",
26 "city": "austin"
27 },
28 {
29 "title": "Joe's Pizza",
30 "email": "joe@gmial.com",
31 "phone": "call us"
32 }
33 ]
34};
35
36
37const run = await client.actor("hiredhandai/lead-data-cleaner").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47