Geocoding

Getting Started

Geocoding is the process of finding locations that match a user's search query or interest on the map.

The Gebeta Geocoding API does two things: forward geocoding and reverse geocoding:

  • Forward geocoding converts location text into geographic coordinates, turning Bole Road into 38.7578,9.0192.
  • Reverse geocoding turns geographic coordinates into place names, turning 38.7578, 9.0192 into Bole Road. These location names can vary in specificity, from individual street/addresses to cities and countries containing the given coordinates.

Types of Geocoding

Geographic Feature Types

Various types of geographic features are available in the Gebeta Geocoding API. These features are returned in search results under the following hierarchy:

Feature TypeDescription
countryGenerally recognized countries (e.g., Ethiopia).
regionTop-level sub-national administrative features (e.g., Oromia, Amhara).
placeTypically cities, towns, villages, or municipalities. Suitable for main locality displays.
localityOfficial sub-city features (e.g., sub-cities, districts, zones).
neighborhoodColloquial sub-city areas or local quarters.
streetStreet features hosting one or more addresses (e.g., Bole Road).
addressIndividual residential, business, or point of interest addresses.

Geocoding response object

The response to a Geocoding API request is an object containing the following properties:

PropertyTypeDescription
dataobjectMain payload enclosing the query details and matching locations.
data.querystringEchoes the search query or coordinates coordinates.
data.resultsarrayAn array of feature objects. Forward matches are ordered by search relevance and distance weight. Reverse matches are sorted by proximity.

Result properties object

Each feature object in the results array contains the following properties:

PropertyTypeDescription
idstringUniquely identifies the feature index and database document identifier.
namestringThe formatted primary name of the matched location or POI.
display_namestringThe complete formatted description of the result combining place name, city, and country.
categorystringFeature type category tag (e.g., highway, accommodation, shop, amenity).
locationobjectAn object representing the exact coordinates center point of the feature.
location.latnumberLatitude coordinate of the feature.
location.lngnumberLongitude coordinate of the feature.
addressobjectAddress envelope outlining context variables.
address.citystringName of city, zone, or locality.
address.countrystringName of the country.
address.country_codestringISO country abbreviation code (e.g., ETH, USA).

Geocoding API errors

Response body message / error objectHTTP error codeDescription
{ "query": { "apiKey": ["missing api key"] } }422 Unprocessable EntityNo token was used in the query or header.
{ "query": { "limit": ["limit must be a number"] } }422 Unprocessable EntityThe limit parameter was provided but was not a number.
{ "query": { "body": ["..."] } }422 Unprocessable EntityData validation failed (e.g., bounding box coordinate bounds or proximity layout values are invalid).
{ "error": { "status": 400, "code": "BAD_REQUEST", "message": "..." } }400 Bad RequestReverse geocoding input latitude/longitude missing, out of range, or invalid.
{ "error": { "status": "500", "message": "...", "code": "HE00001" } }500 Internal Server ErrorThe geocoding service encountered an unhandled internal system error.
{ "error": { "status": "500", "message": "...", "code": "HE00002" } }500 Internal Server ErrorInternal server conflict or communication issues with the core verification servers.

On this page