Home → Blog

You're building a finance workflow that needs a defensible, EIA-sourced price for Rocky Mountain gasoline to power fuel-surcharge models, risk dashboards, or cost accruals. By the end of this guide, you will query FreightPulse for Rocky Mountain gasoline using the documented fuel-price endpoints, interpret the envelope precisely, and read only the fields that matter for financial calculations and audit trails.

What this API delivers and how to think about Rocky Mountain gasoline in finance

FreightPulse aggregates EIA fuel benchmarks and exposes them through a stable JSON envelope for finance use cases like surcharge indexing, accruals, and budget variance analysis. The Rocky Mountain Gasoline metric is the specific target of this guide. All examples use the documented endpoints and headers only, without inventing unpublished values.

Illustration: Rocky Mountain Gasoline Price API

Two important constraints guide a clean integration:

Origin catalog facts you must implement exactly

Endpoints, authentication, and access limits

FreightPulse requires an API key via the X-API-Key header for authenticated requests. Without a key, guest access permits 100 requests per day per IP. For finance-grade jobs, add a key early in development so you do not exhaust guest limits during testing or load tests.

Responses follow an envelope of {"success": true, "data": {...}}. Timestamps are provided in ISO 8601 with timezone offsets (UTC in samples). Currency is USD and units are gallon for fuel prices. Treat any absent field as unknown and avoid backfilling with data from another field or region.

Copy-paste cURL quickstart

This is the officially provided sample. Use it as-is and keep the header and URL unchanged aside from swapping YOUR_API_KEY for your key in production.

curl -H "X-API-Key: YOUR_API_KEY" "https://freightpulsehq.com/api/v1/historical?metric=fuel_price_gasoline_rocky_mountain&period=30d"

Official JSON envelope and how to read it

Below is the official example JSON. Do not modify or reinterpret its values. In your finance code, parse only the fields you use (timestamp, currency, unit, and the specific price fields relevant to your model).

{
"success": true,
"data": {
"timestamp": "2026-10-04T00:00:22+00:00",
"source": "EIA (U.S. Energy Information Administration)",
"currency": "USD",
"unit": "gallon",
"data": {
"diesel": {
"national_average": 6.382,
"change_week": -0.147,
"change_percent": -2.25,
"updated_at": "2026-09-28",
"regions": {
"east_coast": 6.137,
"midwest": 6.526,
"gulf_coast": 5.955,
"rocky_mountain": 6.407,
"west_coast": 7.357,
"california": 8.181
}
},
"gasoline": {
"national_average": 4.465,
"change_week": -0.013,
"change_percent": -0.29,
"updated_at": "2026-09-28",
"grades": {
"regular": 4.465,
"midgrade": 5.073,
"premium": 5.482
}
},
"bunker_fuel": {
"available": false,
"note": "No known free source (Rotterdam/Singapore/Houston) — requires a paid provider (e.g. Ship & Bunker, Argus)."
}
},
"historical": {
"diesel_30d_avg": 6.291,
"diesel_90d_avg": 5.561,
"diesel_yoy_change": 72,
"gasoline_30d_avg": 4.355,
"gasoline_90d_avg": 4.111,
"gasoline_yoy_change": 42.9
}
},
"meta": {
"request_id": "0282bc84-c17f-436d-8623-ec1ed2f8cf76"
}
}

What to use in finance code:

Rocky Mountain Gasoline: choosing the correct field

The target metric in this article is Rocky Mountain Gasoline. Per the origin catalog, there is no officially published historical series for fuel_price_gasoline_rocky_mountain. That means:

For diesel, the sample includes regional fields such as data.data.diesel.regions.rocky_mountain. Do not repurpose diesel region values as gasoline proxies.

JavaScript integration example (fetch + basic validation)

This example calls the same historical endpoint shown above and extracts the exact fields present in the official sample that a finance system can safely store. Replace YOUR_API_KEY with your key in production. In guest mode, omit the header, noting the 100 requests/day/IP limit.

