Resolve a free-text Google Maps query such as a city or a trade plus a place into latitude, longitude and zoom.
View all Google Maps Data API: Business Search, Reviews & Photos endpoints →Given a text query, returns the most relevant GPS coordinates for it as a single location object. Send the required query, either general such as "restaurant in New York City" or specific such as "New York City, NY, USA", and optionally add country, language, lat, lng and zoom (3 zoomed out to 21 zoomed in, per the endpoint documentation). The documentation says a query like "restaurant in New York" resolves to the coordinates of New York, so the result is the point for the place the query names, not a list of businesses. The response is a JSON object with status (true on success), request_id, a location object and the echoed request_params. In a live test call with only query set to "attorney in Philadelphia, PA, USA", location held id and name (both null), altitude (97787.43; the unit is not documented), latitude (39.9525839), longitude (-75.1652215) and zoom (7), and request_params echoed just the query. The documentation says status is false on failure, but no failed call was captured. The response example published with the endpoint is an empty object, so the fields above come from the live test call only.
API Features
Live API Demo
🔒 Sign in to try it live
Log in to call this API with your own API key. New accounts get 100 free credits — no card required.
Log in / Sign upNo active API key found. Create one in your Dashboard, then reload this page. Dashboard →
/api/project/google-maps-extractor/query-locate API Response (JSON)
{} curl -X GET 'https://api.opendata-api.com/api/project/google-maps-extractor/query-locate?key=<API_KEY>&query=attorney+in+Philadelphia%2C+PA%2C+USA'
Query Result
Use Cases
- Resolve a phrase like "coffee shops in Lisbon" to one center point, cache it, and reuse the same coordinates for many later nearby searches
- Validate a user-typed city or region before spending a business search on it, and show the resolved location back for confirmation
- Generate a ring or grid of search centers around a city by offsetting the resolved center, for a coverage sweep of one category
- Normalize a messy CRM column of city names into coordinates so leads can be sorted by distance to a sales office
- Seed the initial center and zoom of an embedded map from whatever place name a visitor types into a search box
Frequently asked questions
What does the query locate endpoint return?
A JSON object with status, request_id, a location object and the echoed request_params. In a live test call the location held id and name (both null), altitude, latitude, longitude and zoom. It is one point for the query, not a list of businesses.
Which parameters are required?
Only query is required; the sample form uses "attorney in Philadelphia, PA, USA". country, language, lat, lng and zoom are optional. Zoom is documented as 3 (zoomed out) to 21 (zoomed in); the other optional values are not enumerated in the endpoint documentation.
Does it return businesses?
No. It returns the coordinates related to the query, such as the city named in it. To list businesses, call search nearby with those coordinates, or use locate and search, which does both steps in one request.
Why are id and name null in the location object?
Both were null in the test call, and the documentation does not say when they are filled. Treat latitude, longitude and zoom as the fields to rely on and verify id and name on your own queries.
What do lat, lng and zoom do?
They are documented as the latitude and longitude of the query location and a map zoom level from 3 to 21. How they change the returned point was not covered by the test call. Note that the response still included zoom (7) when no zoom was sent.
How do I use the result with search nearby?
Pass the returned latitude and longitude as lat and lng, together with a query such as "attorney". The two calls were not run as one chain in the test, but the coordinates returned for "attorney in Philadelphia, PA, USA" are the same pair pre-filled in the search nearby form.
How are failures reported?
The documentation says status is false on failure and lists a 422 validation response with a detail array of loc, msg and type entries. The test call succeeded, so neither shape was observed; handle both in your client.