Oil price API: station price history
Station price historyEvery price change at one station.
PlansEvery plan
Cost1 call per request
ReturnsEvery change in the window
UpdatedLive
What it is for
Every price change at one station, oldest first: the fuel, the new price and when it changed.
fuel narrows it to one fuel; from and to set the window. How far back you can read depends on your plan.
Good for
- A station's price chart
- How often a station changes its prices
- A station's price on a past day
Parameters 1 in the path, 4 in the query
| Name | Where and type | Required | What it does | Example |
|---|---|---|---|---|
id | path string | required | Goes in the address itself. | fr-75056-0001 |
fuel | query string | optional | One fuel; leave out for all. | diesel |
from | query date | optional | First date, YYYY-MM-DD. | 2024-01-01 |
to | query date | optional | Last date, YYYY-MM-DD. | 2024-12-31 |
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 | |
price | number | The price in currency per unit | |
currency | string | Three letter currency code | |
changed_at | string | When the price changed |
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. |
| 404 | not_found | No record by that id | Check the code; the list endpoint gives every one that exists. |
| 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.