Fuel Prices API
getFuelPrices
The getFuelPrices API provides refined fuel price data and reference data. Refined fuel data can be requested for fuel selling locations, for geographic coordinates and radius, for zip code and radius, and for a specified county. Refined fuel data can be filtered by product name(s), and by number of locations will be returned. Reference data contains fuel selling locations and product names, providing valid values in use for requesting refined fuel data. Reference data can be requested for geographic coordinates and radius. If no geographic coordinates are given, reference data will return all valid values by default.
View All APIsrequestTypeoptional
A type of reference data to define what reference data will be returned.
locationoptional
A location id or a code identifies a or multiple fuel selling location(s) that fuel prices will be returned for. A valid code consist of multiple location ids separated by a comma, and the code can contain up to 100 locations. A list of valid location ids can be retrieved by using this API with input: requestType = location. location and several other inputs -geographic coordinates, zipCode, maxDistance, county, totalLocations- are mutually exclusive.
latitudeoptional
The latitude of a valid geographic coordinates to define the center of area that fuel prices will be returned for. Geographic coordinates and Zipcode are mutually exclusive.
longitudeoptional
The longitude of a valid geographic coordinates to define the center of area that fuel prices will be returned for. Geographic coordinates and Zipcode are mutually exclusive.
zipCodeoptional
A valid US or Canadian zip code to define the center of area that fuel prices will be returned for. Default value is 60606. Geographic coordinates and Zipcode are mutually exclusive.
60606
maxDistanceoptional
A maximum distance from geographic coordinates input or from the center of zip code input in miles to help user define the area that fuel prices will be returned for. Maximum value is 250
100
countyoptional
A valid string code which represents the concatenation of county name and state code seperated by a hyphen.
BOONE COUNTY-IA
fipsCodeoptional
A string concatenation of state FIPS code and county FIPS code without separator to define the county that fuel prices will be returned for. Please click here to get a list of possible values.
17053
productNameoptional
A standard product name or a name list that's separated by pipe (|) to filter prices. Note that the input needs to be encoded in UTF-8. A list of valid product names can be retrieved by using this API with input: requestType = products.
USLD
totalLocationsoptional
The maximum amount of fuel selling locations that fuel prices will be returned for. If zip code is set, then API will provide cashbid for given amount closet locations in relation to the requested zip code. Maximum value is 100.
1
pageoptional
The page number.
1
fieldsoptional
Additional as per-requested fields that the user can define. Requested fields should be separated by a comma. Valid per-requested fields are companyId, locationType, mailingAddress, fax, defLanes, dieselLanes, bioBlend, businessHours, productId, productShort, productFull
always returned
A type which includes a list of valid possible values.
always returned
A sequence of characters. (example: GOOG)
always returned
A numeric type defining a whole number. (example: 2)
always returned
A sequence of characters. (example: GOOG)
as requested
A numeric type defining a whole number. (example: 2)
always returned
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
always returned
A numeric type defining a number with fractional parts. (example: 2.14)
always returned
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A sequence of characters. (example: GOOG)
always returned
A date in the format of YYYY-MM-DD.
always returned
A date and time in the format of YYYY-MM-DD HH:MI:SS<TIMEZONE_OFFSET>.
as requested
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
as requested
A sequence of characters. (example: GOOG)
<?php
$ondemand = new SoapClient('https://ondemand.websol.barchart.com/service?wsdl');
$params = [
'apikey' => 'YOUR_API_KEY',
'latitude' => '',
'longitude' => '',
'zipCode' => '60606',
'maxDistance' => '100',
'county' => 'BOONE COUNTY-IA',
'fipsCode' => '17053',
'productName' => 'USLD',
'page' => '1',
];
$result = $ondemand->getFuelPrices($params);
var_dump($result);
Dim ondemand
Dim result
Set ondemand = Server.CreateObject("MSSOAP.SoapClient30")
ondemand.ClientProperty("ServerHTTPRequest") = True
ondemand.MSSoapInit("https://ondemand.websol.barchart.com/service?wsdl")
Set result = ondemand.getFuelPrices("YOUR_API_KEY", "", "", "60606", "100", "BOONE COUNTY-IA", "17053", "USLD", "1")
use SOAP::Lite;
use SOAP::WSDL;
my $ondemand = SOAP::Lite
-> service('https://ondemand.websol.barchart.com/service?wsdl');
my $result = $ondemand->getFuelPrices('YOUR_API_KEY', '', '', '60606', '100', 'BOONE COUNTY-IA', '17053', 'USLD', '1');
print $result;
from suds.client import Client
ondemand = Client('https://ondemand.websol.barchart.com/service?wsdl')
result = ondemand.service.getFuelPrices('YOUR_API_KEY', '', '', '60606', '100', 'BOONE COUNTY-IA', '17053', 'USLD', '1')
print(result)
require 'savon'
ondemand = Savon.client(wsdl: 'https://ondemand.websol.barchart.com/service?wsdl')
response = ondemand.call(
:getFuelPrices,
message: {
apikey: 'YOUR_API_KEY',
latitude: '',
longitude: '',
zipCode: '60606',
maxDistance: '100',
county: 'BOONE COUNTY-IA',
fipsCode: '17053',
productName: 'USLD',
page: '1',
}
)
response.body