# US Gas & Diesel Prices: Weekly Retail by Region and Grade (`scrapemint/us-gas-diesel-prices`) Actor

Official weekly US retail fuel prices as clean rows: national, the refining regions, nine states and ten cities, for every grade of gasoline and for diesel, with the move on the week and the year and the spread against the national average.

- **URL**: https://apify.com/scrapemint/us-gas-diesel-prices.md
- **Developed by:** [Ken M](https://apify.com/scrapemint) (community)
- **Categories:** Business, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 fuel price rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## US Gas & Diesel Prices: Weekly Retail by Region and Grade

The official weekly survey of what American drivers actually pay at the pump, as clean rows: **national, the refining districts, nine states and ten cities**, for every grade of gasoline and for diesel.

No API key, no login, no browser.

### Why this exists

The agency publishes this as **legacy Excel workbooks, not an API** — there is no CSV and no JSON endpoint. Getting a usable table out of them means parsing twelve sheets of spreadsheet, decoding Excel date serials, and untangling series titles. That is the work this does.

### Modes

- **Prices** - one row per area at the latest published week: price, the move on the week and on the year, the 52 week high and low, the **spread against the national average**, and a rank from most to least expensive.
- **History** - one row per area per week over any range.
- **Series** - the catalogue of areas and grades published, with each one's first and latest week.

### Example output

```json
{
  "mode": "prices",
  "product": "gasoline",
  "grade": "regular",
  "regionName": "San Francisco",
  "areaType": "city",
  "weekEnding": "2026-07-27",
  "pricePerGallon": 5.578,
  "weekChangeCents": 16.2,
  "yearChangeCents": 127.1,
  "centsVersusNationalAverage": 148.2,
  "fiftyTwoWeekLow": 3.944,
  "fiftyTwoWeekHigh": 6.129,
  "priceRankMostExpensive": 1
}
```

### Coverage

| Area type | What is included |
| --- | --- |
| national | the US average |
| region | East Coast, New England, Central Atlantic, Lower Atlantic, Midwest, Gulf Coast, Rocky Mountain, West Coast, and for diesel West Coast Except California |
| state | California, Colorado, Florida, Massachusetts, Minnesota, New York, Ohio, Texas, Washington |
| city | Boston, Chicago, Cleveland, Denver, Houston, Los Angeles, Miami, New York City, San Francisco, Seattle |

Gasoline comes in regular, midgrade, premium or all grades, each as conventional, reformulated or both. Diesel comes as No 2, low sulfur and ultra low sulfur. Diesel has no formulation split.

### Things worth knowing

- **The diesel workbook pairs every weekly sheet with a monthly one whose title differs by a single extra space.** Mixing them drops monthly averages into a weekly series. The frequency here is confirmed from the spacing of the dates themselves rather than trusted from the sheet name, and only weekly sheets are used.
- **Dates are Excel serial numbers**, not dates, and the sheets end with an empty row.
- **A blank cell means that area was not surveyed that week, not a price of zero.** Series start in different years, so blanks appear inside otherwise complete rows and are skipped rather than zeroed.
- **Refining districts carry their designator inside the name**, as in "Central Atlantic (PADD 1B)". The code is extracted to its own field so the district still classifies as a region.
- **Asking for a grade the fuel does not have** — premium diesel, for instance — returns a free note naming the published grades and answers with the default, rather than silently reporting a different grade as though you had asked for it.
- Prices are dollars per US gallon, including taxes, as surveyed.

### Who this is for

Fleet, haulage and delivery operators tracking fuel cost by region; travel and consumer apps; commodity and equity analysts watching the retail margin over crude; and journalists covering pump prices. The California versus Gulf Coast gap, which the spread column gives you directly, is one of the most reliably newsworthy numbers in US energy.

### Pricing

**$0.004 per row.** The first 2 rows of every run are free, and note rows (an unpublished grade, a region filter nothing matched, a source that did not load) are never charged.

A full national snapshot of regular gasoline is 28 rows, or **$0.11**. A year of weekly history for one city is 52 rows. Diesel is 11 areas.

### Related actors

- **Oil & Gas Inventory Report** - the weekly supply data behind these prices.
- **Commodity Futures Prices: Gold, Oil, Grains and Rates** - crude and refined product futures.

### How to run it via API

```bash
curl -X POST "https://api.apify.com/v2/acts/scrapemint~us-gas-diesel-prices/runs?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mode":"prices","product":"gasoline","grade":"regular"}'
```

Data from the US Energy Information Administration weekly retail price survey.

# Actor input Schema

## `mode` (type: `string`):

prices = the latest published week for every region, with the move on the week and year and the spread against the national average. history = one row per region per week. series = what regions and grades are published.

## `product` (type: `string`):

Petrol (gasoline) or diesel. Diesel has no formulation split.

## `grade` (type: `string`):

Gasoline: regular, midgrade, premium or all. Diesel: no2, low\_sulfur, ultra\_low\_sulfur.

## `formulation` (type: `string`):

Gasoline only. conventional, reformulated, or all for both combined.

## `regions` (type: `array`):

Filter by name, for example California, Gulf Coast, Chicago. Partial names match. Empty returns every region published.

## `areaTypes` (type: `array`):

national, region (the refining districts), state, city. Empty returns all of them.

## `weeksBack` (type: `integer`):

History mode. How many weeks back from the latest published week.

## `startDate` (type: `string`):

History mode. YYYY-MM-DD. Overrides weeks of history.

## `endDate` (type: `string`):

History mode. YYYY-MM-DD.

## `maxRows` (type: `integer`):

Cap on rows returned. Controls total cost.

## Actor input object example

```json
{
  "mode": "prices",
  "product": "gasoline",
  "grade": "regular",
  "formulation": "all",
  "regions": [],
  "areaTypes": [],
  "weeksBack": 52,
  "startDate": "",
  "endDate": "",
  "maxRows": 200
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "product": "gasoline",
    "grade": "regular",
    "maxRows": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapemint/us-gas-diesel-prices").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "product": "gasoline",
    "grade": "regular",
    "maxRows": 200,
}

# Run the Actor and wait for it to finish
run = client.actor("scrapemint/us-gas-diesel-prices").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "product": "gasoline",
  "grade": "regular",
  "maxRows": 200
}' |
apify call scrapemint/us-gas-diesel-prices --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapemint/us-gas-diesel-prices"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/fD9XXT8W7W3DpoNgT/builds/mOEG0FZ7kpMCUmtQF/openapi.json
