1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "searchStringsArray": [
12 "restaurants"
13 ],
14 "startUrls": [
15 {
16 "url": "https://yandex.com/maps/org/no_plates_coffee/124606085044/"
17 },
18 {
19 "url": "https://yandex.com/maps/org/124606085044/"
20 },
21 {
22 "url": "https://yandex.com/maps/org/no_plates_coffee/124606085044/reviews/"
23 },
24 {
25 "url": "https://yandex.ru/maps/org/no_plates_coffee/124606085044/"
26 },
27 {
28 "url": "https://yandex.com/maps/?ll=-74.006%2C40.7128&z=12&text=coffee"
29 },
30 {
31 "url": "https://yandex.com/maps/?text=restaurants"
32 },
33 {
34 "url": "https://yandex.com/maps/202/new-york/search/restaurants/"
35 },
36 {
37 "url": "https://yandex.com/maps/202/new-york/category/coffee_shop/"
38 },
39 {
40 "url": "https://yandex.com/maps/?ol=biz&oid=1018907821"
41 },
42 {
43 "url": "https://yandex.com/maps/213/moscow/search/%D0%BA%D0%BE%D1%84%D0%B5/"
44 },
45 {
46 "url": "https://yandex.com/maps/213/moscow/search/coffee/?page=2"
47 },
48 {
49 "url": "https://m.yandex.com/maps/org/192990200894/"
50 }
51 ],
52 "location": "New York, NY",
53 "maxResultsPerSearch": 20,
54 "proxyConfiguration": {
55 "useApifyProxy": true
56 },
57 "ignoreFieldsForChanges": []
58};
59
60
61const run = await client.actor("abotapi/yandex-maps-scraper").call(input);
62
63
64console.log('Results from dataset');
65console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
66const { items } = await client.dataset(run.defaultDatasetId).listItems();
67items.forEach((item) => {
68 console.dir(item);
69});
70
71