# 2GIS Places Scraper (`devilscrapes/2gis-places-scraper`) Actor

Scrape 2GIS (2gis.ru, .kz, .ae) local business search by city and query. Get name, category, address, coordinates, rating, review count, opening hours, plus optional phone, website and e-mail for every place.

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

## Pricing

Pay per event

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

<div align="center">
  <img src=".actor/icon.svg" width="160" alt="Devil Scrapes mark" />

## 2GIS Places Scraper

**💰 $3.00 / 1 000 results**  ·  pay only for results  ·  no credit card to try

*We do the dirty work so your dataset stays clean.* 😈

Scrape 2GIS, the local business directory for Russia, Kazakhstan and the UAE. Run any number of queries across any number of cities and get name, category, address, coordinates, rating, review count and opening hours for every place — deduplicated by place id, with optional phones, websites and e-mails.

</div>

***

### 🎯 What this scrapes

2GIS search results by city and query: cafes, pharmacies, salons, clinics, shops and every other category 2GIS lists, in Moscow, Saint Petersburg, Almaty, Dubai and every other 2GIS city. Each place becomes one dataset row with its 2GIS id, name, primary and additional categories, street address, building, district, numeric latitude and longitude, 2GIS rating and review count, opening hours per weekday, last-updated date, and a direct 2GIS link. Switch on `includeContacts` to add business phones, website and e-mail from each place's own page.

### 🔥 Features

- 🛡️ **We rotate browser fingerprints** (curl-cffi impersonation — Chrome / Firefox / Safari) so the target sees real-browser TLS, not Python.
- 🔁 **We retry with exponential backoff** on `408 / 429 / 5xx` and honour `Retry-After`. Up to 5 attempts per page.
- 🌐 **We route through Apify Proxy** and rotate the exit on every failed attempt. Pin an exit country with `proxyCountryCode` when you need one.
- 🗺️ **We fan out for you.** Give a list of cities and a list of queries and we run every combination.
- 🧱 **We dedupe by place id** across every page, query and city in a run, so overlapping searches never double-count or double-bill.
- 📞 **We enrich on request.** `includeContacts` opens each place page and adds phones, website and e-mail.
- 🧊 **Pydantic-validated rows** — clean, typed, stable field names, ISO-8601 timestamps. One failing page or place never kills the run.
- 💰 **You pay only for results that land.** No data → no charge (only the small `actor-start` warm-up fee).

### 💡 Use cases

- Lead lists of local businesses by category and city
- Location analytics and competitor mapping for retail, food and healthcare chains
- Feeding directories, delivery and travel products with fresh place data
- Tracking rating and review growth on chains and individual venues

### ⚙️ How to use it

1. Open the Actor input form on the Apify Console.
2. Add one or more `cities` (the slug in the 2GIS address, for example `moscow`, `spb`, `almaty`, `dubai`).
3. Add one or more `queries` in the local language, for example `кафе` or `аптека`.
4. Tune `maxItemsPerQuery`, `maxPages` and the run-wide `maxResults`, then click **Start**. Results stream into the default dataset as JSON, CSV, Excel, or XML.

