1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "locations": [
12 {
13 "locationId": "S001",
14 "name": "Acme Coffee Downtown",
15 "city": "Springfield",
16 "websiteUrl": "https://www.acmecoffee.example/locations/downtown"
17 },
18 {
19 "locationId": "S002",
20 "name": "Acme Coffee Riverside",
21 "city": "Springfield",
22 "websiteUrl": "acmecoffee.example/locations/riverside?utm_source=maps"
23 },
24 {
25 "locationId": "S003",
26 "name": "Acme Coffee Airport",
27 "city": "Shelbyville",
28 "websiteUrl": "http://acme-coffee-airport.example"
29 },
30 {
31 "locationId": "S004",
32 "name": "Acme Coffee Mall",
33 "city": "Shelbyville",
34 "websiteUrl": ""
35 },
36 {
37 "locationId": "S005",
38 "name": "Acme Coffee Harbor",
39 "city": "Capital City",
40 "websiteUrl": "https://acmecoffee.example/locations/downtown/"
41 },
42 {
43 "locationId": "S006",
44 "name": "Acme Coffee Station",
45 "city": "Capital City",
46 "websiteUrl": "https//acmecoffee.example/station"
47 }
48 ],
49 "brandDomains": [
50 "acmecoffee.example"
51 ]
52};
53
54
55const run = await client.actor("practical_ai_lab_jp/pal-maps-location-website-health-audit").call(input);
56
57
58console.log('Results from dataset');
59console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
60const { items } = await client.dataset(run.defaultDatasetId).listItems();
61items.forEach((item) => {
62 console.dir(item);
63});
64
65