Get locations by postcode
Endpoint
Section titled “Endpoint”GET /api/locations/postcode/{postCode}Returns all suburbs associated with a specific Australian postcode. A single postcode can cover multiple suburbs.
Path parameters
Section titled “Path parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
postCode | string | Yes | A four-digit Australian postcode |
Request
Section titled “Request”curl -X GET \ -H "Content-Type: application/json" \ https://www.transdirect.com.au/api/locations/postcode/2000Response
Section titled “Response”A successful response returns a 200 status code with an array of location objects for the given postcode.
[ { "locality": "BARANGAROO", "postcode": "2000", "state": "NSW" }, { "locality": "DAWES POINT", "postcode": "2000", "state": "NSW" }, { "locality": "HAYMARKET", "postcode": "2000", "state": "NSW" }, { "locality": "MILLERS POINT", "postcode": "2000", "state": "NSW" }, { "locality": "SYDNEY", "postcode": "2000", "state": "NSW" }, { "locality": "SYDNEY SOUTH", "postcode": "2000", "state": "NSW" }, { "locality": "THE ROCKS", "postcode": "2000", "state": "NSW" }]Response fields
Section titled “Response fields”| Field | Type | Description |
|---|---|---|
locality | string | Suburb or locality name |
postcode | string | Four-digit Australian postcode |
state | string | State or territory abbreviation (e.g. NSW, VIC, QLD, SA, WA, TAS, NT, ACT) |
Error responses
Section titled “Error responses”| Status code | Meaning |
|---|---|
404 | Not found — the postcode does not exist |