Skip to main content

Google Maps Integration

Need to add location intelligence to your agents? Connect Google Maps to your workflows and let agents geocode addresses or search for nearby locations—instantly.

TL;DR

Generate a Google Maps API Key, store it in the Vault, and use Drive components like Geocode Address or Get Nearby Places to power geospatial agents.

List of Google Maps Components

ComponentActionWhat it DoesInputsKey OutputsUse Case
Geocode AddressConvertTurns an address into coordinates.urlEncodedAddresslocation, responseEnrich a user form with lat/lng.
Get Nearby PlacesSearchFinds POIs within a given radius.location, radius, keywordresultsSuggest coffee spots or ATMs nearby.

Prerequisites

To use Google Maps with SmythOS, you need:

  • A Google Cloud Project
  • Enabled APIs: Maps JavaScript API, Places API
  • A Maps API Key
  • A SmythOS account (sign up) and access to the Vault

API Key Setup

Step 1: Create a Google Cloud Project

Open Google Cloud Console and create or select a project.

Step 2: Enable Required APIs

Navigate to APIs & Services > Library and enable:

  • Maps JavaScript API
  • Places API

Step 3: Generate an API Key

  1. Go to Credentials
  2. Click Create Credentials > API Key
  3. Restrict the key to specific APIs (recommended)
Secure Your Key

Restrict by IP, referrer, and limit to Maps APIs only. Store securely in the Vault.

Step 4: Store Key in Vault

  1. Go to Vault > New Secret in SmythOS
  2. Name it something like google_maps_api_key
  3. Paste the API Key you copied from Google

Component Reference

Geocode Address

This component converts a human-readable address into GPS coordinates (latitude, longitude).

Inputs

FieldRequiredDescription
urlEncodedAddressrequiredAddress string formatted for URL (e.g., 1600+Amphitheatre+Parkway,+Mountain+View,+CA).
Geocode Address Input

Outputs

FieldDescription
locationObject with lat and lng.
responseRaw JSON from Google Geocoding API.
headersHTTP headers from the API call.
Geocode Output Example
Use Case

Convert shipping or address input into coordinates and pass to logistics API or distance calculator.

{ "component": "maps.geocodeAddress", "urlEncodedAddress": "1600+Amphitheatre+Parkway,+Mountain+View,+CA" }

Get Nearby Places

Returns nearby points of interest (POIs) based on location, radius, and keyword.

Inputs

FieldRequiredDescription
locationrequiredLat/lng string (e.g., 37.4220,-122.0841).
radiusrequiredSearch radius in meters.
keywordrequiredPlace type or keyword (e.g., bookstore, atm).
Nearby Search Input

Outputs

FieldDescription
resultsArray of places with name, address, and geometry.
responseFull response from the Places API.
headersMetadata headers returned from the call.
Nearby Places Output
Use Case

Pair this with a user’s geocoded address to find relevant venues nearby: coffee, pharmacies, or retail.

{ "component": "maps.getNearbyPlaces", "location": "37.4220,-122.0841", "radius": 1500, "keyword": "restaurant" }

Best Practices

  • 🔐 Always store your API key in the Vault, never in plain text.
  • 📍 Chain Geocode AddressGet Nearby Places to power geospatial logic.
  • ✅ Validate API results by checking status and ZERO_RESULTS.
  • ⚠️ Use clear keyword values to improve relevance (e.g., use "pharmacy", not "meds").

Troubleshooting

ErrorCauseResolution
REQUEST_DENIEDInvalid or missing keyCheck Vault and restrictions.
ZERO_RESULTSNo matches foundTry broader keywords or adjust radius.
OVER_QUERY_LIMITDaily quota exceededUpgrade your plan or reduce frequency.
INVALID_REQUESTMissing fieldsCheck inputs for required values.
INFO

Check response.status and error_message in the output for deeper context.

What’s Next?

Example workflows to try:

  • Local Finder Agent: Geocode a form address → Find nearby resources
  • Routing Helper: Convert multiple addresses to coordinates → Optimize with Maps Distance Matrix
  • Venue Recommender: Detect location from IP → Recommend restaurants or hotels nearby
Google Maps integration overview