Get Address from Latitude and Longitude: Google Maps API and Distancematrix.ai

Written by:

Casey Lane

6

min read

Date:

December 16, 2024

Updated on:

September 17, 2026

If your business is not on Google Maps, you probably don't exist. The service is embedded in 1.78 million domains in 2026, making it the biggest player in the Maps & Geolocation market. Thus, it is not just a nice-to-have. It's the foundation businesses build location features on. Whether it's a GPS pin or a delivery stop, businesses often turn to a reliable way to get addresses from latitude and longitude via APIs.

Reverse geocoding is used by Application Programming Interfaces (APIs) to convert the coordinates into human-readable addresses and improve delivery apps as well as location-based services in turn. At the same time, companies can just as easily get longitude and latitude from an address via APIs.

Several providers offer this service, but not all are equal. Google offers its Maps API, while some third-party providers guarantee the same efficiency at a lower price. How to choose? Our experts have prepared a guide to help you pick the right API to get latitude and longitude from addresses and vice versa.

image.png
Google Maps domain growth chart

Short Overview

  • Google Maps is embedded on 1.78 million domains, making it the leading platform in the Maps and Geolocation market. 
  • Geocoding is used by businesses for delivery route planning, store locators, location-based ads, and cleaning up address data.
  • Reverse geocoding means converting coordinates into an address, while forward geocoding works in another way, turning an address into coordinates.
  • Businesses use the Distance Matrix API or Google Maps to get an address from latitude and longitude, and vice versa.
  • Both Google Maps API and Distancematrix.ai handle this through plain HTTP requests and return the result (an address or coordinates) as JSON.
  • Google's Essentials tier gives you 10,000 free requests a month, then $5.00 per 1,000; above 5 million requests a month, the price drops to $0.38 per 1,000.
  • Distancematrix.ai offers 1,000 free elements a month, then $2.00 per 1,000, dropping to $1.00 per 1,000 at higher volumes — cheaper than Google at most tiers.
  • Google Maps API needs a Google Cloud project with billing enabled; Distancematrix.ai just needs a sign-up and an API key.

Using Google Maps to Get Address from Latitude and Longitude

Reverse geocoding takes a pair of GPS coordinates and matches them to the nearest human-readable address. That's the core of using Google Maps: get an address from lat/long via a device or mapping software that captures a location as latitude and longitude, sends those coordinates to a geocoding service, and gets back a formatted address. This means a host of practical benefits for delivery and logistics teams:

  • GPS coordinates pinpoint precise delivery locations to accurately identify destinations, reducing misdeliveries.
  • Clear customer communication as raw coordinates get converted into readable addresses for notifications and updates.
  • Better-structured location data supports enhanced record-keeping, analysis, and richer delivery logs.
  • Route sorting gets faster thanks to delivery grouping being streamlined and assigned by location.

These benefits only work if the underlying service is fast, accurate, and easy to plug into an existing stack, which is exactly what separates a good reverse geocoding API from a mediocre one. Here’s what to watch for:

Key features of a reverse geocoding service

Here's what typically separates a solid reverse geocoding API from a weak one:

  • RESTful and straightforward to integrate (a single HTTP request is usually enough).
  • Converts geographic coordinates into a clean, readable address format.
  • Returns additional context beyond the address itself, including postal codes, place names, and place types like "locality" or "political".

To get addresses from latitude and longitude, the Google Maps API and Distancematrix.ai can be used. Both of which let you fetch addresses from coordinates with ease, and we have depicted how each one works in code.

How Distancematrix.ai and Google Maps Get Addresses from Lat/Long?

Both APIs follow the same basic pattern behind the scenes: send addresses and get coordinates back over HTTP, and vice versa. Here, Google Maps API’s latitude/longitude request sits side by side with Distancematrix.ai's, so you can compare the two before choosing your go-to provider.

Distance Matrix API request

This is how a minimal request that sends a pair of coordinates to Distancematrix.ai and returns the matching address looks like.

import requests
api\_key = 'YOUR\_API\_KEY'
lat = '37.4224764'
lng = '-122.0842499'
\# Construct the API request URL
url = f'[https://api.distancematrix.ai/maps/api/geocode/json?latlng={lat},{lng}&key={api\_key}](https://api.distancematrix.ai/maps/api/geocode/json?latlng={lat},{lng}\&key={api_key)'
\# Send the request
response = requests.get(url)
\# Parse the response
data = response.json()
\# Extract the formatted address
if data['status'] == 'OK':
address = data['results'][0]['formatted\_address']
print(f'The address is: {address}')
else:
print('Error fetching address')

