Madrid, Spain — City Data API
Country: ES Community of Madrid (MD) Pop: 3.3 million
Madrid is a city in Spain (ES), Community of Madrid (MD). Get Madrid geographic data, postal codes and location info via the Country Data API REST endpoints. Query by country code 'ES' and state code 'MD' to retrieve Madrid data. Free to start, JSON, plans from $9.99/mo.
Madrid location data via REST API
Use country code ES and state code MD to query cities and zip codes that include Madrid.
All cities of Spain
List every city in Spain
Cities in Community of Madrid
List every city in Community of Madrid, Spain
Zip codes in Spain
Postal code dataset for Spain
API Request Example
Fetch cities in Spain (ES) — your response will include Madrid.
Cities by country
GET https://api.countrydataapi.com/v1/cities/by-country?country=ESAuthorization: Bearer YOUR_API_KEY
cURL example
curl "https://api.countrydataapi.com/v1/cities/by-country?country=ES" -H "Authorization: Bearer YOUR_KEY"More cities in Spain
Access Madrid data via API
Integrate Madrid (Spain) into your application. One API for all countries, states, cities and zip codes.

