Possible errors
HTTP code 403 when accessing the API
Possible reasons:
The request header doesn't contain the API access key
Make sure the request includes the
X-Yandex-Weather-Key
header with the access key you received.
The request was sent to an incorrect URL
The request URL depends on the chosen rate.
For the rate:
- “Yandex Weather on your site” —
https://api.weather.yandex.ru/v2/informers/
.- “Test” —
https://api.weather.yandex.ru/v2/forecast/
.
The rate expired
The “Test” rate is valid for 30 days. If you need to extend your use of the service under this rate, write to us.
Request limit is exceeded
The “Test” and “Yandex Weather on your site” rates have a daily limit on the number of requests. To continue using the API, change the rate or wait for the next day.
You can see the API key value, current rate, expiration date, number of requests sent and the reason for blocking in the Keys section in the Developer Dashboard.
You can change the rate in the Finance section in the Developer Dashboard.
“No 'Access-Control-Allow-Origin' ...” when the request is generated by the browser
The Yandex Weather API is not meant for sending requests from the user's browser. These actions are not safe, as someone can view your API key through the browser tools.
If you need to make requests from the browser, use an intermediary server that will accept client requests, add the access key to them and send requests to the Yandex Weather API.