Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions pages/toolkits/search/google_news.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Search
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--> Google News


import ToolInfo from "@/components/ToolInfo";
import Badges from "@/components/Badges";
import TabbedCodeBlock from "@/components/TabbedCodeBlock";
import TableOfContents from "@/components/TableOfContents";

<ToolInfo
description="Enable agents to search for news stories with Google News."
author="Arcade"
codeLink="https://github.com/ArcadeAI/arcade-ai/tree/main/toolkits/search"
authType="API Key"
versions={["0.1.0"]}
/>

<Badges repo="arcadeai/arcade_search" />

The Arcade Google News toolkit provides a pre-built set of tools for interacting with Google News. These tools make it easy to build agents and AI apps that can:

- Search for news stories with Google News.

## Install

```bash
pip install arcade_search
```

<Note>
pip installing the toolkit is only needed if you are [self-hosting](/home/install/overview) Arcade. You do not need to install the toolkit if you're using Arcade Cloud.
</Note>

## Default parameters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider placing below tools and Auth section. Seems unlikely that someone wants to know how to set a default parameter before seeing the tools


Language and Country are configurable through environment variables. When set, they will be used as default for Google News tools.

Providing a different value as `language_code` or `country_code` argument in the tool call will override the default value.

**Language**

The language code is a 2-character code that determines the language in which the API will search and return news articles. There are two environment variables:

- `ARCADE_GOOGLE_LANGUAGE`: a default value for all Google search tools. If not set, defaults to 'en' (English).
- `ARCADE_GOOGLE_NEWS_LANGUAGE`: a default value for the news search tools. If not set, defaults to `ARCADE_GOOGLE_LANGUAGE`.

A list of supported language codes can be found [here](/toolkits/search/reference#languagecodes).

**Country**

The country code is a 2-character code that determines the country in which the API will search for news articles. There are two environment variables:

- `ARCADE_GOOGLE_NEWS_COUNTRY`: a default value for the `SearchNews` tool. If not set, defaults to `None` (search news globally).

A list of supported country codes can be found [here](/toolkits/search/reference#countrycodes).

## Available Tools

<TableOfContents
headers={["Tool Name", "Description"]}
data={
[
["SearchNews", "Search for news stories with Google News."],
]
}
/>

<Tip>
If you need to perform an action that's not listed here, you can [get in touch
with us](mailto:[email protected]) to request a new tool, or [create your
own tools](/home/build-tools/create-a-toolkit).
</Tip>

## SearchNews

<br />
<TabbedCodeBlock
tabs={[
{
label: "Call the Tool Directly",
content: {
Python: [
"/examples/integrations/toolkits/search/search_news_example_call_tool.py",
],
JavaScript: ["/examples/integrations/toolkits/search/search_news_example_call_tool.js"],
},
},
{
label: "Execute the Tool with OpenAI",
content: {
Python: [
"/examples/integrations/toolkits/search/search_news_example_llm_oai.py",
],
JavaScript: ["/examples/integrations/toolkits/search/search_news_example_llm_oai.js"],
},
},
]}
/>

Search for news stories with Google News.

**Auth:**

- **Environment Variables Required:**
- `SERP_API_KEY`: Your SerpAPI API key.

**Parameters**

- **`query`** _(string, required)_ Keywords to search for news articles. E.g. 'Apple launches new iPhone'.
- **`country_code`** _(string, optional, Defaults to `None`)_ 2-character country code to search for news articles. E.g. 'us' (United States). Defaults to `None` (search news globally).
- **`language`** _(string, optional, Defaults to 'en' English)_ 2-character language code to search for news articles. E.g. 'en' (English). Defaults to 'en' (English).
- **`limit`** _(int, optional, Defaults to 10)_ Maximum number of news articles to return. Defaults to None (returns all results found by the API).

## Auth

The Arcade Google Maps toolkit uses the [SerpAPI](https://serpapi.com/) to get directions and search Google Maps.

**Global Environment Variables:**

- `SERP_API_KEY`: Your SerpAPI API key.
Loading