Morocco has 32,524 cities in the Geomelon dataset, one of the more densely covered countries in the API. The most populous is Casablanca in Casablanca-Settat, at 3,215,935 people. Query it by name, region, or coordinates, with translations in 11 languages.
Data updated: 2026-07-14
| City | Region | Population |
|---|---|---|
| Casablanca | Casablanca-Settat | 3,215,935 |
| Tangier | Tangier-Tetouan-Al Hoceima | 1,275,428 |
| Fez | Fès-Meknès | 1,167,842 |
| Marrakesh | Marrakesh-Safi | 1,002,697 |
| Salé | Rabat-Salé-Kénitra | 945,101 |
| Meknes | Fès-Meknès | 551,503 |
| Hay Hassani | Casablanca-Settat | 537,509 |
| Rabat | Rabat-Salé-Kénitra | 509,916 |
| Kenitra | Rabat-Salé-Kénitra | 507,736 |
| Oujda | Oriental | 506,224 |
GET /cities/search?countryCode=ma&sort=population_desc&limit=3
[
{
"id": "d9d9e46a-d123-40c1-9518-11c30fe938f8",
"name": "Casablanca",
"population": 3215935,
"countryName": "Morocco",
"countryCode": "MA",
"countryEmoji": "🇲🇦",
"regionName": "Casablanca-Settat"
},
{
"id": "e6ee687d-bcc9-49e8-ab23-79064b77831d",
"name": "Tangier",
"population": 1275428,
"countryName": "Morocco",
"countryCode": "MA",
"countryEmoji": "🇲🇦",
"regionName": "Tangier-Tetouan-Al Hoceima"
},
{
"id": "38171d9b-b3d9-4f55-8242-7f303e8e397b",
"name": "Fez",
"population": 1167842,
"countryName": "Morocco",
"countryCode": "MA",
"countryEmoji": "🇲🇦",
"regionName": "Fès-Meknès"
}
]curl --request GET \
--url 'https://geomelon.p.rapidapi.com/cities/search?countryCode=ma&sort=population_desc&limit=10' \
--header 'x-rapidapi-host: geomelon.p.rapidapi.com' \
--header 'x-rapidapi-key: YOUR_API_KEY'City names in Morocco are available in 11 languages.
Want the data offline? npm install @geomelon/morocco ships 32,554 Morocco cities, 12 regions and multilingual names, no API key. See the Morocco data package.
Geomelon currently has 32,524 cities in Morocco across 12 regions. Results are paginated, up to 100 per request.
Yes. RapidAPI's free tier covers a fixed number of requests per month with no credit card required. There is also a free, no-key city-autocomplete endpoint (the demo above) for prefix search.
Yes — city names in Morocco are available in 11 languages. Pass the languages you want via the preferredLanguages parameter, most-preferred first.
The main search and lookup endpoints require a free RapidAPI key. The prefix-search autocomplete endpoint used in the demo above is public and does not require a key.