Пример: getVehiclesInfoWithRegion - OwlSoul/YandexTransportProxy GitHub Wiki

Пример данных, получаемых методом getVehiclesInfoWithRegion

Маршрут: г. Долгопрудный, Автобус 472
(id = 203727226)

Ссылка на URL маршрута:

https://yandex.ru/maps/214/dolgoprudniy/?ll=37.521372%2C55.936159&masstransit%5BrouteId%5D=2037272262&masstransit%5BstopId%5D=stop__9688641&masstransit%5BthreadId%5D=2037281383&mode=stop&z=16

Ссылка на URL маршрута:

https://yandex.ru/maps/api/masstransit/getVehiclesInfoWithRegion?ajax=1&csrfToken=a0d2b5faa91a52ba3fcb94cbe234f8ec983fd5cf%3A1553484307379&lang=ru&ll=37.56351541749997%2C55.764540640753&locale=ru_RU&routeId=2036924571&sessionId=1553484307271_905685&spn=0.14277938099998266%2C0.05619494351852694&type=bus

Проход по данной ссылке приведет к ошибке "Invalid CSRF Token", это нормально. Ссылка приведена для демонстрации как оно выывается в Yandex Masstransit API.

Открыть в отдельной вкладке

Посмотреть в Online JSON Viewer

Данные содержат все то же самое, что и getVehiclesInfoInfo (координаты транспорта, траектории), но еще какую-то информацию о "регионе".

