Skip to main content

Get object by IP

Catalog of objects (3.0)

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

Catalog

Geocoding by IP

Performs geocoding by IP. If the IP-address matches the coordinate, but the geo object is not found at this point, the coordinate is returned.

query Parameters
ip
required
string
Example: ip=194.226.82.50

IP-address. IPv4 and IPv6 notations are allowed.

key
required
string

Unique key of API user.

locale
string
Examples:
  • locale=ar_AE - Arabic for the UAE
  • locale=ru_RU - Russian for Russia

The locale from which the search is performed and the results are given.
List of available locales:

  • az_AZ — Azerbaijani (Azerbaijan);
  • ru_AZ — Russian (Azerbaijan);
  • hy_AM — Armenian (Armenia);
  • ru_AM — Russian (Armenia);
  • ar_BH — Arabic (Bahrain);
  • en_BH — English (Bahrain);
  • ru_BY — Russian (Belarus);
  • ka_GE — Georgian (Georgia);
  • ru_GE — Russian (Georgia);
  • en_EG — English (Egypt);
  • ar_EG — Arabic (Egypt);
  • it_IT — Italian (Italy);
  • en_IQ — English (Iraq);
  • ar_IQ — Arabic (Iraq);
  • kk_KZ — Kazakh (Kazakhstan);
  • ru_KZ — Russian (Kazakhstan);
  • en_QA — English (Qatar);
  • ar_QA — Arabic (Qatar);
  • en_CY — English (Cyprus);
  • es_CL — Spanish (Cyprus);
  • ky_KG — Kyrgyz (Kyrgyzstan);
  • ru_KG — Russian (Kyrgyzstan);
  • en_CN — English (China);
  • zh_CN — Chinese (China);
  • ru_CN — Russian (China);
  • en_KW — English (Kuwait);
  • ar_KW — Arabic (Kuwait);
  • en_MA — English (Morocco);
  • ar_MA — Arabic (Morocco);
  • en_AE — English (UAE);
  • ar_AE — Arabic (UAE);
  • en_OM — English (Oman);
  • ar_OM — Arabic (Oman);
  • en_RU — English (Russia);
  • ar_RU — Arabic (Russia);
  • es_RU — Spanish (Russia);
  • it_RU — Italian (Russia);
  • ru_RU — Russian (Russia);
  • uk_RU — Ukrainian (Russia);
  • cs_RU — Czech (Russia);
  • en_SA — English (Saudi Arabia);
  • ar_SA — Arabic (Saudi Arabia);
  • ru_TJ — Russian (Tajikistan);
  • tg_TJ — Tajik (Tajikistan);
  • ru_UZ — Russian (Uzbekistan);
  • uz_UZ — Uzbek (Uzbekistan);
  • ru_UA — Russian (Ukraine);
  • uk_UA — Ukrainian (Ukraine);
  • cs_CZ — Czech (Czech Republic).

type
Array of strings
Examples:
  • type=adm_div,street - An example of multiple types
  • type=adm_div - An example of a single type

Types of geoobjects to search among. When passing multiple types, the less relevant results of some types may be replaced by the more relevant results of other types. The types are separated by commas.

The value 'adm_div `is an alias for all 'adm_div' types.* 'simultaneously.

List of available types:

  • adm_div — administrative unit;
  • adm_div.city — city;
  • adm_div.district_area — district of the region;
  • adm_div.district — district;
  • adm_div.division — division;
  • adm_div.living_area — residential area, neighborhood;
  • adm_div.place — place;
  • adm_div.region — region (region/province/republic, etc.);
  • adm_div.settlement — locality;
  • adm_div.amana — amana;
  • coordinates — global coordinate.
fields
Array of strings
Examples:
  • fields=items.region_id,items.name_ex - An example of multiple types
  • fields=items.region_id - An example of a single type

