Search Google Maps businesses from a free-text query such as a trade and a city, with the resolved location returned.

View all Google Maps Data API: Business Search, Reviews & Photos endpoints →

Resolves a free-text query to a map location and then lists the businesses found around it, in a single request. Send the required query (for example "attorney in Philadelphia, PA, USA") and optionally country, language, limit (default 20), offset (default 0) and zoom (3 zoomed out to 21 zoomed in). The response is a JSON object with status (true on success), request_id, a data array of places, a location object and the echoed request_params. In a live test call with limit=5, data held 5 places, each with 37 fields: google_id, google_mid, place_id, cid, name, status (OPEN in all five), address, full_address, a detailed_address object (district, street, city, zip_code, state, country), main_category, category_id, categories, latitude, longitude, time_zone, phone, full_phone, website_url, website_domain, working_hours by weekday, rating, reviews_count, featured_photo, about attribute groups, owner fields and hotel, price and reservation fields that were null for the sampled law firms. The location object had id, name, altitude, latitude, longitude and zoom, with id and name null and zoom 7. The documentation says this method combines the query locate and search nearby operations and recommends reusing the returned location with search nearby when the same area is queried repeatedly. The response example published with the endpoint is an empty object, so the fields above come from the live test call only.

API Features

Locate and search in one call The query is first resolved to a map location and the businesses around it are listed, so no separate geocoding request is needed before the search.
Plain-language query input Type a trade and a place such as "attorney in Philadelphia, PA, USA" or "restaurant in New York City" instead of supplying latitude and longitude.
Contact and rating data per place Each place row carries phone, website, rating, reviews_count, working hours by weekday and main category, which is enough to build a first lead sheet from one response.
Resolved location object The location object returns the latitude, longitude and zoom the query was resolved to, so the area can be reused for follow-up nearby searches.
Limit and offset slicing limit defaults to 20 and offset to 0, and the test call with limit=5 returned five places. Offset paging itself was not exercised in the test call.
Zoom control for search area The optional zoom parameter accepts 3 (zoomed out) to 21 (zoomed in) and sets how wide the map view is, so city-wide or street-level searches can be tried.
IDs that feed the business endpoints Rows include google_id, place_id and cid, the same identifier types the business details, photos and reviews endpoints document for business_id.

Live API Demo

GET /api/project/google-maps-extractor/locate-and-search

Request cost is temporarily unavailable. No price is assumed.

View pricing

API Response (JSON)

{}
curl -X GET 'https://api.opendata-api.com/api/project/google-maps-extractor/locate-and-search?key=<API_KEY>&limit=20&offset=0&query=attorney+in+Philadelphia%2C+PA%2C+USA'
📢
Need Help?
If you encounter API issues or need other API requirements, please contact us.
Contact Us

Use Cases

Frequently asked questions

What does locate and search return?

A JSON object with status, request_id, a data array of places, a location object and the echoed request_params. In a live test call with limit=5, data held five places with 37 fields each, and location held latitude, longitude, zoom, altitude, id and name.

Which parameters are required?

Only query is required; the sample form uses "attorney in Philadelphia, PA, USA" and the documentation suggests a shape like "restaurant in New York City". country, language, limit, offset and zoom are optional.

How is this different from query locate and search nearby?

It performs both steps in one request. The documentation recommends that if you repeat the same area many times, you call it once, keep the returned location, and then use search nearby with that location, which is faster because the location is resolved only once.

How do limit and offset work?

limit is the maximum number of results (default 20) and offset skips results (default 0). The test call used limit=5 and returned five places. Offset paging and the maximum limit were not tested, so check them on your own query.

What range does zoom accept?

The documentation gives 3 (zoomed out) to 21 (zoomed in) as a number. The test call did not send zoom, and its location object showed zoom 7, but how that relates to the default is not documented.

Why are some fields null in the place rows?

Category-specific fields are empty when they do not apply. In the sampled law firms, hotel_stars, hotel_about, price_range, reservation_url and order_online_url were null, while phone, website_url, rating and working_hours were filled. Null-check every field.

Is the language parameter called lang here?

No. This endpoint names it language, unlike the business photos and reviews endpoints, which use lang. Both are optional and their accepted values are not enumerated in the documentation, and the test call sent neither.

Related operations

Guides

View Subscription Plans →