# twogis.search

The places on a page of 2GIS's search results for a query in a city: address, pin, categories, rating, attributes and hours.

2GIS search, one of the 2GIS scrapers.

| | |
| --- | --- |
| Id | `twogis.search` |
| Version | 1 |
| Billed per | request — 1 unit for a charged run |
| Runs | within one request |

Start it with `POST /v1/scrapers/twogis.search/runs`. How runs work is in [Running a scraper](https://docs.enrichednow.com/running-a-scraper.md); what a run costs is in [Usage and units](https://docs.enrichednow.com/usage-and-units.md).

## Inputs

The fields of `input`. A field that is not listed here is refused.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | yes | What to search for: a kind of place (`coffee`, `аптека`), a name or an address. Limit: at least 1 characters, at most 200 characters. |
| `city` | string | yes | The city to search in, as 2GIS names it in its page addresses: `moscow`, `spb`, `novosibirsk`, `almaty`, `dubai`. Limit: at least 2 characters, at most 61 characters. |
| `page` | integer | no | The results page, from 1. A page holds up to 12 places. Limit: 1 to 1000. Default: `1`. |
| `max_results` | integer | no | Return at most this many places of the page; all of them when not given. Limit: 1 to 12. |

- `city` is the name 2GIS files a city under in its page addresses: `moscow`, `spb`, `novosibirsk`, `almaty`, `dubai`. A name it does not have ends `failed` with `unknown_city`.
- One run reads one page, up to 12 places, in the order 2GIS shows them. A search nothing matches, and a `page` past the last one, end `ok` with zero records.
- Names, addresses and categories are in the language of the city's own 2GIS site: Russian for most cities, English for the Emirates.
- `type` is `branch` for an organisation's branch. A search for an address or a landmark also returns records of type `building`, `street`, `station` and the like.
- A card has no contacts. Pass a record's `place_id` to [`twogis.place`](https://docs.enrichednow.com/scrapers/twogis.place.md) for the telephone numbers and websites.

## Record fields

Every record of a run has these fields. A value that is not known is `null` — never an empty string and never `0`.

| Field | Type | Notes |
| --- | --- | --- |
| `place_id` | string | 2GIS's id of the place. |
| `type` | string | What the place is: `branch` for an organisation's branch, or `building`, `street`, `adm_div` (a district or a town), `station`, `attraction` and the like. |
| `name` | string | The name as the page writes it, e.g. `Orto, cafe`. |
| `short_name` | string or null | The name without what follows the comma, e.g. `Orto`. |
| `description` | string or null | What the name is followed by, e.g. `cafe`. |
| `url` | string | The place's page on 2GIS. |
| `address` | string or null | The street address, e.g. `395, Jumeirah road`. |
| `address_comment` | string or null | What the page adds to the address, e.g. the floor or the office. |
| `building_name` | string or null | The name of the building the place is in, when the page gives one. |
| `postal_code` | string or null | The postal code. |
| `district` | string or null | The district of the city. |
| `city` | string or null | The city or town. |
| `region` | string or null | The region the city is in. |
| `country` | string or null | The country, in the page's language. |
| `latitude` | number or null | The latitude of the place's pin, in decimal degrees. |
| `longitude` | number or null | The longitude of that pin. |
| `categories` | array of string | The categories 2GIS lists the place in, the main one first. |
| `rating` | number or null | The average rating, 1 to 5. Null for a place nobody has rated. |
| `rating_count` | integer or null | How many ratings the average is of. |
| `review_count` | integer or null | How many of those ratings come with a written review. |
| `attributes` | array of string | What the page lists the place as offering or having, e.g. `Wi-Fi`, `Average bill 40 AED`. |
| `hours` | array of object | The opening hours, a row per day and period. Empty when the page lists none. |
| `hours[].day` | string | The day of the week: `Mon`, `Tue`, `Wed`, `Thu`, `Fri`, `Sat` or `Sun`. |
| `hours[].opens` | string | When the place opens, `HH:MM` in its own time. |
| `hours[].closes` | string | When it closes, `HH:MM`; earlier than `opens` when it closes after midnight, `24:00` at midnight. |
| `open_24_7` | boolean or null | True when the page says the place is open around the clock. |
| `utc_offset_minutes` | integer or null | The place's time zone as minutes ahead of UTC. |
| `organization_id` | string or null | 2GIS's id of the organisation the branch belongs to. |
| `branch_count` | integer or null | How many branches that organisation has on 2GIS. |
| `photo_count` | integer or null | How many photos the page has of the place. |
| `image` | string or null | The place's main photo. |
| `promoted` | boolean or null | True when the place is shown as an advertiser. |
| `removed` | boolean | True when 2GIS says the place was removed from its directory: it may have closed for good or for a while. Default: `false`. |
| `position` | integer | The place's position on the results page, from 1. |
| `page` | integer | The results page it was on. |
| `fetched_at` | string (date-time) | When the page was read, in UTC. |

## Example request

It starts a run with this scraper's example input and waits up to 60 seconds for it. The key is read from `ENRICHEDNOW_API_KEY`.

```bash
curl -X POST "https://api.enrichednow.com/v1/scrapers/twogis.search/runs?wait=60" \
  -H "Authorization: Bearer $ENRICHEDNOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{"query":"coffee","city":"dubai"}}'
```

## Example response

The run, once it has ended. A run that has not ended within `wait` comes back with `202` and the status `queued` or `running`.

```json
{
  "id": "run_841742f37553189ff9c27ba1",
  "scraper_id": "twogis.search",
  "scraper_version": 1,
  "status": "ok",
  "reason": null,
  "input": {
    "query": "coffee",
    "city": "dubai"
  },
  "record_count": 1,
  "units": 1,
  "units_per_request": 1,
  "units_per_record": null,
  "units_per_page": null,
  "diagnostics": {
    "requests": 1,
    "bytes": 259214,
    "wall_ms": 885,
    "facts": {}
  },
  "created_at": "2026-11-16T22:37:50.170950Z",
  "started_at": "2026-11-16T22:37:50.178331Z",
  "finished_at": "2026-11-16T22:37:51.066313Z"
}
```

Its records, from `GET /v1/runs/{id}/records`. The record is a real one: this scraper's own parser read it from a page recorded from the site.

```json
{
  "records": [
    {
      "place_id": "70000001035714425",
      "type": "branch",
      "name": "Starbucks, coffee shop",
      "short_name": "Starbucks",
      "description": "coffee shop",
      "url": "https://2gis.ru/dubai/firm/70000001035714425",
      "address": "Al Bayt 4, 19, Al Seef road",
      "address_comment": "G Floor",
      "building_name": "Al Bayt 4",
      "postal_code": null,
      "district": "Al Hamriya",
      "city": "Dubai",
      "region": "Dubai Emirate",
      "country": "UAE",
      "latitude": 25.26464,
      "longitude": 55.303865,
      "categories": [
        "Coffee shop"
      ],
      "rating": 4.8,
      "rating_count": 76,
      "review_count": 22,
      "attributes": [
        "Average bill 30 AED",
        "Breakfast menu",
        "Outdoor sitting area"
      ],
      "hours": [
        {
          "day": "Mon",
          "opens": "08:00",
          "closes": "24:00"
        },
        {
          "day": "Tue",
          "opens": "08:00",
          "closes": "24:00"
        }
      ],
      "open_24_7": null,
      "utc_offset_minutes": 240,
      "organization_id": "70000001033047305",
      "branch_count": 309,
      "photo_count": 62,
      "image": "https://i6.photo.2gis.com/main/branch/99/70000001035714425/common",
      "promoted": false,
      "removed": false,
      "position": 1,
      "page": 1,
      "fetched_at": "2026-11-19T18:07:41.636733Z"
    }
  ],
  "next_cursor": null
}
```

What was done to the record for this page, and nothing else — the API returns every value whole. A text that was cut ends with `… [truncated]`.

- Shortened: `attributes`: 10 items, the first 3 shown.
- Shortened: `hours`: 7 items, the first 2 shown.

A run does not always end `ok`. [Results and statuses](https://docs.enrichednow.com/results-and-statuses.md#reason-codes) lists every status and the reasons every scraper shares; [the reasons of the 2GIS scrapers](https://docs.enrichednow.com/results-and-statuses.md#2gis) are in their own section there.
