How to create a fuel price request for all fuel types
This section provides an example of a fuel price request for all fuel types.
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 prices for all fuel types within 5km of latitude 52.53087 and longitude 13.44176, which is in Berlin, Germany. Latitude and longitude values are in WGS 84 format.
Request Summary
Request
This code block demonstrates the complete request, with the data delivered in JSON format.
https://fuel.hereapi.com/v3/stations
?prox=52.53087,13.44176,5000
&apiKey=\{YOUR\_API\_KEY\}Response
The response to the request contains:
- the fuel prices of all the fuel types which meet the search criteria (within proximity radius). If price is an estimate, the fuelPrice element doesn't contain any price information, and only specifies that the fuel type is available at this station (fuel type 4 -
Premium). - a list of stations which fit the specified criteria with additional details.
This is the sample response in JSON format:
{
"hasMore":true,
"fuelStations":{
"fuelStation":[
{
"brand":"TOTAL",
"brandIcon":"http://origin.stg.cld.vcdn.data.here.com/p/d/autox_stg/dt/icons/2015-05-06/
total.png",
"fuelPrice":[
{
"price":1.469,
"fuelType":"27",
"unit":"l",
"currency":"EUR",
"lastUpdateTimestamp":"2015-03-12T10:17:45.000Z"
},
{
"price":1.389,
"fuelType":"1",
"unit":"l",
"currency":"EUR",
"lastUpdateTimestamp":"2015-03-12T10:17:45.000Z"
},
{
"price":0.619,
"fuelType":"14",
"unit":"l",
"currency":"EUR",
"lastUpdateTimestamp":"2015-02-25T11:04:41.000Z"
},
{
"price":1.299,
"fuelType":"11",
"unit":"l",
"currency":"EUR",
"lastUpdateTimestamp":"2015-03-12T10:17:45.000Z"
}
],
"open24x7":true,
"stationDetails":{
"openingHours":{
"regularOpeningHours":[
{
"daymask":127,
"period":[
{
"from":"00:00:00",
"to":"24:00:00"
}
]
}
]
}
},
"address":{
"city":"Berlin",
"country":"DEU",
"region":"Berlin",
"street":"Margarete-Sommer-Stra#e",
"streetNumber":"2",
"postalCode":"10407"
},
"contacts":{
"phone":[
{
"value":"+493042852514",
"label":"PHONE"
}
]
},
"distance":0,
"position":{
"latitude":52.53087,
"longitude":13.44176
},
"name":"TOTAL",
"id":"276u33dc-d1d2783a63404a6789f281438f32375f",
"pvId":"50664433",
"lastUpdateTimestamp":"2014-12-14T11:01:41.609Z",
"timeZone":"Europe/Berlin"
}
]
}
}
For more information, see Fuel Stations Response.
Updated 16 days ago