AAA Fuel Prices Scraper avatar

AAA Fuel Prices Scraper

Pricing

Pay per event

Go to Apify Store
AAA Fuel Prices Scraper

AAA Fuel Prices Scraper

Scrape AAA fuel price averages for US states and metro areas.

Pricing

Pay per event

Rating

0.0

(0)

Developer

Stas Persiianenko

Stas Persiianenko

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Share

Scrape public AAA Fuel Prices data for national, state, and metro gasoline price averages in the United States.

What this actor does

AAA Fuel Prices Scraper collects fuel price average records from AAA's public fuel price website.

It is designed for logistics teams, fleet operators, travel planners, analysts, and monitoring workflows that need repeatable fuel-price snapshots.

Data source

The actor reads public pages from https://gasprices.aaa.com.

No login is required.

No API key is required.

No browser automation is used.

Main source page

The main state averages page is:

https://gasprices.aaa.com/state-gas-price-averages/

This page includes current regular, mid-grade, premium, and diesel averages for US states and DC.

State detail pages

For each state, AAA publishes a detail page such as:

https://gasprices.aaa.com/?state=CA

State pages can include historical comparison rows and metro-area averages.

Typical use cases

Track daily state fuel averages.

Monitor metro fuel prices for routing and dispatch decisions.

Compare diesel prices across operating regions.

Feed dashboards for travel-cost planning.

Archive recurring price snapshots for analysis.

Build alerts when a state or metro changes above a threshold.

Input overview

You can run a broad state-average scrape or narrow the run to selected states.

The default prefill targets a few common states and enables detail collection.

Use maxItems to limit the number of dataset records.

State codes

Use two-letter state codes such as CA, TX, NY, or FL.

Leave the list empty to collect all state averages from the main table.

When detail collection is enabled, selected state codes also control which state pages are visited.

Scrape modes

stateAverages collects the national/current state table only.

stateDetails adds historical comparison rows from selected state pages.

all collects current state averages, historical rows, and metro averages.

Metro areas

When includeMetroAreas is enabled, the actor reads AAA metro tables from state pages.

Metro rows use locationType = metro.

Metro output includes the parent stateCode and stateName.

Historical averages

When includeHistoricalAverages is enabled, the actor collects comparison periods where AAA publishes them.

Supported period labels are normalized to:

current

yesterday

week_ago

month_ago

year_ago

Output overview

Each dataset item is one fuel-price average record.

Records can represent the whole United States, a state, or a metro area.

All prices are numeric USD-per-gallon values when available.

Output fields

locationType identifies whether the row is national, state, or metro.

locationName is the human-readable location.

stateCode is the two-letter state code when relevant.

stateName is the full state name when relevant.

metroName is the AAA metro name when relevant.

period is the normalized comparison period.

regularUsd is the regular gasoline average.

midGradeUsd is the mid-grade gasoline average.

premiumUsd is the premium gasoline average.

dieselUsd is the diesel average.

priceDate is the date displayed by AAA.

sourceUrl is the source page used for the row.

scrapedAt is the actor extraction timestamp.

Example output item

{
"locationType": "metro",
"locationName": "Los Angeles-Long Beach, CA",
"stateCode": "CA",
"stateName": "California",
"metroName": "Los Angeles-Long Beach",
"period": "current",
"regularUsd": 5.828,
"midGradeUsd": 6.041,
"premiumUsd": 6.225,
"dieselUsd": 7.092,
"priceDate": "6/11/26",
"sourceUrl": "https://gasprices.aaa.com/?state=CA",
"scrapedAt": "2026-06-11T08:52:49.345Z"
}

Example input: all data for three states

{
"stateCodes": ["CA", "TX", "NY"],
"mode": "all",
"includeMetroAreas": true,
"includeHistoricalAverages": true,
"maxItems": 250
}

Example input: fast state table