This sends the coordinates to Distancematrix.ai and prints back the matching formatted address.

Google Maps API request

The same request pattern, this time pointed at Google’s Geocoding endpoint. This is how a Maps API request from Google gets an address from latitude and longitude looks like in action.

import requests
api\_key = 'YOUR\_API\_KEY'
lat = '37.4224764'
lng = '-122.0842499'
url = f'[https://maps.googleapis.com/maps/api/geocode/json?latlng={lat},{lng}&key={api\_key}](https://maps.googleapis.com/maps/api/geocode/json?latlng={lat},{lng}\&key={api_key)'
response = requests.get(url)
data = response.json()
if data['status'] == 'OK':
address = data['results'][0]['formatted\_address']
print(f'The address is: {address}')
else:
print('Error fetching address')

Same logic, same response structure — just pointed at Google’s endpoint instead.

How the code works

Both code samples do the same four steps:

  • Constructing the URL: both APIs require you to build a URL with the latitude and longitude parameters along with your API key.
  • Sending the request: the requests library sends an HTTP GET request to the API endpoint.
  • Parsing the response: the response is converted to JSON, then checked for a valid status.
  • Extracting the address: if the status is 'OK', the formatted_address field is pulled from the response.

Getting your API key

Being able to get an API key and start working without a delay is another argument when selecting a geocoding tool. Here’s a look at what both providers offer:

Step Distancematrix.ai Google Maps API
1 Sign up on the website Go to the Google Cloud Console
2 Create a new project Create a new project or select an existing one
3 Obtain your API key Enable the Geocoding API
4 — Generate an API key
5 — Enable billing on your project (without it, the API will not return results)

Pricing comparison

While Google Maps API seems tempting with its wider free tier, Distancematrix.ai wins on cost at scale. Let’s look at the pricing more closely.

Distancematrix.ai Google Maps API
Free tier 1,000 elements/month 10,000 requests/month
Base rate $2.00 per 1,000 $5.00 per 1,000
Volume discount Drops to $1.00 per 1,000 at scale Drops to $4.00, $3.00, $1.50, then $0.38 per 1,000 at over 5 million requests

Whichever you choose, both give a reliable way to get the required data with the accuracy developers rely on for logistics systems, routing software, and mapping applications.

Get Lat/Long from Address: Google API and Distance Matrix Use Cases

Everything covered so far ran in one direction: coordinates to addresses. But most businesses also need the reverse trip, turning a written address into the coordinates that power a map, a route, or a database. When you call the Google Maps API to get lat/long from an address, or send the same address to Distancematrix.ai, you get back the coordinates behind that address in a matter of milliseconds. That process is called forward geocoding, and it shows up in more everyday tools than you’d expect.

Plotting Customer Locations on a Map

Store locators, delivery-zone maps, and checkout previews all need coordinates to place a pin, but customers only ever type in an address. Forward geocoding bridges that gap, converting the address a customer enters into the latitude and longitude a map actually understands. Without it, a “find your nearest store” feature has no way to render results visually, no matter how accurate the underlying address data is.

Planning Routes and Optimizing Delivery

Route optimization engines don’t work with street names; they work with coordinates. Before a delivery fleet can calculate the shortest path between ten stops, each stop’s address has to be converted into a lat/long pair a routing algorithm can plot and compare. This is typically one of the first steps in any logistics pipeline, run in bulk across an entire day’s delivery list before a single route is calculated.

Powering Location-Based Marketing and Analytics

Marketing teams building heat maps, service-area radius targeting, or geodemographic reports need coordinates, not addresses, to run the math. A customer database full of street addresses becomes usable for spatial analysis only once each entry is geocoded, turned into a point on a map that can be measured, clustered, or filtered by distance from a location.

Validating and Cleaning Address Data

Running an address through the Google Maps API lat/long endpoint, or through Distancematrix.ai’s equivalent, is also a practical way to catch bad data. If an address doesn’t resolve to coordinates, it’s likely misspelled, incomplete, or fake — a much faster check than manual review. Many businesses run forward geocoding as a validation step before an address ever reaches a shipping label or a CRM record.