{
  "data": {
    "vehicles": [
      {
        "type": "FeatureCollection",
        "properties": {
          "VehicleMetaData": {
            "id": "mosobl%5Fdta|1023",
            "Transport": {
              "id": "2037281383",
              "lineId": "2037272262",
              "name": "472",
              "Types": [
                "bus"
              ],
              "type": "bus"
            }
          }
        },
        "features": [
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.436899,
                  55.874029
                ],
                [
                  37.437049,
                  55.873954
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 1,
                "time": 1554221442
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.437049,
                  55.873954
                ],
                [
                  37.437049,
                  55.873954
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 8,
                "time": 1554221443
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.437049,
                  55.873954
                ],
                [
                  37.437056,
                  55.873951
                ],
                [
                  37.437113,
                  55.873922
                ],
                [
                  37.437278,
                  55.873835
                ],
                [
                  37.43734,
                  55.873801
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 2,
                "time": 1554221451
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.43734,
                  55.873801
                ],
                [
                  37.437436999999996,
                  55.873746
                ],
                [
                  37.437704,
                  55.873583999999994
                ],
                [
                  37.438392,
                  55.873152
                ],
                [
                  37.439087,
                  55.872713
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 18,
                "time": 1554221453
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.439087,
                  55.872713
                ],
                [
                  37.439339,
                  55.872554
                ],
                [
                  37.439406999999996,
                  55.872513
                ],
                [
                  37.439471,
                  55.872353
                ],
                [
                  37.439496999999996,
                  55.872271
                ],
                [
                  37.439592999999995,
                  55.872045
                ],
                [
                  37.439837,
                  55.871480999999996
                ],
                [
                  37.439847,
                  55.871461
                ],
                [
                  37.439892,
                  55.871348999999995
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 11,
                "time": 1554221471
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.439892,
                  55.871348999999995
                ],
                [
                  37.440048,
                  55.870960999999994
                ],
                [
                  37.440214999999995,
                  55.870566
                ],
                [
                  37.440256999999995,
                  55.870467999999995
                ],
                [
                  37.440253999999996,
                  55.870312999999996
                ],
                [
                  37.440021,
                  55.869932999999996
                ],
                [
                  37.440013,
                  55.869921999999995
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 15,
                "time": 1554221482
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.440013,
                  55.869921999999995
                ],
                [
                  37.439879,
                  55.869726
                ],
                [
                  37.439656,
                  55.869395999999995
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 5,
                "time": 1554221497
              }
            }
          }
        ]
      },
      {
        "type": "FeatureCollection",
        "properties": {
          "VehicleMetaData": {
            "id": "mosobl%5Fdta|359",
            "Transport": {
              "id": "2037281383",
              "lineId": "2037272262",
              "name": "472",
              "Types": [
                "bus"
              ],
              "type": "bus"
            }
          }
        },
        "features": [
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.492086,
                  55.948837
                ],
                [
                  37.492076999999995,
                  55.948837999999995
                ],
                [
                  37.491949999999996,
                  55.948848
                ],
                [
                  37.491761,
                  55.948859
                ],
                [
                  37.491687999999996,
                  55.948862999999996
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 12,
                "time": 1554221442
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.491687999999996,
                  55.948862999999996
                ],
                [
                  37.491583,
                  55.948867
                ],
                [
                  37.491462,
                  55.94887
                ],
                [
                  37.49147,
                  55.948758999999995
                ],
                [
                  37.491481,
                  55.94853
                ],
                [
                  37.491495,
                  55.948102
                ],
                [
                  37.491507999999996,
                  55.947753999999996
                ],
                [
                  37.491512,
                  55.94764
                ],
                [
                  37.491532,
                  55.947078999999995
                ],
                [
                  37.491537,
                  55.946864
                ],
                [
                  37.491546,
                  55.946666
                ],
                [
                  37.491558999999995,
                  55.946296999999994
                ],
                [
                  37.491561,
                  55.94625
                ],
                [
                  37.491562,
                  55.946213
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 41,
                "time": 1554221454
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.491562,
                  55.946213
                ],
                [
                  37.491566,
                  55.94607
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 7,
                "time": 1554221495
              }
            }
          }
        ]
      },
      {
        "type": "FeatureCollection",
        "properties": {
          "VehicleMetaData": {
            "id": "mosobl%5Fdta|955",
            "Transport": {
              "id": "2037281384",
              "lineId": "2037272262",
              "name": "472",
              "Types": [
                "bus"
              ],
              "type": "bus"
            }
          }
        },
        "features": [
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.494459,
                  55.891304
                ],
                [
                  37.493939,
                  55.891073
                ],
                [
                  37.493818,
                  55.89102
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 10,
                "time": 1554221442
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.493818,
                  55.89102
                ],
                [
                  37.492156,
                  55.890291999999995
                ],
                [
                  37.491907,
                  55.890178999999996
                ],
                [
                  37.491648,
                  55.890068
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 16,
                "time": 1554221452
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.491648,
                  55.890068
                ],
                [
                  37.491625,
                  55.890057999999996
                ],
                [
                  37.491355999999996,
                  55.889944
                ],
                [
                  37.491327999999996,
                  55.889931999999995
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 2,
                "time": 1554221468
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.491327999999996,
                  55.889931999999995
                ],
                [
                  37.491327999999996,
                  55.889931999999995
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 7,
                "time": 1554221470
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.491327999999996,
                  55.889931999999995
                ],
                [
                  37.491319,
                  55.889928999999995
                ],
                [
                  37.491119999999995,
                  55.889846
                ],
                [
                  37.491065,
                  55.889824
                ],
                [
                  37.491005,
                  55.889799
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 2,
                "time": 1554221477
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.491005,
                  55.889799
                ],
                [
                  37.490524,
                  55.889602999999994
                ],
                [
                  37.490213,
                  55.889482
                ],
                [
                  37.489973,
                  55.88939
                ],
                [
                  37.489675999999996,
                  55.889277
                ],
                [
                  37.489506999999996,
                  55.889213
                ],
                [
                  37.489329999999995,
                  55.889146999999994
                ],
                [
                  37.489128,
                  55.889072
                ],
                [
                  37.488915999999996,
                  55.888996
                ],
                [
                  37.488864,
                  55.888977999999994
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 14,
                "time": 1554221479
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.488864,
                  55.888977999999994
                ],
                [
                  37.488648999999995,
                  55.888904
                ],
                [
                  37.488577,
                  55.888878999999996
                ],
                [
                  37.487815999999995,
                  55.88863
                ],
                [
                  37.487729,
                  55.888602999999996
                ],
                [
                  37.487612999999996,
                  55.888566
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 9,
                "time": 1554221493
              }
            }
          }
        ]
      },
      {
        "type": "FeatureCollection",
        "properties": {
          "VehicleMetaData": {
            "id": "mosobl%5Fdta|1027",
            "Transport": {
              "id": "2037281384",
              "lineId": "2037272262",
              "name": "472",
              "Types": [
                "bus"
              ],
              "type": "bus"
            }
          }
        },
        "features": [
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.491987,
                  55.937594999999995
                ],
                [
                  37.491955,
                  55.937805
                ],
                [
                  37.491909,
                  55.938384
                ],
                [
                  37.491889,
                  55.938584999999996
                ],
                [
                  37.491876999999995,
                  55.93891
                ],
                [
                  37.491875,
                  55.939242
                ],
                [
                  37.491875,
                  55.939386999999996
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 43,
                "time": 1554221442
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.491875,
                  55.939386999999996
                ],
                [
                  37.491873999999996,
                  55.939581
                ],
                [
                  37.491872,
                  55.939611
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 8,
                "time": 1554221485
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.491872,
                  55.939611
                ],
                [
                  37.491872,
                  55.939611
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 7,
                "time": 1554221493
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.491872,
                  55.939611
                ],
                [
                  37.491870999999996,
                  55.939614
                ],
                [
                  37.491867,
                  55.939656
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 2,
                "time": 1554221500
              }
            }
          }
        ]
      },
      {
        "type": "FeatureCollection",
        "properties": {
          "VehicleMetaData": {
            "id": "mosobl%5Fdta|844",
            "Transport": {
              "id": "2037281384",
              "lineId": "2037272262",
              "name": "472",
              "Types": [
                "bus"
              ],
              "type": "bus"
            }
          }
        },
        "features": [
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.495523,
                  55.948603
                ],
                [
                  37.496148999999996,
                  55.94856
                ],
                [
                  37.497119999999995,
                  55.948496
                ],
                [
                  37.49731,
                  55.948482999999996
                ],
                [
                  37.497581,
                  55.948463999999994
                ],
                [
                  37.497665999999995,
                  55.948459
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 37,
                "time": 1554221442
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.497665999999995,
                  55.948459
                ],
                [
                  37.498064,
                  55.948432
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 14,
                "time": 1554221479
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.498064,
                  55.948432
                ],
                [
                  37.498064,
                  55.948432
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 7,
                "time": 1554221493
              }
            }
          },
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.498064,
                  55.948432
                ],
                [
                  37.49808,
                  55.948431
                ],
                [
                  37.498197,
                  55.948423
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 2,
                "time": 1554221500
              }
            }
          }
        ]
      },
      {
        "type": "FeatureCollection",
        "properties": {
          "VehicleMetaData": {
            "id": "mosobl%5Fdta|956",
            "Transport": {
              "id": "2037281384",
              "lineId": "2037272262",
              "name": "472",
              "Types": [
                "bus"
              ],
              "type": "bus"
            }
          }
        },
        "features": [
          {
            "type": "Feature",
            "geometry": {
              "type": "LineString",
              "coordinates": [
                [
                  37.519451,
                  55.937765
                ],
                [
                  37.519452,
                  55.937765999999996
                ]
              ]
            },
            "properties": {
              "type": "Feature",
              "TrajectorySegmentMetaData": {
                "duration": 86400,
                "time": 1554221309
              }
            }
          }
        ]
      }
    ],
    "regionInfo": {
      "id": 120988,
      "type": 10,
      "parent_id": 1,
      "capital_id": 10758,
      "geo_parent_id": 0,
      "city_id": 10758,
      "name": "himki-urban-okrug",
      "native_name": "",
      "iso_name": "",
      "is_main": false,
      "en_name": "Himki Urban Okrug",
      "short_en_name": "",
      "phone_code": "495 498 496",
      "phone_code_old": "",
      "zip_code": "",
      "population": 250688,
      "synonyms": "",
      "latitude": 55.94319,
      "longitude": 37.436984,
      "latitude_size": 0.118833,
      "longitude_size": 0.278217,
      "zoom": 13,
      "tzname": "Europe/Moscow",
      "official_languages": "ru",
      "widespread_languages": "ru",
      "suggest_list": [],
      "is_eu": false,
      "services_names": [],
      "names": {
        "ablative": "",
        "accusative": "Городской округ Химки",
        "dative": "Городскому округу Химки",
        "directional": "",
        "genitive": "Городского округа Химки",
        "instrumental": "Городским округом Химки",
        "locative": "",
        "nominative": "Городской округ Химки",
        "preposition": "в",
        "prepositional": "Городском округе Химки"
      },
      "parent": {
        "id": 1,
        "type": 5,
        "parent_id": 3,
        "capital_id": 213,
        "geo_parent_id": 0,
        "city_id": 213,
        "name": "moscow-and-moscow-oblast",
        "native_name": "",
        "iso_name": "RU-MOS",
        "is_main": true,
        "en_name": "Moscow and Moscow Oblast",
        "short_en_name": "RU-MOS",
        "phone_code": "495 496 498 499",
        "phone_code_old": "",
        "zip_code": "",
        "population": 7503385,
        "synonyms": "Московская область, Подмосковье, Podmoskovye",
        "latitude": 55.815792,
        "longitude": 37.380031,
        "latitude_size": 2.705659,
        "longitude_size": 5.060749,
        "zoom": 8,
        "tzname": "Europe/Moscow",
        "official_languages": "ru",
        "widespread_languages": "ru",
        "suggest_list": [
          213,
          10716,
          10747,
          10758,
          20728,
          10740,
          10738,
          20523,
          10735,
          10734,
          10743,
          21622
        ],
        "is_eu": false,
        "services_names": [
          "bs",
          "yaca",
          "ad"
        ],
        "names": {
          "ablative": "",
          "accusative": "Москву и Московскую область",
          "dative": "Москве и Московской области",
          "directional": "",
          "genitive": "Москвы и Московской области",
          "instrumental": "Москвой и Московской областью",
          "locative": "",
          "nominative": "Москва и Московская область",
          "preposition": "в",
          "prepositional": "Москве и Московской области"
        },
        "parent": {
          "id": 225,
          "type": 3,
          "parent_id": 10001,
          "capital_id": 213,
          "geo_parent_id": 0,
          "city_id": 213,
          "name": "russia",
          "native_name": "",
          "iso_name": "RU",
          "is_main": false,
          "en_name": "Russia",
          "short_en_name": "RU",
          "phone_code": "7",
          "phone_code_old": "",
          "zip_code": "",
          "population": 146880432,
          "synonyms": "Russian Federation,Российская Федерация",
          "latitude": 61.698653,
          "longitude": 99.505405,
          "latitude_size": 40.700127,
          "longitude_size": 171.643239,
          "zoom": 3,
          "tzname": "",
          "official_languages": "ru",
          "widespread_languages": "ru",
          "suggest_list": [
            213,
            2,
            65,
            54,
            47,
            43,
            66,
            51,
            56,
            172,
            39,
            62
          ],
          "is_eu": false,
          "services_names": [
            "bs",
            "yaca",
            "ad"
          ],
          "names": {
            "ablative": "",
            "accusative": "Россию",
            "dative": "России",
            "directional": "",
            "genitive": "России",
            "instrumental": "Россией",
            "locative": "",
            "nominative": "Россия",
            "preposition": "в",
            "prepositional": "России"
          },
          "parent": null,
          "ename": "russia"
        },
        "ename": "moscow-and-moscow-oblast"
      },
      "ename": "himki-urban-okrug"
    }
  }
}