Skip to main content

Places API

The Places API searches for organizations, buildings, and places.

You can search for one or more places:

  • by company name (“Moos Hair Dressing”)
  • by company's business area (“restaurants” or “music instrument stores”)
  • with geotags (“Al Mankhool flowers”)
  • with attributes of goods and services (“Italian cuisine café” or “Sauna with a pool”)
  • by telephone number or website (“97143017777” or “www.marinaviewhotel.com”)
  • without specifying a text query (in a building, in a category, in a city, search for all branches of one company)
  • by makani (“12991 75289”)

Requests are made using the GET method, all required parameters should be passed in the query string. The response is returned in the JSON format. To provide hints when searching for objects, use the Suggest API.

Learn about features of other search APIs to enrich your scenarios of working with objects on the map.

Getting started

  1. Get an access key:

    1. Sign in to the Platform Manager.
    2. Create a demo key or purchase a subscription for using API. For details on service prices, see the Tariffs section.

    Important

    To get certain information about objects, an additional permission is required. Check the list of methods and fields for getting additional information on demand.

    To work with access keys, you can use the Platform Manager: for details, see the account documentation.

  2. Learn about the request and response formats.

  3. Check the examples of the Places API requests and the full API reference.

Additional information on demand

Getting certain information about objects is only available on demand and for an extra cost. To purchase access to the methods and fields below, contact the Urbi sales team.

  • API methods:

  • Fields (specified in the fields parameter):

    • items.contact_groups - detailed contact information of the organization
    • items.floors - number of floors
    • items.floor_plans - floor plans
    • items.links.database_entrances.apartments_info - information about apartments in the building
    • items.employees_org_count - number of employees of the organization
    • items.itin - individual tax identification number
    • items.trade_license - trade license
    • items.fias_code - code of streets or administrative territories in the Federal Information Address System
    • items.address.components.fias_code - code of buildings in the Federal Information Address System
    • items.fns_code - Federal Tax Service code of administrative territories
    • items.okato - code of streets and administrative territories in the National Classifier of Administrative Territorial Entities
    • items.address.components.okato - code of buildings in the National Classifier of Administrative Territorial Entities
    • items.oktmo - code of streets and administrative territories in the National Classification of Territories of Municipal Formations
    • items.address.components.oktmo - code of buildings in the National Classification of Territories of Municipal Formations
    • items.structure_info.material - information about the building material
    • items.structure_info.apartments_count - number of apartments in the building
    • items.structure_info.porch_count - number of entrances in the building
    • items.structure_info.floor_type - floor type in the building
    • items.structure_info.gas_type - type of gas supply in the building
    • items.structure_info.year_of_construction - year of building construction
    • items.structure_info.elevators_count - number of elevators in the building
    • items.structure_info.is_in_emergency_state - whether the building is considered to be in emergency state
    • items.structure_info.project_type - series or a project of building construction
    • items.structure_info.chs_name - name of the cultural heritage site
    • items.structure_info.chs_category - category of the cultural heritage site

Request format

Requests to the Places API must contain the following components:

  1. Object search request (what to search for?). This component is always required. You can provide this request:

    • As a text query (q parameter) with different levels of precision:

      • with a particular object name (“Moos Hair Dressing”)
      • with a category of interest (music instrument stores)
      • with criteria of interest (restaurant with italian cuisine) and more
    • As a filter by an attribute of interest (for example, by working hours). See more about attributes below.

    • By specifying an ID of a particular object or category.

    • By specifying a known attribute of a particular object: phone number, website address, tax identification number, or trade license.

  2. Geographic restriction (where to search?). This component is required when searching for a list of objects by specific criteria (for example, all currently open cafes in Dubai). You can set this restriction:

    • In a text query (q parameter): for example, by specifying a region, city, district, street, subway station, and more.

      You can combine an object search request and a geographic restriction in one text query (flower shops in Dubai). Only one q parameter must be used.

    • By specifying an ID of a city, building, subway station, and more.

    • By specifying a search region:

    Note

    You do not need to specify a geographic restriction if you search for a particular object by its unique attribute using the following methods:

  3. Your API key.


You can apply additional configurations to your search.

Request example

https://catalog.api.2gis.com/3.0/items?q=cafe&location=37.630866,55.752256&key=YOUR_KEY

The request takes the following parameters:

  • q=cafe - search is performed for the “cafe” query
  • location=37.630866,55.752256 - geographic restriction: coordinates for a nearby cafe search
  • key=YOUR_KEY - your API key

See more request examples for solving various tasks.

Response format

The response is returned in the JSON format:

