OLS Client HERE Destination Weather v3 API

HERE Destination Weather v3 returns insights into real-time weather forecasts and weather alerts.

For the full WeatherAPI specification, see WeatherApi.

The following pages describe the per-request configuration and metrics.

Example

Scala
Java
val client = BaseClient()
val weatherApi = client.of[WeatherReportApi]

val result = weatherApi
  .weatherReport(
    products = Seq(WeatherProduct.Product.Observation),
    q = Option.apply("Brandenburg Gate, Berlin"),
    oneObservation = Option.apply(true)
  )
  .executeToEntity()

result
  .andThen {
    case Success(response) =>
      // do something with the weather response
      println(response.places)
    case Failure(ex) =>
      ex.printStackTrace()
  }

Await.result(result, Duration.Inf)
BaseClient client = BaseClientJava.instance();
WeatherReportApi weatherApi = new WeatherReportApi(client);

WeatherReport response =
    weatherApi
        .weatherReport()
        .withProducts(
            Collections.singletonList(
                WeatherProduct.ProductParser$.MODULE$.parse("observation")))
        .withQ(Optional.of("Brandenburg Gate, Berlin"))
        .withOneObservation(Optional.of(true))
        .build()
        .toEntity();

// do something with the weather response
response.getPlaces().ifPresent(System.out::println);

Examples of responses can be found in the API References

results matching ""

    No results matching ""