# Reverse Geocoding
The term geocoding generally refers to translating a human-readable address into a location on a map. The process of doing the opposite, translating a location on the map into a human-readable address, is known as reverse geocoding.
Required parameters in a reverse Geocoding request:
- latlon: The latitude and longitude values specifying the location for which you wish to obtain the closest, human-readable address.
- key: Your application's API key. This key identifies your application for purposes of quota management. Learn how to obtain API key.
# Example of Reverse Geocoding
The following query contains the latitude/longitude value for a location in Brooklyn:
https://apis.geodir.co/geocoding/v1/json?latlon=-12.05,-77.05&key=YOUR_KEY
Note: Ensure that no space exists between the latitude and longitude values when passed in the latlng parameter.
{
"status": "OK",
"results": [
{
"result_types": [
"address"
],
"address_segments": [
{
"name": "721",
"name_abbr": "721",
"types": [
"route_number"
]
},
{
"name": "Pomabamba",
"name_abbr": "Pomabamba",
"types": [
"route"
]
},
{
"name": "Jirón",
"name_abbr": "Jr",
"types": [
"route_type"
]
},
{
"name": "Lima",
"name_abbr": "Lima",
"types": [
"admin_level_1",
"political"
]
},
{
"name": "15",
"name_abbr": "15",
"types": [
"admin_level_1_code",
"political"
]
},
{
"name": "Lima",
"name_abbr": "Lima",
"types": [
"admin_level_2",
"political"
]
},
{
"name": "1501",
"name_abbr": "1501",
"types": [
"admin_level_2_code",
"political"
]
},
{
"name": "Breña",
"name_abbr": "Breña",
"types": [
"admin_level_3",
"political"
]
},
{
"name": "150105",
"name_abbr": "150105",
"types": [
"admin_level_3_code",
"political"
]
},
{
"name": "Chacra Colorada",
"name_abbr": "Chacra Colorada",
"types": [
"sublocality",
"political"
]
},
{
"name": "Perú",
"name_abbr": "PE",
"types": [
"country",
"political"
]
},
{
"name": "15082",
"name_abbr": "15082",
"types": [
"postal_code"
]
}
],
"geometry": {
"coordinates": {
"lat": -12.0499011,
"lon": -77.049985
},
"bbox": [
-77.049985,
-12.0499011,
-77.049985,
-12.0499011
],
"geocoding_type": "DOOR"
},
"place_id": "ZTI0NjQxOWQtNWZhMC01YzRiLTkwZjktOTIyMjI0OGRhN2Zh",
"standard_address": "Jirón Pomabamba 721, Breña, Lima, Lima, Perú"
}
]
}
# Reverse Geocoding Responses
The format of the reverse Geocoding response is the same as the Geocoding response. See Geocoding Responses. Below are the status codes possible in a reverse geocoding response.
# Reverse Geocoding Status Codes
The "status" field within the Geocoding response object contains the status of the request, and may contain debugging information to help you track down why geocoding is not working. The "status" field may contain the following values:
- "ok" indicates that no errors occurred; the address was successfully parsed and at least one geocode was returned.
- "ZERO_RESULTS" indicates that the geocode was successful but returned no results. This may occur if the geocoder was passed a non-existent address.
- "OVER_QUERY_LIMIT" indicates that you are over your quota.
- "REQUEST_DENIED" indicates that your request was denied.
- "INVALID_REQUEST" generally indicates one of the following:
- The query (address, segments or latlng) is missing.
- An invalid segments or geocoding_type was given.
- "UNKNOWN_ERROR" indicates that the request could not be processed due to a server error. The request may succeed if you try again.
# Address for a Place
Required parameters:
- place_id: The place ID of the place for which you wish to obtain the human-readable address. The place ID is a unique identifier that can be used with other Geodir APIs. For more information about place IDs, see the place ID.
- key: Your application's API key. This key identifies your application for purposes of quota management. Learn how to get a key.
The optional parameters are the same as those for Reverse Geocoding.