Examples

Search for geographical features

Search for a feature by name:

https://search-maps.yandex.ru/v1/?text=village of Tolstik&type=geo&lang=en_US&apikey=<API key>

Search for an object by address:

https://search-maps.yandex.ru/v1/?text=18 Amurskaya ulitsa, Svobodniy&type=geo&lang=en_us&apikey=<API key>

Query with the typo "Mascow". The response will contain the corrected version.

https://search-maps.yandex.ru/v1/?text=Mascow&type=geo&lang=en_US&apikey=<API key>

Search for businesses

Search for a business by name:

https://search-maps.yandex.ru/v1/?text=Shear Pleasure&type=biz&lang=ru_RU&apikey=<API key>

Search for a business by phone number:

https://search-maps.yandex.ru/v1/?text=+7(495)739-70-00&type=biz&lang=ru_RU&apikey=<API key>

Search for a business by service provided:

https://search-maps.yandex.ru/v1/?text=cut,style&type=biz&lang=en_us&apikey=<API key>

Search for a business with the address specified:

https://search-maps.yandex.ru/v1/?text=Auto repair,Moscow, Smolenskaya ulitsa&type=biz&lang=ru_RU&apikey=<API key>

Search for a business by multiple parameters:

https://search-maps.yandex.ru/v1/?text=аптека day,card payment&type=biz&lang=en_us&apikey=<API key>

Search for places in a specified area

If the request specifies the search area, the results will show objects that are closest to this area first. For example:

https://search-maps.yandex.ru/v1/?text=village of  Pozharishche&ll=40.17248,60.594641&spn=3.552069,2.400552&lang=ru_RU&apikey=<API key>

Restricting the number of results in the response

Some queries may match multiple objects. The request sent to the geocoder can specify the desired number of objects to receive in the response, and the number of the first one.

Output the first 5 results:

https://search-maps.yandex.ru/v1/?text=ul. Griboedova&results=5&lang=ru_RU&apikey=<API key>

Output one result, starting from the third:

https://search-maps.yandex.ru/v1/?text=Red Square&results=1&skip=2&lang=en_us & apikey=<API key>

Getting the response in JSONP format

The security policies of modern browsers do not allow web pages to load data from third-party servers. Third-party refers to a server whose domain name is different from the domain name of the server that the page is on. When making a page that requests geocoding results, use JSONP technology.

When using JSONP, a function name is passed to the server that is returning data. Results are returned in JSON format, but as a parameter of the function with the specified name.

To get search results in JSONP format, you must assign the callback parameter the name of the function that will process the results returned in JSON format. For example:

https://search-maps.yandex.ru/v1/?text=Moscow, ul. Krylatsky Holmi&lang=en_us&apikey=<API key>&callback=my_callback

The server returns a JSON object, wrapped in the specified function:

my_callback({
    "status":"success",
    "data": {
        "type":"FeatureCollection",
        "properties": {
            "ResponseMetaData": {
                "SearchRequest": {
                    "request":"Moscow, ul. Krylatsky Holmi",
                    ...
                 }
             }
         }
    }
})