Search code examples
here-api

HERE Destination Weather API: Can I use lat/lon instead of name?


Using the documentation for the HERE Destination Weather API under https://developer.here.com/api-explorer/rest/auto_weather I cannot find the information whether it is possiblen to use latitude and longitude instead of a City name for forecasts.

Does this option (using lat/lon instead of name) exist?


Solution

  • Yes, the documentation is linked on the page you shared: https://developer.here.com/api-explorer/rest/auto_weather/weather-observation-lat-long

    Example for current weather: https://weather.cit.api.here.com/weather/1.0/report.json?product=observation&latitude=52.516&longitude=13.389&oneobservation=true&app_id=xxx&app_code=yyy

    Example for weather alerts: https://weather.cit.api.here.com/weather/1.0/report.json?product=alerts&latitude=52.516&longitude=13.389&app_id=xxx&app_code=yyy