Reference expansion
Keep references compact or expand selected fields into named objects.
By default, brand is one integer, siteFeatures is an array of integers, and restrictions is an array of integers or null. Each price.products value is a number in Australian cents per litre. Expansion adds names to selected fields. See the complete code tables.
Choose fields
| Request | Brand | Features | Restrictions | Product prices |
|---|---|---|---|---|
No expand | Code | Codes | Codes or null | Numbers |
expand=brand | Object | Codes | Codes or null | Numbers |
expand=siteFeatures,restrictions | Code | Objects | Objects or null | Numbers |
expand=product | Code | Codes | Codes or null | Named amounts |
expand=all | Object | Objects | Objects or null | Named amounts |
Names and values are case-insensitive: ExPaNd=BRAND,siteFEATURES works. Whitespace is trimmed and repeated members deduplicated. all,brand is equivalent to all. An empty value, unknown field, empty member or repeated expand parameter returns 400. filter[expand] is unsupported.
Both examples are complete responses captured for the same Costco Perth Airport selection. Compare them with the compact and expanded station responses. Expansion changes only the selected reference representations; it does not remove the price, address, opening hours or enrichment information.
Expand product prices
Use the singular expand=product to turn each price value into { name, amount }. The outer key remains the product code, and amount remains Australian cents per litre. For example, 218.7 means AUD 2.187/L in both representations. Names come from the product code table, including Unleaded Petrol for code 1.
{
"price": {
"asAt": "2026-09-30T06:00:00.000+08:00",
"products": {
"1": { "name": "Unleaded Petrol", "amount": 218.7 },
"6": { "name": "Premium Unleaded 98", "amount": 242.7 },
"11": { "name": "Brand Diesel", "amount": 264.7 }
}
}
}The excerpt and complete example below preserve the real prices and station details in the compact Costco production capture. Only the product representation is derived locally; this is labelled separately from captured HTTP responses.
Product names with unchanged prices and enrichment
Derived from production data captured 2026-09-30T11:42:42.955+08:00 (AWST). Product values expanded locally; this is not a captured production response.
curl 'https://fuelwatch.oss.bhodges.me/v1?brand=32&suburb=PERTH%20AIRPORT&surrounding=no&expand=product' \
-H 'Accept: application/vnd.api+json'{
"jsonapi": {
"version": "1.1"
},
"meta": {
"source": "fuelwatch.wa.gov.au",
"products": [
1,
2,
4,
5,
6,
10,
11
],
"sourceDate": "2026-09-30",
"fetchedAt": "2026-09-30T11:00:52.278+08:00",
"validFrom": "2026-09-30T06:00:00.000+08:00",
"validUntil": "2026-10-01T06:00:00.000+08:00",
"publicationStatus": "available",
"copyright": "Copyright 2025 Department of Local Government, Industry Regulation and Safety (source data); Copyright 2026 Bradley Hodges (api). All rights reserved.",
"documentation": "https://docs.fuelwatch.oss.bhodges.me",
"issues": "https://github.com/bradleyhodges/fuelwatch-api/issues",
"version": "4.30.1"
},
"data": [
{
"type": "serviceStation",
"id": "2026-09-30:dca78516464d85042c12eab0fd45d71665adc32b578908bc8444f29201d02ba7",
"attributes": {
"name": "Costco Perth Airport",
"tradingName": "Costco Perth Airport",
"brand": 32,
"price": {
"asAt": "2026-09-30T06:00:00.000+08:00",
"products": {
"1": {
"name": "Unleaded Petrol",
"amount": 218.7
},
"6": {
"name": "Premium Unleaded 98",
"amount": 242.7
},
"11": {
"name": "Brand Diesel",
"amount": 264.7
}
}
},
"address": {
"street": "142 Dunreath Dr",
"suburb": "PERTH AIRPORT",
"state": "WA",
"postcode": "6105"
},
"is24Hours": false,
"phone": "+61893114700",
"latitude": -31.940377,
"longitude": 115.951869,
"siteFeatures": [
8,
1,
2
],
"restrictions": [
3
],
"enrichment": {
"provider": "Google Maps",
"placeId": "ChIJw1UkrSm5MioRiEMGrwrsOUI",
"fetchedAt": "2026-09-29T18:36:18.295+08:00",
"stale": false,
"fields": [
"address.postcode",
"siteFeatures"
],
"googleMapsUri": "https://www.google.com/maps/search/?api=1&query=Costco%20Perth%20Airport&query_place_id=ChIJw1UkrSm5MioRiEMGrwrsOUI",
"attributions": []
},
"openHours": {
"Monday": "06:00-21:30",
"Tuesday": "06:00-21:30",
"Wednesday": "06:00-21:30",
"Thursday": "06:00-21:30",
"Friday": "06:00-21:30",
"Saturday": "06:00-19:30",
"Sunday": "07:00-19:00"
}
}
}
]
}The product filter chooses which fuels to return; expand=product only changes how those selected prices are represented. Combine them as ?product=1,4&expand=product, or expand a brand too with ?product=1,4&expand=brand,product. A station still omits unavailable products. Expansion never adds missing prices or changes price.asAt.
expand=all includes product prices as well as brand, features and restrictions. Read products["1"].amount for expanded prices. To retain numeric prices while naming station references, use expand=brand,siteFeatures,restrictions.
Missing and unknown information
Empty features stay [], and no known restrictions stays null even with expand=all. These values do not prove a facility or restriction is absent.
An unmapped source brand uses code 0 and preserves its name in sourceNotes.brand. When expanded, code 0 retains that source name and uses the generic logo. Independent remains code 15.
Unrecognized source feature/restriction text is retained in sourceNotes; it never receives a guessed code. Reference codes must not be recycled or renumbered.
Cache behavior
Expansion changes the response body, ETag and rendered cache entry. It preserves station IDs, selected products and original fetch time. Equivalent expansion sets share a cache entry. It does not perform extra RSS or Google lookups and does not create separate D1 price snapshots.
Expansion applies only to /v1. /legacy retains string fields and rejects expand. Addresses and enrichment retain their documented shape.