langchain.utilities.google_places_api.GooglePlacesAPIWrapper¶
- class langchain.utilities.google_places_api.GooglePlacesAPIWrapper(*, gplaces_api_key: Optional[str] = None, google_map_client: Any = None, top_k_results: Optional[int] = None)[source]¶
Bases:
BaseModelWrapper around Google Places API.
- To use, you should have the
googlemapspython package installed, an API key for the google maps platform, and the environment variable ‘’GPLACES_API_KEY’’ set with your API key , or pass ‘gplaces_api_key’ as a named parameter to the constructor.
- By default, this will return the all the results on the input query.
You can use the top_k_results argument to limit the number of results.
Example
from langchain import GooglePlacesAPIWrapper gplaceapi = GooglePlacesAPIWrapper()
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- param gplaces_api_key: Optional[str] = None¶
- param top_k_results: Optional[int] = None¶
- To use, you should have the