States
Get a list of supported states and territories for the FuelPrice API.
Use the states endpoint when you need a canonical list of Australian state identifiers before filtering other resources like cities, suburbs, or stations.
The state model
The state model contains the identifying information for an Australian state or territory returned by the API.
Properties
- Name
id- Type
- string
- Description
Unique identifier for the state. This is the slug used in the endpoint path.
- Name
name- Type
- string
- Description
Formatted state or territory name.
- Name
acronym- Type
- string
- Description
Short state code used throughout the API, such as
wa,qld, ornsw.
List all states
Retrieve all supported Australian states and territories.
This is useful when you want to populate filters or validate the state parameter used by other endpoints.
Request
curl https://api.fuelprice.io/v1/states \
-H "Authorization: Bearer {token}"
Response
{
"data": [
{
"id": "new-south-wales",
"name": "New South Wales",
"acronym": "nsw"
},
{
"id": "queensland",
"name": "Queensland",
"acronym": "qld"
},
{
"id": "western-australia",
"name": "Western Australia",
"acronym": "wa"
}
]
}
Retrieve a state
Retrieve a specific state or territory using its state slug.
Request
curl https://api.fuelprice.io/v1/states/western-australia \
-H "Authorization: Bearer {token}"
Response
{
"data": {
"id": "western-australia",
"name": "Western Australia",
"acronym": "wa"
}
}
