Documentation

API documentation

Access boundary metadata and download links over HTTP. Select a version and view examples for Python and R. No API key is required.

Choose an API version

Current follows the most recent versioned release of geoBoundaries; nightly follows the latest published build with all recent data.

Loading version availability…

Build an API request

The API returns a JSON object for a single boundary, or a list for queries using ALL. The response includes source information, the year represented, and links to boundary files. Open a download URL to retrieve the geometry.

Use an ISO-3 code, such as USA, KEN, or GBR. Use ALL to query every country.

https://www.geoboundaries.org/api/current/gbOpen/USA/ADM1/

Install requests for Python or jsonlite for R before running these examples.

Python

import requests

url = "https://www.geoboundaries.org/api/current/gbOpen/USA/ADM1/"
response = requests.get(url, timeout=30)
response.raise_for_status()
boundary = response.json()
print(boundary["gjDownloadURL"])

R

library(jsonlite)

url <- "https://www.geoboundaries.org/api/current/gbOpen/USA/ADM1/"
boundary <- fromJSON(url, simplifyVector = FALSE)
print(boundary[["gjDownloadURL"]])

Examples follow the selected API version. Single-boundary requests return an object; ALL queries return a list. Queries with no matches return HTTP 404.

Endpoint format

https://www.geoboundaries.org/api/[VERSION]/gbOpen/[ISO-3]/[ADM-LEVEL]/

Levels run from ADM0 (country boundaries) to ADM5 (more local subdivisions). Coverage varies by country. Use ALL in place of the ISO code or level to list available boundaries.

Response fields

Presence counts show how many boundary records include a field in this version. Values may be empty. Download fields link to geometry; the response itself contains metadata. Fields marked single-boundary only are omitted from ALL responses.

Element Presence Definition Example
boundaryID Loading… The ID for this layer, which is a combination of the ISO code, the boundary type, and a unique identifier for the boundary generated based on the input metadata and geometry. This only changes if the underlying data changes "ALB-ADM0-26141361"
boundaryName Loading… The name of the country the layer represents "Albania"
boundaryISO Loading… ISO-3166-1 (Alpha 3) code for the country "ALB"
boundaryYearRepresented Loading… The year, or range of years in "[START] to [END]" format, which the boundary layers represent "2021" or "1995 to 2021"
boundaryType Loading… The type of boundary "ADM1"
boundaryCanonical Loading… The canonical name of a given boundary "Qarqet"
boundarySource Loading… A comma-separated list of the primary sources for the boundary "OCHA ROSEA, South African Municipal Demarcation Board"
boundaryLicense Loading… The original license that the dataset was released under by the primary source "Creative Commons Attribution 3.0 Intergovernmental Organisations (CC BY 3.0 IGO)"
licenseDetail Loading… Any notes regarding the license. "License was confirmed by two parties and the official website provided in the metadata."
licenseSource Loading… The URL of the primary source. "data.humdata.org/dataset/south-africa-admin-level-1-boundaries"
sourceDataUpdateDate Loading… The date the source information was integrated into the geoBoundaries repository. "Wed Jun 9 14:10:43 2021"
buildDate Loading… The date the source data was most recently standardized and built into a geoBoundaries release. "Jan 05, 2023"
Continent Loading… The continent the country is associated with. "Africa"
UNSDG-region Loading… The United Nations Sustainable Development Goals (SDG) region the country is associated with. "Sub-Saharan Africa"
UNSDG-subregion Loading… The United Nations Sustainable Development Goals (SDG) subregion the country is associated with. "Southern Africa"
worldBankIncomeGroup Loading… The World Bank income group the country is associated with. "Upper-middle-income Countries"
admUnitCount Loading… Count of administrative units in the file. "1"
meanVertices Loading… Mean number of vertices defining the boundaries of each administrative unit in the layer. "282824.0"
minVertices Loading… Minimum number of vertices defining a boundary. "18365"
maxVertices Loading… Maximum number of vertices defining a boundary. "38176456"
minPerimeterLengthKM Loading… The minimum perimeter length of an administrative unit in the layer, measured in kilometers (based on a World Equidistant Cylindrical projection). "180.5741729203648"
meanPerimeterLengthKM Loading… The mean perimeter length of all administrative units in the layer, measured in kilometers (based on a World Equidistant Cylindrical projection). "540.32156874946843"
maxPerimeterLengthKM Loading… The maximum perimeter length of an administrative unit in the layer, measured in kilometers (based on a World Equidistant Cylindrical projection). "1584.804735999137"
meanAreaSqKM Loading… The mean area of all administrative units in the layer, measured in square kilometers (based on a EASE-GRID 2 projection). "5731.517972980774"
minAreaSqKM Loading… The minimum area of an administrative unit in the layer, measured in square kilometers (based on a EASE-GRID 2 projection). "545.4813798711891"
maxAreaSqKM Loading… The maximum area of an administrative unit in the layer, measured in square kilometers (based on a EASE-GRID 2 projection). "44231.22640471353"
staticDownloadLink Loading… The static download link for the aggregate zip file containing all boundary information.
gjDownloadURL Loading… The static download link for the geoJSON.
tjDownloadURL Loading… The static download link for the topoJSON.
imagePreview Loading… The static download link for the automatically rendered PNG of the layer.
simplifiedGeometryGeoJSON Loading… The static download link for the simplified geoJSON.

Archived releases

Every published numbered release is listed below, including file-only archives. Select a version to see its coverage, formats, and boundary changes. Use a numbered release for reproducible work.

Loading published versions…

Release Date Single-country CGAZ

Availability is read from the published catalog. New numbered releases appear here automatically after publication.