🇲🇦 Cities in Morocco — API & JSON data

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

Live demo

Type to search Morocco cities…

Top 10 cities by population

CityRegionPopulation
CasablancaCasablanca-Settat3,215,935
TangierTangier-Tetouan-Al Hoceima1,275,428
FezFès-Meknès1,167,842
MarrakeshMarrakesh-Safi1,002,697
SaléRabat-Salé-Kénitra945,101
MeknesFès-Meknès551,503
Hay HassaniCasablanca-Settat537,509
RabatRabat-Salé-Kénitra509,916
KenitraRabat-Salé-Kénitra507,736
OujdaOriental506,224

Sample API response

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"
  }
]

Try it

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'

Multilingual city names

City names in Morocco are available in 11 languages.

Free dataset

Prefer a static file? Download 5,000 Morocco cities as JSON (748 KB, no API key) from the Morocco cities dataset page.

FAQ

How many cities in Morocco does the API return?

Geomelon currently has 32,524 cities in Morocco across 12 regions. Results are paginated, up to 100 per request.

Is there a free tier?

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.

Can I get Morocco city names in other languages?

Yes — city names in Morocco are available in 11 languages. Pass the languages you want via the preferredLanguages parameter, most-preferred first.

Do I need an API key?

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.

Try free on RapidAPI

Related