Skip to main content

Examples

Address autocomplete

https://catalog.api.2gis.com/3.0/suggests?q=Moscow Li&suggest_type=address&key=YOUR_KEY

Route endpoint autocomplete

https://catalog.api.2gis.com/3.0/suggests?q=Moscow Li&suggest_type=route_endpoint&key=YOUR_KEY

Autocomplete for the catalog objects

https://catalog.api.2gis.com/3.0/suggests?q=Moscow Li&suggest_type=object&key=YOUR_KEY

Filtering by result types

Completion of a building address, display only buildings in results:

https://catalog.api.2gis.com/3.0/suggests?q=Moscow Petrovka, 2&type=building&suggest_type=address&fields=items.point&key=YOUR_KEY

Completion of an end point of a route, only stops in results:

https://catalog.api.2gis.com/3.0/suggests?q=Moscow cent&type=station&suggest_type=route_endpoint&fields=items.point&key=YOUR_KEY

Completion of a user query, the result contains options for the query text and companies:

https://catalog.api.2gis.com/3.0/suggests?q=post rus&type=user_queries,branch&fields=items.point&polygon=POLYGON((37.5930 55.7667,37.6494 55.7667,37.6494 55.7405,37.5930 55.7405,37.5930 55.7667))&key=YOUR_KEY

Getting additional data in the response

Retrieving the point for an object:

https://catalog.api.2gis.com/3.0/suggests?q=Moscow cent&fields=items.point&suggest_type=route_endpoint&type=station&key=YOUR_KEY

Retrieving the address of an object:

https://catalog.api.2gis.com/3.0/suggests?q=post rus&fields=items.address&type=branch&fields=items.point&polygon=POLYGON((37.5930 55.7667,37.6494 55.7667,37.6494 55.7405,37.5930 55.7405,37.5930 55.7667))&key=YOUR_KEY

Retrieving the schedule of a company:

https://catalog.api.2gis.com/3.0/suggests?q=post rus&fields=items.schedule&type=branch&polygon=POLYGON((37.5930 55.7667,37.6494 55.7667,37.6494 55.7405,37.5930 55.7405,37.5930 55.7667))&key=YOUR_KEY

Geo-limiting the search area

Specifying the search area in the WKT format:

https://catalog.api.2gis.com/3.0/suggests?q=cafe&polygon=POLYGON((37.5930 55.7667,37.6494 55.7667,37.6494 55.7405,37.5930 55.7405,37.5930 55.7667))&key=YOUR_KEY

Specify the point from which the search is performed:

https://catalog.api.2gis.com/3.0/suggests?q=caf&sort_point=37.630866,55.752256&key=YOUR_KEY