HERE Traffic API v7

The HERE Traffic API provides real-time traffic flow and incident data in JSON format.

For the full RealTimeTrafficApi specification, see CustomizationsApi.

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

Example

Scala
Java
val client = BaseClient()
val trafficApi = client.of[RealTimeTrafficApi]

val result = trafficApi
  .getIncidents(in = "bbox:13.08836,52.33812,13.761,52.6755",
                locationReferencing = Seq("none"),
                criticality = Seq("critical"))
  .executeToEntity()

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

Await.result(result, Duration.Inf)
BaseClient client = BaseClientJava.instance();
RealTimeTrafficApi trafficApi = new RealTimeTrafficApi(client);

IncidentsResponse incidents =
    trafficApi
        .getIncidents()
        .withIn("bbox:13.08836,52.33812,13.761,52.6755")
        .withLocationReferencing(Collections.singletonList("none"))
        .withCriticality(Collections.singletonList("critical"))
        .build()
        .toEntity();

incidents.getResults().forEach(System.out::println);

Examples of responses can be found in the Developer Guide

results matching ""

    No results matching ""