Skip to main content

Geocoding (deprecated)

Directory of map objects (2.0)

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

Geocoding

Search for map objects

Method support discontinued. Use 3.0/items/geocode method for geocoding.

query Parameters
key
required
string

A unique key of API user.

q
string [ 1 .. 400 ] characters

An arbitrary search string.

region_id
string

Region identifier. It is required if a geographical limit of search has not been specified. Details about the territorial division of the map into regions can be found in the description of the Regions API.

point
string
Example: point=82.921663,55.030195

A center of the search area (point coordinates in the lon, lat format).
It is used to filter results in circumference.

radius
integer [ 0 .. 40000 ]
Default: 0.1

Search radius in meters. Used to filter the results in circumference.

point1
string
Example: point1=82.921663,55.030195

The coordinates of the upper left vertex of a rectangular area limiting the search results in the lon, lat format.
It is used to filter results in a rectangular area.
Allowed difference of the point1 and point2 coordinates is not more than 0.06 for lon, and 0.04 (approximately 6.6 x 4.4 km) for lat.
If the parameter q has been passed — the limitations are not imposed.

point2
string
Example: point2=82.921663,55.030195

The coordinates of the lower right vertex of a rectangular area limiting the search results in the lon, lat format.
It is used to filter results in a rectangular area.
Allowed difference of the point1 and point2 coordinates is not more than 0.06 for lon, and 0.04 (approximately 6.6 x 4.4 km) for lat.
If the parameter q has been passed — the limitations are not imposed.

viewpoint1
string
Example: viewpoint1=82.921663,55.030195

The coordinates of the upper left vertex of a rectangular visibility scope, in the lon, lat format. The parameters viewpoint 1 and viewpoint 2 transmit the area of the map where the user looked before entering the request. It is used as one of the criteria for choosing where results are needed and for ranking. Does not strictly restrict the search results to the transmitted area only.

viewpoint2
string
Example: viewpoint2=82.921663,55.030195

The coordinates of the lower right vertex of a rectangular visibility scope, in the lon, lat format. The parameters viewpoint 1 and viewpoint 2 transmit the area of the map where the user looked before entering the request. It is used as one of the criteria for choosing where results are needed and for ranking. Does not strictly restrict the search results to the transmitted area only.

polygon
string
Example: polygon=POLYGON((82.91259527206421 55.0614369017519,82.90572881698608 55.05902823221974,82.91521310806274 55.05580825372468))

A polygon in WKT format.
It is used to filter the results in an arbitrary area.

type
Array of strings

Type filter geoobjects, the types should be comma separated.
the Value adm_div is an alias for all types of adm_div.* at the same time.
List of available types:

  • adm_div — an administrative unit;
  • adm_div.city is a city;
  • adm_div.district is a district;
  • adm_div.division is a district;
  • adm_div.living_area — zhilmassiv neighborhood;
  • adm_div.place place;
  • adm_div.settlement — place;
  • adm_div.district_area is a district of the region;
  • adm_div.amana — amana;
  • adm_div.region is the region (oblast/Krai/Republic, etc.);
  • attraction is a tourist attraction;
  • building building;
  • crossroad — intersection;
  • gate — the passage/the passage.
  • parking — parking;
  • poi — POI;
  • road — road;
  • street — street;
  • kilometer_road_sign — kilometer road sign.

page
integer
Default: 1

The number of the requested page.

page_size
integer [ 1 .. 50 ]
Default: 20

Number of search results displayed on one page.

locale
string

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

sort
string

The sorting of results. Possible values:

  • relevance — in descending order of the relevance;
  • rating — in descending order of the rating.

zoom_level
integer

The current zoom level for geocoding.

has_photos
boolean

Filter by availability of photos. Takes the true or false values.

fields
Array of strings

Additional fields to display in the response are separated by commas.
List of available fields:

  • items.adm_div — administrative division;
  • items.address — address where the organization's branch is located;
  • items.address.is_conditional — flag for "conditional address";
  • items.full_address_name — the same as address_name, but with the city;
  • items.floors — number of floors;
  • items.attraction — description of the attraction;
  • items.statistics — summary information about the geo object;
  • items.level_count — number of Parking levels;
  • items.capacity — Parking capacity;
  • items.description — description of the geo object;
  • items.context — dynamic information;
  • items.access_name — localized name of the access type;
  • items.is_paid — whether Parking is paid;
  • items.for_trucks — truck parking;
  • items.paving_type — type of parking paving;
  • items.access — type of access for Parking;
  • items.access_comment — localized name for the access type;
  • items.schedule — work schedule for a geo object (for example, for Parking);
  • hash — base hash;
  • items.stat — data for generating statistics messages;
  • search_attributes — information about the search performed;
  • items.geometry.selection - geometry for selecting the object;
  • items.geometry.hover — geometry of the area used to determine whether the cursor is in the area of the object.
  • items.geometry.style - ID of the style to display;
  • items.geometry.centroid — visual center of the object geometry;
  • items.region_id — unique project ID;
  • items.links - related objects;
  • items.external_content — additional company data (requires additional permission on API key);
  • items.is_routing_available - flag for whether travel to the object is possible;
  • items.group — objects linked to the combined card;
  • items.reviews — statistics on branch reviews;
  • items.is_main_in_group — indicates that this is the main object in the hybrid object group;
  • items.city_alias — alias of the city, where the object is located;
  • items.detailed_subtype — detailed type of administrative-territorial unit;
  • items.name_back — revealed name in the reverse direction, if available;
  • items.value_back — kilometer number in the reverse direction;

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": {
    • "items": [
      ],
    • "total": 1
    }
}