Have you ever found yourself in the situation of needing a geojson from the France divided by Regions?
Well, maybe not that specific case... but with this API you can replace France by the country of your choosing, and doing a simple API call you will have the solution that you need for your project.
You could need something more specific, like the state of New York divided by counties, same thing, one simple query will be enough.
A simple API to get any geometry(almost all) of the world. With RESTGIS you will be able to get a collection of geographic data(aka map) in different formats like Geojson, Topojson, SVG among others.
Access to the API is allowed by using an API KEY. You can get one after you register and create the request.
Authenticated requests must include a x-api-key header containing the API KEY that you requested.
Be sure to keep your API keys secure. Do not share them in publicly accessible areas such as GitHub, client-side code, and so forth.
Also note that all API requests must be made over HTTPS. Calls made over plain HTTP will attempt to be automatically upgraded to HTTPS, though this use cases is discouraged.
All endpoints will cache any request for 24 hours since the data will not likely change. The Expires header will let you know when the cache for that request will expire.
API requests may be rate limited depending on your subscription plan and traffic patterns.
The following response headers will be present in these cases:
x-ratelimit-limit
x-ratelimit-remaining
x-ratelimit-reset
When the rate limit is exceeded, an error is returned with the status "429 Too Many Requests":
{
"error": {
"code": "too_many_requests",
"message": "The request exceeded your daily limit rate.
You will have to wait for {number} seconds."
}
}
400 - BAD REQUEST
401 - UNAUTHORIZED
404 - NOT FOUND
500 - INTERNAL SERVER ERROR
All endpoints will have a mandatory pagination. The maximum items per page are 30.
You are able to navigate between pages. Every response will contain the following pagination headers:
page The current page number.
pageSize The size of the pagination that you are currently using, defaults to 30.
totalRecords The amount of records in all pages.
totalPages The amount of total pages, this is defined as totalRecords / pageSize.
You can change the pagination size and navigate through the pages by sending optional query params:
?page={page_number}&pageSize={page_size_number}
All endpoints provide a way to get more or less detailed versions of the same features by setting the optional resolution query parameter:
?resolution={resolution_number}
This value goes from 0.01 to 1. The default is 0.05.
This endpoint will retrieve a set of features according to the specified hierarchy path.
/v1/path/{admin_level_0}/{?admin_level_1}/{?admin_leve_2}/{?admin_leve_3}/...
/v1/path/United States Will retrieve the geometries for USA
/v1/path/United States/New York Will provide the geometries for New York
/v1/path/United States?admin_level=1 Will return all the states for USA
center: boolean
default: False
This parameter will let you get the contour of the feature or just the geographical center of it.
properties: Array
default: id,name,lat,lng,bounds
This parameter will let you enrich the properties parameter of a given geometry.
Available values:
id: Unique identifier
name: Geometry name (Country name, State/Provice name, etc)
full_name: Full concatenated name, for ex: New York, United States
lat: Latitude of the center of the geometry
lng: Longitude of the center of the geometry
bounds: Bounding box of the geometry in lat,lng
Only available for countries or administrative level zero:
admin_level: number
Also check Pagination, Resolution
{
"type": "FeatureCollection",
"features": [
...
{
"type": "Feature",
"geometry": { ... },
"properties": {
"id": "USA",
"name": "United States",
...
}
}
]
}
Status 400, 404, 500:
Status 401:
This endpoint will retrieve a set of features according to the specified name.
/v1/name/{name}
/v1/name/United States Will retrieve the geometries for USA
/v1/name/New York Will provide the geometries for New York
center: boolean
default: False
This parameter will let you get the contour of the feature or just the geographical center of it.
properties: Array
default: id,name,lat,lng,bounds
This parameter will let you enrich the properties parameter of a given geometry.
Available values:
id: Unique identifier
name: Geometry name (Country name, State/Provice name, etc)
full_name: Full concatenated name, for ex: New York, United States
lat: Latitude of the center of the geometry
lng: Longitude of the center of the geometry
bounds: Bounding box of the geometry in lat,lng
Only available for countries or administrative level zero:
admin_level: number
Also check Pagination, Resolution
{
"type": "FeatureCollection",
"features": [
...
{
"type": "Feature",
"geometry": { ... },
"properties": {
"id": "USA",
"name": "United States",
...
}
}
]
}
Status 400, 404, 500:
Status 401:
This endpoint will retrieve a set of features according to the specified lat-lng bounding box.
/v1/lat-lng/{lat_min}/{lat_max}/{lng_min}/{lng_max}/
/v1/lat-lng/0/90/-180/180 Will retrieve the admin_level_0 geometries (countries) for the northern emisphere.
center: boolean
default: False
This parameter will let you get the contour of the feature or just the geographical center of it.
properties: Array
default: id,name,lat,lng,bounds
This parameter will let you enrich the properties parameter of a given geometry.
Available values:
id: Unique identifier
name: Geometry name (Country name, State/Provice name, etc)
full_name: Full concatenated name, for ex: New York, United States
lat: Latitude of the center of the geometry
lng: Longitude of the center of the geometry
bounds: Bounding box of the geometry in lat,lng
Only available for countries or administrative level zero:
admin_level: number
Also check Pagination, Resolution
{
"type": "FeatureCollection",
"features": [
...
{
"type": "Feature",
"geometry": { ... },
"properties": {
"id": "USA",
"name": "United States",
...
}
}
]
}
Status 400, 404, 500:
Status 401:
This endpoint will retrieve a set of features according to the specified alpha2 code.
/v1/country/alpha2/{alpha2}
/v1/country/alpha2/US Will retrieve the geometries for United States
/v1/country/alpha2/ES Will provide the geometries for Spain
center: boolean
default: False
This parameter will let you get the contour of the feature or just the geographical center of it.
properties: Array
default: id,name,lat,lng,bounds
This parameter will let you enrich the properties parameter of a given geometry.
Available values:
id: Unique identifier
name: Geometry name (Country name, State/Provice name, etc)
full_name: Full concatenated name, for ex: New York, United States
lat: Latitude of the center of the geometry
lng: Longitude of the center of the geometry
bounds: Bounding box of the geometry in lat,lng
Only available for countries or administrative level zero:
admin_level: number
Also check Pagination, Resolution
{
"type": "FeatureCollection",
"features": [
...
{
"type": "Feature",
"geometry": { ... },
"properties": {
"id": "USA",
"name": "United States",
...
}
}
]
}
Status 400, 404, 500:
Status 401:
This endpoint will retrieve a set of features according to the specified alpha3 code.
/v1/country/alpha3/{alpha3}
/v1/country/alpha3/US Will retrieve the geometries for United States
/v1/country/alpha3/ESP Will provide the geometries for Spain
center: boolean
default: False
This parameter will let you get the contour of the feature or just the geographical center of it.
properties: Array
default: id,name,lat,lng,bounds
This parameter will let you enrich the properties parameter of a given geometry.
Available values:
id: Unique identifier
name: Geometry name (Country name, State/Provice name, etc)
full_name: Full concatenated name, for ex: New York, United States
lat: Latitude of the center of the geometry
lng: Longitude of the center of the geometry
bounds: Bounding box of the geometry in lat,lng
Only available for countries or administrative level zero:
admin_level: number
Also check Pagination, Resolution
{
"type": "FeatureCollection",
"features": [
...
{
"type": "Feature",
"geometry": { ... },
"properties": {
"id": "USA",
"name": "United States",
...
}
}
]
}
Status 400, 404, 500:
Status 401:
This endpoint will retrieve a set of features according to the specified region.
/v1/region/{region}
/v1/region/Europe Will retrieve the geometries for all the countries in Europe.
center: boolean
default: False
This parameter will let you get the contour of the feature or just the geographical center of it.
properties: Array
default: id,name,lat,lng,bounds
This parameter will let you enrich the properties parameter of a given geometry.
Available values:
id: Unique identifier
name: Geometry name (Country name, State/Provice name, etc)
full_name: Full concatenated name, for ex: New York, United States
lat: Latitude of the center of the geometry
lng: Longitude of the center of the geometry
bounds: Bounding box of the geometry in lat,lng
Only available for countries or administrative level zero:
admin_level: number
Also check Pagination, Resolution
{
"type": "FeatureCollection",
"features": [
...
{
"type": "Feature",
"geometry": { ... },
"properties": {
"id": "USA",
"name": "United States",
...
}
}
]
}
Status 400, 404, 500:
Status 401:
This endpoint will retrieve a set of features according to the specified subregion.
/v1/subregion/{subregion}
/v1/subregion/North America Will retrieve the geometries for all the countries in North America.
center: boolean
default: False
This parameter will let you get the contour of the feature or just the geographical center of it.
properties: Array
default: id,name,lat,lng,bounds
This parameter will let you enrich the properties parameter of a given geometry.
Available values:
id: Unique identifier
name: Geometry name (Country name, State/Provice name, etc)
full_name: Full concatenated name, for ex: New York, United States
lat: Latitude of the center of the geometry
lng: Longitude of the center of the geometry
bounds: Bounding box of the geometry in lat,lng
Only available for countries or administrative level zero:
Also check Pagination, Resolution
{
"type": "FeatureCollection",
"features": [
...
{
"type": "Feature",
"geometry": { ... },
"properties": {
"id": "USA",
"name": "United States",
...
}
}
]
}
Status 400, 404, 500:
Status 401:
This endpoint will retrieve a set of features according to the specified map.
/v1/custom-map/{mapId}
/v1/custom-map/65c958f9-8f4e-4322-bcf2-4a21b2ae45b3 Will retrieve the features for the specified map id.
Also check Pagination, Resolution
{
"type": "FeatureCollection",
"features": [
...
{
"type": "Feature",
"geometry": { ... },
"properties": {
"id": "USA",
"name": "United States",
...
}
}
]
}
Status 400, 404, 500:
Status 401: