# 2GIS Places Scraper · Карты и организации / Maps & businesses (`scraperx/2gis-places-scraper`) Actor

russian map

- **URL**: https://apify.com/scraperx/2gis-places-scraper.md
- **Developed by:** [ScraperX](https://apify.com/scraperx) (community)
- **Categories:** Automation
- **Stats:** 30 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## 2GIS Places Scraper

Compact Apify Actor that scrapes 2GIS place data from search URLs using a robust two-phase strategy:

1. Collect firm IDs from search listings (API interception + fallback extraction)
2. Open firm pages and extract full SSR profile data

### Why this Actor

- Keeps output close to rich 2GIS profile structure
- Handles blocking with automatic proxy fallback
- Saves records live to dataset during the run
- Supports bulk input URLs

### Key Features

- Two-phase scraping flow based on Playwright
- Proxy chain: direct -> datacenter -> residential
- Residential sticky mode after first successful fallback
- Residential retries (up to 3 attempts)
- Random delay (1-2 seconds) between requests
- Detailed Apify logs for visibility

### Input

```json
{
  "urls": [
    { "url": "https://2gis.ru/moscow/search/%D0%A0%D0%B5%D1%81%D1%82%D0%BE%D1%80%D0%B0%D0%BD" }
  ],
  "maxItems": 50,
  "includeContacts": true,
  "headless": true,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

#### Input fields

- `urls`: Required. Bulk list of 2GIS search URLs.
- `maxItems`: Max items scraped per search URL.
- `includeContacts`: Keep/remove phone/email/website/socials.
- `headless`: Headless browser mode toggle.
- `proxyConfiguration`: Apify proxy editor field. Actor still starts direct by design, then applies fallback chain on block.

### Output

Dataset records include fields like:

- `id`, `title`, `shortName`, `extension`, `url`
- `rubrics`, `category`, `totalScore`, `reviewsCount`, `ratingCount`
- `summary`, `country`, `region`, `city`, `district`, `street`, `houseNumber`, `address`
- `mainPhotoUrl`, `location`, `working_hours`, `nearestStations`, `attributeGroups`
- `brand`, `detailsType`, `searchString`, `searchUrl`, `pageNumber`, `scrapedAt`
- Optional contacts: `phoneText`, `phoneValue`, `email`, `website`, `socials`

### How it handles blocking

By default requests are sent without proxy.

If 2GIS blocks/rejects traffic:

1. Switch to datacenter proxy
2. If still blocked, switch to residential proxy
3. Retry with residential up to 3 times
4. Once residential works, keep residential for all remaining requests

Proxy transitions are logged clearly in Apify logs.

### Notes

- Scrapes only publicly available data.
- Please ensure your use complies with applicable terms and local laws.

# Actor input Schema

## `query` (type: `array`):

🇷🇺 Одна или несколько фраз, как в поиске на сайте 2GIS (например: *ресторан*, *стоматология*, *автомойка*). Разные формулировки дают лучшее покрытие.
🇬🇧 One or more phrases, like in the 2GIS search box (e.g. *restaurant*, *dentist*, *car wash*). Varied wording improves coverage.

## `locationQuery` (type: `string`):

🇷🇺 Где искать: город, район, улица или ориентир (например: *Москва*, *Нижний Новгород*).
🇬🇧 Where to search: city, district, street or landmark (e.g. *Moscow*, *Almaty*).

🇷🇺 Если задана пользовательская область ниже — она важнее этого поля.
🇬🇧 If **Custom area (GeoJSON)** is set below, it overrides this field.

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

🇷🇺 Максимум карточек на **каждый** поисковый запрос. **0** — попытаться взять все доступные (ограничено сайтом).
🇬🇧 Maximum listings **per search term**. **0** — try to take all available (still limited by the site).

## `domain` (type: `string`):

🇷🇺 Карта какой страны использовать (**Авто** — по умолчанию Россия / 2gis.ru).
🇬🇧 Which national 2GIS site to use (**Auto** defaults to Russia / 2gis.ru).

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

🇷🇺 Предпочтительный язык страницы и заголовков (**Авто** — язык по умолчанию для выбранного домена).
🇬🇧 Preferred page language (**Auto** — default for the selected domain).

## `includeContacts` (type: `boolean`):

🇷🇺 Дополнительно подгружает телефоны, e-mail, сайт и соцсети, если они указаны в карточке.
🇬🇧 Also loads phones, email, website and socials when the listing shows them.

## `maxReviewsPerPlace` (type: `integer`):

🇷🇺 Максимум отзывов на одну организацию. **0** — не собирать отзывы (быстрее).
🇬🇧 Max reviews per place. **0** — skip reviews (faster run).

## `reviewSortBy` (type: `string`):

🇷🇺 Как упорядочивать отзывы при сборе.
🇬🇧 How reviews are ordered when fetched.

## `reviewRatings` (type: `string`):

🇷🇺 Какие отзывы оставлять: все, только негативные или только позитивные.
🇬🇧 Filter by sentiment: all, negative only, or positive only.

## `includeUnratedReviews` (type: `boolean`):

🇷🇺 Включать отзывы без числовой оценки, если они есть.
🇬🇧 Include text-only reviews without a star rating when present.

## `includeReviewerData` (type: `boolean`):

🇷🇺 Сохранять публичные поля профиля автора (имя, аватар и т.п.), если 2GIS их отдаёт.
🇬🇧 Store public reviewer fields (name, avatar, etc.) when exposed by 2GIS.

⚠️ Персональные данные регулируются GDPR и др. Собирайте только при законной цели.
⚠️ Personal data is regulated (e.g. GDPR). Collect only where you have a lawful basis.

## `maxMediaPerPlace` (type: `integer`):

🇷🇺 Сколько медиафайлов сохранить на карточку. **0** — не заходить в галерею (быстрее).
🇬🇧 How many gallery items to save per place. **0** — skip media (faster).

## `includePhotoAuthors` (type: `boolean`):

🇷🇺 Для дополнительных фото сохранять имя и ссылку на профиль автора, если указано.
🇬🇧 For extra photos, store author name and profile link when 2GIS shows them.

## `rubricIds` (type: `array`):

🇷🇺 Сузить выдачу до выбранных **рубрик** (категорий) из справочника 2GIS. В данных сохраняются числовые коды; здесь — удобные названия.
🇬🇧 Narrow results to selected **2GIS categories**. Stored values are numeric IDs; labels here are for the form only.

## `filterHasGoods` (type: `boolean`):

🇷🇺 Только места, где в карточке есть раздел с ценами/меню (обычно общепит).
🇬🇧 Only places that expose prices or a menu in the listing.

## `filterHomeDelivery` (type: `boolean`):

🇷🇺 Только заведения с доставкой.
🇬🇧 Only venues that offer delivery.

## `filterTakeaway` (type: `boolean`):

🇷🇺 Только заведения с заказом навынос.
🇬🇧 Only places with takeaway / to-go.

## `filterHasSite` (type: `boolean`):

🇷🇺 Только организации с указанным сайтом.
🇬🇧 Only listings that include a website URL.

## `filterHasPhotos` (type: `boolean`):

🇷🇺 Только места с загруженными фотографиями.
🇬🇧 Only places that have photo gallery content.

## `filterPaymentCard` (type: `boolean`):

🇷🇺 Только места, где указана оплата банковской картой.
🇬🇧 Only where card payment is indicated.

## `filterAvgPriceMin` (type: `integer`):

🇷🇺 Нижняя граница среднего чека (для заведений, где он указан).
🇬🇧 Minimum average bill (where available).

## `filterAvgPriceMax` (type: `integer`):

🇷🇺 Верхняя граница среднего чека (для заведений, где он указан).
🇬🇧 Maximum average bill (where available).

## `filterCreatedRecently` (type: `boolean`):

🇷🇺 Показывать недавно появившиеся в городе точки.
🇬🇧 Prefer newly listed places in the area.

## `filterWifi` (type: `boolean`):

🇷🇺 Только места с отмеченным Wi‑Fi.
🇬🇧 Only listings that mention Wi‑Fi.

## `filterRating` (type: `string`):

🇷🇺 Оставить точки не ниже выбранного уровня звёзд (один вариант).
🇬🇧 Keep places at or above the selected star tier (pick one).

## `sortBy` (type: `string`):

🇷🇺 Как упорядочить список на странице поиска перед сбором.
🇬🇧 How search results are ordered before scraping.

## `customGeolocation` (type: `object`):

🇷🇺 Нарисуйте или вставьте **Polygon / MultiPolygon** в формате GeoJSON — поиск ограничится этой фигурой. Имеет приоритет над полем «Город».
🇬🇧 Paste a **Polygon / MultiPolygon** GeoJSON to limit the search to that shape. Overrides the city text above.

## `enableGlobalDataset` (type: `boolean`):

🇷🇺 Включить накопление и объединение записей между запусками (полезно для больших обходов).
🇬🇧 Accumulate and deduplicate records across runs (for large crawling projects).

## Actor input object example

```json
{
  "query": [
    "Ресторан"
  ],
  "locationQuery": "Москва",
  "maxItems": 10,
  "domain": "auto",
  "language": "auto",
  "includeContacts": false,
  "maxReviewsPerPlace": 0,
  "reviewSortBy": "trust",
  "reviewRatings": "all",
  "includeUnratedReviews": false,
  "includeReviewerData": false,
  "maxMediaPerPlace": 0,
  "includePhotoAuthors": false,
  "rubricIds": [],
  "filterHasGoods": false,
  "filterHomeDelivery": false,
  "filterTakeaway": false,
  "filterHasSite": false,
  "filterHasPhotos": false,
  "filterPaymentCard": false,
  "filterCreatedRecently": false,
  "filterWifi": false,
  "sortBy": "rating",
  "enableGlobalDataset": false
}
```

# 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": [
        "Ресторан"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraperx/2gis-places-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": ["Ресторан"] }

# Run the Actor and wait for it to finish
run = client.actor("scraperx/2gis-places-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": [
    "Ресторан"
  ]
}' |
apify call scraperx/2gis-places-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/qrabZ29qDmisVwFNN/builds/4yKMBdkcklVgzFZrT/openapi.json