async function getRockyMountainGasoline() {
const url = 'https://freightpulsehq.com/api/v1/historical?metric=fuel_price_gasoline_rocky_mountain&period=30d';
const res = await fetch(url, {
headers: {
'X-API-Key': 'YOUR_API_KEY'
}
});

if (!res.ok) {
throw new Error(`HTTP ${res.status} fetching FreightPulse`);
}

const payload = await res.json();

// Envelope validation
if (!payload || payload.success !== true || !payload.data) {
throw new Error('Malformed FreightPulse envelope');
}

const { timestamp, source, currency, unit } = payload.data;
const gasoline = payload.data.data && payload.data.data.gasoline ? payload.data.data.gasoline : null;
const hist = payload.data.historical || null;

// Use only present fields. Do not infer Rocky Mountain gasoline if not provided.
return {
timestamp, // ISO 8601 (UTC sample)
source, // EIA provenance string
currency, // 'USD'
unit, // 'gallon'
gasolineGrades: gasoline ? gasoline.grades : null,
gasolineRolling: hist ? {
avg30d: hist.gasoline_30d_avg,
avg90d: hist.gasoline_90d_avg,
yoy: hist.gasoline_yoy_change
} : null
};
}

// Example: persist with clear labels
getRockyMountainGasoline()
.then(data => {
console.log('FreightPulse EIA gasoline payload (store with exact labels):');
console.log(JSON.stringify(data, null, 2));
})
.catch(err => {
console.error(err);
});

Python example (requests + guardrails for accounting)

The Python example mirrors the same endpoint, zero assumptions. It retains the timestamp and provenance, persists only what exists, and avoids region inferences.

import os
import json
import requests
from datetime import datetime, timezone

API_URL = "https://freightpulsehq.com/api/v1/historical"
PARAMS = {
"metric": "fuel_price_gasoline_rocky_mountain",
"period": "30d"
}
HEADERS = {
"X-API-Key": "YOUR_API_KEY"
}

def fetch_payload():
r = requests.get(API_URL, params=PARAMS, headers=HEADERS, timeout=20)
r.raise_for_status()
payload = r.json()
if not payload or payload.get("success") is not True or "data" not in payload:
raise ValueError("Malformed FreightPulse envelope")
return payload

def normalize_for_ledger(payload):
data = payload["data"]
ts = data.get("timestamp")
src = data.get("source")
ccy = data.get("currency")
unit = data.get("unit")

gas = data.get("data", {}).get("gasoline", {})
hist = data.get("historical", {})

record = {
"as_of": ts, # keep the exact ISO timestamp
"source": src, # 'EIA (U.S. Energy Information Administration)'
"currency": ccy, # 'USD'
"unit": unit, # 'gallon'
# For gasoline, store only explicit fields present:
"gasoline_grades": gas.get("grades"),
"gasoline_rolling": {
"avg_30d": hist.get("gasoline_30d_avg"),
"avg_90d": hist.get("gasoline_90d_avg"),
"yoy_change": hist.get("gasoline_yoy_change"),
}
}

# No computed Rocky Mountain gasoline value; respect the catalog note.
return record

if __name__ == "__main__":
payload = fetch_payload()
record = normalize_for_ledger(payload)
print(json.dumps(record, indent=2))

Practical implementation notes that will save you an hour

Designing surcharge and accrual logic around the available fields

Because Rocky Mountain gasoline historical series are not officially published in the catalog, scope your model to use only what exists:

Validation checklist before you ship

FAQ

How do I access the API without a key while prototyping?

Guest access allows 100 requests per day per IP without sending X-API-Key. For repeatable finance tests and CI pipelines, register for a key to avoid quota surprises.

Can I use diesel Rocky Mountain values as a stand-in for gasoline?

No. Do not cross-apply diesel regional values to gasoline. Only use gasoline fields returned by the endpoint and label them exactly.

Where do I find the Rocky Mountain gasoline historical time series?

The catalog states that no official historical series is published for fuel_price_gasoline_rocky_mountain. Persist the current envelope and any rolling aggregates provided; do not fabricate a series.

Is the port congestion metric live?

No. FreightPulse port congestion references IMF PortWatch with a ~6–7 day lag and a 7-day average vs a 90-day baseline. It is not a live AIS wait-time feed.

What units and currency should I store for reconciliation?

USD per gallon, as specified by currency and unit fields in the envelope. Include both fields in your ledger notes for consistent reconciliation and downstream conversions.

Get an API key and start integrating

Register for an API key to move beyond guest limits and wire this into your finance stack. Read the field-by-field reference and production notes before deploying. Start here: Register and keep the spec handy: Documentation.