{
"meta": {
"api_version": "3.0.448950",
"code": 200,
"issue_date": "20200626"
},
"result": {
"items": [
{
"address_comment": "3, 5 floor",
"address_name": "Nikolskaya, 25",
"id": "70000001031668425",
"name": "MCK, lounge bar chain",
"type": "branch"
}
],
"total": 5926
}
}

Parameters that are passed in the response by default:

  • id - object identifier
  • name - object name
  • type - object type (see the full list in the API reference)

Additional configuration

You can additionally configure the search to get data in a required form, for example:

Additional information

To get additional information in the response, use the fields parameter. For example, you can get the following data for an object:

  • the point to which the object is bound
  • the object's address or location and its binding to administrative and territorial units
  • object geometry, visual center of geometry
  • the parent organization to which all company branches belong in a particular segment of the map.
  • working hours
  • contact info
  • objects related to the company or place: entry points, nearest stops and parking lots, service organizations, entrances to the building, and others
  • detailed information about parking lots: capacity, cost, type of access, number of levels
  • detailed information about the building: number of floors, building material

See the full list of additional information in the API reference.


Type of search

The search_type parameter defines the search type: the algorithm and settings optimized for the search goal, as well as the logic for forming results.

The most commonly used search types are described below. See the full list in the search_type parameter description.

Search with an expansion

In search results, categories and organizations will be expanded to companies (branches of an organization). For example, a search for "Russian Post" will put all post offices in the search results. Category expansion works in a similar way - when searching for a "cafe", the result will contain companies from the "Cafe / Cafeteria" category rather than the category itself, which is also the subject of the catalog.

This algorithm of forming search results is used by default and matches the search_type=discovery parameter to the query.

Search with the only branch of an organization in a result

It is similar to a search with an expansion, but also keeps only one branch for each organization. For example, the user wants to find an online store and to look at its site, and he does not need all the pick-up points in the result.

To change the algorithm of forming search results, pass the search_type=one_branch parameter to the query.

Search in a building

It is suitable for searching for organizations in a building, for example, in a business center or a mall. You can also use it to autocomplete when searching in the building.

To change the algorithm of forming search results, pass the search_type=indoor parameter to the query and specify the building ID in the building_id field.


Sorting search results

You can enable sorting of the search result using the sort parameter in a query.

The search result is sorted by a distance from the user, object rating, and other parameters. See sorting types in the API reference.


Filtering search results

You can filter search results:

  • by object type - for example, only among attractions
  • by location - for example, in a certain district, city, in a given area
  • by the type of response data - e.g., only companies or only buildings
  • by category - e.g., a search for cafes or grocery stores only
  • by organization - you can get the list of all branches of an organization
  • by working hours - e.g., only branches working around the clock
  • by availability or absence of data, e.g., photos, reviews, rating, website, tax identification number
  • by additional attributes - e.g., the availability of Wi-Fi, the ability to pay by card, etc.

See the complete list of filters and the corresponding parameters in the API reference.

Filtering by additional attributes

Additional attributes contain reference information about organizations: the availability of Wi-Fi, the average check, whether they have delivery, what product range and types of services they offer, whether there is coffee-to-go, and so on.

The list of available additional attributes for filtering is dynamic. To see it, specify the &fields=filters parameter in the request. In the response, additional attributes will be listed in the result.filters.attributes field.

To filter the results by one or more additional attributes, pass each of them as a separate parameter attr[<code>]=<value>.

Where:

  • <code> - is the code of an additional attribute.

  • <value> - is the value of the additional attribute. The value type depends on the attribute type:

    Attribute typeValue typeExample
    flagBooleanattr[food_service_business_lunch]=true
    rangeRange of two comma-separated integersattr[food_service_capacity]=10,30

Filtering by attributes with type filter:

Attribute tagPurposeValue typeExample
has_siteFilter by site availabilityBooleanhas_site=true
has_photosFilter by photo availabilityBooleanhas_photos=true
boundFilter by rectangular areaString (see the format of the point1 and point2 fields in the API reference)point1=82.921663,55.030195&point2=82.921663,55.030195

Filtering by other attributes:

Attribute tagPurposeValue typeExample
districtFilter by district, can only be used when searching for organizations (type=branch)Integer (district ID)district_id=141347373711435
worktimeFilter by working timeString (see the format for the work_time parameter in the API reference)work_time=now ID
subwayFilter by metro stationInteger (subway station ID)subway=141523467371731

If you specify several additional attributes, only those objects that meet all conditions will be returned in the response.

The attributes with the sort type in the filters block output are used to sort search results.

Tariffs

  • The service fee is calculated based on the number of requests per month.
  • To find out the current prices for services, contact the manager.