The Geoconnect API allows you to access our large collection of organized "districts". There are different levels to each district: Admin0 represents a country, (e.g. "Sudan"). Admin1 is a region within that country(e.g. "Red Sea"). Admin2 is a district within that region (e.g. "Port Sudan"), and Admin3 is a sub-district of that district (e.g. "Al Shargi").
The API returns a JSON object that looks like this:
admin1: "Red Sea",
admin2: "Port Sudan",
admin3: "Al Shargi"
To gain access to our API, simply request a key. Once we receive your request a unique key will be generated and sent to you via email. This key is yours, and you should take care to keep it private. Once you have your key, you can pass it as a URL string query by setting it as the value to the parameter
:api_key to begin consuming the API.
Passing your key as the only URL query, as in the example above, will return active districts from the database. There are more parameters available, and the different URL queries can be chained together to further filter, sort and even control how many results are fetched from the database at a time. Read on to learn more about these functionalities.
Results can be filtered by name according to the different levels discussed in the overview (
admin3_id). To filter, pass one of the levels as a URL string query and set the value of the parameter to the specific name you are looking for. The query is not case-sensitive, however to avoid returning wildcard results spelling must be exact. This filtering string query will follow your api key. Make sure to separate different queries with an & symbol.
The results are sorted alphabetically by name according to the highest filtered level. The above example would return districts of Sudan, sorted by their respective admin1 name. To organize by a different level, simply pass the level as the value to the
By default, the API returns the results in ascending alphabetical order. To return the results in a descending alphabetical order you can use the
parameter with the value set to
By default the API will return 50 results from the database at a time per page. 50 results is also the maximum amount of results per page that you can receive at a time, 0 being the least. in order to specify how many results per page pass the
:page_size parameter with the value set to the number of results desired as a query string.
Navigating the pagination is very simple as well. Just set the page number as the value to the
The GeoJSON API provides encoded geographic data for each country in the form of
Feature objects commonly used by geospatial applications.
You can request GeoJSON for a single country, set of, or all countries. Please reference a GeoJSON repository to obtain the proper
geojson_id needed as a parameter when requesting a single or set of countries. For example, the
geojson_id for Kiribati is "KIR".
GET All Countries
GET Set of Countries
GET Single Country
The successful API request will return an array of GeoJSON
Feature object(s) for the requested country or countries that looks like this: