Odometer and dashboard representing programmatic vehicle fuel economy lookups using FuelEconomy.gov web services

FuelEconomy.gov API Guide: Pull MPG and Cost Data

Quick Summary FuelEconomy.gov provides XML web services endpoints that let you fetch vehicle menus (year, make, model) and vehicle details programmatically. This is useful if you're building a comparison tool, a data pipeline, or your own research dataset without manual browsing.
  • Use menu endpoints to get years, makes, models, and vehicle options (IDs).
  • Use a vehicle ID endpoint to fetch detailed data for that specific configuration.
  • If you prefer bulk offline work, FuelEconomy.gov also offers CSV downloads.

What We Know (Sourced)

FuelEconomy.gov provides a "Vehicle Menu Items and XML Web Service Documentation" page describing how its web services are organized. The site also exposes REST-style endpoints that return XML for menu items (year, make, model, options) and for individual vehicle data.

FuelEconomy.gov also offers downloadable datasets (CSV) that may be easier than calling the web services repeatedly if you need bulk data.

Practical tip: If you need a one-time bulk analysis, start with CSV downloads. If you're building an app that needs live lookups, use web services.

A Simple End-to-End Workflow

The web service menu pattern is simple:

For consumers, this is the same concept as shopping through vehicle menus — you're just doing it via XML endpoints instead of clicking.

Example Endpoints (Verified)

These endpoints are live and return XML:

If you're turning this into a fuel-cost tool, you'll typically compute cost per mile once you have MPG (or MPGe/kWh fields). Related: cost per mile and EV charging cost per mile.

What's Next

Frequently Asked Questions

Is this a JSON API?

FuelEconomy.gov refers to XML web services and the endpoints above return XML. If you need JSON, you can typically convert XML to JSON in your application code.

Should I use web services or CSV downloads?

Use CSV downloads for offline/bulk analysis. Use web services for interactive tools and live lookups.

How do I avoid keyword cannibalization in a content pipeline?

Use the API content for technical intent (developers) and keep consumer intent separate (label and shopping explainers). For consumer intent, link to hub posts like how to use FuelEconomy.gov.