List locations
Endpoint
Section titled “Endpoint”GET /api/locationsReturns all Australian locations, including suburbs, postcodes, and states. The response is paginated due to the large number of locations.
Pagination
Section titled “Pagination”To retrieve a specific page of results, use the paginated endpoint:
GET /api/locations/page/{page}| Parameter | Type | Required | Description |
|---|---|---|---|
page | integer | No | Page number (starts at 1) |
Request
Section titled “Request”# Get the first page of locationscurl -X GET \ -H "Content-Type: application/json" \ https://www.transdirect.com.au/api/locations
# Get a specific pagecurl -X GET \ -H "Content-Type: application/json" \ https://www.transdirect.com.au/api/locations/page/5Response
Section titled “Response”A successful response returns a 200 status code with an array of location objects.
[ { "locality": "SYDNEY", "postcode": "2000", "state": "NSW" }, { "locality": "THE ROCKS", "postcode": "2000", "state": "NSW" }, { "locality": "DAWES POINT", "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) |