Oil price API: government set prices
Government set pricesPrices a government has fixed, as each level took effect.
PlansEvery plan
Cost1 call per request
ReturnsEvery fuel in one call
UpdatedWhen a new level is set
What it is for
Where a government or regulator fixes fuel prices: the level in force, the day it took effect, the level before and the change.
Some countries set prices by town or zone; region picks one. date gives the prices in force on any past day.
Good for
- Alerts when a set price changes
- Showing what changed this month
- Prices by zone
- The price in force on a past date
set_pricesParameters 4 in the query
| Name | Where and type | Required | What it does | Example |
|---|---|---|---|---|
country | query country | required | Two letter country code, such as fr, gb or ke. | hr |
region | query string | optional | A town or zone, where prices are set by place; leave out for the national price or the fullest record. | |
date | query date | optional | The prices in force on this date; leave out for now. | 2025-01-01 |
currency | query ISO 4217 | optional | Convert every price to this currency on its own day, such as usd. | usd |
Try it runs against the live API with your key
No key yet? Get a free one; it is saved in this browser for every page.
The answer 200, application/json
| Field | Type | What it holds | Example |
|---|---|---|---|
fuel | string | Fuel code; see Fuels and units | "diesel_blue" |
price | number | The price in currency per unit | 1.38 |
currency | string | Three letter currency code | "EUR" |
unit | string | litre, gallon or barrel | "litre" |
effective_from | string | The day the price took effect | "2026-10-01" |
previous | number | The level before it | 0.84 |
change | number | price minus previous | 0.54 |
Example answer real, from what we hold now; long lists cut to three
GET /v1/prices/set?country=hr{ "data": [ { "fuel": "diesel_blue", "price": 1.38, "currency": "EUR", "unit": "litre", "effective_from": "2026-10-01", "previous": 0.84, "change": 0.54 } ], "meta": { "count": 1, "as_of": "2026-10-29", "region": null } }
Errors every error has the same shape
| HTTP | Code | When | What to do |
|---|---|---|---|
| 401 | unauthorized | No key, or not a valid one | Send your key in the X-API-Key header; your account page shows it. |
| 400 | bad_request | A value is wrong or a required one is missing | The message names the parameter and the form it takes. |
| 422 | unknown_parameter | A parameter this endpoint does not take | Take it out; the parameters this endpoint takes are listed above. |
| 429 | rate_limited | Too many calls this minute | Wait the seconds in the Retry-After header, then call again. |
| 429 | quota_exceeded | Today's calls are used up | Wait for the day to reset at midnight UTC, or move to a larger plan. |
Dates and times are UTC. A point's date is the day its price took effect, or the first day of its week or month for weekly and monthly series. Conversions use each day's own rate, so a converted series moves with both the price and the exchange rate.