Title: OilPriceAPI Fuel Widgets
Author: Karl Waldman
Published: <strong>5. juli, 2026</strong>
Last modified: 19. juli, 2026

---

Søg plugins

![](https://ps.w.org/oilpriceapi-widgets/assets/banner-772x250.png?rev=3613705)

![](https://ps.w.org/oilpriceapi-widgets/assets/icon-256x256.png?rev=3597074)

# OilPriceAPI Fuel Widgets

 Af [Karl Waldman](https://profiles.wordpress.org/kwaldman/)

[Download](https://downloads.wordpress.org/plugin/oilpriceapi-widgets.1.1.1.zip)

 * [Detaljer](https://da.wordpress.org/plugins/oilpriceapi-widgets/#description)
 * [Vurderinger](https://da.wordpress.org/plugins/oilpriceapi-widgets/#reviews)
 *  [Installation](https://da.wordpress.org/plugins/oilpriceapi-widgets/#installation)
 * [Udvikling](https://da.wordpress.org/plugins/oilpriceapi-widgets/#developers)

 [Support](https://wordpress.org/support/plugin/oilpriceapi-widgets/)

## Beskrivelse

OilPriceAPI Fuel Widgets adds source-dated U.S. retail-fuel data to WordPress as
shortcodes or a Gutenberg block.

#### Fuel Price Ticker

National U.S. diesel and regular gasoline averages. Each result shows its EIA observation
week, weekly cadence, unit, and source.

#### U.S. Diesel Price

The national U.S. diesel retail average, quoted in USD per gallon and labeled with
its observation week.

#### Fuel Surcharge Calculator

Calculates the percentage by which the weekly national diesel average exceeds a 
base price configured by the site owner. It does not describe the result as an industry
standard or a contractual surcharge.

#### Features

 * Source date, weekly cadence, currency, unit, and EIA attribution in every successful
   widget
 * Dark and light themes
 * Shortcodes and Gutenberg block
 * Server-side requests with no remote executable code
 * One-hour validated cache
 * Last successful result for up to 48 hours after an error, visibly labeled as 
   a cached copy
 * Fail-closed handling for unavailable, rate-limited, timed-out, empty, or malformed
   responses
 * No API key required for the public EIA series

### External service

This plugin uses OilPriceAPI to retrieve the EIA retail-fuel series displayed by
the widgets.

The WordPress server sends a GET request to `https://www.oilpriceapi.com/api/widgets/
fuel-prices` at most once per hour while a page containing a widget is requested.
OilPriceAPI receives the site server’s IP address and standard HTTP request metadata.
The plugin does not send the visitor’s IP address, WordPress user data, page content,
or an API credential.

The underlying retail-fuel observations come from the [U.S. Energy Information Administration](https://www.eia.gov/petroleum/gasdiesel/)
and are public domain at the source. OilPriceAPI delivers and validates the response;
it does not grant rights in underlying data.

 * [OilPriceAPI privacy policy](https://www.oilpriceapi.com/privacy)
 * [OilPriceAPI terms](https://www.oilpriceapi.com/terms)
 * [OilPriceAPI service status](https://status.oilpriceapi.com/)

## Blokke

Dette plugin giver 1 blok.

 *   OilPriceAPI Widget Embed source-dated weekly U.S. fuel prices or a fuel surcharge
   calculator.

## Installation

 1. Upload the `oilpriceapi-widgets` folder to `/wp-content/plugins/`.
 2. Activate **OilPriceAPI Fuel Widgets** through the Plugins screen.
 3. Add an OilPriceAPI block or one of the shortcodes below to a page.

#### Quick Start

 * `[oilpriceapi_ticker]` – weekly national diesel and gasoline prices
 * `[oilpriceapi_diesel]` – weekly national diesel price
 * `[oilpriceapi_fuel_surcharge base_price="2.50"]` – percentage above the configured
   base

Configure default theme, fuels, and base price under **Settings > OilPriceAPI**.

## FAQ

### Do I need an API key?

No. These widgets use a public OilPriceAPI route restricted to two EIA public-domain
retail-fuel series.

### How current is the data?

EIA publishes these retail-fuel series weekly. Every successful widget shows the
source observation as `Week of` followed by a date and says `Updated weekly`.

### What happens if the service is unavailable?

The plugin can show its last successful response for up to 48 hours. That state 
is visibly labeled `Cached copy; service temporarily unavailable`. After 48 hours,
the price is removed and the widget links to the service status page.

### What does the plugin cache?

Only the validated fuel-price payload, its EIA source date, and the time it was 
retrieved. The fresh cache lasts one hour. The last-success cache lasts no more 
than 48 hours.

### Can I display crude oil or natural gas prices?

Not with this public widget. OilPriceAPI does not hold downstream display or redistribution
rights for the crude and natural-gas inputs previously shown by the ticker. Review
the [data-use guidance](https://www.oilpriceapi.com/docs/redistribution) before 
publishing API data to third parties.

### What happened to the carbon calculator and regional diesel display?

Version 1.1 retired the carbon calculator’s uncleared crude-price input and removed
unsupported regional diesel output. An existing carbon shortcode shows a retirement
notice instead of silently displaying a fabricated or uncleared value.

### Where can developers get programmatic access?

See the [API documentation](https://docs.oilpriceapi.com/) and the official [PHP SDK](https://packagist.org/packages/oilpriceapi/oilpriceapi).

## Anmeldelser

Der er ingen anmeldelser for denne widget.

## Bidragsydere & udviklere

“OilPriceAPI Fuel Widgets” er open source-software. Følgende personer har bidraget
til dette plugin.

Bidragsydere

 *   [ Karl Waldman ](https://profiles.wordpress.org/kwaldman/)
 *   [ oilpriceapi ](https://profiles.wordpress.org/oilpriceapi/)

[Oversæt “OilPriceAPI Fuel Widgets” til dit eget sprog.](https://translate.wordpress.org/projects/wp-plugins/oilpriceapi-widgets)

### Interesseret i udvikling?

[Gennemse koden](https://plugins.trac.wordpress.org/browser/oilpriceapi-widgets/),
tjek [SVN repository](https://plugins.svn.wordpress.org/oilpriceapi-widgets/), eller
abonner på [udviklerloggen](https://plugins.trac.wordpress.org/log/oilpriceapi-widgets/)
via [RSS](https://plugins.trac.wordpress.org/log/oilpriceapi-widgets/?limit=100&mode=stop_on_copy&format=rss).

## Ændringslog

#### 1.1.1

 * Matched the package folder and text domain to the approved WordPress.org directory
   slug `oilpriceapi-widgets`

#### 1.1.0

 * Replaced crude and natural-gas public display with allowlisted EIA diesel and
   gasoline series
 * Added visible source date, weekly cadence, unit, and EIA attribution
 * Moved rendering server-side and removed remote executable widget scripts
 * Added strict response validation and fail-closed recovery states
 * Added one-hour fresh caching and an explicitly labeled 48-hour last-success fallback
 * Retired the carbon widget’s uncleared crude-price dependency
 * Removed unsupported regional diesel output and unsupported marketing claims
 * Added deterministic failure-path tests and CI

#### 1.0.1

 * Confirmed WordPress compatibility and expanded directory documentation

#### 1.0.0

 * Initial plugin release

## Meta

 *  Version **1.1.1**
 *  Senest opdateret **5 timer siden**
 *  Aktive installationer **Færre end 10**
 *  WordPress-version ** 6.0 eller højere **
 *  Testet op til **7.0.2**
 *  PHP-version ** 7.4 eller højere **
 *  Sprog
 * [English (US)](https://wordpress.org/plugins/oilpriceapi-widgets/)
 * Tags
 * [fuel surcharge](https://da.wordpress.org/plugins/tags/fuel-surcharge/)[widget](https://da.wordpress.org/plugins/tags/widget/)
 *  [Avanceret visning](https://da.wordpress.org/plugins/oilpriceapi-widgets/advanced/)

## Bedømmelser

Der er endnu ikke indsendt nogen anmeldelser.

[Your review](https://wordpress.org/support/plugin/oilpriceapi-widgets/reviews/#new-post)

[Se alle anmeldelser.](https://wordpress.org/support/plugin/oilpriceapi-widgets/reviews/)

## Bidragsydere

 *   [ Karl Waldman ](https://profiles.wordpress.org/kwaldman/)
 *   [ oilpriceapi ](https://profiles.wordpress.org/oilpriceapi/)

## Support

Har du noget at sige? Har du brug for hjælp?

 [Vis supportforum](https://wordpress.org/support/plugin/oilpriceapi-widgets/)