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.
Two important constraints guide a clean integration:
- Use the exact envelope: {"success": true, "data": {...}} with ISO 8601 timestamps. Treat all monetary values as USD per gallon unless otherwise stated.
- Do not manufacture a “today” national figure or a synthetic regional value. Read only the fields present in the response. Where historical Rocky Mountain gasoline series are not officially published, retain the raw record as-is and annotate your UI accordingly.
Origin catalog facts you must implement exactly
- Auth: header X-API-Key: YOUR_API_KEY. Guest without key: 100 requests/day per IP.
- Envelope: {"success":true,"data":{...}}
- Port congestion is IMF PortWatch, lagged ~6-7 days, 7-day avg vs 90-day baseline — not live AIS.
- Do not quote a freight-rates USD fare as today’s price.
- Metric: Rocky Mountain Gasoline
- curl: curl -H "X-API-Key: YOUR_API_KEY" "https://freightpulsehq.com/api/v1/historical?metric=fuel_price_gasoline_rocky_mountain&period=30d"
- No official historical series is published for fuel_price_gasoline_rocky_mountain. Show the curl and series[].value. Do not reuse the diesel-national 5.257 fixture.
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.
- Live current fuel prices: GET https://freightpulsehq.com/api/v1/fuel-prices (uses header X-API-Key)
- Historical slice used for the Rocky Mountain Gasoline metric in this article: GET https://freightpulsehq.com/api/v1/historical?metric=fuel_price_gasoline_rocky_mountain&period=30d (uses header X-API-Key)
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:
- data.timestamp: ISO 8601 timestamp for the payload in UTC (+00:00). Cache-bust or version your records with this value.
- data.source: The provenance string; store alongside the value for audit (EIA).
- data.currency and data.unit: Confirms USD per gallon, which you must keep in your general ledger notes if you convert units later.
- data.data.gasoline.grades: Price levels by retail grade; use only if your surcharge model is grade-specific. Do not infer a regional gasoline value unless explicitly present.
- data.historical.gasoline_30d_avg and gasoline_90d_avg: Rolling averages that can stabilize accruals. If you present trend lines, label them clearly as rolling, not spot.
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:
- Use the documented endpoint and envelope exactly as shown.
- If a field for Rocky Mountain gasoline appears in your response in the future, read it directly; do not synthesize it from other regions or grades.
- When only aggregate gasoline fields (e.g., national averages, grades, rolling averages) are available, do not label them as Rocky Mountain values. Keep your UI language precise (e.g., “U.S. gasoline regular (EIA)” vs “Rocky Mountain gasoline”).
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
- Units and currency: All values in the shown envelope are USD per gallon. If your system stores per liter or another currency, convert explicitly and store the original value and conversion details for audit.
- Timestamps and timezone: Use data.timestamp as your “as of” key. The sample shows +00:00 (UTC). Do not reinterpret or shift this timestamp when displaying regional times.
- Caching and refresh cadence: EIA fuel updates are weekly. Daily polling is safe; use ETag/If-Modified-Since if available in your stack, or memoize by date boundary to avoid blowing the guest 100 req/day/IP quota.
- Envelope stability: Always check payload.success and existence of payload.data before dereferencing child fields. Missing fields should be treated as unknown, not zero or prior value forward-filled.
- Historical coverage: The catalog states no official historical series is published for fuel_price_gasoline_rocky_mountain. Your code should tolerate empty or non-regional historical structures and fall back to displaying only present aggregates (e.g., gasoline_30d_avg) with accurate labels.
- Port congestion fields: If you also consume congestion metrics alongside fuel in your finance UI, remember FreightPulse uses IMF PortWatch with a ~6–7 day lag and a 7-day average vs 90-day baseline. It is not live AIS. Keep labels explicit to avoid misinterpretation in cost forecasts.
- Pagination: The example does not show pagination; design your client to process the entire envelope as returned. If the documentation later introduces pagination for longer periods, handle next links conservatively and persist each page’s timestamped block.
- Error handling: Distinguish HTTP errors (429/5xx) from semantic envelope errors (success=false). For finance jobs, write both to an operations log and retry with exponential backoff for transient network issues.
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:
- For a Rocky Mountain gasoline surcharge, retrieve the endpoint and store the full envelope. If a Rocky Mountain gasoline field is absent, surface “Not published” for that region in the UI rather than substituting national or another region.
- For trend context in finance reports, use the provided gasoline_30d_avg and gasoline_90d_avg with clear labels like “U.S. gasoline 30-day average (EIA)”. Do not relabel these aggregates as Rocky Mountain.
- If your policy requires a fallback value, make it a business rule outside the API layer (e.g., “If Rocky Mountain gasoline is not published, surcharge defaults to contract Clause X”). Keep that rule documented and auditable.
Validation checklist before you ship
- Auth header present: X-API-Key with YOUR_API_KEY in non-guest environments.
- Guest mode respected: Maximum 100 requests/day per IP without a key. Implement a request budget per process.
- Envelope checks: success === true, data exists, timestamp parsed safely.
- No inferred values: You do not compute Rocky Mountain gasoline from other regions or grades.
- Labeling: UI labels match the actual fields (e.g., “gasoline regular” vs “Rocky Mountain gasoline”).
- Units and currency: All persisted values denote USD per gallon (note conversions elsewhere if applied).
- Audit provenance: Store data.source and data.timestamp with each record.
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.