Google Videos API
Google Videos API uses /api/v1/search?engine=google_videos
API endpoint to scrape real-time results.
The Google Videos API offers a dynamic video search service. It accumulates video results from the most popular sources across the globe, categorizes similar videos, and presents them according to each user's search query. The API offers access to the specific source for each video, granting users the freedom to choose their preferred topic and select videos from various publishers.
API Parameters
Search Query
-
- Name
-
q
- Required
- Required
- Description
-
Parameter defines the query you want to search. You can use anything that you would use in a regular Google search. e.g.
inurl:
,site:
,intitle:
. We also support advanced search query parameters such asas_dt
andas_eq
.
Device
-
- Name
-
device
- Required
- Optional
- Description
-
The default parameter
desktop
defines the search on a desktop device. Themobile
parameter defines the search on a mobile device. Thetablet
parameter defines the search on a tablet device.
Geographic Location
-
- Name
-
location
- Required
- Optional
- Description
-
Parameter defines from where you want the search to originate. If several locations match the location requested, we'll pick the most popular one. Head to the Locations API if you need more precise control.
-
- Name
-
uule
- Required
- Optional
- Description
-
Parameter is the Google encoded location you want to use for the search. SearchApi automatically generated the
uule
parameter when you use thelocation
parameter but we allow you to overwrite it directly.uule
andlocation
parameters can't be used together.
Localization
-
- Name
-
google_domain
- Required
- Optional
- Description
-
The default parameter
google.com
defines the Google domain of the search. Check the full list of supported Googlegoogle_domain
domains.
-
- Name
-
gl
- Required
- Optional
- Description
-
The default parameter
us
defines the country of the search. Check the full list of supported Googlegl
countries.
-
- Name
-
hl
- Required
- Optional
- Description
-
The default parameter
en
defines the interface language of the search. Check the full list of supported Googlehl
languages.
-
- Name
-
lr
- Required
- Optional
- Description
-
The lr parameter restricts search results to documents written in a particular language or a set of languages. The accepted format for this parameter is
lang_{2-letter country code}
. For instance, to filter documents written in Japanese, the value should be set tolang_jp
. To incorporate multiple languages, a value likelang_it|lang_de
restricts the search to documents written in either Italian or German. Google identifies the document language based on the top-level domain (TLD) of the document's URL, any language meta tags present, or the language utilized within the document's body text. Check the full list of supported Googlelr
languages.
-
- Name
-
cr
- Required
- Optional
- Description
-
The cr parameter restricts search results to documents originating in a particular country. Google determines the country of a document by the top-level domain (TLD) of the document's URL or by Web server's IP address geographic location. Check the full list of supported Google
cr
countries.
Filters
-
- Name
-
nfpr
- Required
- Optional
- Description
-
This parameter controls whether results from queries that have been auto-corrected for spelling errors are included. To exclude these auto-corrected results, set the value to
1
. By default, the value is0
, meaning auto-corrected results are included.
-
- Name
-
filter
- Required
- Optional
- Description
-
This parameter controls whether the "Duplicate Content" and "Host Crowding" filters are enabled. Set the value to
1
to enable these filters, which is the default setting. To disable these filters, set the value to0
.
-
- Name
-
safe
- Required
- Optional
- Description
-
This parameter toggles the SafeSearch feature for the results. SafeSearch operates by filtering out adult content from your search results. Google's filters use proprietary technology to check keywords, phrases and URLs. While no filters are 100 percent accurate, SafeSearch will remove the overwhelming majority of adult content from your search results. Set the value to
active
to enable SafeSearch. To disable it, set the value tooff
. By default, SafeSearch is disabled.
-
- Name
-
tbs
- Required
- Optional
- Description
-
This parameter restricts results to URLs based on encoded values. For instance,
dur:s
would return only results that are shorter than 4 min.
-
- Name
-
time_period
- Required
- Optional
- Description
-
This parameter restricts results to URLs based on date. Supported values are:
last_hour
- data from the past hour.last_day
- data from the past 24 hours.last_week
- data from the past week.last_month
- data from the past month.last_year
- data from the past year.
tbs
parameter.
-
- Name
-
duration
- Required
- Optional
- Description
-
This parameter restricts results to URLs based on video duration. Supported values are:
short
- short videos (0-4 min.).medium
- medium videos (4-20 min.).long
- long videos (20+ min.).
tbs
parameter.
-
- Name
-
quality
- Required
- Optional
- Description
-
This parameter restricts results to URLs based on video quality. By default, all videos are returned. To retrieve only videos with high quality,
high
param should be used.
Note: this parameter is not compatible with a customtbs
parameter.
-
- Name
-
source
- Required
- Optional
- Description
-
This parameter restricts results to URLs based on source. Supported values are:
youtube
,cncc
,cnn
,ted
,cbsnews
,twitter
,tiktok
,facebook
,timesnownews
,nbcnews
,foxnews
.
Note: this parameter is not compatible with a customtbs
parameter.
Pagination
-
- Name
-
num
- Required
- Optional
- Description
-
This parameter specifies the number of results to display per page. Use in combination with the
page
parameter to implement pagination functionality.
-
- Name
-
page
- Required
- Optional
- Description
-
This parameter indicates which page of results to return. By default, it is set to
1
. Use in combination with the num parameter to implement pagination.
Engine
-
- Name
-
engine
- Required
- Required
- Description
-
Parameter defines an engine that will be used to retrieve real-time data. It must be set to
google_videos
.
API key
-
- Name
-
api_key
- Required
- Required
- Description
-
The
api_key
authenticates your requests. Use it as a query parameter (https://www.searchapi.io/api/v1/search?api_key=YOUR_API_KEY
) or in the Authorization header (Bearer YOUR_API_KEY
).
API Examples
Full Response
https://www.searchapi.io/api/v1/search?engine=google_videos&q=scraping+guides
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_videos",
"q": "scraping guides"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_OxE2l6wMgOJVSBbwp9PbYq4K",
"status": "Success",
"created_at": "2023-06-21T17:56:04Z",
"request_time_taken": 1.35,
"parsing_time_taken": 0.04,
"total_time_taken": 1.39,
"request_url": "https://www.google.com/search?q=Scraping+guides&oq=Scraping+guides&gl=us&hl=en&tbm=vid&ie=UTF-8",
"html_url": "https://wwww.searchapi.io/api/v1/searches/search_OxE2l6wMgOJVSBbwp9PbYq4K.html",
"json_url": "https://wwww.searchapi.io/api/v1/searches/search_OxE2l6wMgOJVSBbwp9PbYq4K"
},
"search_parameters": {
"engine": "google",
"q": "Scraping guides",
"google_domain": "google.com",
"hl": "en",
"gl": "us"
},
"search_information": {
"query_displayed": "Scraping guides",
"total_results": 5110000,
"time_taken_displayed": 0.32
},
"videos": [
...
{
"position": 3,
"title": "Beginners Guide To Web Scraping with Python - YouTube",
"link": "https://www.youtube.com/watch?v=QhD015WUMxE",
"displayed_link": "www.youtube.com › watch",
"snippet": "The web is full of data. Lots and lots of data. Data prime for scraping. But manually going to a website and copying and pasting the data ...",
"highlighted": [
"scraping"
],
"length": "7:36",
"source": "YouTube",
"date": "Nov 27, 2021",
"channel": "Tinkernut",
"key_moments": [
{
"time": "00:00",
"seconds": 0,
"title": "Introduction",
"link": "https://www.youtube.com/watch?v=QhD015WUMxE&t=0",
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR4jPIu2ZKf7Qhi0lwiSscoljg9ruzc1Nn1Lcj3xYtNbQ&s"
},
...
],
"thumbnail": "data:image/jpeg;base64,..."
},
...
],
"related_searches": [
{
"query": "web scraping using python beautifulsoup",
"link": "https://www.google.com/search?gl=us&hl=en&tbm=vid&q=Web+scraping+using+Python+BeautifulSoup&sa=X&ved=2ahUKEwiwxcja99T_AhW9kYkEHWFtBxsQ1QJ6BAgYEAE"
},
...
]
}
Videos Carousel
https://www.searchapi.io/api/v1/search?device=mobile&engine=google_videos&q=How+to+scrape+websites
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_videos",
"q": "How to scrape websites",
"device": "mobile"
}
response = requests.get(url, params=params)
print(response.text)
{
"videos_carousel": [
{
"position": 1,
"title": "How to Easily Scrape Websites with Python and Beautiful Soup (Web Scraping with Python)",
"snippet": "From 8:45 How to scrape a single page",
"link": "https://www.youtube.com/watch?v=A1s1aGHoODs&t=525",
"displayed_link": "YouTube • The PyCoach",
"length": "23:13",
"thumbnail": "data:image/jpeg;base64,..."
},
...
]
}
Shorts Response
https://www.searchapi.io/api/v1/search?device=mobile&engine=google_videos&q=Rami+Malek
- Python
- Node
- Ruby
- Java
- Go
- PHP
- Bash
- R
- Kotlin
- Swift
- C#
- C
- C++
- requests
import requests
url = "https://www.searchapi.io/api/v1/search"
params = {
"engine": "google_videos",
"q": "Rami Malek",
"device": "mobile"
}
response = requests.get(url, params=params)
print(response.text)
{
"shorts": [
{
"position": 1,
"title": "Oscar Winner Rami Malek wins Best Actor | 91st Oscars",
"link": "https://www.youtube.com/shorts/D3IbOSmUlf0",
"source": "YouTube",
"author": "Oscars",
"thumbnail": "data:image/jpeg;base64,..."
},
...
]
}