Additional fields to be displayed in the response should be separated by commas. Fields labeled additional permission for the API key is required will be present in the output only if the key has permissions for that field. By default, the key does not have any of these additional permissions.
The list of fields containing information on geometry and address of the place:

  • items.point — object coordinates, specified in the WGS84 in the lon, lat format;
  • items.address — address where the object is located;
  • items.adm_div — belonging to an administrative territory;
  • items.full_address_name — objects address with indication of a city;
  • items.geometry.centroid — visual center of object geometry;
  • items.geometry.hover — geometry of the area used to determine whether the cursor is in the object zone;
  • items.geometry.selection — geometry for object selection;

The list of fields with additional information on the place:
  • items.rubrics — categories of the company;
  • items.org — a company to which the branch belongs;
  • items.brand — brand to which the branch belongs;
  • items.contact_groups — the company's contact details (additional permission from the API key is required to obtain the information);
  • items.schedule — opening hours of the company;
  • items.schedule_special — special schedule company;
  • items.access_comment — localized name for the type of access;
  • items.access_name — localized name of the type of access;
  • items.access — access type for a parking lot;
  • items.capacity — parking lot capacity;
  • items.description — map object description;
  • items.external_content — additional company data (requires additional permission on API key);
  • items.flags — a list of object attributes;
  • items.floors — the number of floors (additional permission from the API key is required to obtain the information);
  • items.floor_plan — the plan of floors (additional permission from the API key is required to obtain the information);
  • items.is_paid — whether the parking facility is chargeable or not;
  • items.for_trucks — truck parking;
  • items.paving_type — type of parking paving;
  • items.is_incentive — whether this parking is intercepting.;
  • items.purpose — purpose of parking lot;
  • items.level_count — the number of parking facility levels;
  • items.links — linked objects (nearest parking, public transport stops, and more);
  • items.links.database_entrances — information about entry points (requires additional permission on the API key);
  • items.links.database_entrances.apartments_info — information about the apartments in the building (additional permission from the API key is required to obtain the information);
  • items.name_ex — components of the object name;
  • items.reviews — statistics on reviews about the object;
  • items.employees_org_count — the number of employees of the organization (additional permission from the API key is required to obtain the information);
  • items.itin — the individual number of the taxpayer (additional permission from the API key is required to obtain the information);
  • items.trade_license — the license of the branch (additional permission from the API key is required to obtain the information);
  • items.fias_code — FIAS code of streets and administrative territories;
  • items.address.components.fias_code — FIAS code of buildings;
  • items.fns_code — FNS code of administrative territories (additional permission for API key is required);
  • items.okato — OKATO code of streets and administrative territories (additional permission for API key is required);
  • items.address.components.okato — OKATO code of buildings (additional permission for API key is required);
  • items.oktmo — OKTMO code of streets and administrative territories (additional permission for API key is required);
  • items.address.components.oktmo — OKTMO code of buildings (additional permission for API key is required);