{
"stateCodes": [],
"mode": "stateAverages",
"includeMetroAreas": false,
"includeHistoricalAverages": false,
"maxItems": 60
}

Example input: one state with details

{
"stateCodes": ["CA"],
"mode": "all",
"includeMetroAreas": true,
"includeHistoricalAverages": true,
"maxItems": 100
}

How much does it cost to scrape AAA fuel prices?

This actor uses pay-per-event pricing.

There is a small one-time start event of $0.005 per run.

Each saved fuel-price record is charged as one result event with tiered prices:

  • FREE: $0.0000575 per record
  • BRONZE: $0.00005 per record
  • SILVER: $0.000039 per record
  • GOLD: $0.00003 per record
  • PLATINUM: $0.00002 per record
  • DIAMOND: $0.000014 per record

Use maxItems and selected stateCodes to control run size.

Performance

The actor uses HTTP requests and HTML parsing.

It does not launch a browser.

Typical state-average runs complete quickly.

Metro detail runs make one additional request per selected state.

Proxy usage

The actor does not require a proxy by default.

AAA fuel price pages are public and return HTML over standard HTTP requests.

If AAA changes access controls in the future, proxy options can be revisited.

Limits and safety

Use maxItems to cap dataset output.

Use selected stateCodes for smaller recurring runs.

Use stateAverages mode for the cheapest broad daily monitoring run.

Data freshness

AAA displays a price date on the source pages.

The actor stores that value in priceDate.

The actor also stores scrapedAt so you can distinguish the source date from the run timestamp.

Data accuracy

The actor reports the values shown by AAA at scrape time.

It does not calculate or interpolate prices.

If a price is missing on the source page, the field is returned as null.

Handling page changes

The actor validates that at least one record was extracted.

If AAA changes the table structure and no records are found, the run fails instead of silently returning empty data.

Integrations

Use this actor as the fuel-price data step in repeatable operations workflows:

  • Actor to Google Sheets dashboard: schedule a daily run, export the dataset to Google Sheets, and chart regular, premium, and diesel averages by state.
  • Diesel price alerts: run selected states each morning, compare dieselUsd against your threshold, and send Slack, email, or webhook alerts when a region moves above budget.
  • Fleet BI sync: pull results with the Apify API into BigQuery, Snowflake, Power BI, Tableau, or a transport management system for cost-per-mile analysis.
  • Travel-cost calculators: combine current AAA state averages with route distance data to estimate trip and reimbursement costs.
  • Regional monitoring archives: append scheduled dataset exports to your data lake so analysts can compare AAA snapshots over time.

Scheduling

For daily monitoring, schedule the actor once per day after AAA updates prices.

For broad national coverage, use stateAverages mode.

For regional route planning, select the states where you operate and enable metro areas.

For a lightweight national/state snapshot, leave stateCodes empty and choose stateAverages.

For a fleet operating in a few regions, list those states and choose all.

For long-term trend archives, keep historical averages enabled.

Troubleshooting

If you see fewer rows than expected, check maxItems first.

If a state has no metro rows, AAA may not publish metro data for that state.

If a price field is null, AAA did not publish that value in the parsed row.

FAQ

Does this scrape individual gas stations?

No. This actor scrapes AAA average prices by national, state, and metro geography.

Does it require an AAA account?

No. It only reads public AAA Fuel Prices pages.

Does it use GasBuddy?

No. The source is AAA Fuel Prices.

Can I scrape only diesel?

The actor saves all available fuel grades. Filter the dataset to dieselUsd in your downstream workflow.

Can I monitor every state?

Yes. Leave stateCodes empty for all current state averages. Enable detail collection if you also need metro and historical rows.

Compliance note

Use this actor responsibly and respect the target website's public availability and terms.

The actor is intended for normal monitoring and analytics workloads, not abusive traffic.

Who is it for

Fleet and dispatch teams

