1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "brandUrls": [
12 "https://olaplex.com/pages/certified-stylists",
13 "https://www.paulmitchell.com/pages/salon-locator"
14 ],
15 "searchAreas": [
16 {
17 "label": "New York, NY",
18 "latitude": 40.7128,
19 "longitude": -74.006,
20 "radiusMiles": 50
21 },
22 {
23 "label": "Los Angeles, CA",
24 "latitude": 34.0522,
25 "longitude": -118.2437,
26 "radiusMiles": 50
27 },
28 {
29 "label": "Atlanta, GA",
30 "latitude": 33.749,
31 "longitude": -84.388,
32 "radiusMiles": 50
33 },
34 {
35 "label": "Chicago, IL",
36 "latitude": 41.8781,
37 "longitude": -87.6298,
38 "radiusMiles": 50
39 }
40 ]
41};
42
43
44const run = await client.actor("tpa_d/beauty-pro-locator-radar").call(input);
45
46
47console.log('Results from dataset');
48console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
49const { items } = await client.dataset(run.defaultDatasetId).listItems();
50items.forEach((item) => {
51 console.dir(item);
52});
53
54