Regions API
The Regions API is used to select a region that limits the searches for organizations, buildings, and places.
In terms of this API we’re going to use a word region for an agglomeration that includes a large city and its nearest settlements, as well as its satellite cities. In general, our regions have nothing to do with the subjects of the Russian Federation and correspond to the internal data storage format in 2GIS.
This API is primarily intended for internal use.
Outside the regions, the search for places and companies is geographically restricted.
Request format
This section presents an example of a request
https://catalog.api.2gis.com/2.0/region/search?q=Moscow&key=YOUR_KEY
This request takes the following parameters:
q=Moscow
— the search is performed for the “Moscow” querykey=YOUR_KEY
— your API key
Request response format
The response to the request is returned in JSON format:
{
"meta": {
"api_version": "2.0.448950",
"code": 200,
"issue_date": "20200629"
},
"result": {
"items": [
{
"id": "32",
"name": "Moscow",
"type": "region"
}
],
"total": 1
}
}
How to use
An example of using the Regions API is given below.
Determining a search area from a user query, e.g. “Moscow”:
https://catalog.api.2gis.com/2.0/region/search?q=Moscow&key=YOUR_KEY
Search for a category within a specified region:
https://catalog.api.2gis.com/2.0/catalog/rubric/search?q=cafe®ion_id=32&key=YOUR_KEY
Search for branches in the found category:
https://catalog.api.2gis.com/3.0/items?rubric_id=162&sort_point=37.622161%2C55.751597&key=YOUR_KEY
Getting Started
- Fill in the application form to get your key.
- Learn about the request and response formats.