Oil price API: get a station
Get a stationOne station and every price it shows.
PlansEvery plan
Cost1 call per request
ReturnsOne station
UpdatedLive
What it is for
One station by its id: name, brand, address, location and every price it shows now, each with the time it last changed.
Station ids never change, so they are safe to store and come back to.
Good for
- A station page
- Refreshing a saved station's prices
- Updating one marker on a map
Parameters 1 in the path, 1 in the query
| Name | Where and type | Required | What it does | Example |
|---|---|---|---|---|
id | path string | required | Goes in the address itself. | fr-75056-0001 |
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 |
|---|---|---|---|
id | string | Our id for the station; it never changes | |
brand | string | The brand, or the name when there is none | |
name | string | Our name for it | |
address | string | Street address | |
city | string | Town or city | |
country | string | Two letter country code | |
lat | number | Latitude | |
lon | number | Longitude | |
prices | array | Each fuel: price, currency, unit, changed_at and stale |
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.
Related
Find stationsStations near a point, or in a country, town or brand, with their prices.GET /v1/stationsStation price historyEvery price change at one station.GET /v1/stations/{id}/historyCheapest fuel near a userThe five cheapest diesel stations within 3 km of a point, with how fresh each price is.Recipe