GasBuddy API: List cheapest gas stations
Finds nearby GasBuddy stations for a US or Canadian city, address or postal code and lists their reported prices for a fuel grade, lowest listed price first.
Unofficial. Not affiliated with or endorsed by GasBuddy.
Inputs
Values from the run on Oct 31, 2026, shown under Output.
- Location, required
location US or Canadian city, street address, or postal code, such as Denver, CO or 90210.
Los Angeles, CA
- Fuel Type optional
fuel_type Fuel grade, such as premium. Defaults to regular.
premium
One of
regular,midgrade,premium,diesel. Defaultregular.- Max Results optional
max_results Maximum number of stations, such as 20. Defaults to 20; maximum 50.
50
Whole number from 1 to 50. Default
20.
Input as JSON
{ "location": "Los Angeles, CA", "fuel_type": "premium", "max_results": 50}Output
{ "stations": [ { "city": "West Los Angeles", "unit": "gallon", "brand": "Speedway", "price": 6.09, "currency": "USD", "latitude": 34.050540643163, "reported": "10 Hours Ago", "longitude": -118.435224965215, "cash_price": 6.09, "price_type": "cash", "station_id": "11323", "star_rating": 4, "credit_price": 6.14, "station_link": "https://www.gasbuddy.com/station/11323" , "station_name": "Speedway Express", "street_address": "10801 Santa Monica Blvd" }, { "city": "Los Angeles", "unit": "gallon", "brand": "Speedway", "price": 6.09, "currency": "USD", "latitude": 34.059134876425, "reported": "9 Hours Ago", "longitude": -118.383294716477, "cash_price": 6.09, "price_type": "cash", "station_id": "11297", "star_rating": 4.1, "credit_price": 6.19, "station_link": "https://www.gasbuddy.com/station/11297" , "station_name": "Speedway Express", "street_address": "8770 W Olympic Blvd" }, { "city": "Los Angeles", "unit": "gallon", "brand": "SnacKing", "price": 6.09, "currency": "USD", "latitude": 34.058437133258, "reported": "18 Hours Ago", "longitude": -118.364059925079, "cash_price": null, "price_type": "credit", "station_id": "9922", "star_rating": 1.8, "credit_price": 6.09, "station_link": "https://www.gasbuddy.com/station/9922" , "station_name": "SK Gasoline", "street_address": "6101 W Olympic Blvd" } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"gasbuddy.com/list_cheapest_gas_stations","input":{"location":"Los Angeles, CA","fuel_type":"premium","max_results":50}}' # Save as fous.py, then run: python3 fous.pyimport json, os, timefrom urllib.error import HTTPErrorfrom urllib.request import Request, urlopenAPI = "https://api.fous.com/v1/runs" KEY = os.environ["FOUS_API_KEY"]HEADERS = { "Authorization": f"Bearer {KEY}", "Content-Type": "application/json" ,}def call(url, body=None): data = json.dumps(body).encode() if body else None request = Request(url, data, HEADERS) try: with urlopen(request, timeout=120) as r: return r.status, json.load(r) except HTTPError as error: message = json.load(error)["error"]["message"] raise RuntimeError(message) from errorstatus, run = call(API, { "method": "gasbuddy.com/list_cheapest_gas_stations" , "input": { "location": "Los Angeles, CA", "fuel_type": "premium", "max_results": 50 }})# 202: still going after 30 s. Ask again until it ends.while status == 202: time.sleep(2) status, run = call(f"{API}/{run['id']}")print(json.dumps(run["data"], indent=2))// Save as fous.mjs, then run: node fous.mjsconst api = "https://api.fous.com/v1/runs" ;const headers = { Authorization: `Bearer ${process.env.FOUS_API_KEY}`, "Content-Type": "application/json" ,};let response = await fetch(api, { method: "POST", headers, body: JSON.stringify({ "method": "gasbuddy.com/list_cheapest_gas_stations" , "input": { "location": "Los Angeles, CA", "fuel_type": "premium", "max_results": 50 } }), signal: AbortSignal.timeout(120_000),});let run = await response.json();// 202: still going after 30 s. Ask again until it ends.while (response.status === 202) { await new Promise((done) => setTimeout(done, 2_000)); response = await fetch(`${api}/${run.id}`, { headers }); run = await response.json();}if (!response.ok) throw new Error(run.error.message);console.log(run.data);# Connect your agent to Fous once, over MCP (Streamable HTTP):# https://api.fous.com/mcp# Set FOUS_API_KEY first: create a key at https://app.fous.com/keys.# Claude Codeclaude mcp add \ --scope user \ --transport http fous https://api.fous.com/mcp \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Codexcodex mcp add fous \ --url https://api.fous.com/mcp \ --bearer-token-env-var FOUS_API_KEY# Cursor, VS Code, Windsurf, Cline and morenpx -y add-mcp https://api.fous.com/mcp -g -n fous \ --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"# Then ask your agent:# "Use Fous to run gasbuddy.com/list_cheapest_gas_stations# with {"location":"Los Angeles, CA","fuel_type":"premium","max_results":50}"Over HTTP, the answer’s data holds the output. A run still going after 30 seconds answers 202 with its id: ask GET /v1/runs/{id} until it ends.
Schema
Input schema
{ "type": "object", "required": [ "location" ], "properties": { "location": { "type": "string", "description": "US or Canadian city, street address, or postal code, such as Denver, CO or 90210." }, "fuel_type": { "enum": [ "regular", "midgrade", "premium", "diesel" ], "type": "string", "default": "regular", "description": "Fuel grade, such as premium. Defaults to regular." }, "max_results": { "type": "integer", "default": 20, "maximum": 50, "minimum": 1, "description": "Maximum number of stations, such as 20. Defaults to 20; maximum 50." } }}Output schema
{ "type": "object", "required": [ "stations" ], "properties": { "stations": { "type": "array", "items": { "type": "object", "required": [ "station_name", "brand", "street_address", "city", "price", "currency", "unit", "price_type", "cash_price", "credit_price", "reported", "star_rating", "station_link", "station_id", "latitude", "longitude" ], "properties": { "city": { "type": [ "string", "null" ], "description": "City." }, "unit": { "type": "string", "description": "gallon or litre." }, "brand": { "type": [ "string", "null" ], "description": "Fuel or store brand." }, "price": { "type": [ "number", "null" ], "description": "Listed price for the selected fuel in the stated currency and unit." }, "currency": { "type": "string", "description": "USD or CAD." }, "latitude": { "type": [ "number", "null" ], "description": "Station latitude." }, "reported": { "type": [ "string", "null" ], "description": "Approximate age of the selected price, such as 2 Hours Ago." }, "longitude": { "type": [ "number", "null" ], "description": "Station longitude." }, "cash_price": { "type": [ "number", "null" ], "description": "Cash price for the selected fuel when reported." }, "price_type": { "type": [ "string", "null" ], "description": "Cash or credit for the listed price." }, "station_id": { "type": "string", "description": "GasBuddy station ID." }, "star_rating": { "type": [ "number", "null" ], "description": "Star rating when shown." }, "credit_price": { "type": [ "number", "null" ], "description": "Credit price for the selected fuel when reported." }, "station_link": { "type": "string", "description": "GasBuddy page for the station." }, "station_name": { "type": [ "string", "null" ], "description": "Name shown for the station." }, "street_address": { "type": [ "string", "null" ], "description": "Street address." } } }, "description": "Nearby stations, lowest listed price first, stations without a price last." } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
gasbuddy.com/list_cheapest_gas_stations- Returns
- station name, brand, address, price, cash and credit prices, price age, rating, link, coordinates
Use it from your agent
Give your agent this line. It reads SKILL.md, gets a Fous API key and connects the Fous MCP server. Its run then takes the method gasbuddy.com/list_cheapest_gas_stations with the inputs above.
Ask your agent
- Where's the cheapest regular unleaded near Denver, CO right now? Give me the top 10 stations with prices.
- I drive a diesel truck and I'm passing through Amarillo, TX tonight. Which stations have the lowest diesel prices, including cash vs credit?
- Check GasBuddy for the cheapest premium gas around zip code 30318 and list about 15 stations with addresses and how recent the prices are.
- Lowest midgrade prices close to 1200 Main St, Kansas City, MO, sorted cheapest first please.
- Pull up GasBuddy prices for Calgary, AB. I want the 25 cheapest places to fill up with regular, with ratings and map coordinates.
See more
All GasBuddy methodsGets GasBuddy's latest reported average regular gas price, its changes and the diesel benchmark for a US state or a listed metro area. Midgrade, premium and area low/high prices are not published with these averages; updates may lag the current day.
gasbuddy.com/get_average_gas_pricesGets AAA average gasoline and diesel prices for the US, a state, or a metro area listed on its state page, with yesterday, week, month and year-ago comparisons and record highs, as of the date AAA shows.
gasprices.aaa.com/get_gas_pricesFinds the US Costco warehouses nearest a city, address or ZIP code, with today's and weekly hours, gas station hours, services and posted gas prices.
costco.com/search_warehousesFind public, open EV charging stations near a US or Canadian city, address, or postal code, sorted by distance. Power is the highest listed connector output at each station; unavailable details are null.
afdc.energy.gov/search_ev_chargersGets the latest weekly EIA retail gasoline and on-highway diesel prices for a U.S. area, with changes from the prior week and from 52 weeks earlier.
eia.gov/get_fuel_pricesFinds the AutoZone stores nearest a US ZIP code, city or street address, with contact details, opening hours, whether each is open now, distance and store page links.
autozone.com/search_storesFinds public PlugShare charging stations near an address, city or ZIP code, nearest first, with driver PlugScores and charging details. Cost and opening hours appear when listed.
plugshare.com/search_chargersFinds postal codes, place names and coordinates for a town and state or region in a country covered by Zippopotam.us.
zippopotam.us/search_postal_codes