YouTube Search
The Arcade YouTube Search toolkit provides a pre-built set of tools for interacting with YouTube. These tools make it easy to build agents and AI apps that can:
- Search for videos on YouTube;
- Get details about a video.
Install
pip install arcade_search
pip installing the toolkit is only needed if you are self-hosting Arcade. You do not need to install the toolkit if you’re using Arcade Cloud.
Available Tools
Tool Name | Description |
---|---|
SearchYoutubeVideos | Search for videos on YouTube. |
GetYoutubeVideoDetails | Get details about a video on YouTube. |
If you need to perform an action that’s not listed here, you can get in touch with us to request a new tool, or create your own tools.
SearchYoutubeVideos
Search for videos on YouTube.
Parameters
- keywords (string, required) Keywords to search for. E.g. ‘apple iphone’ or ‘samsung galaxy’
language_code
(string, optional, Defaults to ‘en’ English) 2-character language code to use in the YouTube search. A list of supported language codes can be found here.country_code
(string, optional, Defaults to ‘us’ United States) 2-character country code to use in the YouTube search. A list of supported country codes can be found here.next_page_token
(string, optional, Defaults to ‘None’) The next page token to use for pagination. Defaults toNone
(start from the first page).
GetYoutubeVideoDetails
Get details about a video on YouTube.
Parameters
- video_id (string, required) Video ID. E.g. ‘414600577’. This can be retrieved from the search results of the
SearchYoutubeVideos
tool. language_code
(string, optional, Defaults to ‘en’ English) 2-character language code to return information about the video. A list of supported language codes can be found here.country_code
(string, optional, Defaults to ‘us’ United States) 2-character country code to return information about the video. A list of supported country codes can be found here.
Auth
The Arcade YouTube Search toolkit uses the SerpAPI to get video information from YouTube.
- Secret:
SERP_API_KEY
: Your SerpAPI API key.
Setting the SERP_API_KEY
secret is only required if you are self-hosting Arcade. If you’re using Arcade Cloud, the secret is already set for you. To manage your secrets, go to the Secrets page in the Arcade Dashboard.
Default parameter values
Language and Country are configurable through environment variables. When set, they will be used as default for YouTube tools.
Providing a different value as language_code
or country_code
argument in a tool call will override the default value set in the environment variables.
Language
The language code is a 2-character code that determines the language in which the API will search and return video information. There are two environment variables:
ARCADE_GOOGLE_LANGUAGE
: a default value for all Google Search tools. If not set, defaults to ‘en’ (English).ARCADE_YOUTUBE_SEARCH_LANGUAGE
: a default value for the YouTube Search tools. If not set, defaults toARCADE_GOOGLE_LANGUAGE
.
A list of supported language codes can be found here.
Country
The country code is a 2-character code that determines the country in which the API will search for videos:
ARCADE_GOOGLE_COUNTRY
: a default value for all Google Search tools. If not set, defaults toNone
.ARCADE_YOUTUBE_SEARCH_COUNTRY
: a default value for the YouTube Search tools. If not set, defaults toARCADE_GOOGLE_COUNTRY
. IfARCADE_GOOGLE_COUNTRY
is not set, the default country for YouTube tools will beus
(United States).
A list of supported country codes can be found here.