PHPackages                             scraper-apis/2gis-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. scraper-apis/2gis-parser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

scraper-apis/2gis-parser
========================

PHP client library for scraping 2GIS data (places, reviews, property, jobs) using Apify actors

00PHPCI passing

Since Feb 20Pushed 2mo agoCompare

[ Source](https://github.com/Scraper-APIs/2gis-parser-php)[ Packagist](https://packagist.org/packages/scraper-apis/2gis-parser)[ RSS](/packages/scraper-apis-2gis-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

2GIS Parser PHP
===============

[](#2gis-parser-php)

[English](https://github.com/Scraper-APIs/2gis-scraper-php) | **Русский**

PHP-библиотека для парсинга данных 2ГИС: организации, отзывы, недвижимость, вакансии.

Работает через [Apify API](https://apify.com/) — запускает акторы и возвращает типизированные DTO.

Установка
---------

[](#установка)

```
composer require scraper-apis/2gis-parser
```

Быстрый старт
-------------

[](#быстрый-старт)

```
use TwoGisParser\Client;

$client = new Client('apify_api_ваш_токен');

// Поиск ресторанов в Москве
$places = $client->scrapePlaces(
    query: ['ресторан'],
    location: 'Москва',
    maxResults: 50,
);

foreach ($places as $place) {
    echo "{$place->name} — {$place->address}" . PHP_EOL;
    echo "Рейтинг: {$place->rating}, отзывов: {$place->reviewCount}" . PHP_EOL;

    if ($place->hasContactInfo()) {
        echo "Тел: {$place->getFirstPhone()}" . PHP_EOL;
    }
}
```

Методы
------

[](#методы)

### Организации

[](#организации)

```
$places = $client->scrapePlaces(
    query: ['стоматология', 'клиника'],
    location: 'Санкт-Петербург',
    maxResults: 200,
    language: Language::Russian,
    country: Country::Russia,
    options: [
        'filterRating' => 'excellent',      // 4.5+
        'skipClosedPlaces' => true,
        'maxReviews' => 10,                  // подгрузить отзывы
        'filterCardPayment' => true,
    ],
);
```

**Хелперы Place:**

```
$place->hasContactInfo();    // есть телефоны или email
$place->getFirstPhone();     // первый номер телефона или null
$place->getFirstEmail();     // первый email или null
$place->hasWebsite();        // есть ли сайт
$place->getCoordinates();    // ['lat' => float, 'lng' => float] или null
```

### Отзывы

[](#отзывы)

```
$reviews = $client->scrapeReviews(
    startUrls: ['https://2gis.ru/moscow/firm/70000001057394703'],
    maxReviews: 100,
    maxPlaces: 5,
    reviewsRating: ReviewsRating::Negative,  // только 1-2 звезды
    reviewsSource: ReviewsSource::TwoGis,
);

foreach ($reviews as $review) {
    echo "{$review->authorName}: {$review->rating}/5" . PHP_EOL;

    if ($review->hasOfficialAnswer()) {
        echo "Ответ: {$review->getOfficialAnswerText()}" . PHP_EOL;
    }
}
```

**Хелперы Review:**

```
$review->hasOfficialAnswer();      // есть ли ответ компании
$review->getOfficialAnswerText();  // текст ответа или null
$review->hasPhotos();              // есть ли фото у отзыва
$review->isPositive();             // рейтинг >= 4
$review->isNegative();             // рейтинг scrapeProperties(
    location: 'Казань',
    maxResults: 500,
    category: PropertyCategory::SaleResidential,
    sort: PropertySort::PriceAsc,
    options: [
        'rooms' => ['2', '3'],
        'priceMax' => 15000000,
        'notFirstFloor' => true,
    ],
);

foreach ($properties as $property) {
    echo "{$property->name} — {$property->getPriceFormatted()}" . PHP_EOL;
    echo "{$property->area} м², этаж {$property->floor}" . PHP_EOL;
}
```

**Хелперы Property:**

```
$property->hasImages();         // есть ли фото
$property->getCoordinates();    // ['lat' => float, 'lng' => float] или null
$property->getPriceFormatted(); // "1 500 000 RUB" или null
```

### Вакансии

[](#вакансии)

```
$jobs = $client->scrapeJobs(
    location: 'Новосибирск',
    maxResults: 300,
    categoryId: '200',       // Разработка
    salaryMin: 80000,
    salaryMax: 250000,
);

foreach ($jobs as $job) {
    echo "{$job->name} — {$job->orgName}" . PHP_EOL;
    echo "Зарплата: {$job->salaryLabel}" . PHP_EOL;
}
```

**Хелперы Job:**

```
$job->hasApplyUrl();      // есть ли ссылка для отклика
$job->getCoordinates();   // ['lat' => float, 'lng' => float] или null
```

Фильтры и перечисления
----------------------

[](#фильтры-и-перечисления)

EnumЗначения`Language``Auto`, `Russian`, `English`, `Arabic`, `Kazakh`, `Uzbek`, `Kyrgyz`, `Armenian`, `Georgian`, `Azerbaijani`, `Tajik`, `Czech`, `Spanish`, `Italian``Country``Auto`, `Russia`, `Kazakhstan`, `UAE`, `Uzbekistan`, `Kyrgyzstan`, `Armenia`, `Georgia`, `Azerbaijan`, `Belarus`, `Tajikistan`, `SaudiArabia`, `Bahrain`, `Kuwait`, `Qatar`, `Oman`, `Iraq`, `Chile`, `Czechia`, `Italy`, `Cyprus``RatingFilter``None`, `Perfect` (4.9+), `Excellent` (4.5+), `PrettyGood` (4.0+), `Nice` (3.5+), `NotBad` (3.0+)`ReviewsRating``All`, `Positive` (4-5), `Negative` (1-2)`ReviewsSource``All`, `TwoGis`, `Flamp`, `Booking``PropertyCategory``SaleResidential`, `SaleCommercial`, `RentResidential`, `RentCommercial`, `DailyRent``PropertySort``Default`, `PriceAsc`, `PriceDesc`, `AreaAsc`, `AreaDesc`Конфигурация
------------

[](#конфигурация)

```
use TwoGisParser\Client;
use TwoGisParser\Config;

// Изменить таймаут или базовый URL
$client = new Client('токен', new Config(
    apiToken: 'токен',
    timeout: 600,
));
```

Обработка ошибок
----------------

[](#обработка-ошибок)

```
use TwoGisParser\Exception\ApiException;
use TwoGisParser\Exception\RateLimitException;

try {
    $places = $client->scrapePlaces(query: ['кафе'], location: 'Алматы');
} catch (RateLimitException $e) {
    sleep($e->retryAfter);
    // повторить запрос
} catch (ApiException $e) {
    echo "Ошибка API: {$e->getMessage()}" . PHP_EOL;
}
```

Требования
----------

[](#требования)

- PHP 8.3+
- Токен [Apify API](https://console.apify.com/account/integrations)

См. также
---------

[](#см-также)

- [Yandex Parser PHP](https://github.com/Scraper-APIs/yandex-parser-php) — парсинг Яндекса (организации и отзывы с Яндекс Карт, товары с Яндекс Маркета, объявления с Яндекс Недвижимости)

Лицензия
--------

[](#лицензия)

MIT

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance56

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8433587?v=4)[Peter Thaleikis](/maintainers/spekulatius)[@spekulatius](https://github.com/spekulatius)

---

Top Contributors

[![spekulatius](https://avatars.githubusercontent.com/u/8433587?v=4)](https://github.com/spekulatius "spekulatius (5 commits)")

---

Tags

2gis2gis-parserdata-extractionphp

### Embed Badge

![Health badge](/badges/scraper-apis-2gis-parser/health.svg)

```
[![Health](https://phpackages.com/badges/scraper-apis-2gis-parser/health.svg)](https://phpackages.com/packages/scraper-apis-2gis-parser)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
