Api "try it out" error

When I use https://weatherflow.github.io/Tempest/api/swagger/#!/forecast/getBetterForecast, the response is: “REQUEST_INPUT_ERROR lat and lon are required”, but the page doesn’t have a field to enter longitude and latitude.

While you’re at it, I know https://weatherflow.github.io/Tempest/api/swagger/#!/observations/getObservationsByDeviceId expects unix time, but it would be nice if on this same page there was a human way to enter starting/ending date and time.

Good spot @sunny. I’ve been in the beta group for this new forecast endpoint, and WeatherFlow are aware that the docs released just before the Christmas break don’t quite match the current functionality of the endpoint. I assume they will fix it first thing after their break ready for the public launch.

I didn’t know I was accessing beta functionality

Sorry, @sunny. As Peter notes, the docs are slightly ahead of the production implementation. We had hoped to release both at the same time, but that didn’t happen. The update will go out next week.

no problem, I just stumbled across it. I have no plans of accessing it (for now)

1 Like

Yes, after realizing we were not going to be able to push the production changes before the New Year we decided to quietly update the docs so that the developers beta testing the forecast endpoint could comment. Not the smoothest release ever, but a step forward!

1 Like

Can someone post the correct syntax for the Longitude/Latitude information in the URL ? Cannot find any documentation about this

which url are you talking about?

The API Explorer generates the following URL : https://swd.weatherflow.com/swd/rest/better_forecast?station_id=32315&units_temp=c&units_wind=kph&units_pressure=hpa&units_precip=cm&units_distance=km&token=xxxxxxx

(Token replaced with XXXX)

This call results in the following error : “status_message”: “REQUEST_INPUT_ERROR lat and lon are required”

I assume that I have to provide the Longitude Latitude information in the URL (see above) What is the syntax for that ?

aha, as mentioned in the answer above, this is a mismatch between documentation and implementation. As the documentation is ahead of the implementation I assume, that lat/lon is no longer needed, just the station id. But you will have to wait until the implementation catches up.

OK Thanks that clarifies this

Could you clarify on the response object (I guess I’m not in the beta program so I can’t test it out myself). It says it returns a daily and hourly forecast, but the docs don’t indicate these objects are arrays, so it does it just return the current day/hour?

You receive a json string which you then convert into an array

Array
(
[latitude] => 26,16869
[longitude] => -80,09912
[timezone] => Europe/Berlin
[timezone_offset_minutes] => 60
[current_conditions] => Array
(
[time] => 1609826981
[conditions] => Clear
[icon] => cc-clear-night
[air_temperature] => 1
[sea_level_pressure] => 1022,8
[station_pressure] => 1016
[pressure_trend] => steady
[relative_humidity] => 98
[wind_avg] => 2
[wind_direction] => 108
[wind_direction_cardinal] => ESE
[wind_direction_icon] => wind-rose-ese
[wind_gust] => 4
[solar_radiation] => 0
[uv] => 0
[brightness] => 6
[feels_like] => 1
[dew_point] => 1
[wet_bulb_temperature] => 1
[delta_t] => 0
[air_density] => 1,29
[lightning_strike_count_last_1hr] => 0
[lightning_strike_count_last_3hr] => 0
[precip_accum_local_day] => 0,01
[precip_accum_local_yesterday] => 0
[precip_minutes_local_day] => 14
[precip_minutes_local_yesterday] => 0
[is_precip_local_day_rain_check] =>
[is_precip_local_yesterday_rain_check] =>
[includes_station_data] => 1
)

[forecast] => Array
    (
        [daily] => Array
            (
                [0] => Array
                    (
                        [day_start_local] => 1609801200
                        [day_num] => 5
                        [month_num] => 1
                        [conditions] => Clear
                        [icon] => clear-day
                        [sunrise] => 1609762116
                        [sunset] => 1609800141
                        [air_temp_high] => 22
                        [air_temp_low] => 14
                        [air_temp_high_color] => ffc900
                        [air_temp_low_color] => 4fe25b
                        [precip_probability] => 0
                    )

       [hourly] => Array
            (
                [0] => Array
                    (
                        [time] => 1609830000
                        [conditions] => Clear
                        [icon] => clear-night
                        [air_temperature] => 16
                        [sea_level_pressure] => 1016,6
                        [relative_humidity] => 68
                        [precip] => 0
                        [precip_probability] => 0
                        [wind_avg] => 7
                        [wind_avg_color] => b2e6e4
                        [wind_direction] => 328
                        [wind_direction_cardinal] => NNW
                        [wind_direction_icon] => wind-arrow-nnw
                        [wind_gust] => 8
                        [wind_gust_color] => b2e6e4
                        [uv] => 0
                        [feels_like] => 16
                        [local_hour] => 8
                        [local_day] => 5
                    )

You get 10 Days and 241 hours