For programs and applications that rely on location services, reverse geocoding can provide accurate information using GPS data. Reverse geocoding is the act of taking the latitude and longitude of a location and returning the normalized street address information for the input. The following API will perform this task instantly, to provide you with the information you need to serve your users.
Run this command to install the SDK:
pip install cloudmersive-validate-api-client
Then, you can call the function:
from __future__ import print_function
from cloudmersive_validate_api_client.rest import ApiException
from pprint import pprint# Configure API key authorization: Apikey
configuration = cloudmersive_validate_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'# create an instance of the API class
api_instance = cloudmersive_validate_api_client.AddressApi(cloudmersive_validate_api_client.ApiClient(configuration))
input = cloudmersive_validate_api_client.ReverseGeocodeAddressRequest() # ReverseGeocodeAddressRequest | Input reverse geocoding requesttry:
# Reverse geocode a lattitude and longitude into an address
api_response = api_instance.address_reverse_geocode_address(input)
except ApiException as e:
print("Exception when calling AddressApi->address_reverse_geocode_address: %s\n" % e)
This will return whether the function was successful, as well as the street address, city, state or province, postal code, and country name and code for the location. You can retrieve the API Key from the Cloudmersive website at no cost and with no commitment. This will provide you with 800 monthly calls across our library of APIs.