Skip to main content

Get Cities

API operation: Open the endpoint in Scalar

Use GET /countries/{country}/cities to list the cities associated with one country. The operation is City.findAll.

Requests may use an API key or bearer token. Role levels 0 and 1 can access this operation; results are scoped to the specified country and support pagination, ordering, filters, and relation expansion. See Cities special request for relation names.

Legacy SDK example​

const response = await ordering.countries(countryId).cities().get()

The SDK helper name is cities(). SDK helpers can vary by version, so check the package and version you use.

OpenAPI reference​

Operation: GET /countries/{country}/cities

Path parameters

NameTypeRequiredDescription
countryintegerYes—

Query parameters

NameTypeRequiredDescription
paramsstringNoComma-separated list of fields. It is intersected with the model’s $fillable; an empty or invalid list returns all fields.
orderBystringNoField to sort by, with - prefixed for descending order. Multiple fields can be chained with commas.
wherestringNoJSON filter over the fields the model declares as filterable. Valid fields for each resource are exposed in its x-ordering-whereable schema extension.
pageintegerNoPage number, starting at 1. Applies only to lists that return a pagination block.
page_sizeintegerNoNumber of items per page.

Responses

CodeDescription
200OK (Envelope)
400Bad Request (ErrorResponse)
401Unauthorized
404Not Found
429Too Many Requests (ErrorResponse)
500Internal Server Error (ErrorResponse)
503Service Unavailable (ErrorResponse)
Open this operation in the API reference