The list of command boxes:
  • items.dates.deleted_at — the date when the company data was last deleted in the ISO 8601 format;
  • items.dates.updated_at — the date when the company data was last updated in the ISO 8601 format;
  • items.dates — the time when the information on the company was added to the database;
  • items.geometry.style — style ID for display;
  • items.detailed_subtype — detailed type of administrative-territorial unit;
  • items.group — objects gathered in one linked card;
  • items.delivery — delivery is available
  • items.is_main_in_group — an attribute meaning that it is the main object in the group of the hybrid objects.
  • items.routes — transport routes passing through the station or public transport stop;
  • items.directions — route directions;
  • items.barrier — type of enclosure;
  • items.floor_id — floor ID;
  • items.is_routing_available — a flag showing whether it is possible to create a route to the object or not;
  • items.locale — current locale for the region;
  • items.region_id — unique identifier of the project;
  • items.segment_id — unique identifier of the segment;
  • items.stop_factors — a set of blocking attributes that match the query;
  • items.has_apartments_info — an attribute of availability of information on apartments in the building;
  • items.timezone — timezone in the POSIX format;
  • items.timezone_offset — the offset the offset at the minute regarding UTC0;
  • items.comment — comment for the entrance;
  • items.station_id — the unique identifier of the stop to which this stopping platform is linked;
  • items.platforms — the bus stop platform stop;
  • items.sources — the ID of the object data source;
  • items.structure_info — the data on the number of apartments and the material the building is made of (additional permission from the API key is required to obtain the information;
  • items.structure_info.material — information about the material the building is made of (additional permission from the API key is required to obtain the information;
  • items.structure_info.apartments_count — the data on the number of apartments (additional permission from the API key is required to obtain the information;
  • items.structure_info.porch_count — the data on the number of entrances (additional permission from the API key is required to obtain the information;
  • items.route_logo — icon of the underground;
  • items.is_deleted — a sign of a deleted object;
  • items.search_attributes — parameters of the search result for the found object. Each field inside items.search_attributes must be queried separately through a dot, for example, items.search_attributes.segment_id. The list of available fields inside the items.search_attributes object can be viewed in the response schema for any object inside items;
  • items.congestion — branch congestion;
  • items.marker_alt — relative height of marker placement;
  • items.purpose_code — code of the purpose of the building;
  • items.poi_category — POI category;
  • search_attributes — information about the performed search;
  • items.name_back — for the road sign, the localized name in the reverse direction, if available;
  • items.value_back — for the road sign, the number of the kilometer in the reverse direction;
  • items.ev_charging_station — attributes for charging stations;
  • items.has_ads_model — an indication of the presence of an advertising 3D model in the building;
  • items.has_otello_stories — A sign that has story from Otello in the branch;
  • items.has_otello_hotels — sign of availability of hotels in Otello;
  • items.summary — block of summarized information;

lon
string
Examples:
  • lon=82.921663 - Longitude

Longitude of the point - center of the search area.
Should be used together with the lat parameter.
Allowed range of values: from -180 to 180
Can be used together with the radius parameter to filter the results in circumference.

lat
string
Examples:
  • lat=55.030195 - Latitude

Latitude of the point — center of the search area.
Should be used together with the lon parameter.
Allowed range of values: from -90 to 90
Can be used together with the radius parameter to filter the results in circumference.

point
string
Examples:
  • point=82.921663,55.030195 - Longitude and latitude

A center of the search area (point coordinates in the lon, lat format).
It is used to filter results in circumference. The parameter conflicts with the parameters polygon, point1, point2.

radius
integer >= 0
Default: 250

Search radius in meters.
Limitation: from 0 to 40,000 — if there is a search query (q), from 0 to 2,000 — if there is none.
Default value: 250 - when combined with point, 0 - when combined with lon/lat.
Used to filter the results in circumference.

point1
string
Examples:
  • point1=82.921663,55.030195 - Longitude and latitude

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.
The maximum distance between the points point1 and point2 is not more than 2 km.
If the parameter q has been passed — the limitations are not imposed. The parameter conflicts with the parameters point, polygon.

point2
string
Examples:
  • point2=82.921663,55.030195 - Longitude and latitude

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.
The maximum distance between the points point2 and point1 is not more than 2 km.
If the parameter q has been passed — the limitations are not imposed. The parameter conflicts with the parameters point, polygon.

polygon
string
Examples:
  • polygon=POLYGON((82.91259527206421 55.0614369017519,82.90572881698608 55.05902823221974,82.91521310806274 55.05580825372468,82.91259527206421 55.0614369017519)) - WKT format

Polygon in WKT format.
It is used to filter the results in an arbitrary area. The permissible area of the polygon is ~ 6 km^2. If the q parameter is passed, no restrictions are imposed. The parameter conflicts with the parameters point, point1, point2.

page
integer [ 1 .. 1000000 ]
Default: 1

The number of the requested page.

page_size
integer [ 1 .. 50 ]
Default: 20

Number of search results displayed on one page.

has_photos
boolean

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

has_rating
boolean

Filter by availability of rating on flamp.ru. Takes the true or false values.

has_reviews
boolean

Filter by availability of reviews on flamp.ru. Takes the true or false values.

has_site
boolean

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

Responses

Response Schema: application/json
required
object

Main result

required
object (ObjMeta)

Response metadata

Response samples

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