“Test” rate
This version of the API is deprecated. Use the new version.
Use this request to get the current weather and forecast for the specified locality.
Request format
The locality is indicated using the latitude (lat parameter) and longitude (lon parameter). If these parameters are set incorrectly, the response will contain a 404 error code.
GET https://api.weather.yandex.ru/v1/forecast?
lat=<latitude>
& lon=<longitude>
& [lang=<response language>]
& [limit=<forecast period>]
& [hours=<hourly forecast>]
& [extra=<detailed precipitation forecast>]
X-Yandex-API-Key: <key value>
- X-Yandex-API-Key
- The key you received when enabling the Yandex.Weather API.
Request parameters:
- lat
-
The latitude in degrees. Required field.
- lon
-
The longitude in degrees. Required field.
- lang
-
The combination of language and country that weather information will be returned for. Possible values:
- “ru_RU” — Russian for the Russia locale.
- “ru_UA” — Russian for the Ukraine locale.
- “uk_UA” — Ukrainian for the Ukraine locale.
- “be_BY” — Belarusian for the Belarus locale.
- “kk_KZ” — Kazakh for the Kazakhstan locale.
- “tr_TR” — Turkish for the Turkey locale.
- “en_US” — International English.
- limit
-
The number of days in the forecast, including the current day.
For the “Test” rate, the maximum value is 7.
- hours
-
For each day, the response will contain the hourly weather forecast. Possible values:
- “true” — Default value. Returns the hourly forecast.
- “false” — Does not return the hourly forecast.
- extra
-
Extra information about precipitation. Possible values:
- <true> — Returns detailed information about precipitation.
- <false> — Default value. Does not return detailed information about precipitation.
Response format
The response to the request is returned in JSON format. The information in the response contains:
Field | Description | Format |
---|---|---|
now | The time on the server in Unix time. | Number |
now_dt | The time on the server in UTC. | String |
info | Locality information object. | Object |
fact | Current weather information object. | Object |
forecasts | Weather forecast object. | Object |
Field | Description | Format |
---|---|---|
now | The time on the server in Unix time. | Number |
now_dt | The time on the server in UTC. | String |
info | Locality information object. | Object |
fact | Current weather information object. | Object |
forecasts | Weather forecast object. | Object |
info object
This object contains information about the locality.
Field | Description | Format |
---|---|---|
lat | The latitude (in degrees). | Number |
lon | The longitude (in degrees). | Number |
tzinfo | Information about the time zone. Contains the fields offset, name, abbr and dst. | Object |
offset | Time zone in seconds from UTC. | Number |
name | Name of the time zone. | String |
abbr | Abbreviated name of the time zone. | String |
dst | Daylight saving time. | Boolean |
def_pressure_mm | The normal pressure for the given coordinates (mm Hg). | Number |
def_pressure_pa | The normal pressure for the given coordinates (hPa). | Number |
url | Locality page on Yandex.Weather. | String |
Field | Description | Format |
---|---|---|
lat | The latitude (in degrees). | Number |
lon | The longitude (in degrees). | Number |
tzinfo | Information about the time zone. Contains the fields offset, name, abbr and dst. | Object |
offset | Time zone in seconds from UTC. | Number |
name | Name of the time zone. | String |
abbr | Abbreviated name of the time zone. | String |
dst | Daylight saving time. | Boolean |
def_pressure_mm | The normal pressure for the given coordinates (mm Hg). | Number |
def_pressure_pa | The normal pressure for the given coordinates (hPa). | Number |
url | Locality page on Yandex.Weather. | String |
fact object
This object contains information about the current weather.
Field | Description | Format |
---|---|---|
temp | Temperature (°C). | Number |
feels_like | What the temperature feels like (°C). | Number |
temp_water | The water temperature (°C). This parameter is returned for localities where this information is relevant. | Number |
icon | The code of the weather icon. The icon is available at https://yastatic.net/weather/i/icons/funky/dark/<value from the icon field>.svg. | String |
condition | The code for the weather description. Possible values:
| String |
wind_speed | Wind speed (meters per second). | Number |
wind_gust | Speed of wind gusts (meters per second). | Number |
wind_dir | Wind direction. Possible values:
| String |
pressure_mm | Atmospheric pressure (mm Hg). | Number |
pressure_pa | Atmospheric pressure (hPa). | Number |
humidity | Humidity (percent). | Number |
daytime | Light or dark time of the day. Possible values:
| String |
polar | Indicates that the time of day specified in the daytime field is polar. | Boolean |
season | Time of year in this locality. Possible values:
| String |
obs_time | The time when weather data was measured, in Unix time. | Number |
prec_type | Type of precipitation. Possible values:
| Number |
prec_strength | Intensity of precipitation. Possible values:
| Number |
cloudness | Cloud cover. Possible values:
| Number |
Field | Description | Format |
---|---|---|
temp | Temperature (°C). | Number |
feels_like | What the temperature feels like (°C). | Number |
temp_water | The water temperature (°C). This parameter is returned for localities where this information is relevant. | Number |
icon | The code of the weather icon. The icon is available at https://yastatic.net/weather/i/icons/funky/dark/<value from the icon field>.svg. | String |
condition | The code for the weather description. Possible values:
| String |
wind_speed | Wind speed (meters per second). | Number |
wind_gust | Speed of wind gusts (meters per second). | Number |
wind_dir | Wind direction. Possible values:
| String |
pressure_mm | Atmospheric pressure (mm Hg). | Number |
pressure_pa | Atmospheric pressure (hPa). | Number |
humidity | Humidity (percent). | Number |
daytime | Light or dark time of the day. Possible values:
| String |
polar | Indicates that the time of day specified in the daytime field is polar. | Boolean |
season | Time of year in this locality. Possible values:
| String |
obs_time | The time when weather data was measured, in Unix time. | Number |
prec_type | Type of precipitation. Possible values:
| Number |
prec_strength | Intensity of precipitation. Possible values:
| Number |
cloudness | Cloud cover. Possible values:
| Number |
forecasts object
This object contains weather forecast data.
Field | Description | Format |
---|---|---|
date | Date of the forecast, in the format YYYY-MM-DD. | String |
date_ts | The date of the forecast in Unix time. | Number |
week | Week number. | Number |
sunrise | Time of the sunrise in local time (may be omitted for polar regions). | String |
sunset | Time of the sunset in local time (may be omitted for polar regions). | String |
moon_code | Code of the lunar phase. Possible values:
| Number |
moon_text | Text code for the lunar phase. Possible values:
| String |
parts | Forecasts by time of day and 12-hour forecasts. Contains fields that differ by type of forecast:
All weather forecasts for a certain time of day have the same set of fields. All 12-hour forecasts have the same set of fields. Note. For the last day returned in the forecast, some of the parts might be missing. | Object |
night | Object with the weather forecast for the night. Contains the following fields: Attention. The beginning of the nighttime period corresponds to the beginning of the 24-hour period. To specify the upcoming night temperatures, use the object for the nighttime forecast for the next day. | Object |
temp_min | Minimum temperature for the time of day (°C). | Number |
temp_max | Maximum temperature for the time of day (°C). | Number |
temp_avg | Average temperature for the time of day (°C). | Number |
feels_like | What the temperature feels like (°C). | Number |
icon | The code of the weather icon. The icon is available at https://yastatic.net/weather/i/icons/funky/dark/<value from the icon field>.svg. | String |
condition | The code for the weather description. Possible values:
| String |
daytime | Light or dark time of the day. Possible values:
| String |
polar | Indicates that the time of day specified in the daytime field is polar. | Boolean |
wind_speed | Wind speed (meters per second). | Number |
wind_gust | Speed of wind gusts (meters per second). | Number |
wind_dir | Wind direction. Possible values:
| String |
pressure_mm | Atmospheric pressure (mm Hg). | Number |
pressure_pa | Atmospheric pressure (hPa). | Number |
humidity | Humidity (percent). | Number |
prec_mm | Predicted amount of precipitation (mm). | Number |
prec_period | Predicted duration of precipitation (minutes). | Number |
prec_type | Type of precipitation. Possible values:
| Number |
prec_strength | Intensity of precipitation. Possible values:
| Number |
cloudness | Cloud cover. Possible values:
| Number |
day_short | Object with a 12-hour forecast for the day. Contains the following fields: | Object |
temp | Highest daytime or lowest nighttime temperature (°C). | Number |
hours | Object for the hourly forecast. Consists of 24 parts (hours) for the first 2-3 days, then an empty string is returned. Each part contains the following fields: | Object |
hour | The hour the forecast is for (0-23) using the local time. | String |
hour_ts | The time of the forecast in Unix time. | Number |
Field | Description | Format |
---|---|---|
date | Date of the forecast, in the format YYYY-MM-DD. | String |
date_ts | The date of the forecast in Unix time. | Number |
week | Week number. | Number |
sunrise | Time of the sunrise in local time (may be omitted for polar regions). | String |
sunset | Time of the sunset in local time (may be omitted for polar regions). | String |
moon_code | Code of the lunar phase. Possible values:
| Number |
moon_text | Text code for the lunar phase. Possible values:
| String |
parts | Forecasts by time of day and 12-hour forecasts. Contains fields that differ by type of forecast:
All weather forecasts for a certain time of day have the same set of fields. All 12-hour forecasts have the same set of fields. Note. For the last day returned in the forecast, some of the parts might be missing. | Object |
night | Object with the weather forecast for the night. Contains the following fields: Attention. The beginning of the nighttime period corresponds to the beginning of the 24-hour period. To specify the upcoming night temperatures, use the object for the nighttime forecast for the next day. | Object |
temp_min | Minimum temperature for the time of day (°C). | Number |
temp_max | Maximum temperature for the time of day (°C). | Number |
temp_avg | Average temperature for the time of day (°C). | Number |
feels_like | What the temperature feels like (°C). | Number |
icon | The code of the weather icon. The icon is available at https://yastatic.net/weather/i/icons/funky/dark/<value from the icon field>.svg. | String |
condition | The code for the weather description. Possible values:
| String |
daytime | Light or dark time of the day. Possible values:
| String |
polar | Indicates that the time of day specified in the daytime field is polar. | Boolean |
wind_speed | Wind speed (meters per second). | Number |
wind_gust | Speed of wind gusts (meters per second). | Number |
wind_dir | Wind direction. Possible values:
| String |
pressure_mm | Atmospheric pressure (mm Hg). | Number |
pressure_pa | Atmospheric pressure (hPa). | Number |
humidity | Humidity (percent). | Number |
prec_mm | Predicted amount of precipitation (mm). | Number |
prec_period | Predicted duration of precipitation (minutes). | Number |
prec_type | Type of precipitation. Possible values:
| Number |
prec_strength | Intensity of precipitation. Possible values:
| Number |
cloudness | Cloud cover. Possible values:
| Number |
day_short | Object with a 12-hour forecast for the day. Contains the following fields: | Object |
temp | Highest daytime or lowest nighttime temperature (°C). | Number |
hours | Object for the hourly forecast. Consists of 24 parts (hours) for the first 2-3 days, then an empty string is returned. Each part contains the following fields: | Object |
hour | The hour the forecast is for (0-23) using the local time. | String |
hour_ts | The time of the forecast in Unix time. | Number |
Example
Request:
GET https://api.weather.yandex.ru/v1/forecast?lat=55.75396&lon=37.620393&extra=true
X-Yandex-API-Key: 4pa...3
Response:
{
"now": 1470220206,
"now_dt": "2016-08-03T10:30:06.238Z",
"info": {
"lat": 55.833333,
"lon": 37.616667,
"tzinfo": {
"offset": 10800,
"name": "Europe/Moscow",
"abbr": "MSK",
"dst": false
},
"def_pressure_mm": 746,
"def_pressure_pa": 994,
"url": "https://yandex.ru/pogoda/moscow"
},
"fact": {
"temp": 20,
"feels_like": 21,
"icon": "ovc",
"condition": "overcast",
"wind_speed": 2,
"wind_gust": 5.9,
"wind_dir": "n",
"pressure_mm": 745,
"pressure_pa": 994,
"humidity": 83,
"daytime": "d",
"polar": false,
"season": "summer",
"prec_type": 1,
"prec_strength": 0.25,
"cloudness": 1,
"obs_time": 1470214800
},
"forecasts": [
{
"date": "2016-08-03",
"date_ts": 1470171600,
"week": 32,
"sunrise": "04:38",
"sunset": "20:31",
"moon_code": 8,
"moon_text": "new-moon",
"parts": {
"night": {
"temp_min": 20,
"temp_max": 21,
"temp_avg": 21,
"feels_like": 23,
"icon": "bkn_n",
"condition": "cloudy",
"daytime": "n",
"polar": false,
"wind_speed": 0.9,
"wind_gust": 4,
"wind_dir": "nw",
"pressure_mm": 746,
"pressure_pa": 995,
"humidity": 81,
"prec_mm": 0,
"prec_period": 360,
"prec_type": 1,
"prec_strength": 0.5,
"cloudness": 0.75
},
...
"evening": {
"temp_min": 17,
"temp_max": 19,
"temp_avg": 18,
"feels_like": 19,
"icon": "ovc_+ra",
"condition": "overcast-and-rain",
"daytime": "d",
"polar": false,
"wind_speed": 1.8,
"wind_dir": "nw",
"pressure_mm": 745,
"pressure_pa": 994,
"humidity": 99,
"prec_mm": 17.95,
"prec_period": 360,
"prec_type": 1,
"prec_strength": 0.5,
"cloudness": 0.75,
"_fallback_temp": false,
"_fallback_prec": false
},
"day_short": {
"temp": 20,
"temp_min": 18,
"feels_like": 21,
"icon": "bkn_+ra_d",
"condition": "overcast-and-rain",
"wind_speed": 1.9,
"wind_gust": 5.9,
"wind_dir": "nw",
"pressure_mm": 745,
"pressure_pa": 994,
"humidity": 88,
"prec_type": 1,
"prec_strength": 0.25,
"cloudness": 1,
"_fallback_temp": false,
"_fallback_prec": false
},
"night_short": {
"temp": 20,
"feels_like": 22,
"icon": "bkn_n",
"condition": "cloudy",
"wind_speed": 0.9,
"wind_gust": 5.9,
"wind_dir": "nw",
"pressure_mm": 746,
"pressure_pa": 995,
"humidity": 81,
"prec_type": 1,
"prec_strength": 0.25,
"cloudness": 1,
"_fallback_temp": false,
"_fallback_prec": false
}
},
"hours": [
{
"hour": "0",
"hour_ts": 1470171600,
"temp": 21,
"feels_like": 23,
"icon": "bkn_n",
"condition": "partly-cloudy",
"wind_speed": 0.3,
"wind_gust": 4,
"wind_dir": "nw",
"pressure_mm": 746,
"pressure_pa": 995,
"humidity": 80,
"prec_mm": 0,
"prec_period": 60,
"prec_type": 1,
"prec_strength": 0.5,
"cloudness": 1,
"_fallback_temp": false,
"_fallback_prec": false
},
...
{
"hour": "23",
"hour_ts": 1470254400,
"temp": 17,
"feels_like": 19,
"icon": "ovc_-ra",
"condition": "overcast-and-light-rain",
"wind_speed": 0.9,
"wind_gust": 3.6,
"wind_dir": "nw",
"pressure_mm": 745,
"pressure_pa": 994,
"humidity": 100,
"prec_mm": 0.05,
"prec_period": 60,
"prec_type": 1,
"prec_strength": 0.5,
"cloudness": 1,
"_fallback_temp": false,
"_fallback_prec": false
}
]
},
...
{
"date": "2016-08-10",
"date_ts": 1471035600,
"week": 33,
"sunrise": "04:57",
"sunset": "20:09",
"moon_code": 13,
"moon_text": "growing-moon",
"parts": {
"night": {...},
"morning": {...},
"day": {...},
"evening": {...},
"day_short": {...},
"night_short": {...}
},
"hours": [...]
}
]
}