Skip to content

Search locations

GET /api/locations/search

Searches for Australian locations matching a query string. You can search by suburb name, postcode, or a combination of both.

ParameterTypeRequiredDescription
qstringYesSearch query (suburb name, postcode, or partial match)
Terminal window
# Search by suburb name
curl -X GET \
-H "Content-Type: application/json" \
"https://www.transdirect.com.au/api/locations/search?q=melbourne"
# Search by postcode
curl -X GET \
-H "Content-Type: application/json" \
"https://www.transdirect.com.au/api/locations/search?q=3000"

A successful response returns a 200 status code with an array of matching location objects.

[
{
"locality": "MELBOURNE",
"postcode": "3000",
"state": "VIC"
},
{
"locality": "MELBOURNE AIRPORT",
"postcode": "3045",
"state": "VIC"
},
{
"locality": "EAST MELBOURNE",
"postcode": "3002",
"state": "VIC"
},
{
"locality": "NORTH MELBOURNE",
"postcode": "3051",
"state": "VIC"
},
{
"locality": "SOUTH MELBOURNE",
"postcode": "3205",
"state": "VIC"
},
{
"locality": "WEST MELBOURNE",
"postcode": "3003",
"state": "VIC"
}
]
FieldTypeDescription
localitystringSuburb or locality name
postcodestringFour-digit Australian postcode
statestringState or territory abbreviation (e.g. NSW, VIC, QLD, SA, WA, TAS, NT, ACT)