Automate fuel surcharge inputs for freight, shipping & logistics software
Use current gasoline and diesel price inputs in your CRM, quoting tool, spreadsheet, or internal dashboard — without maintaining scrapers. Start with a widget, then move to API-backed surcharge logic when you need full control.
Free trial · no credit card required
Just need to run the numbers? Try the free interactive fuel surcharge calculator — prefilled with the latest weekly DOE diesel price.
The clean v1 surcharge workflow
National default, optional US state override, cached calculation. Your pricing logic stays in your app — we just supply the fuel input.
1. National default
Pull the US national gasoline and diesel averages once per day as your baseline surcharge input.
2. State override
Pull state-specific codes only for the US states your customers configure, by two-letter state code.
3. Cache & calculate
Store the value and timestamp, then let your customers add their own buffer / multiplier rules. Move daily → hourly only if needed.
Example API calls
National defaults
GET /v1/prices/latest?by_code=GASOLINE_RETAIL_USD,DIESEL_RETAIL_USDState override (e.g. California)
GET /v1/prices/latest?by_code=GASOLINE_RETAIL_STATE_CA_USD,DIESEL_RETAIL_STATE_CA_USDCode mapping
- gasoline, no state → GASOLINE_RETAIL_USD
- diesel, no state → DIESEL_RETAIL_USD
- gasoline, state=XX → GASOLINE_RETAIL_STATE_XX_USD
- diesel, state=XX → DIESEL_RETAIL_STATE_XX_USD
Best-fit use cases
What this is — and is not
How to think about it: OilPriceAPI is a data-pulling / API service. Public redistribution, display, and benchmark licensing rights are not transferred, and cannot be: we hold none, so no agreement with us at any tier could convey them. The fuel-surcharge workflow uses current/latest retail fuel values as an input inside your own application.
Implementation checklist
- Pull national gasoline/diesel once per day.
- Pull state-specific codes only for states your customers configure.
- Store the value and timestamp.
- Use the cached value inside your surcharge logic.
- Let end customers add buffer / multiplier rules.
- Move from daily to hourly only if necessary.