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 Plumbing",
16 "phone": "(813) 555-0142",
17 "city": "Tampa",
18 "countryCode": "US"
19 },
20 {
21 "businessName": "Tacos El Sol",
22 "phone": "55 1234 5678",
23 "city": "Guadalajara, Mexico"
24 },
25 {
26 "businessName": "London Cafe",
27 "phones": [
28 "+44 7400 123456",
29 "020 7946 0958"
30 ]
31 },
32 {
33 "businessName": "No Phone Co",
34 "city": "Austin"
35 }
36 ],
37 "phoneFields": [],
38 "defaultCountry": "US",
39 "countryHintField": "",
40 "outputFormats": [
41 "e164",
42 "international",
43 "national"
44 ]
45};
46
47
48const run = await client.actor("jurassic_jove/phone-number-validator").call(input);
49
50
51console.log('Results from dataset');
52console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
53const { items } = await client.dataset(run.defaultDatasetId).listItems();
54items.forEach((item) => {
55 console.dir(item);
56});
57
58