V
V
Vladislav Dudashvili2021-01-12 20:33:54
Python
Vladislav Dudashvili, 2021-01-12 20:33:54

How to get data from the Yandex API?

I'm new, I'm trying to get data from Yandex timetable via API. It seems like he did everything according to the documentation that Yandex gives, but he writes that he did not find the station using this code. Help to understand please. My code:

import requests

url = (" https://api.rasp.yandex.net/v3.0/schedule/?apikey=... ")
res = requests.get(url)
print(res.text)


The schedule that I want to get - https://voronezhvokzal.ru/raspisanie-poezdov/

Link to Yandex documentation - https://yandex.ru/dev/rasp/doc/reference/schedule-...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-01-12
@yozjke

Where did you get the station ID from?
id - 2014001
it must be transmitted by adding s before the station number
https://api.rasp.yandex.net/v3.0/schedule/?apikey=...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question