Skip to main content

Search for regions

OpenAPI Specification

Directory of regions (2.0)

2GIS API Support: api@2gis.ru URL: https://docs.2gis.com/

Region

Search for regions

A region is an agglomeration which includes a major city and the surrounding areas. Now you can implement the selection of the city, as it is made in the Online version of 2GIS, which is the API partner.

query Parameters
key
required
string

A unique key of API user.

q
required
string [ 1 .. 400 ] characters

An arbitrary search string.

lang
string
Default: "ru"

The language of regions.

locale
string

The locale with which the search is performed and given results.

country_code_filter
Array of strings
Example: country_code_filter=ru

List of country codes separated by commas that you use to filter.

page
integer
Default: 1

The number of the requested page.

page_size
integer [ 1 .. 2000 ]
Default: 1000

Number of search results displayed on one page.

locale_filter
Array of strings
Example: locale_filter=ru_RU

List of locales separated by commas that you use to filter.

fields
Array of strings

Additional fields to be displayed in the response should be separated by commas.
List of available fields:

  • items.name_grammatical_cases — inducing names of the region;
  • items.domain — the value of the domain.
  • items.locales — the list of locales for which you can search for the region;
  • items.time_zone — time zone;
  • items.bounds — the geometry of the boundaries of the project WKT;
  • items.statistics — statistics for the region;
  • items.locale — the current locale for the region;
  • items.settlements — the list of satellite cities;
  • items.satellites — the list of satellite cities as objects;
  • items.online_languages — the valid languages in the Online version of 2GIS for the project;
  • items.zoom_level is the zoom level;
  • items.seo — additional fields for SEO;
  • items.code — the region code;
  • items.uri_code — the region code that will be displayed in the domain;
  • items.uri_aliases is the set of aliases of the region;
  • items.allow_for_indexing — a list of languages project, which allowed the index;
  • items.weights_time — time of last update of promotional scales in Unix timestamp format;
  • items.hidden — a flag whether a project is hidden;
  • items.country_code — country code;
  • items.flags — signs of the presence of certain information in the region;
  • items.default_pos — the default position for display of the project;
  • items.extras_tips_languages — valid languages.

type
string
Default: "region"
Examples:
  • type=region,segment - An example of multiple types
  • type=region - An example of a single type

A filter by object type, the types should be comma separated.
The list of available types:

  • region;
  • segment;
  • universe.

Responses

Response Schema:
required
object (ObjMeta)

Response metadata

required
object

Main result

Response samples

Content type
{
  • "meta": {
    • "code": 200,
    • "api_version": "dev",
    • "issue_date": "string"
    },
  • "result": {
    • "total": 1,
    • "items": [
      ]
    }
}