Fuel Prices API
Live per-station retail fuel prices for any US location — by ZIP code, city name or GPS coordinates. Returns station name and address, distance from the search point, cash and credit prices with posted timestamps, and popularity metadata, across six fuel grades.
MEDIAN LAGon demand
PARAMETERS5
TOTAL USERS169
MONTHLY ACTIVE39
RUNS SUCCEEDED99.8%
RATING3.71 (5)
Input parameters
| PARAMETER | TYPE | REQ | DEFAULT | DESCRIPTION |
|---|---|---|---|---|
| search | string | yes | — | ZIP code, city name, or lat/long pair — e.g. '11507', 'New York', '36.0816642, -115.0534345' |
| fuel | integer | no | 1 | 1 Regular · 2 Midgrade · 3 Premium · 4 Diesel · 5 E85 · 12 Unleaded 88 |
| maxAge | integer | no | 0 | Maximum age of a reported price in days. 0 returns every station regardless of when it last reported. |
| lang | enum | no | en | English only at present |
| output_file | string | no | — | Custom CSV filename; auto-generated with a timestamp when omitted |
Worked examples
{ "search": "11507" }
{
"search": "Houston",
"fuel": 4
}
{
"search": "36.0816642, -115.0534345",
"fuel": 1
}
{
"search": "Chicago",
"fuel": 3,
"maxAge": 2
}
POWER-USER TIP
maxAge is the freshness dial — Prices are crowd-reported, so a station that has not been visited in a fortnight still appears with a stale figure by default. Set maxAge to 1 or 2 when you need a defensible snapshot, and leave it at 0 when you want maximum station coverage and can tolerate drift.
Coverage
6
fuel grades — Regular · Midgrade · Premium · Diesel · E85 · Unleaded 88
3
lookup modes — ZIP code · city name · GPS coordinates
2
countries — United States, with some Canadian coverage
Tasks
Saved runs with the inputs already filled in — each one a standalone page and a working configuration example.
Code
curl
curl -X POST "https://api.apify.com/v2/acts/johnvc~fuelprices/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"search":"11507","fuel":1}'
Python
from apify_client import ApifyClient
client = ApifyClient("APIFY_TOKEN")
run = client.actor("johnvc/fuelprices").call(
run_input={"search": "Houston", "fuel": 4, "maxAge": 2}
)
for item in client.dataset(run.default_dataset_id).iterate_items():
print(item.get("name"), item.get("price"))
What people use it for
- Metro-level pump price monitoring
- Competitive analysis for fuel retailers
- Fleet and route-planning cost models
- Building historical price time series
- Powering a price-comparison app
- Procurement benchmarking