Use the actor to monitor diesel and regular gasoline averages in the states where your trucks operate. A common workflow is a scheduled morning run for selected states, followed by an alert when dieselUsd crosses an internal fuel-surcharge threshold.

Logistics and freight analysts

Archive daily state and metro averages to compare regional fuel costs with lane profitability, freight-rate changes, and cost-per-mile models. Analysts can load the dataset into BI tools and join it with route or shipment data by stateCode.

Travel, mobility, and reimbursement teams

Use state averages as an input for travel-cost calculators, mileage reimbursement estimates, car-rental planning, and customer-facing trip-budget tools. The priceDate and scrapedAt fields make it clear when each estimate was sourced.

Developers and automation builders

Call the actor from the Apify API, a webhook, or an MCP client when another system needs fresh structured AAA fuel-price averages without custom HTML parsing.

Spreadsheet users

Schedule the actor and export JSON, CSV, Excel, or Google Sheets-ready data instead of copying AAA tables by hand.

API Usage

You can run the actor from the Apify API after it is available in your account.

Node.js API example

import { ApifyClient } from 'apify-client';
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/aaa-fuel-prices-scraper').call({
stateCodes: ['CA', 'TX'],
mode: 'all',
includeMetroAreas: true,
includeHistoricalAverages: true,
maxItems: 100,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);

Python API example

from apify_client import ApifyClient
import os
client = ApifyClient(os.environ['APIFY_TOKEN'])
run = client.actor('automation-lab/aaa-fuel-prices-scraper').call(run_input={
'stateCodes': ['CA', 'TX'],
'mode': 'all',
'includeMetroAreas': True,
'includeHistoricalAverages': True,
'maxItems': 100,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)

cURL API example

curl -X POST 'https://api.apify.com/v2/acts/automation-lab~aaa-fuel-prices-scraper/runs?token=YOUR_APIFY_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"stateCodes":["CA","TX"],"mode":"all","includeMetroAreas":true,"includeHistoricalAverages":true,"maxItems":100}'

MCP

Use this actor from MCP-enabled tools through the Apify MCP HTTP server.

Current Apify MCP URL for this actor:

https://mcp.apify.com?tools=automation-lab/aaa-fuel-prices-scraper

Claude Code MCP setup

Add the Apify MCP HTTP server in Claude Code and use your Apify API token for authentication. Configure the server URL as:

https://mcp.apify.com?tools=automation-lab/aaa-fuel-prices-scraper

Example Claude Code CLI setup:

$claude mcp add apify-aaa-fuel-prices --url "https://mcp.apify.com?tools=automation-lab/aaa-fuel-prices-scraper"

Then ask Claude Code to run the actor with a JSON input such as selected stateCodes, mode, and maxItems.

Claude Desktop, Cursor, and VS Code MCP setup

In Claude Desktop, Cursor, or VS Code, add an MCP server that points to the same Apify HTTP endpoint:

{
"mcpServers": {
"apify-aaa-fuel-prices": {
"url": "https://mcp.apify.com?tools=automation-lab/aaa-fuel-prices-scraper",
"headers": {
"Authorization": "Bearer YOUR_APIFY_TOKEN"
}
}
}
}

After saving the configuration, restart or reload the MCP client so the AAA Fuel Prices Scraper tool appears.

Example prompts for MCP usage:

  • "Run the AAA Fuel Prices Scraper for CA and TX and summarize diesel averages."
  • "Get current AAA metro fuel prices for California with a max of 100 records."
  • "Compare regular gas averages for selected states using the latest AAA data."

Use it when an agent needs fresh structured fuel-price averages for a state, metro area, or monitoring workflow.

Legality

The actor reads publicly available AAA Fuel Prices pages and stores the values displayed at run time.

You are responsible for using the exported data in a lawful way and for respecting AAA's website terms and applicable rules for your use case.

Use this actor when you need AAA average price tables for the United States rather than individual station listings.

Changelog

Initial version: collect AAA national, state, historical, and metro fuel price averages.