GoogleFinanceAPIWrapper#

class langchain_community.utilities.google_finance.GoogleFinanceAPIWrapper[source]#

Bases: BaseModel

Wrapper for SerpApi’s Google Finance API

You can create SerpApi.com key by signing up at: https://serpapi.com/users/sign_up. The wrapper uses the SerpApi.com python package: https://serpapi.com/integrations/python To use, you should have the environment variable SERPAPI_API_KEY set with your API key, or pass serp_api_key as a named parameter to the constructor. .. rubric:: Example


from langchain_community.utilities import GoogleFinanceAPIWrapper google_Finance = GoogleFinanceAPIWrapper() google_Finance.run(‘langchain’)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param serp_api_key: SecretStr | None = None#
param serp_search_engine: Any = None#
run(query: str) str[source]#

Run query through Google Finance with Serpapi

Parameters:

query (str)

Return type:

str

Examples using GoogleFinanceAPIWrapper