P
P
p1ter2018-07-10 11:50:37
API
p1ter, 2018-07-10 11:50:37

Why does it not return the strength of precipitation (Yandex.Weather API)?

There is a VK bot that sends a notification if the precipitation strength > 0.
The problem is that when requesting the API, Yandex does not send the precipitation strength (prec_strength).

Response Example
"parts": {
  "night": {
    "_source": "0,1,2,3,4,5",
    "temp_min": 16,
    "temp_max": 19,
    "temp_avg": 18,
    "feels_like": 18,
    "icon": "bkn_n",
    "condition": "partly-cloudy",
    "daytime": "n",
    "polar": false,
    "wind_speed": 1.6,
    "wind_gust": 5.5,
    "wind_dir": "sw",
    "pressure_mm": 744,
    "pressure_pa": 992,
    "humidity": 80,
    "uv_index": 0,
    "soil_temp": 21,
    "soil_moisture": 0.35,
    "prec_mm": 0,
    "prec_period": 360,
    "prec_prob": 0
  }


As you can see, the prec_strength field is not here, but it is in the documentation.
Example from documentation
"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
        }


What could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
p1ter, 2018-07-13
@p1ter

The problem was solved very simply. When requesting, you must specify extra = true

A
Artem, 2018-10-13
@webog

Hey! What headers are you sending?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question