GuidesAPI Reference
Guides

How to get a list of fuel stations

This section provides an example of a request for a list of fuel stations within a specified geometry.

📘

Note

This example uses a HERE API key to authenticate your request. For the available authentication options, see the Identity and Access Management Developer Guide.

User story

You want to obtain a list of fuel stations along a planned travel route.

Request Summary

ResourceParameters
stationsThe resource representation is a .json extension.
corridorIndicates the area searched for fuel stations; in this case a corridor between Berlin and Hamburg, with a stop at Magdeburg.
corridorwidthIndicates the corridor width, in this case 10 km.

Request

This code block demonstrates the complete request, specifying that the response data is in JSON format.

https://fuel.hereapi.com/v3/stations
?corridor=52.516667,13.383333;52.133333,11.616667;53.565278,10.001389
&corridorwidth=10000
&apiKey=\{YOUR\_API\_KEY\}

Response

The response to the request contains:

  • a list of stations that fit the specified criteria with additional details

This is the example response in JSON format:

{
   "hasMore":true,
   "fuelStations":{
      "fuelStation":[
         {
            "brand":"Shell",
            "brandIcon":"http://origin.stg.cld.vcdn.data.here.com/p/d/autox_stg/dt/icons/2015-05-06/shell.png",
            "fuelPrice":[
               {
                  "price":1.379,
                  "fuelType":"27",
                  "unit":"l",
                  "currency":"EUR",
                  "lastUpdateTimestamp":"2015-03-08T14:48:52.000Z"
               },
               {
                  "price":1.149,
                  "fuelType":"1",
                  "unit":"l",
                  "currency":"EUR",
                  "lastUpdateTimestamp":"2015-03-08T14:48:52.000Z"
               }
            ],
            "stationDetails":{
               "openingHours":{
                  "regularOpeningHours":[
                     {
                        "daymask":127,
                        "period":[
                           {
                              "from":"05:00:00",
                              "to":"23:00:00"
                           }
                        ]
                     }
                  ]
               }
            },
            "address":{
               "city":"Hamburg",
               "country":"DEU",
               "region":"Hamburg",
               "street":"Alter Teichweg",
               "streetNumber":"71",
               "postalCode":"22049"
            },
            "position":{
               "latitude":53.5845718,
               "longitude":10.0596704
            },
            "name":"Hamburg, Alter Teichweg.",
            "id":"276u1x0u-749a20a72c684f898d045f54239b962d",
            "lastUpdateTimestamp":"2014-12-14T11:05:53.374Z",
			"timeZone":"Europe/Berlin"
         },
	 { ---removed to shorten document }
      ]
   }
}

For more details about responses to this type of request refer to Fuel Stations Response.