Skip to main content
Thirdwatchthirdwatch
Business & local data

Feed Gas Price Data Into Expense Forecasting

Export AAA fuel averages as JSON to forecast mileage reimbursement and travel spend — dated state rates that finance can actually audit.

Sep 21, 2026 · 2 min read · 443 words
See the scraper →

TL;DR — The Fuel Prices Scraper returns AAA's dated state fuel averages as JSON. Forecasts built on the current fix plus month/year-ago context stop being last quarter's number with a shrug attached.

Why expense forecasts quietly rot

Travel and mileage budgets are typically set quarterly — while fuel reprices daily. By mid-quarter, the variance is structural, not noise, and nobody can say when it started.

The fix is a feed, not a figure: dated state averages flowing into the forecast so every variance conversation has a timestamped market rate behind it.

How does this compare to the alternatives?

Static budget figure Finance consensus tools Thirdwatch actor
Cost Free, drifts Heavy platform Pay per result
Reliability Stale by week 3 Good Daily benchmark
Setup time Zero Implementation project Minutes
Maintenance Quarterly Vendor Scheduled runs

How to feed forecasts in 4 steps

How do I pull the forecast inputs?

import os
from apify_client import ApifyClient

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("thirdwatch/fuel-prices-scraper").call(
    run_input={"states": ["texas", "florida", "new-york", "illinois", "california"]}
)
rows = list(client.dataset(run["defaultDatasetId"]).iterate_items())

How do I derive the projection band?

import pandas as pd
df = pd.DataFrame(rows)
df["yoy_change"] = df.regular - df.year_ago
df["mom_change"] = df.regular - df.month_ago
print(df[["region", "regular", "mom_change", "yoy_change"]])

month_ago/year_ago give trend and seasonality context — the honest ingredients of a projection band.

How do I apply it to mileage spend?

monthly_miles = {"california": 4000, "texas": 6000}
forecast = sum(m / 25 * df.set_index("region").loc[s.title(), "regular"]
               for s, m in monthly_miles.items())  # 25 mpg fleet
print(f"Next-month fuel forecast: ${forecast:.0f}")

How do I archive for variance review?

Append each run's rows to a dated JSONL store — when actuals diverge, the benchmark series shows whether the market moved or the plan was wrong.

Sample output

{"region": "New York", "scope": "state:ny", "date": "2026-09-21",
 "regular": 3.48, "mid_grade": 3.82, "premium": 4.15,
 "diesel": 4.30, "e85": 2.98,
 "yesterday": 3.47, "week_ago": 3.44, "month_ago": 3.52, "year_ago": 3.36}

Common pitfalls

Forecasts need a refresh cadence — a feed that updates weekly beats a better model fed quarterly. State averages understate metro spend where most travel happens; pad dense-market states. Seasonal moves (summer blends, winter diesel) show in the year_ago comparison — read it before projecting. The actor supplies the market truth; policy and buffer are finance's call.

Related use cases

Frequently asked questions

Why forecast fuel separately from other expenses?

Fuel is the most volatile travel line item — it moves weekly while airfare and hotels follow bookings. A dated feed of state averages keeps the forecast honest between budget cycles.

Which column should forecasts use?

The grade your vehicles burn — regular for most fleets, diesel for trucks. month_ago and year_ago columns give the trend context for projecting forward.

Can finance audit the source?

Yes — AAA's published averages, returned with a date field per record. That's the citation an expense policy needs.

How do I project future prices?

The data is current-market, not forecast. Combine the current fix with the year_ago seasonal comparison for a defensible projection band.

Related

Try it yourself

100 free credits, no credit card.

About 30 real searches. Add the MCP to Claude or Cursor in two minutes.