FuelEconomy.gov API: Get fuel economy
Returns official MPG or MPGe, range, annual fuel cost, five-year savings and emissions for every matching version of a vehicle. Costs use current fuel prices and 15,000 miles per year; plug-in hybrid costs include gasoline and electricity.
Unofficial. Not affiliated with or endorsed by FuelEconomy.gov.
Inputs
Values from the run on Oct 23, 2026, shown under Output.
- Make, required
make Vehicle make, for example Toyota.
Toyota
- Year, required
year Model year, for example 2022.
2022
Whole number.
- Model, required
model Model name, for example RAV4 or Model 3.
RAV4
- Version optional
version Optional words identifying trim, engine, transmission or drive, for example Hybrid AWD.
2.5 L AWD
Default
.
Input as JSON
{ "make": "Toyota", "year": 2022, "model": "RAV4", "version": "2.5 L AWD"}Output
{ "versions": [ { "make": "Toyota", "year": 2022, "drive": "All-Wheel Drive", "model": "RAV4 AWD", "engine": "2.5 L, 4 cylinders, SIDI & PFI", "city_mpg": 25, "page_url": "https://www.fueleconomy.gov/feg/Find.do?action=sbs&id=45005" , "city_mpge": null, "fuel_type": "Regular", "vehicle_id": "45005", "highway_mpg": 33, "range_miles": null, "combined_mpg": 28, "highway_mpge": null, "transmission": "Automatic (S8)", "combined_mpge": null, "fuel_price_unit": "gallon", "co2_grams_per_mile": 319, "vehicle_description": "2022 Toyota RAV4 AWD, 2.5 L, 4 cylinders, SIDI & PFI, Automatic (S8), All-Wheel Drive", "annual_fuel_cost_usd": 2300, "annual_miles_assumed": 15000, "electric_range_miles": null, "greenhouse_gas_score": 6, "five_year_savings_usd": 0, "fuel_price_usd_per_unit": 4.28, "secondary_fuel_price_unit": null, "secondary_fuel_price_usd_per_unit": null }, { "make": "Toyota", "year": 2022, "drive": "All-Wheel Drive", "model": "RAV4 AWD", "engine": "2.5 L, 4 cylinders, SIDI & PFI; Stop-Start", "city_mpg": 27, "page_url": "https://www.fueleconomy.gov/feg/Find.do?action=sbs&id=45006" , "city_mpge": null, "fuel_type": "Regular", "vehicle_id": "45006", "highway_mpg": 33, "range_miles": null, "combined_mpg": 29, "highway_mpge": null, "transmission": "Automatic (S8)", "combined_mpge": null, "fuel_price_unit": "gallon", "co2_grams_per_mile": 301, "vehicle_description": "2022 Toyota RAV4 AWD, 2.5 L, 4 cylinders, SIDI & PFI; Stop-Start, Automatic (S8), All-Wheel Drive", "annual_fuel_cost_usd": 2200, "annual_miles_assumed": 15000, "electric_range_miles": null, "greenhouse_gas_score": 6, "five_year_savings_usd": 500, "fuel_price_usd_per_unit": 4.28, "secondary_fuel_price_unit": null, "secondary_fuel_price_usd_per_unit": null }, { "make": "Toyota", "year": 2022, "drive": "All-Wheel Drive", "model": "RAV4 AWD LE", "engine": "2.5 L, 4 cylinders, SIDI & PFI", "city_mpg": 27, "page_url": "https://www.fueleconomy.gov/feg/Find.do?action=sbs&id=45008" , "city_mpge": null, "fuel_type": "Regular", "vehicle_id": "45008", "highway_mpg": 34, "range_miles": null, "combined_mpg": 30, "highway_mpge": null, "transmission": "Automatic (S8)", "combined_mpge": null, "fuel_price_unit": "gallon", "co2_grams_per_mile": 296, "vehicle_description": "2022 Toyota RAV4 AWD LE, 2.5 L, 4 cylinders, SIDI & PFI, Automatic (S8), All-Wheel Drive", "annual_fuel_cost_usd": 2150, "annual_miles_assumed": 15000, "electric_range_miles": null, "greenhouse_gas_score": 6, "five_year_savings_usd": 750, "fuel_price_usd_per_unit": 4.28, "secondary_fuel_price_unit": null, "secondary_fuel_price_usd_per_unit": null } ]}Code
curl https://api.fous.com/v1/runs \ -H "Authorization: Bearer $FOUS_API_KEY" \ -H "Content-Type: application/json" \ -d '{"method":"fueleconomy.gov/get_fuel_economy","input":{"make":"Toyota","year":2022,"model":"RAV4","version":"2.5 L AWD"}}' # 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": "fueleconomy.gov/get_fuel_economy" , "input": { "make": "Toyota", "year": 2022, "model": "RAV4", "version": "2.5 L AWD" }})# 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": "fueleconomy.gov/get_fuel_economy" , "input": { "make": "Toyota", "year": 2022, "model": "RAV4", "version": "2.5 L AWD" } }), 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 fueleconomy.gov/get_fuel_economy# with {"make":"Toyota","year":2022,"model":"RAV4","version":"2.5 L AWD"}"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": [ "year", "make", "model" ], "properties": { "make": { "type": "string", "description": "Vehicle make, for example Toyota." }, "year": { "type": "integer", "description": "Model year, for example 2022." }, "model": { "type": "string", "description": "Model name, for example RAV4 or Model 3." }, "version": { "type": "string", "default": "", "description": "Optional words identifying trim, engine, transmission or drive, for example Hybrid AWD." } }}Output schema
{ "type": "object", "required": [ "versions" ], "properties": { "versions": { "type": "array", "items": { "type": "object", "properties": { "make": { "type": "string" }, "year": { "type": "integer" }, "drive": { "type": [ "string", "null" ] }, "model": { "type": "string" }, "engine": { "type": [ "string", "null" ] }, "city_mpg": { "type": [ "number", "null" ] }, "page_url": { "type": "string" }, "city_mpge": { "type": [ "number", "null" ] }, "fuel_type": { "type": "string" }, "vehicle_id": { "type": "string" }, "highway_mpg": { "type": [ "number", "null" ] }, "range_miles": { "type": [ "number", "null" ] }, "combined_mpg": { "type": [ "number", "null" ] }, "highway_mpge": { "type": [ "number", "null" ] }, "transmission": { "type": [ "string", "null" ] }, "combined_mpge": { "type": [ "number", "null" ] }, "fuel_price_unit": { "type": [ "string", "null" ] }, "co2_grams_per_mile": { "type": [ "number", "null" ] }, "vehicle_description": { "type": "string" }, "annual_fuel_cost_usd": { "type": [ "number", "null" ] }, "annual_miles_assumed": { "type": "integer" }, "electric_range_miles": { "type": [ "number", "null" ] }, "greenhouse_gas_score": { "type": [ "integer", "null" ] }, "five_year_savings_usd": { "type": [ "number", "null" ] }, "fuel_price_usd_per_unit": { "type": [ "number", "null" ] }, "secondary_fuel_price_unit": { "type": [ "string", "null" ] }, "secondary_fuel_price_usd_per_unit": { "type": [ "number", "null" ] } } } } }}- Price
- 1 credit per completed run (1¢ with pay as you go); failed runs are free.
- Method
fueleconomy.gov/get_fuel_economy- Returns
- MPG/MPGe, range, annual fuel cost, fuel prices, five-year savings, CO2, greenhouse gas score
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 fueleconomy.gov/get_fuel_economy with the inputs above.
Ask your agent
- What is the MPG and annual fuel cost for a 2022 Toyota RAV4 Hybrid AWD?
- Show me the fuel economy, range, and five-year savings for the 2023 Tesla Model 3.
- How many miles per gallon does a 2021 Honda Civic get, and what would it cost to fuel per year?
- Compare the MPGe and CO2 emissions for a 2024 Ford Mustang Mach-E on fueleconomy.gov.
- Find the estimated range and greenhouse gas score for a 2020 Chevrolet Bolt EV.
See more
All FuelEconomy.gov methodsCompares the official fuel economy and estimated annual fuel cost of two to four cars by year, make and model, using FuelEconomy.gov. Selects a base version when no trim is given.
fueleconomy.gov/compare_carsGets NHTSA 5-Star Safety Ratings for a car by make, model and model year. Returns each matching version; unrated versions have no stars.
nhtsa.gov/get_safety_ratingsGets the current average used asking price, the CarGurus price range and the 12-month price history for a model year (all trims), from CarGurus price trends.
cargurus.com/get_market_valueGets 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_pricesGets Kelley Blue Book's expert and consumer ratings, trim prices with the KBB Fair Purchase Price, fuel economy, pros, cons and the expert review's opening verdict for a car model by year, make and model. Some details are unavailable for certain model years.
kbb.com/get_car_reviewLists the passenger car, SUV/minivan and truck models NHTSA has for a make and model year, alphabetically.
nhtsa.gov/list_vehicle_modelsLists NHTSA safety recalls for a vehicle model, given a model year, make and model or a 17-character VIN. Results cover the model, not whether a specific car has been repaired.
nhtsa.gov/check_recallsIdentifies a vehicle from its 17-character VIN using NHTSA vehicle data. Missing details are returned as null; decoding errors and warnings are included.
nhtsa.gov/decode_vin