Google Maps links let you share locations, get directions, and embed maps. Whether you're adding a "Get Directions" button to your website or sharing a meeting location, here's how to build the right URL.
Key Takeaways
- 1Use google.com/maps/search/ for place searches
- 2Use google.com/maps/dir/ for directions with origin and destination
- 3Add api=1 to use the official Maps URLs API
- 4Include travelmode for driving, walking, bicycling, or transit
- 5Links open in Google Maps app on mobile, browser on desktop
Search for a Place
Google Maps links are essential for local businesses, event pages, and any content where users need to find a physical location. Unlike embedding a map widget, these links open the full Google Maps experience where users can get directions, see street view, and save the location.
Create a link that searches for a location by name or address:
https://www.google.com/maps/search/?api=1&query=Eiffel+Tower+Parishttps://www.google.com/maps/search/?api=1&query=350+5th+Ave+New+York+NYThe api=1 parameter tells Google to use the official Maps URLs API, which ensures consistent behavior across platforms. Replace spaces with + signs in the query parameter.
Get Directions
Direction links take users straight to turn-by-turn navigation. These are perfect for event invitations, appointment confirmations, and business location pages where getting there is the primary goal.
Create links that show directions between two points:
https://www.google.com/maps/dir/?api=1&destination=Times+Square+New+Yorkhttps://www.google.com/maps/dir/?api=1&origin=JFK+Airport&destination=Times+Square+New+York&travelmode=drivingWhen you omit the origin parameter, Google Maps uses the user's current location. This is ideal for mobile users who want to navigate from wherever they are.
URL Parameters Reference
Google Maps URLs support a variety of parameters for customizing the map view and directions. The tables below document the most commonly used options.
Search Parameters
| Parameter | Description | Example |
|---|---|---|
api | Required. Set to 1 | api=1 |
query | Search term or address | query=Central+Park |
query_place_id | Google Place ID (more precise) | query_place_id=ChIJ... |
For directions links, you have additional parameters to control the starting point and transportation method.
Directions Parameters
| Parameter | Description | Example |
|---|---|---|
destination | End point (required) | destination=LAX+Airport |
origin | Start point (optional, defaults to user location) | origin=Santa+Monica |
travelmode | driving, walking, bicycling, transit | travelmode=transit |
destination_place_id | Precise destination by Place ID | destination_place_id=ChIJ... |
origin_place_id | Precise origin by Place ID | origin_place_id=ChIJ... |
waypoints | Stops along the route (pipe-separated) | waypoints=stop1|stop2 |
Specifying the travel mode helps users get relevant directions immediately, without needing to switch modes manually.
Travel Modes
Choose the travel mode that makes the most sense for your audience. Urban event venues might default to transit, while suburban businesses might prefer driving directions.
| Mode | Description | URL Parameter |
|---|---|---|
| 🚗 Driving | Car directions (default) | travelmode=driving |
| 🚶 Walking | Pedestrian routes | travelmode=walking |
| 🚴 Bicycling | Bike-friendly routes | travelmode=bicycling |
| 🚇 Transit | Public transportation | travelmode=transit |
Let's put these parameters together with practical examples you can adapt for your own use.
Ready-to-Use Examples
These examples cover the most common scenarios for adding Google Maps links to websites and marketing materials. Replace the placeholder locations with your actual business address.
Business Location Link
<a href="https://www.google.com/maps/search/?api=1&query=Your+Business+Name+City"
target="_blank"
rel="noopener noreferrer">
📍 Find us on Google Maps
</a>Including your business name in the search query helps Google identify the correct location, especially if there are multiple similar addresses. The map marker emoji adds visual recognition for the link.
Get Directions Button
<a href="https://www.google.com/maps/dir/?api=1&destination=123+Main+St+New+York+NY&travelmode=driving"
target="_blank"
rel="noopener noreferrer"
class="directions-btn">
🚗 Get Driving Directions
</a>Direction links without an origin let users navigate from their current location. On mobile, this opens turn-by-turn navigation immediately if the Maps app is installed.
Event Location with Transit
https://www.google.com/maps/dir/?api=1&destination=Madison+Square+Garden+New+York&travelmode=transitTransit mode shows public transportation options including buses, subways, and trains. This is especially helpful for events in cities where parking is difficult or expensive.
Using Coordinates
Sometimes you need to link to a precise location that doesn't have a street address, like a trailhead, park pavilion, or construction site. Coordinates ensure users arrive at exactly the right spot.
For precise locations, use latitude and longitude:
https://www.google.com/maps/search/?api=1&query=40.7128,-74.0060https://www.google.com/maps/dir/?api=1&destination=40.7128,-74.0060function createMapsLink(lat, lng, label) {
const url = new URL('https://www.google.com/maps/search/');
url.searchParams.set('api', '1');
// If you have a label, search for it; otherwise use coordinates
if (label) {
url.searchParams.set('query', label);
} else {
url.searchParams.set('query', `${lat},${lng}`);
}
return url.toString();
}
// Usage
const link = createMapsLink(40.7128, -74.0060, 'Downtown NYC');This function accepts optional label text that makes the search results clearer. When coordinates are used alone, Google shows the location on the map without any label.
Building Links Dynamically
For applications with multiple locations, like store locators or delivery tracking, you'll want to generate Maps links programmatically. These functions handle the URL construction and encoding.
function createDirectionsLink(options) {
const { destination, origin, travelMode = 'driving' } = options;
const url = new URL('https://www.google.com/maps/dir/');
url.searchParams.set('api', '1');
url.searchParams.set('destination', destination);
if (origin) {
url.searchParams.set('origin', origin);
}
url.searchParams.set('travelmode', travelMode);
return url.toString();
}
// Examples
const walkingLink = createDirectionsLink({
destination: 'Central Park, New York',
travelMode: 'walking'
});
const drivingLink = createDirectionsLink({
origin: 'JFK Airport',
destination: 'Manhattan, NY',
travelMode: 'driving'
});The createDirectionsLink function accepts an options object for flexibility. Default values like driving for travel mode reduce the required parameters for common cases.
Embedding Maps
If you want to show a map directly on your page instead of linking out, you can embed Google Maps using an iframe. Note that embeds require an API key, unlike simple links.
For embedding maps in websites, use the Maps Embed API:
<!-- Place embed -->
<iframe
width="600"
height="450"
style="border:0"
loading="lazy"
allowfullscreen
referrerpolicy="no-referrer-when-downgrade"
src="https://www.google.com/maps/embed/v1/place?key=YOUR_API_KEY&q=Space+Needle,Seattle+WA">
</iframe>
<!-- Directions embed -->
<iframe
width="600"
height="450"
style="border:0"
loading="lazy"
allowfullscreen
src="https://www.google.com/maps/embed/v1/directions?key=YOUR_API_KEY&origin=Oslo+Norway&destination=Stockholm+Sweden&mode=driving">
</iframe>API Key Required for Embeds
Embedding maps requires a Google Maps API key from the Google Cloud Console. Regular share links (google.com/maps/...) don't need an API key.
Now let's look at how to optimize Maps links for mobile users who likely have the Google Maps app installed.
Mobile App Deep Links
The standard google.com/maps URLs work everywhere, but you can also use platform-specific URL schemes to open the native Maps app directly. However, for most use cases, the universal URLs are the best choice.
To open the Google Maps app directly on mobile:
| Platform | URL Scheme | Example |
|---|---|---|
| iOS/Android (Universal) | https://www.google.com/maps/... | Opens app if installed, web if not |
| iOS (Maps app) | comgooglemaps:// | comgooglemaps://?q=Coffee |
| Android (Intent) | geo: | geo:0,0?q=Coffee |
// Cross-platform maps link
function openInMaps(query) {
// This URL works on all platforms
const url = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(query)}`;
// Opens app on mobile, web on desktop
window.open(url, '_blank');
}
// Usage
openInMaps('Starbucks near me');This function uses the universal URL format that works on all platforms. On mobile devices with Google Maps installed, the link opens the app. On desktop or devices without the app, it opens Maps in the browser.
Try the URL Builder
Use our Google Maps Directions template to build map links interactively.