Fuel Prices API Developer's Guide

Fuel Station by PVID or station ID Example

This section provides an example of a request for detailed information about a specific fuel station.

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

User story

The user wants to be able to get the Fuel station details knowing the PVID or station id which user has received previously.

Request Summary

Resource: stations/bulk , note that resource representation is specified via extensions .xml or .json
Parameters: id – known fuel station PVID or station id.

Request

Note: id values change without notice. If the id is no longer available, a blank response is returned.

The code block below demonstrates the complete request, specifying that the response data are to be delivered in JSON.


https://fuel-v2.cc.api.here.com/fuel/stations/bulk.json
?id=1099721199
&apiKey={YOUR_API_KEY}

Here is the same request indicating that the response data are to be delivered in XML.


https://fuel-v2.cc.api.here.com/fuel/stations/bulk.xml
?id=1099721199
&apiKey={YOUR_API_KEY}

Response

The response to the request contains:

  • fuel price information

The example response in JSON format is as follows:


{
   "hasMore":false,
   "fuelStations":{
    "fuelStation":[
     {
      "fuelPrice":[
         {
          "price":1.219,
          "fuelType":"27",
          "unit":"l",
          "currency":"EUR",
          "lastUpdateTimestamp":"2015-01-20T13:03:43.000Z"
         },
         {
          "price":1.039,
          "fuelType":"1",
          "unit":"l",
          "currency":"EUR",
          "lastUpdateTimestamp":"2015-01-20T13:03:43.000Z"
         },
         {
          "price":0.639,
          "fuelType":"14",
          "unit":"l",
          "currency":"EUR",
          "lastUpdateTimestamp":"2015-01-16T11:03:16.000Z"
         }
      ],
      "id":"276u336g-6a194aba138f4fab96f4b2cecd4bde7b",
      "pvId":"1099721199"
     }
    ]
   }
}

The example response in XML format is as follows:


<fuel:fuelStationsResult xmlns:fuel="http://www.here.com/2014/02/ACS-Fuel" xmlns:common="http://www.here.com/2014/02/ACS-Common" xmlns:ev="http://www.here.com/2014/02/ACS-EV"
  xmlns:parking-offstreet="http://www.here.com/2014/02/ACS-Parking-Offstreet"
>
  <hasMore>false</hasMore>
  <fuelStations>
    <fuelStation id="276u336g-6a194aba138f4fab96f4b2cecd4bde7b" pvId="1099721199">
      <fuelPrice fuelType="27" unit="l" currency="EUR" lastUpdateTimestamp="2015-01-20T13:03:43.000Z">
        <price>1.219</price>
      </fuelPrice>
      <fuelPrice fuelType="1" unit="l" currency="EUR" lastUpdateTimestamp="2015-01-20T13:03:43.000Z">
        <price>1.039</price>
      </fuelPrice>
      <fuelPrice fuelType="14" unit="l" currency="EUR" lastUpdateTimestamp="2015-01-16T11:03:16.000Z">
        <price>0.639</price>
      </fuelPrice>
    </fuelStation>
  </fuelStations>
</fuel:fuelStationsResult>

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