```json
{
  "cities": ["moscow", "spb"],
  "queries": ["кафе", "аптека"],
  "maxItemsPerQuery": 60,
  "maxPages": 5,
  "includeContacts": false,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

### 📥 Input

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `cities` | `string[]` | no | `["moscow"]` | 2GIS city slugs. Every query runs in every city. |
| `queries` | `string[]` | no | `["кафе"]` | Search queries in the local language. |
| `maxItemsPerQuery` | `integer` | no | `60` | Cap on places per city and query (max 60). |
| `maxPages` | `integer` | no | `5` | Result pages per city and query, 12 places each (max 5). |
| `maxResults` | `integer` | no | `1000` | Hard cap on total deduplicated rows across the run. |
| `includeContacts` | `boolean` | no | `false` | Add phone, website and e-mail from each place page. |
| `proxyConfiguration` | `object` | no | Apify Proxy | Apify Proxy configuration. |
| `proxyCountryCode` | `string` | no | any | Two-letter proxy exit country, e.g. `RU`, `KZ`, `AE`. |

### 📤 Output

One row per deduplicated place:

```json
{
  "placeId": "70000001007179642",
  "name": "Му-Му, кафе",
  "organizationId": "4504136498368318",
  "category": "Кафе",
  "categories": ["Кафе", "Доставка еды", "Быстрое питание"],
  "address": "Манежная площадь, 1 ст2",
  "buildingName": "Охотный ряд",
  "city": "Москва",
  "district": "Тверской",
  "latitude": 55.755301,
  "longitude": 37.614586,
  "rating": 4.8,
  "reviewCount": 1107,
  "phone": "+74957818781",
  "website": "http://cafemumu.ru",
  "workingHours": { "Mon": "08:00-23:00", "Sun": "08:00-23:00" },
  "url": "https://2gis.ru/moscow/firm/70000001007179642",
  "query": "кафе",
  "searchCity": "moscow",
  "scrapedAt": "2026-10-01T10:00:00+00:00"
}
```

`phone`, `phones`, `website` and `email` are filled only when `includeContacts` is on and the business lists them.

### 💰 Pricing

Pay-Per-Event (PPE) — you pay only for what you use:

| Event | Price (USD) | When |
|---|---|---|
| `actor-start` | $0.20 | Once per run, at boot |
| `result-emitted` | $0.003 | Per deduplicated place row written |

At scale that's roughly **$3.00 per 1,000 results**.

### 🚧 Limitations

- **60 places per city and query.** 2GIS serves five result pages of 12 places for any single search. We detect the limit and stop cleanly instead of repeating page one. Use several specific queries (`кафе`, `пиццерия`, `кофейня`) and more cities to cover more ground.
- Queries work best in the local language of the city.
- `includeContacts` opens one extra page per place, so runs are slower and use more proxy traffic.
- `rating`, `reviewCount` and opening hours are only present when 2GIS lists them.
- A query with no exact matches finishes successfully with zero rows.
- Search-result rows only — no review text, menus or photos.

### ❓ FAQ

**Do I need a 2GIS account or API key?**

No. Add your cities and queries and start the run.

**Why did I get fewer rows than `maxResults`?**

Either each search reached 2GIS's 60-place limit, or it ran out of matching places. Add queries or cities for broader coverage. Places seen under an earlier search are not repeated.

**Which cities are supported?**

Use the slug from the 2GIS address of any city, such as `moscow`, `spb`, `novosibirsk`, `almaty` or `dubai`. Kazakhstan and UAE cities are served through the matching 2GIS country site automatically.

**Are phone numbers personal data?**

No. `includeContacts` only reads the business contacts a company publishes on its own 2GIS page.

### 💬 Your feedback

Found a bug or need a new field? Open an issue on the Actor's Apify Store page or contact the Devil Scrapes team at [apify.com/DevilScrapes](https://apify.com/DevilScrapes).

# Changelog

This Actor's version history is a separate document: https://apify.com/devilscrapes/2gis-places-scraper/changelog.md

# Actor input Schema

## `cities` (type: `array`):

2GIS city slugs from the 2gis.ru URL, e.g. moscow, spb, novosibirsk, almaty (Kazakhstan), dubai (UAE). Every query runs in every city.

## `queries` (type: `array`):

What to search for, e.g. кафе, аптека, салон красоты. Use the local language of the city (English works in Dubai). 2GIS serves at most 60 places per city and query, so add more specific queries to go deeper.

## `maxItemsPerQuery` (type: `integer`):

Cap on places per city and query. 2GIS serves 12 places per page and at most 60 per search.

## `maxPages` (type: `integer`):

Result pages to read per city and query (12 places each). 2GIS serves 5 pages at most.

## `maxResults` (type: `integer`):

Hard cap on total deduplicated places emitted across the whole run.

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

Open each place's own page to add business phones, website and e-mail. Slower and uses more proxy traffic (one extra page per place).

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

Apify Proxy configuration. Datacenter exit by default.

## `proxyCountryCode` (type: `string`):

Two-letter country code for the proxy exit, e.g. RU, KZ or AE. Leave empty for any country.

## Actor input object example

```json
{
  "cities": [
    "moscow",
    "spb"
  ],
  "queries": [
    "кафе",
    "аптека"
  ],
  "maxItemsPerQuery": 24,
  "maxPages": 2,
  "maxResults": 100,
  "includeContacts": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `datasetItems` (type: `string`):

All dataset items as JSON.

## `datasetItemsCsv` (type: `string`):

Same data exported to CSV.

## `datasetView` (type: `string`):

Open the run dataset in the Console.

# 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 = {
    "cities": [
        "moscow",
        "spb"
    ],
    "queries": [
        "кафе",
        "аптека"
    ],
    "maxItemsPerQuery": 24,
    "maxPages": 2,
    "maxResults": 100,
    "includeContacts": false,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("devilscrapes/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 = {
    "cities": [
        "moscow",
        "spb",
    ],
    "queries": [
        "кафе",
        "аптека",
    ],
    "maxItemsPerQuery": 24,
    "maxPages": 2,
    "maxResults": 100,
    "includeContacts": False,
    "proxyConfiguration": { "useApifyProxy": True },
}

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

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

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

```

## CLI example

```bash
echo '{
  "cities": [
    "moscow",
    "spb"
  ],
  "queries": [
    "кафе",
    "аптека"
  ],
  "maxItemsPerQuery": 24,
  "maxPages": 2,
  "maxResults": 100,
  "includeContacts": false,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call devilscrapes/2gis-places-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,devilscrapes/2gis-places-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/WWaNltXMU7SNwhBH3/builds/UMJvBlPkbK3cnRObf/openapi.json
