1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "businesses": [
12 {
13 "name": "Example HVAC Co",
14 "website": "https://example.com",
15 "reviewsCount": 140,
16 "reviews": [
17 {
18 "text": "AC died on a Sunday, called three times and nobody answered.",
19 "stars": 1
20 }
21 ],
22 "openingHours": [
23 {
24 "day": "Monday",
25 "hours": "7 AM to 4 PM"
26 },
27 {
28 "day": "Sunday",
29 "hours": "Closed"
30 }
31 ]
32 }
33 ],
34 "proxyConfiguration": {
35 "useApifyProxy": false
36 }
37};
38
39
40const run = await client.actor("john_selk/missed-call-lead-finder").call(input);
41
42
43console.log('Results from dataset');
44console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
45const { items } = await client.dataset(run.defaultDatasetId).listItems();
46items.forEach((item) => {
47 console.dir(item);
48});
49
50