Get All Cities
Get a paginated list of all cities for a specific country. Public endpoint.
Endpoint
Authentication
Not required (public endpoint)
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id |
integer | Yes | Country ID |
page |
integer | Yes | Page number (starts at 1) |
count |
integer | Yes | Items per page (max 100) |
search |
string | No | Search by city name (case-insensitive) |
Response
Success (200 OK)
{
"count": 5,
"data": [
{
"id": 1,
"name": "Baku",
"country_id": 1,
"country": {
"id": 1,
"name": "Azerbaijan",
"created": "2025-01-15T10:30:00Z"
},
"created": "2025-01-15T10:30:00Z"
},
{
"id": 2,
"name": "Ganja",
"country_id": 1,
"country": {
"id": 1,
"name": "Azerbaijan",
"created": "2025-01-15T10:30:00Z"
},
"created": "2025-01-15T10:30:00Z"
}
]
}
Error Responses
Missing ID Parameter (400)
Pagination Error (400)
Example Request
Notes
- Only returns cities for the specified country
- Only returns non-deleted cities
- Search matches against city name
- Results are ordered by ID descending (newest first)
- This is a public endpoint, no authentication required