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
| Parameter | Type | Description |
|---|---|---|
fuelType | FuelType | Type of fuel to query (e.g., "regular", "diesel"). See fuel types for more details. |
country | string | Two-letter country code (e.g., "US"). |
Optional parameters
| Parameter | Type | Description |
|---|---|---|
country | string | Two-letter country code (e.g., "US", "CA"). |
region | string | Region/state code (e.g., "CA"). |
city | string | City name (e.g., "San Francisco"). |
OR
| Parameter | Type | Description |
|---|---|---|
latitude | number | Latitude coordinate for location-based search. |
longitude | number | Longitude 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 type | Endpoint |
|---|---|
regular | Regular gasoline: /v1/fuel/regular |
midgrade | Midgrade gasoline: /v1/fuel/midgrade |
premium | Premium gasoline: /v1/fuel/premium |
diesel | Diesel fuel: /v1/fuel/diesel |
e85 | E85 fuel: /v1/fuel/e85 |
e15 | E15 fuel: /v1/fuel/e15 |
propane | Propane fuel: /v1/fuel/propane |
biodiesel | Biodiesel fuel: /v1/fuel/biodiesel |
cng | CNG fuel: /v1/fuel/cng |
lng | LNG fuel: /v1/fuel/lng |
Was this helpful?