---
title: "Download a country dataset"
method: GET
path: "/download.php"
tags: ["Downloads"]
---

# Download a country dataset

`GET /download.php`

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.

## Query parameters

- `country` string, required
- `format` 'csv' | 'xlsx' | 'json', required
- `t` string, required

## Response `200`

Country dataset file in the requested format.

- PostalRecord[]
  - `country_code` string — ISO 3166-1 alpha-2 country code.
  - `postal_code` string — Postal identifier as text. It may contain leading zeroes, spaces, letters or punctuation.
  - `place_name` string
  - `admin_name1` string, nullable
  - `admin_name2` string, nullable
  - `admin_name3` string, nullable
  - `latitude` number, nullable — Approximate locality or area centroid, not a delivery-point coordinate.
  - `longitude` number, nullable — Approximate locality or area centroid, not a delivery-point coordinate.

## Other responses

- `403` — Invalid or missing token.

---

[API](https://skmtc.dev/postalcodes/apis/postalcodes-info-postal-code-reference-api.md) · [All operations](https://skmtc.dev/postalcodes/apis/postalcodes-info-postal-code-reference-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/postalcodes/postalcodes-info-postal-code-reference-api/revisions/d98a4c6d6ad6/schema)
