Skip to main content

Suggests (deprecated)

Autocomplete (2.0)

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

Autocomplete

Autocomplete

Method support discontinued. To see the list of suggestions, use /3.0/suggests method.

query Parameters
q
required
string [ 1 .. 500 ] characters

An arbitrary search string.

key
required
string

A unique key of API user.

region_id
required
integer

Region id.

types
Array of strings

The types of objects among which the search is performed. When passing several types, less relevant results of some types may be crowded out by more relevant other types. Types should be comma separated.
List of available types:

  • adm_div.district is a district;
  • adm_div.settlement — place;
  • adm_div.city is a city;
  • adm_div.place place;
  • adm_div.living_area — zhilmassiv neighborhood;
  • adm_div.division is a district;
  • adm_div.district_area is a district of the region;
  • adm_div.amana — amana;
  • adm_div.region is the region (oblast/Krai/Republic, etc.);
  • building building;
  • station — stop
  • street street;
  • attraction is a tourist attraction;
  • crossroad — intersection;
  • station.metro — metro station;
  • branch is the branch of the organization;
  • general_rubric — the unifying rubric;
  • rubric — the category;
  • attribute — optional attribute.
  • rubric_attribute is the attribute of the column;
  • route.bus is the bus route;
  • route.trolleybus — the trolleybus route;
  • route.tram — the tram route;
  • route.shuttle_bus — the route taxi marshrutnoe;
  • route.metro is a subway route;
  • route.suburban_train — the route of the train;
  • route.funicular_railway — the route of the funicular;
  • route.monorail — the route of the monorail;
  • route.river_transport — the route of water transport;
  • route.cable_car — the route of the ropeway;
  • route.light_rail — the route of light rail;
  • route.the premetro — the route of metrotrama;
  • route.light_metro — the route of light metro;
  • kilometer_road_sign — kilometer road sign.

The list of available subtypes (subtype) for different types of objects can be viewed in the response schema inside items.

type
string
Default: "default"

The type of tips to use. Available types:

  • default;
  • route_endpoint — perfect for a quick search of final objects of the route. All the results have id and coordinates;
  • rubric — category suggests;
  • places;
  • address;
  • city_selector — settlement suggests. Can be used without specifying a project.

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.

page_size
integer [ 1 .. 100 ]
Default: 10

Number of search results displayed on one page.

Responses

Response Schema:
required
object (ObjMeta)

Response metadata

required
object

Main result

Response samples

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