I am looking for some API endpoints that return GeoJSON shapes for each nation. I am not interested in downloading shapefiles. I need some lightweight (not super accurate) nation shapes for every nation that I can call frequently to overlay on a map webapp.
1 Answer
Although not an API, there are hosts of GeoJSON with quite a small size, for example, 251 KB: https://github.com/johan/world.geo.json/blob/master/countries.geo.json
raw data: https://raw.githubusercontent.com/johan/world.geo.json/master/countries.geo.json
If you need a web service, you can turn any (geo)Json into an API endpoint (either local or hosted). Here's one library doing that, although for sure there are many others: https://github.com/Noznoc/geojson-api
-
1Another resource is the World Atlas (TopoJSON) github.com/topojson/world-atlas, particulary world.atlas.countries: github.com/topojson/world-atlas#world/110m.json_countries– philshemCommented Aug 27, 2019 at 7:43
-
2And another one, based on OpenStreetMap: wambachers-osm.website/boundaries– markusNCommented Dec 14, 2019 at 17:23