Open KOLANICH opened 8 years ago
There is some API documentation available here: https://tech.yandex.ru/rasp/doc/reference/schedule-point-point-docpage/ But knowing Russian to implement this is definitely helpful.
Maps of Metro (not only Moscow one, but also ones of some Russian and Ukrainian cities). It seems that rest api is hiden carefully because the source of JS populating that element is obfuscated. https://github.com/ymaps/metro-jsapi/blob/70bbc2ed51f71924ab08c85ccacedef175fc9015/src/transportMap/Scheme.js#L32L33
Also we can try tο use http://api.2gis.com/ as the source of info about bus stops and metro stations and mosgortrans.org as the source of bus schedules. 2gis has unpublic API (and a plans to make it public in future) for transport routes
https://catalog.api.2gis.ru/2.0/transport/route/get?id=<id of route>
- is info about the route
https://catalog.api.2gis.ru/2.0/transport/route/search?q=<search query>®ion_id=<id of region>&key=<api key>
- discovers routes
Description of mosgortrans tool (can be used if you run out of queries in yandex)
http://www.mosgortrans.org/pass3/request.ajax.php?
1 list=ways&type=<type of transport>
tram - tram
trol - trolleybus
avto - bus
returns list of routes separated by \n
2 list=days&type=<type of transport>&way=<id of route>
returns list of available schedules of the route
You can decode schedule id, it is a bitmask of days (base 2), the first is Monday, the last is Sunday, for example 0000011 means weekend.
3 list=directions&type=<type of transport>&way=<id of route>&date=<schedule>
returns directions names (endpoints sepaated by "-" and space characters), the first is AB
, the second is BA
4 list=waypoints&type=<type of transport>&way=<id of route>&date=<days of week>&direction=<direction>
returns names of stations
5
http://www.mosgortrans.org/pass3/shedule.php?type=<type of transport>&way=<id of route>&date=<days of week>&direction=<direction>&waypoint=<waypoints>
waypoints can be all
(this will give all the schedules) or a number of waypoint (this will give only one schedule)
You have to parse HTML to get the schedules
One more source for metro maps. https://github.com/Utyff/pMetro/blob/master/app/src/main/java/com/utyf/pmetro/settings/CatalogList.java
https://tech.yandex.ru/rasp/ (in Russian, but everything is clear)