v1

latestOpenAPI 3.1.0Open Database License 1.02026-07-135311.1 KB
Downloads

Download a country dataset

Downloads one country dataset as CSV, XLSX or JSON after a same-origin token has been minted. Store postal codes as text; do not convert them to integers.

get/download.php

Query parameters

countrystring required
Example:es

ISO 3166-1 alpha-2 country code.

format'csv' | 'xlsx' | 'json' required

Export format.

tstring required

Download token from /download-token.php.

Response

Country dataset file in the requested format.

country_codestring

ISO 3166-1 alpha-2 country code.

postal_codestring

Postal identifier as text. It may contain leading zeroes, spaces, letters or punctuation.

place_namestring
admin_name1string nullable
admin_name2string nullable
admin_name3string nullable
latitudenumber nullable

Approximate locality or area centroid, not a delivery-point coordinate.

longitudenumber nullable

Approximate locality or area centroid, not a delivery-point coordinate.

Example response

[
  {
    "country_code": "ES"
  }
]