Google Images API Documenation
Google Images API uses /api/v1/search?engine=google_images
API endpoint to scrape real-time results.
Google Images API provides a dynamic image search service. It collects image results from various sources globally, categorizes similar images and presents them based on each user's search query. The API provides access to multiple sources for each image, allowing users to choose their topic of interest and select from different publishers' versions of the image. The selection and ranking of images are performed by algorithms that assess factors such as the relevance and quality of the image. It also prioritizes attributes like resolution, source, and freshness. The system is impartial, enabling access to a wide range of images for any search query. Google is continuously improving Images by adding new sources and enhancing its technology, extending its reach to more visual data worldwide.
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. Parameter is normally constructed using size, color, image_type, time_period, usage_rights values. For instance,
isz:l
would return only results that has large image size.
-
- Name
-
size
- Required
- Optional
- Description
-
This parameter controls the size of your search results. There are few options available:
large
,medium
,icon
.
-
- 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.
-
- Name
-
color
- Required
- Optional
- Description
-
This parameter controls the color of your search results. These options are available:
black_and_white
,transparent
,red
,orange
,yellow
,green
,teal
,blue
,purple
,pink
,white
,gray
,black
,brown
.
-
- Name
-
image_type
- Required
- Optional
- Description
-
This parameter controls the type of your search results. There are only few options that are available:
clipart
,line_drawing
,gif
.
-
- Name
-
usage_rights
- Required
- Optional
- Description
-
This parameter controls the usage rights of your search results. Options that are available:
creative_commons_licenses
,commercial_or_other_licenses
.
Pagination
-
- Name
-
page
- Required
- Optional
- Description
-
This parameter indicates which page of results to return. By default, it is set to
1
.
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_images
.
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_images&q=apple
- 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_images",
"q": "apple"
}
response = requests.get(url, params=params)
print(response.text)
{
"search_metadata": {
"id": "search_6EB5K71e3vjbfvQK3vXNW82V",
"status": "Success",
"created_at": "2024-11-28T10:55:15Z",
"request_time_taken": 1.62,
"parsing_time_taken": 0.04,
"total_time_taken": 1.66,
"request_url": "https://www.google.com/search?q=apple&oq=apple&gl=us&hl=en&ie=UTF-8&udm=2",
"html_url": "https://www.searchapi.io/api/v1/searches/search_6EB5K71e3vjbfvQK3vXNW82V.html",
"json_url": "https://www.searchapi.io/api/v1/searches/search_6EB5K71e3vjbfvQK3vXNW82V"
},
"search_parameters": {
"engine": "google_images",
"q": "apple",
"device": "desktop",
"google_domain": "google.com",
"hl": "en",
"gl": "us"
},
"search_information": {
"query_displayed": "apple",
"detected_location": "Hollywood Hills, Hollywood, FL"
},
"suggestions": [
{
"title": "Fruit",
"link": "https://www.google.com/search?sca_esv=4daba4fcecb7e45f&gl=us&hl=en&q=apple+fruit+images&uds=ADvngMjcH0KdF7qGWtwTBrP0nt7dJKTJ99uVgWVcr-vzrAPkVdeCsz9Gnf4fkyJt0_EDA4_G--7Wp9uLFH8uOgQHLiVBa0pdCZ76Vg2qeXcb-jgGMA4ci2y_ho3phKC3Jkc__lG8NMDAzKf0hgrk0pTRK8-qqCLzjw&udm=2&sa=X&ved=2ahUKEwi9o6XX7v6JAxUuVTABHYs4ElgQxKsJegQIDBAB&ictx=0"
},
...
],
"images": [
{
"position": 1,
"title": "Fresh Gala Apple, Each",
"source": {
"name": "Walmart",
"link": "https://www.walmart.com/ip/Fresh-Gala-Apple-Each/44390953"
},
"original": {
"link": "https://i5.walmartimages.com/seo/Fresh-Gala-Apple-Each_f46d4fa7-6108-4450-a610-cc95a1ca28c5_3.38c2c5b2f003a0aafa618f3b4dc3cbbd.jpeg",
"width": 3000,
"height": 3000
},
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSjMsDnJRmRWZds5gdgxnLMYb8vuJfPpRUCzA&s"
},
...
],
"related_searches": [
{
"link": "https://www.google.com/search?sca_esv=4daba4fcecb7e45f&gl=us&udm=2&hl=en&q=apple+cartoon&stick=H4sIAAAAAAAAAFvEyptYUJCTqpCcWFSSn58HADkdrZwQAAAA&source=univ&sa=X&ved=2ahUKEwi9o6XX7v6JAxUuVTABHYs4ElgQrNwCegQIPRAA",
"query": "apple cartoon",
"highlighted": ["cartoon"]
},
...
]
}
Images
https://www.searchapi.io/api/v1/search?engine=google_images&q=panda
- 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_images",
"q": "panda"
}
response = requests.get(url, params=params)
print(response.text)
{
"images": [
{
"position": 1,
"title": "Giant panda - Wikipedia",
"source": {
"name": "Wikipedia",
"link": "https://en.wikipedia.org/wiki/Giant_panda"
},
"original": {
"link": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0f/Grosser_Panda.JPG/640px-Grosser_Panda.JPG",
"width": 640,
"height": 427
},
"thumbnail": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTcizVg6CO7Hd_xCwzi3buwc7qVN6MnPUciSw&s"
},
...
]
}
Suggestions
https://www.searchapi.io/api/v1/search?engine=google_images&q=Programming+languages
- 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_images",
"q": "Programming languages"
}
response = requests.get(url, params=params)
print(response.text)
{
"suggestions": [
{
"title": "Python",
"link": "https://www.google.com/search?sca_esv=4daba4fcecb7e45f&gl=us&hl=en&q=python+Programming+languages&uds=ADvngMjcH0KdF7qGWtwTBrP0nt7dIqfV1NL4IPLO66CytgxdkuAvSgz7NyA-HyV-nltFo3OlVaEMigXPaRfu3sW9Oy5BBWG9oryPs8yVM3mFGQkfdFEjjlf_zSXPsgeH8NjmgwXYY5ZgNDtHZelOZyDAgFfsUZDax4Ikl4SXWbcnOAj8sp_F2oI&udm=2&sa=X&ved=2ahUKEwj71LKO8f6JAxWArYkEHeifGEcQxKsJegQIDBAB&ictx=0"
},
{
"title": "C++",
"link": "https://www.google.com/search?sca_esv=4daba4fcecb7e45f&gl=us&hl=en&q=c%2B%2B+Programming+languages&uds=ADvngMjcH0KdF7qGWtwTBrP0nt7d1DKEJbCVJnf-xyao41sDDcQRf-dBsV3Xav9kn8js3C9BV5IicHjelzVZKNXU4-wqR7LdTpDqpIMtqn__mSEvNvgOgUQIYkkc6fGY7ebzaSZlkuxhoVuGMfPBDgK9CkLZNBtwLvg6dF5tRqMjsTtme8KBODQ&udm=2&sa=X&ved=2ahUKEwj71LKO8f6JAxWArYkEHeifGEcQxKsJegQIDRAB&ictx=0"
},
...
],
...
}