dwd-api icon indicating copy to clipboard operation
dwd-api copied to clipboard

How to use `StationOverviewExtendedGetStationIdsParameterInner`

Open IsaacNez opened this issue 1 year ago • 1 comments

The example in the Python Client does not run as None is a positional argument that StationOverviewExtendedGetStationIdsParameterInner does not take. In the documentation, there is no example of valid kwargs. Can you provide one?

IsaacNez avatar Nov 12 '24 14:11 IsaacNez

The station_overview_extended_get() request seems to be broken. I've got empty response (no error) with the code

import time
from deutschland import dwd
from pprint import pprint

from deutschland.dwd.api import default_api
from deutschland.dwd.model.station_overview_extended_get_station_ids_parameter_inner import StationOverviewExtendedGetStationIdsParameterInner

configuration = dwd.Configuration(
    host = "https://app-prod-ws.warnwetter.de/v30"
)

with dwd.ApiClient(configuration) as api_client:
    api_instance = default_api.DefaultApi(api_client)

    station_ids = [ StationOverviewExtendedGetStationIdsParameterInner( {"stationIds": "10865"} ) ]

    try:
        api_response = api_instance.station_overview_extended_get(station_ids = station_ids)
        pprint(api_response)
    except dwd.ApiException as ex:
        print("%s\n" % ex)

Finally I've found a working solution with 5 lines of code:

import urllib.request, json
from pprint import pprint

with urllib.request.urlopen("https://app-prod-ws.warnwetter.de/v30/stationOverviewExtended?stationIds=10865") as url:
    data = json.load(url)
    pprint(data)

maikgreubel avatar Jan 07 '25 13:01 maikgreubel