Legacy v1

Fuel Prices

Last updated:

API reference for retrieving real-time fuel prices by location.

Docs for the previous API generation. v1 endpoints keep working, but new work should target v2. See v2 documentation.

The fuel prices API returns real-time fuel prices by location. Query by fuel type (for example regular or diesel). The response includes station details.

Get fuel prices

GET /v1/fuel/:fuelType

Retrieve current fuel prices for a specific location and fuel type.

Required parameters

ParameterTypeDescription
fuelTypeFuelTypeType of fuel to query (e.g., "regular", "diesel"). See fuel types for more details.
countrystringTwo-letter country code (e.g., "US").

Optional parameters

ParameterTypeDescription
countrystringTwo-letter country code (e.g., "US", "CA").
regionstringRegion/state code (e.g., "CA").
citystringCity name (e.g., "San Francisco").

OR

ParameterTypeDescription
latitudenumberLatitude coordinate for location-based search.
longitudenumberLongitude coordinate for location-based search.
curl https://api.cardog.app/v1/fuel/regular \
  -H "x-api-key: your-api-key" \
  -G \
  -d "country=US" \
  -d "region=CA" \
  -d "city=San%20Francisco"
import { CardogClient } from "@cardog/api";

const client = new CardogClient({ apiKey: "your-api-key" });

// Find gas stations near coordinates
const fuel = await client.fuel.search({
  lat: 37.7749,
  lng: -122.4194,
  radius: 10,
  fuelType: "REGULAR",
});

console.log(`Current avg: $${fuel.average}/gal`);
for (const station of fuel.stations) {
  console.log(`${station.name}: $${station.price.credit}`);
}
import requests
response = requests.get('https://api.cardog.app/v1/fuel/regular', params={
  'country': 'US',
  'region': 'CA',
  'city': 'San Francisco'
}, headers={'x-api-key': 'your-api-key'})
data = response.json()

Example

10 keys
"response": {
"current": 4.23,
"average": 4.138,
"postedTime": "2025-03-17T03:41:47.204Z",
"unit": "USD/gal",
"isMetric": false,
"fuelType": 1,
"fuelName": "Regular Gasoline",
"location": {
"name": "San Francisco",
"countryCode": "US",
"regionCode": "CA",
"locationType": "metro",
"nearbyLocalities": [3 items]
},
"history": [
0: {3 items}
],
"stations": [
0: {10 items}
]
}

The Fuel Types

The following fuel types are supported. Use one as the :fuelType segment of the URL.

Fuel typeEndpoint
regularRegular gasoline: /v1/fuel/regular
midgradeMidgrade gasoline: /v1/fuel/midgrade
premiumPremium gasoline: /v1/fuel/premium
dieselDiesel fuel: /v1/fuel/diesel
e85E85 fuel: /v1/fuel/e85
e15E15 fuel: /v1/fuel/e15
propanePropane fuel: /v1/fuel/propane
biodieselBiodiesel fuel: /v1/fuel/biodiesel
cngCNG fuel: /v1/fuel/cng
lngLNG fuel: /v1/fuel/lng

Was this helpful?