Spain — Country Data API
Spain's dataset includes all 17 autonomous communities, provinces, municipalities, and 5-digit postal codes for the entire country. Access Spanish geographic data through CountryDataAPI using ISO code 'ES'.
Country overview
Capital
Madrid
Currency
EUR
Euro
Languages
Spanish
Timezone
UTC+1 to UTC+2
What data is available for Spain?
The following geographic datasets are available for Spain via the REST API.
States & Provinces
All administrative subdivisions for Spain
Cities
All cities and localities in Spain
Zip / Postal Codes
Complete postal code dataset for Spain
API Request Example
Fetch Spain data using the ISO code ES as the query parameter.
Get country by code
GET https://api.countrydataapi.com/v1/countries/code?code=ES&apikey=YOUR_API_KEYcURL example
curl "https://api.countrydataapi.com/v1/states/country?country=Spain&apikey=YOUR_API_KEY"States & Provinces of Spain
Andalusia
Catalonia
Community of Madrid
Valencian Community
Galicia
Castile and León
Basque Country
Castile-La Mancha
Canary Islands
Region of Murcia
Aragon
Extremadura
Balearic Islands
Asturias
Navarre
Cantabria
La Rioja
More Countries in Europe
Compare plans and pricing: See CountryDataAPI pricing
Access Spain Data via API
Integrate Spain geographic data into your application today. Countries, states, cities, and zip codes in one API.