See how this plays out for a real logistics operation in how Distancematrix.ai enhanced delivery company efficiency.

How Distancematrix.ai Enhanced Delivery Company Efficiency

Rising transportation costs and delivery delays can quietly erode both margins and customer trust. Here’s how one online retailer turned that around with a geocoding API.

About: A well-known Indian online store was facing rising transportation costs and delivery delays, which were hurting customer satisfaction and the company’s brand image.

The Challenge: The business needed a way to identify delivery and departure locations more accurately and choose shorter, more efficient routes, rather than relying on outdated or imprecise location data.

The Solution: The company integrated the Distancematrix.ai API into its logistics system to collect accurate, up-to-date geographic coordinates for delivery and departure sites. This allowed delivery schedules to be adjusted based on real travel times and distances, rather than estimates.

The Results:

  • Shorter, more efficient routes reduced overall delivery costs.
  • More accurate delivery time estimates improved on-time delivery rates.
  • Better delivery performance translated into higher customer satisfaction and stronger customer loyalty.

By using a geocoding API to power its logistics operations, the company was able to optimize delivery performance and raise the overall standard of its service. (Details shared under an NDA). See more real-world results in our full case study library.

Distance Matrix or Google Maps API: Which Latitude/Longitude and Address Fetching Tool Fits Better?

Getting accurate results from latitude and longitude, or the reverse, comes down to picking an API that matches how your business actually operates. Google Maps API is a solid, well-documented option, especially if you’re already building on other Google Maps Platform tools and don’t mind a higher price at scale. 

But for most delivery, logistics, and mapping teams processing thousands of requests a day, cost adds up fast, and that’s exactly where Distancematrix.ai closes the gap: the same accuracy and speed, at a fraction of Google’s per-request price, with no long-term contract or vendor lock-in required.

Whether you’re plotting customer addresses, optimizing delivery routes, or cleaning up messy address data, the right geocoding API pays for itself many times over in saved time and fewer errors. If you’re ready to see the difference in your own numbers, try the Distance Matrix API and get your first 1,000 requests free, no credit card required.

Table of content

Start for free and get instant access to all Distancematrix.ai products and features

Read API documentation

Ready to Elevate Your Routing and Logistics with the Right Distance Matrix API?

  • Real-time traffic

  • Travel modes

  • Forecasting

  • Quick response

FAQs

How can I get a free address from latitude and longitude?

Distancematrix.ai’s Geocoding API converts latitude and longitude into accurate, readable addresses. The provider also allows you to fully test the API during a free tier, with several other pricing subscriptions available for enterprise-grade use. This lets you see firsthand the accuracy and value Distancematrix.ai provides for your projects.

Can location be determined through latitude and longitude?

Yes, latitude and longitude can help to identify a point anywhere on the Earth which is needed for navigation, mapping and location based services.You can use Distancematrix.ai to get coordinates from a ZIP code or an address (forward geocoding), or get an address from coordinates (reverse geocoding). Discover the possibilities of our Geocoding API and how it can help and/or ease your location-based applications.

How do I convert coordinates to an address?

You can convert coordinates to an address with Distancematrix.ai using a variety of methods:

  1. Postman: Import our pre-configured collection in Postman, and instantly test requests with your API key.
  2. Excel and Google Sheets: Integrate the API into Excel or Google Sheets to fetch and manipulate location data directly in your spreadsheets.
  3. Make direct HTTP requests: Use a web browser or make API requests via scripts in Python, JavaScript, etc.
  4. Applications and Systems Integration: Seamlessly embed precise geolocation features into your applications and systems.

Test it with our API Documentation.

Do you offer customized pricing plans for latitude and longitude API services?

We provide scalable pricing for large-scale business or enterprise use cases, which means that cost is reduced as you scale up. For more than 500,000 requests per month, please reach out to us for a custom pricing package that will accommodate your needs.

How do I use latitude and longitude API services?

  • Register and get your API key: You need to sign up and get your API key.
  • Select your Geocoding API product: Depending on your needs, select Geocoding API Fast and Accurate.
  • Configure request parameters: Provide addresses, coordinates, etc., plus various other parameters like language and region.
  • Send a request: Use your API key to authenticate and send a request to the Geocoding API.
  • Handle and use the data: Extract data from the API and add geolocation data to your app.