# 2GIS Scraper & Парсер 2ГИС — Телефоны, Email, Отзывы (`tugelbay/2gis-scraper`) Actor

Парсер 2ГИС (2GIS Scraper) — выгрузка базы организаций из 2ГИС с телефонами, email, сайтами, рейтингами, отзывами и адресами. Парсинг 2ГИС онлайн по любому запросу. Сбор базы 2ГИС в Excel и CSV. 200+ городов. Скрапинг 2GIS без скачивания. Оплата за результат.

- **URL**: https://apify.com/tugelbay/2gis-scraper.md
- **Developed by:** [Tugelbay Konabayev](https://apify.com/tugelbay) (community)
- **Categories:** Lead generation, SEO tools, Automation
- **Stats:** 4 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-usage

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Парсер 2ГИС — Выгрузка Базы Организаций, Телефонов и Отзывов | 2GIS Scraper

**Парсер 2ГИС** для автоматической выгрузки базы организаций из [2ГИС (2GIS)](https://2gis.ru) — крупнейшего справочника бизнесов России, Казахстана и стран СНГ. Извлекает телефоны, email, сайты, рейтинги, отзывы, адреса и координаты по любой категории в **200+ городах**.

Работает через API 2ГИС — без браузера, быстро и надёжно. **Не нужно ничего скачивать** — парсинг 2ГИС работает онлайн в облаке.

**Первые 100 результатов БЕСПЛАТНО.** Далее $4 за 1 000 организаций.

---

### Что делает парсер 2ГИС?

[2ГИС (2GIS)](https://2gis.ru) — это справочник организаций и карта, покрывающая Россию, Казахстан, ОАЭ, Узбекистан и ещё 16 стран. Содержит подробные данные о миллионах компаний: контакты, часы работы, отзывы и многое другое.

Этот парсер 2ГИС (2GIS Scraper) позволяет **массово выгружать данные организаций** из 2ГИС. Введите запрос (например, "стоматология") и город (например, "Москва") — и получите структурированную базу со всей доступной информацией. Выгрузка базы 2ГИС в Excel, CSV или JSON — в один клик.

**What you get for each business:**

- Business name and categories
- Phone numbers and email addresses
- Website URL and social media links
- Star rating and review count
- Full address with postal code
- GPS coordinates (latitude/longitude)
- Working hours (day by day)
- Direct link to 2GIS page
- Optionally: full review texts with author, date, and official replies

---

### Why use this instead of alternatives?

| Feature                      | **This Actor**  | Zen Studio           | Manual Search    | Official 2GIS API      |
| ---------------------------- | --------------- | -------------------- | ---------------- | ---------------------- |
| **Price per 1,000 results**  | **$4.00**       | $4.50                | Free (your time) | Custom (enterprise)    |
| **Success rate**             | **95%+**        | 82%                  | 100%             | 99%                    |
| **Speed (1,000 results)**    | **~90 seconds** | ~90 seconds          | Hours            | ~30 seconds            |
| **Input parameters**         | **5**           | 40+                  | —                | Complex API            |
| **Data fields per business** | **20+**         | 70+ (but most empty) | ~5               | 20+                    |
| **Reviews**                  | Yes             | Yes                  | Manual           | Limited                |
| **Phone numbers**            | Yes             | Yes                  | One at a time    | Extra cost             |
| **Emails**                   | Yes             | Yes                  | Manual           | Extra cost             |
| **Export to CSV/Excel**      | Built-in        | Built-in             | Copy-paste       | Custom code            |
| **MCP/AI compatible**        | Yes (PPE)       | Yes                  | No               | No                     |
| **Setup required**           | None            | None                 | None             | API key + contract     |
| **Free tier**                | **100 results** | None                 | Unlimited (slow) | 1,000 req/month (demo) |

**Key advantages:**

- **Simple**: 5 parameters vs 40+. Enter query and city — get data.
- **Reliable**: 95%+ success rate with automatic retries and exponential backoff.
- **Fast**: ~1,000 businesses per 90 seconds via direct API.
- **Affordable**: $4 per 1,000 — less than any paid alternative.
- **No setup**: No API keys, contracts, or configurations needed.

---

### Key Features

- **Search any business category** — restaurants, hotels, dentists, car services, beauty salons, pharmacies, or any custom query
- **200+ cities** across Russia, Kazakhstan, UAE, Uzbekistan, Kyrgyzstan, Armenia, Georgia, Azerbaijan, and more
- **Phone numbers and emails** — extracted automatically from business profiles
- **Ratings and reviews** — overall score + individual review texts with dates
- **Working hours** — day-by-day schedule
- **GPS coordinates** — ready for mapping and geospatial analysis
- **Social media links** — VK, Telegram, WhatsApp, Instagram when available
- **Automatic pagination** — extracts all results, not just first page
- **Rate limit handling** — built-in retries with exponential backoff
- **CRM-ready output** — two dataset views: compact "Leads" and detailed "Full Data"
- **Export anywhere** — CSV, Excel, JSON, Google Sheets, or via API

---

### Input Examples

#### Basic: Find cafes in Moscow

```json
{
  "query": "кафе",
  "city": "Москва",
  "maxItems": 100
}
````

#### Lead generation: Dentists in Saint Petersburg with reviews

```json
{
  "query": "стоматология",
  "city": "Санкт-Петербург",
  "maxItems": 500,
  "includeReviews": true,
  "maxReviews": 5
}
```

#### Bulk extraction: All restaurants in Almaty

```json
{
  "query": "ресторан",
  "city": "Алматы",
  "maxItems": 2000
}
```

#### Specific category with English interface

```json
{
  "query": "hotel",
  "city": "Dubai",
  "maxItems": 200,
  "language": "en_RU"
}
```

***

### Input Parameters

| Parameter            | Type    | Required | Default     | Description                                                                         |
| -------------------- | ------- | -------- | ----------- | ----------------------------------------------------------------------------------- |
| `query`              | String  | Yes      | —           | Search query: business type, name, or keyword (e.g., "кафе", "автосервис", "hotel") |
| `city`               | String  | Yes      | —           | City name in Russian or English (e.g., "Москва", "Алматы", "Dubai")                 |
| `maxItems`           | Integer | No       | 100         | Maximum results to extract (1–5,000). Each result = 1 PPE event                     |
| `includeReviews`     | Boolean | No       | false       | Extract review texts for each business                                              |
| `maxReviews`         | Integer | No       | 10          | Reviews per business (1–100). Only used when includeReviews is true                 |
| `language`           | String  | No       | ru\_RU       | Result language: ru\_RU, en\_RU, cs\_CZ, it\_IT, es\_ES                                  |
| `proxyConfiguration` | Object  | No       | Residential | Proxy settings. Residential proxies recommended                                     |

***

### Output Format

Each business is returned as a JSON object with the following fields:

| Field           | Type    | Description                             | Example                                      |
| --------------- | ------- | --------------------------------------- | -------------------------------------------- |
| `id`            | String  | Unique 2GIS business ID                 | `"70000001019505596"`                        |
| `name`          | String  | Business name                           | `"Кофемания"`                                |
| `category`      | String  | Primary business category               | `"Кафе"`                                     |
| `allCategories` | String  | All categories (comma-separated)        | `"Кафе, Ресторан, Кофейня"`                  |
| `address`       | String  | Full street address                     | `"ул. Большая Никитская, 13"`                |
| `city`          | String  | City name                               | `"Москва"`                                   |
| `postcode`      | String  | Postal code                             | `"125009"`                                   |
| `latitude`      | Number  | GPS latitude                            | `55.7558`                                    |
| `longitude`     | Number  | GPS longitude                           | `37.6043`                                    |
| `phone`         | String  | Primary phone number                    | `"+7 (495) 988-55-68"`                       |
| `allPhones`     | String  | All phones (comma-separated)            | `"+7 (495) 988-55-68, +7 (495) 988-55-69"`   |
| `email`         | String  | Email address                           | `"info@coffeemania.ru"`                      |
| `website`       | String  | Website URL                             | `"https://coffeemania.ru"`                   |
| `socialLinks`   | String  | Social media links                      | `"instagram:coffeemania_ru, vk:coffeemania"` |
| `rating`        | Number  | Average star rating (1–5)               | `4.6`                                        |
| `reviewCount`   | Integer | Total number of reviews                 | `1847`                                       |
| `workingHours`  | String  | Schedule by day                         | `"Пн: 08:00-23:00; Вт: 08:00-23:00; ..."`    |
| `url`           | String  | Direct link to 2GIS page                | `"https://2gis.ru/firm/70000001019505596"`   |
| `reviews`       | Array   | Review objects (if includeReviews=true) | See below                                    |

#### Review object format

```json
{
  "author": "Алексей К.",
  "rating": 5,
  "text": "Отличное место! Лучший кофе в городе.",
  "date": "2026-03-15",
  "reply": "Спасибо за отзыв! Будем рады видеть вас снова."
}
```

***

### Example Output

```json
{
  "id": "70000001042166459",
  "name": "Чайхона №1",
  "category": "Ресторан",
  "allCategories": "Ресторан, Кафе, Банкетный зал",
  "address": "ул. Тверская, 18к1",
  "city": "Москва",
  "postcode": "125009",
  "latitude": 55.764532,
  "longitude": 37.606781,
  "phone": "+7 (495) 788-55-00",
  "allPhones": "+7 (495) 788-55-00, +7 (495) 788-55-01",
  "email": "info@chaihona.com",
  "website": "https://chaihona1.ru",
  "socialLinks": "instagram:chaihona_no1, vk:chaihona1, telegram:chaihona1_bot",
  "rating": 4.4,
  "reviewCount": 3256,
  "workingHours": "Пн: 11:00-00:00; Вт: 11:00-00:00; Ср: 11:00-00:00; Чт: 11:00-00:00; Пт: 11:00-02:00; Сб: 11:00-02:00; Вс: 11:00-00:00",
  "url": "https://2gis.ru/firm/70000001042166459",
  "reviews": [
    {
      "author": "Мария П.",
      "rating": 5,
      "text": "Прекрасная кухня, уютная атмосфера. Плов — лучший в Москве!",
      "date": "2026-03-20",
      "reply": "Благодарим за тёплые слова!"
    }
  ]
}
```

***

### Integrations

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("tugelbay/2gis-scraper").call(run_input={
    "query": "стоматология",
    "city": "Москва",
    "maxItems": 500,
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(f"{item['name']} — {item['phone']} — {item['rating']}")
```

#### JavaScript

```javascript
import { ApifyClient } from "apify-client";

const client = new ApifyClient({ token: "YOUR_API_TOKEN" });

const run = await client.actor("tugelbay/2gis-scraper").call({
  query: "автосервис",
  city: "Екатеринбург",
  maxItems: 300,
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Extracted ${items.length} businesses`);
```

#### cURL

```bash
curl "https://api.apify.com/v2/acts/tugelbay~2gis-scraper/runs" \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{"query": "кафе", "city": "Новосибирск", "maxItems": 100}'
```

#### Other integrations

- **Google Sheets** — export results directly to a spreadsheet
- **Zapier / Make** — automate extraction workflows
- **MCP Server** — use with AI agents and LLMs via Apify MCP
- **Webhooks** — get notified when extraction completes
- **Scheduled runs** — run daily/weekly to track changes

***

### Use Cases

1. **B2B Lead Generation** — extract phone numbers and emails for sales outreach. Search "стоматология" in your target city and get a ready-to-call list.

2. **Market Research** — analyze business density, ratings, and competition in any category across Russian and CIS cities.

3. **Competitor Analysis** — find all businesses in your category, compare ratings, review counts, and coverage.

4. **CRM Data Enrichment** — enrich your existing contacts with addresses, coordinates, working hours, and ratings from 2GIS.

5. **Local SEO Audit** — verify business listings, check if addresses match, and monitor review sentiment.

6. **Real Estate Intelligence** — find services and amenities near properties. Map infrastructure for location analysis.

7. **Franchise Research** — discover how many branches a chain has, where they are, and how they're rated.

8. **Review Monitoring** — track customer feedback, spot negative trends, and find common complaints in your industry.

9. **Delivery Zone Planning** — extract business coordinates to plan delivery routes and coverage areas.

10. **Academic Research** — study urban business distribution, economic geography, and service accessibility.

***

### Cost Estimation

| Results | Cost     | Approximate Time |
| ------- | -------- | ---------------- |
| 100     | **FREE** | ~10 seconds      |
| 500     | $2.00    | ~45 seconds      |
| 1,000   | $4.00    | ~90 seconds      |
| 5,000   | $20.00   | ~8 minutes       |
| 10,000  | $40.00   | ~15 minutes      |
| 50,000  | $200.00  | ~75 minutes      |

*Times are approximate and depend on server load and proxy speed. Enabling reviews increases time by ~30-50%.*

Platform compute costs (CPU, memory, proxy) are charged separately by Apify at standard rates. Typical cost is $0.25–$1.00 per 1,000 results depending on run configuration.

***

### Supported Cities & Countries

2GIS covers **200+ cities** across **20 countries**:

| Country            | Major Cities                                                                                                                                                                                                                                         |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Russia**         | Москва, Санкт-Петербург, Новосибирск, Екатеринбург, Красноярск, Казань, Нижний Новгород, Самара, Омск, Челябинск, Ростов-на-Дону, Уфа, Волгоград, Пермь, Воронеж, Тюмень, Краснодар, Иркутск, Барнаул, Хабаровск, Владивосток, Томск, Кемерово, Сочи |
| **Kazakhstan**     | Алматы, Астана, Шымкент, Караганда, Актобе, Тараз, Павлодар, Усть-Каменогорск, Семей, Атырау, Костанай, Петропавловск                                                                                                                                |
| **UAE**            | Dubai, Abu Dhabi, Sharjah                                                                                                                                                                                                                            |
| **Uzbekistan**     | Ташкент, Самарканд, Бухара, Наманган                                                                                                                                                                                                                 |
| **Kyrgyzstan**     | Бишкек, Ош                                                                                                                                                                                                                                           |
| **Armenia**        | Ереван                                                                                                                                                                                                                                               |
| **Georgia**        | Тбилиси, Батуми                                                                                                                                                                                                                                      |
| **Azerbaijan**     | Баку                                                                                                                                                                                                                                                 |
| **Belarus**        | Минск                                                                                                                                                                                                                                                |
| **Tajikistan**     | Душанбе                                                                                                                                                                                                                                              |
| **Saudi Arabia**   | Riyadh, Jeddah                                                                                                                                                                                                                                       |
| **Bahrain**        | Manama                                                                                                                                                                                                                                               |
| **Oman**           | Muscat                                                                                                                                                                                                                                               |
| **Qatar**          | Doha                                                                                                                                                                                                                                                 |
| **Kuwait**         | Kuwait City                                                                                                                                                                                                                                          |
| **Chile**          | Santiago                                                                                                                                                                                                                                             |
| **Czech Republic** | Prague                                                                                                                                                                                                                                               |
| **Italy**          | Rome, Milan                                                                                                                                                                                                                                          |
| **Cyprus**         | Limassol, Nicosia                                                                                                                                                                                                                                    |
| **Egypt**          | Cairo                                                                                                                                                                                                                                                |

***

### FAQ

#### Парсер 2ГИС бесплатно — это возможно?

Да. Первые 100 организаций в каждом запуске — **бесплатно**. Этого достаточно чтобы оценить качество данных. Дальше — $4 за 1 000 результатов. Не нужно ничего скачивать или устанавливать — парсер 2ГИС работает онлайн в облаке.

#### Парсер 2ГИС онлайн — как пользоваться?

1. Откройте страницу актора на Apify
2. Введите запрос (например, "кафе") и город (например, "Москва")
3. Нажмите "Start"
4. Через 1-2 минуты скачайте результаты в Excel, CSV или JSON

Не нужно скачивать программу, устанавливать софт или разбираться в коде. Парсинг 2ГИС онлайн — всё работает в браузере.

#### Выгрузка базы 2ГИС в Excel — как сделать?

Запустите парсер с нужным запросом и городом. После завершения нажмите "Export" → выберите формат Excel (XLSX) или CSV. Готовая выгрузка базы 2ГИС скачается на ваш компьютер. Также можно отправить данные напрямую в Google Sheets, Zapier или Make.

#### Парсинг 2ГИС Python — можно ли использовать через API?

Да. Парсер доступен через REST API. Пример на Python:

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_TOKEN")
run = client.actor("tugelbay/2gis-scraper").call(run_input={"query": "кафе", "city": "Москва"})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["name"], item["phone"])
```

Полные примеры кода на Python и JavaScript — в разделе "Integrations" выше.

#### Парсер организаций 2ГИС — какие данные извлекаются?

Для каждой организации: название, категории, полный адрес, почтовый индекс, телефон(ы), email, сайт, ссылки на соцсети (VK, Telegram, WhatsApp, Instagram), рейтинг, количество отзывов, часы работы по дням, GPS-координаты, ссылка на страницу в 2ГИС. Опционально — тексты отзывов с авторами и датами.

#### Парсинг отзывов 2ГИС — как включить?

Включите опцию "Include reviews" и укажите количество отзывов на организацию (от 1 до 100). Парсер соберёт тексты отзывов, имена авторов, оценки, даты и официальные ответы компании. Учтите что сбор отзывов увеличивает время работы на 30-50%.

#### Скрапинг 2ГИС — это легально?

Парсер использует публичный API каталога 2ГИС. Извлекаются только данные, которые доступны любому пользователю на сайте 2gis.ru. Соблюдайте условия использования 2ГИС и законы о защите данных в вашей юрисдикции.

#### Сбор базы 2ГИС — сколько стоит?

| Количество         | Стоимость     | Время   |
| ------------------ | ------------- | ------- |
| 100 организаций    | **Бесплатно** | ~10 сек |
| 1 000 организаций  | $4            | ~90 сек |
| 5 000 организаций  | $20           | ~8 мин  |
| 10 000 организаций | $40           | ~15 мин |

Платформенные расходы (CPU, память) оплачиваются отдельно по стандартным тарифам Apify (~$0.25-1.00 за 1 000 результатов).

#### Какие города поддерживает парсер 2ГИС?

Все 200+ городов из справочника 2ГИС в 20 странах: Россия (Москва, Санкт-Петербург, Новосибирск, Екатеринбург и др.), Казахстан (Алматы, Астана, Шымкент), ОАЭ, Узбекистан, Кыргызстан, Армения, Грузия, Азербайджан, Беларусь, Таджикистан и другие. Полный список — в таблице выше.

#### 2ГИС API — чем этот парсер отличается от официального API?

Официальный API 2ГИС требует платную подписку с индивидуальными тарифами (enterprise-контракты). Этот парсер предоставляет простой интерфейс с оплатой за результат — от $0 (первые 100 бесплатно). Не нужны API-ключи, договоры или настройка.

#### Телефоны из 2ГИС — всегда ли они есть?

Телефонные номера извлекаются из контактной информации организации. Большинство компаний в 2ГИС публикуют хотя бы один номер телефона. Email-адреса доступны реже — примерно у 40-60% организаций. Парсер извлекает все публично доступные контакты.

#### Можно ли использовать парсер 2ГИС для сбора базы данных?

Да. Укажите категорию бизнеса и город — получите готовую базу организаций с контактами, адресами, рейтингами и координатами. Выгрузка базы 2ГИС доступна в форматах Excel, CSV, JSON. Подходит для лидогенерации, маркетинговых исследований, обогащения CRM.

***

### Troubleshooting

#### "City not found" error

**Cause:** City name not recognized. The actor tries to match your input against the 2GIS region database.
**Fix:** Use the Russian name of the city (e.g., "Москва" instead of "Moscow"). Check the supported cities table above.

#### Empty results or fewer results than expected

**Cause:** The search query is too specific, or there are fewer businesses of that type in the city.
**Fix:** Try broader queries (e.g., "кафе" instead of "кафе с террасой"). Some cities have fewer listings than Moscow or St. Petersburg.

#### Run takes longer than expected

**Cause:** Rate limiting by 2GIS API, slow proxy, or includeReviews is enabled.
**Fix:** The actor handles rate limits automatically with retries. Reviews add extra API calls — disable if speed is a priority.

#### Missing phone numbers or emails

**Cause:** Not all businesses publish contact information on 2GIS.
**Fix:** This is a data availability issue, not an extraction error. The actor extracts all publicly available contacts.

#### Actor fails with timeout

**Cause:** Network issues or very large extraction (5,000+ results).
**Fix:** Increase the actor timeout in run configuration. Try extracting in smaller batches.

***

### Limitations

- **Data availability** — only extracts data that is publicly visible on 2GIS. Some businesses don't publish phone numbers or emails.
- **Review text** — requires separate API calls per business. Extracting reviews for thousands of businesses will increase run time.
- **Rate limits** — 2GIS has rate limits on their API. The actor handles this automatically, but very large extractions may take longer.
- **City matching** — some smaller towns may not be recognized. Use the nearest major city.
- **Language** — most business data is in Russian regardless of the language setting, since 2GIS is primarily a Russian-language service.
- **Real-time data** — 2GIS updates their data periodically. Extracted data reflects the state at the time of extraction.

***

### Changelog

#### v1.0 (2026-04-02)

- Initial release
- Search by query + city
- Extract 20+ fields per business
- Optional review extraction
- Support for 200+ cities across 20 countries
- PPE pricing: $4/1,000 results, first 100 free

# Actor input Schema

## `query` (type: `string`):

What to search for (e.g., 'кафе', 'стоматология', 'автосервис', 'restaurant')

## `city` (type: `string`):

City name (e.g., 'Москва', 'Алматы', 'Новосибирск', 'Dubai'). Supports 200+ cities in 20 countries.

## `maxItems` (type: `integer`):

Maximum number of businesses to extract. Each result counts as one PPE event.

## `includeReviews` (type: `boolean`):

Extract reviews for each business. Increases run time.

## `maxReviews` (type: `integer`):

How many reviews to collect per business (when Include reviews is ON).

## `language` (type: `string`):

Result language. Most 2GIS data is in Russian regardless of setting.

## `proxyConfiguration` (type: `object`):

Proxy settings. Residential proxies recommended for best reliability.

## Actor input object example

```json
{
  "query": "кафе",
  "city": "Москва",
  "maxItems": 100,
  "includeReviews": false,
  "maxReviews": 10,
  "language": "ru_RU",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "кафе",
    "city": "Москва",
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ]
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tugelbay/2gis-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "query": "кафе",
    "city": "Москва",
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
    },
}

# Run the Actor and wait for it to finish
run = client.actor("tugelbay/2gis-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "кафе",
  "city": "Москва",
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}' |
apify call tugelbay/2gis-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=tugelbay/2gis-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "2GIS Scraper & Парсер 2ГИС — Телефоны, Email, Отзывы",
        "description": "Парсер 2ГИС (2GIS Scraper) — выгрузка базы организаций из 2ГИС с телефонами, email, сайтами, рейтингами, отзывами и адресами. Парсинг 2ГИС онлайн по любому запросу. Сбор базы 2ГИС в Excel и CSV. 200+ городов. Скрапинг 2GIS без скачивания. Оплата за результат.",
        "version": "1.0",
        "x-build-id": "BrA40B2E8Fe45dVpY"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/tugelbay~2gis-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-tugelbay-2gis-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/tugelbay~2gis-scraper/runs": {
            "post": {
                "operationId": "runs-sync-tugelbay-2gis-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/tugelbay~2gis-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-tugelbay-2gis-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "query",
                    "city"
                ],
                "properties": {
                    "query": {
                        "title": "Search query",
                        "type": "string",
                        "description": "What to search for (e.g., 'кафе', 'стоматология', 'автосервис', 'restaurant')"
                    },
                    "city": {
                        "title": "City",
                        "type": "string",
                        "description": "City name (e.g., 'Москва', 'Алматы', 'Новосибирск', 'Dubai'). Supports 200+ cities in 20 countries."
                    },
                    "maxItems": {
                        "title": "Max results",
                        "minimum": 1,
                        "maximum": 5000,
                        "type": "integer",
                        "description": "Maximum number of businesses to extract. Each result counts as one PPE event.",
                        "default": 100
                    },
                    "includeReviews": {
                        "title": "Include reviews",
                        "type": "boolean",
                        "description": "Extract reviews for each business. Increases run time.",
                        "default": false
                    },
                    "maxReviews": {
                        "title": "Max reviews per business",
                        "minimum": 1,
                        "maximum": 100,
                        "type": "integer",
                        "description": "How many reviews to collect per business (when Include reviews is ON).",
                        "default": 10
                    },
                    "language": {
                        "title": "Language",
                        "enum": [
                            "ru_RU",
                            "en_RU",
                            "cs_CZ",
                            "it_IT",
                            "es_ES"
                        ],
                        "type": "string",
                        "description": "Result language. Most 2GIS data is in Russian regardless of setting.",
                        "default": "ru_RU"
                    },
                    "proxyConfiguration": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Proxy settings. Residential proxies recommended for best reliability."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
