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": "Barbería La Estación",
14 "category": "Barbería",
15 "address": "Av. Triunvirato 4500, Villa Urquiza, CABA",
16 "city": "Buenos Aires",
17 "country": "AR",
18 "phone": "011 4521-0000",
19 "rating": 4.9,
20 "reviewsCount": 151,
21 "reviews": [
22 {
23 "author": "Martín G.",
24 "text": "Excelente atención, siempre salgo conforme.",
25 "stars": 5
26 },
27 {
28 "author": "Lucas P.",
29 "text": "Puntuales y prolijos. El mejor fade del barrio.",
30 "stars": 5
31 }
32 ],
33 "photos": [],
34 "hours": [
35 {
36 "day": "Tuesday",
37 "hours": "10:00 to 20:00"
38 },
39 {
40 "day": "Saturday",
41 "hours": "10:00 to 18:00"
42 }
43 ]
44 }
45 ],
46 "agencyName": "Your Agency"
47};
48
49
50const run = await client.actor("sebastian_elustondo/local-business-demo-site-generator").call(input);
51
52
53console.log('Results from dataset');
54console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
55const { items } = await client.dataset(run.defaultDatasetId).listItems();
56items.forEach((item) => {
57 console.dir(item);
58});
59
60