1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "places": [
12 {
13 "place_id": "ChIJN1t_tDeuEmsRUsoyG83frY4",
14 "title": "Example Coffee House",
15 "category": "Coffee shop",
16 "categories": [
17 "Coffee shop",
18 "Cafe"
19 ],
20 "website": "https://example-coffee.example",
21 "phone": "+49 30 12345678",
22 "rating": 4.8,
23 "review_count": 1240,
24 "description": "Specialty coffee roastery, direct-trade beans, natural wines and weekend brunch.",
25 "complete_address": {
26 "city": "Berlin",
27 "country": "Germany",
28 "borough": "Sample District"
29 }
30 },
31 {
32 "place_id": "ChIJcareHomeSAMPLE12345",
33 "title": "Sample Care Foundation",
34 "category": "Nursing home",
35 "categories": [
36 "Nursing home",
37 "Senior care service"
38 ],
39 "phone": "+49 7531 200000",
40 "rating": 4.4,
41 "review_count": 87,
42 "description": "Sample Care Foundation has been caring for seniors for over 20 years across three residential campuses.",
43 "complete_address": {
44 "city": "Sampletown",
45 "country": "Germany"
46 }
47 },
48 {
49 "place_id": "ChIJsculptureStudio77",
50 "title": "Example Art Studio",
51 "category": "Sculptor",
52 "website": "https://example-studio.example",
53 "rating": 5,
54 "review_count": 12,
55 "complete_address": {
56 "city": "Berlin",
57 "country": "Germany"
58 }
59 }
60 ]
61};
62
63
64const run = await client.actor("santamaria-automations/ai-icebreaker").call(input);
65
66
67console.log('Results from dataset');
68console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
69const { items } = await client.dataset(run.defaultDatasetId).listItems();
70items.forEach((item) => {
71 console.dir(item);
72});
73
74