List cities, optionally of one country
geography:readActive approved cities plus your company's own pending cities (pending: true). Paginated;
scope geography:read.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
country | query | string | Optional country: id, ISO code (e.g. |
page | query | integer (int32)Default: 1 | Page number, starting at 1. |
pageSize | query | integer (int32)Default: 25 | Items per page, 1 to 100 (larger values are clamped to 100). |
search | query | string | Optional text matched against the Arabic name, English name and city code. |
Request example
curl "https://api.goldrock.live/api/public/v1/geography/cities" \
-H "X-API-Key: lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "X-API-Secret: YOUR_API_SECRET"const response = await fetch("https://api.goldrock.live/api/public/v1/geography/cities", {
method: "GET",
headers: {
"X-API-Key": "lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"X-API-Secret": "YOUR_API_SECRET"
},
});
const data = await response.json();
console.log(response.status, data);<?php
$url = 'https://api.goldrock.live/api/public/v1/geography/cities';
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'X-API-Secret: YOUR_API_SECRET',
],
]);
$result = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
var_dump($status, json_decode($result, true));import requests
response = requests.request(
"GET",
"https://api.goldrock.live/api/public/v1/geography/cities",
headers={
"X-API-Key": "lmc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"X-API-Secret": "YOUR_API_SECRET",
},
timeout=30,
)
print(response.status_code, response.json())Samples use an API key; replace the placeholders. To use a bearer token instead, send Authorization: Bearer <accessToken>.
Responses
200A page of cities.
Responses · Field
| Field | Type | Description |
|---|---|---|
items | array<PublicCityDto>nullable | Items of the requested page. |
iditems[].id | string (uuid) | City id. |
nameAritems[].nameAr | stringnullable | Arabic name. |
nameEnitems[].nameEn | stringnullable | English name. |
codeitems[].code | stringnullable | City code (unique within its country), when defined. |
countryIditems[].countryId | string (uuid) | Id of the country the city belongs to. |
pendingitems[].pending | boolean | True for a city created by your company that the platform has not approved yet. |
page | integer (int32) | Current page number, starting at 1. |
pageSize | integer (int32) | Requested page size (1 to 100, default 25). |
totalCount | integer (int32) | Total number of items across all pages. |
totalPages | integer (int32) | Total number of pages. |
{
"page": 1,
"pageSize": 1,
"totalCount": 1,
"totalPages": 1
}| Status | Description |
|---|---|
400 | The request is invalid (code |
401 | Authentication is missing or invalid (code |
403 | The credential lacks the required scope, or the public API is disabled (codes |
422 | The country could not be resolved ( |
429 | Too many requests (code |
Error responses share one body, described in the error reference. Error reference