GeoJSON
This is not a dynamic API, but rather a static endpoint that serves a GeoJSON file directly from a GitHub repository. It is part of the datasets project by DataHub.io, which provides clean, ready-to-u
Overview
Provider: DataHub.io (via the
datasets
repository on GitHub).Purpose: To provide the polygonal geometries (borders) of all countries in the world in a single file.
Authentication: None required. It is a public file.
Data Format: GeoJSON.
Endpoint
The endpoint is simply the direct URL to the file. It does not accept parameters.
https://raw.githubusercontent.com/datasets/geo-countries/master/data/countries.geojson
Response Structure (GeoJSON)
The response is a GeoJSON object of type FeatureCollection
. Each feature
in the collection represents a country.
geometry
: An object of typePolygon
orMultiPolygon
that contains the coordinate arrays defining the country's borders.properties
: An object with the country's metadata.
Example of a country feature
(Mexico):
JSON
{
"type": "Feature",
"properties": {
"ADMIN": "Mexico",
"ISO_A3": "MEX"
},
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[-108.232537, 23.011831],
[-108.455623, 22.864332],
// ... many more coordinates defining the border ...
[-86.840332, 21.173841],
[-86.828859, 21.176465]
]
],
// ... other polygons for islands, etc. ...
]
}
}
Last updated