A
A
Alexander Pankov2015-01-06 22:25:36
JavaScript
Alexander Pankov, 2015-01-06 22:25:36

How to find out the station code by its name? Yandex.Schedule API?

Hello!
Can you tell me how to find out the station code by its name?

For example, I take the name of the stations "Moscow" - "Kirov" from input:text.
And in the AJAX request, it is the station code that is needed, how to find it out?

Here is the format (according to the station code, everything works for me)

https://api.rasp.yandex.net/v1.0/search/ ?
  apikey=<ключ> 
& format=<формат>
& from=<код станции отправления>
& to=<код станции прибытия>
& lang=<язык>
& [date=<дата>]
& [transport_types=<тип транспорта>]
& [system=<текущая система кодирования>]
& [page=<страница>]


Here "FROM" and "TO" are code stations, not city names! How to find out the code-station by its (city) name?
Thanks in advance for your help!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2015-01-08
@br3t

You can try to use one of the systems from here https://tech.yandex.ru/rasp/doc/concepts/coding-sy... , for example, this one osm.sbin.ru/esr

D
Dmitry Tallmange, 2017-06-12
@game802

HTTP 401 - Unauthorized
The web server (or proxy?) requires authorization to make the request.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question