AskNewsAPIWrapper#

class langchain_community.utilities.asknews.AskNewsAPIWrapper[source]#

Bases: BaseModel

Wrapper for AskNews API.

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 asknews_client_id: str | None = None#

Client ID for the AskNews API.

param asknews_client_secret: str | None = None#

Client Secret for the AskNews API.

async asearch_news(query: str, max_results: int = 10, hours_back: int = 0) str[source]#

Search news in AskNews API asynchronously.

Parameters:
  • query (str) –

  • max_results (int) –

  • hours_back (int) –

Return type:

str

search_news(query: str, max_results: int = 10, hours_back: int = 0) str[source]#

Search news in AskNews API synchronously.

Parameters:
  • query (str) –

  • max_results (int) –

  • hours_back (int) –

Return type:

str