FuelWatch API

Getting started

Make your first request and read a station's published prices.

Request a selection

GET
/v1

Product 1 is unleaded petrol. This request selects Costco in Perth Airport so the complete response is easy to inspect. The default day is the current Perth calendar date. Remove brand, suburb and surrounding to request all stations selling this product.

Note

Before 06:00 AWST, yesterday's price period is still in effect. Use day=yesterday for currently effective prices at that time. See price periods.

Read the document

The collection is data. Station fields live under attributes, and attributes.price.products maps product IDs to cents per litre by default. JSON object keys are strings: use products["1"], not a property named unleaded. With expand=product or expand=all, each value becomes { name, amount }; read products["1"].amount for the price.

The response above was captured from production, with every field retained. It includes a real phone number, opening hours, a membership restriction and enrichment provenance. Its dates and prices are a historical snapshot; rerunning the command returns the current selection.

Check meta.sourceDate, validFrom, validUntil and publicationStatus before treating prices as currently effective. A successful request can have an empty data array.

Use a native HTTP client

Read and compare a product

This JavaScript example uses the built-in fetch API. It handles HTTP failures and excludes stations without the requested product before sorting locally.

Important

Brand, feature and restriction values are numeric codes by default. Use expansion if your application needs labels.

Persist the last valid snapshot and its ETag if the application must survive network outages. A failure must not turn an old quote into a newly fetched one. See conditional requests and error handling.

On this page