Google Image Search API
The Google Image Search API lets you retrieve image search results from Google Images including titles, thumbnails, source links, and original dimensions. Each successful request costs 10 API credits.
Endpoint:
https://api.scrapingdog.com/google_imagesAPI Parameters
π
Scrapingdog Parameters
api_keyRequiredYour personal API key. Available on your dashboard
Type: StringhtmlOptionalThis will return the full HTML of the Google Images page.
Default Value -false
Type - Boolean
π
Search Query
queryRequiredThis is a Google Search Query. Example1 -query=pizza
Type: String
π
Geographic Location and Localization
domainOptionalTo obtain local results from a specific country, for example, for India, it will be "google.co.in," and for the UK, it will be "google.co.uk". For a complete list of supported domains, see the Google Domains Page.
Default:google.com
Type: StringcountryOptionalThis parameter specifies the country for the Google search using a two-letter country code (e.g., US for the United States, UK for the United Kingdom, or FR for France). For a complete list of supported countries, see the Google Country Parameter.
Default Value -us
Type - StringcrOptionalThe parameter allows you to restrict the search to specific countries. It follows the formatcountry{two-letter uppercase country code}and uses|as a separator for multiple countries. For example,countryFR|countryDEwill return results only from French and German websites. For a complete list, see the Google CR Countries Page.
Type - StringuuleOptionalIt is a parameter that specifies the geographic location or locale for which the search results should be tailored. Possible Value could bew+CAIQIFJlbGF5IFN0YXRlcw==
Type - StringlanguageOptionalLanguage of the results. Possible Values -en,es,fr,de, etc. For a complete list of supported languages, see the Google Language Page.
Default Value -en
Type - StringlrOptionalLimit the search to one or multiple languages. It is used aslang_{language code}. For a complete list, see the Google LR Language Page.
Type - String
β°
Time Period
period_unitOptionalThis parameter specifies the time unit for retrieving recent images, such as the past minute, hour, day, etc.
Available options:- s β Second
- n β Minute
- h β Hour
- d β Day
- w β Week
- m β Month
- y β Year
- This parameter cannot be used alongside
start_dateandend_date. - It takes precedence over the
qdrcomponent in thetbsparameter.
period_valueOptionalThis parameter specifies an optional time duration, used in combination withperiod_unitto define time intervals such as 15 seconds, 42 hours, or 178 days.
Details:- Default value: 1
- Valid range: 1 to 2,147,483,647
start_dateOptionalThis parameter specifies the start date for limiting the image search within a specific time range.
Details:- Format: YYYYMMDD
- Example: 20241201
- Cannot be used with
period_unitorperiod_value. - If
end_dateis left blank, the search range will be fromstart_dateto today. - Overrides the
cdrandcd_mincomponents of thetbsparameter.
end_dateOptionalThis parameter specifies the end date for restricting the image search within a specific time range.
Details:- Format: YYYYMMDD
- Example: 20241231
- Cannot be used with
period_unitorperiod_value. - If
start_dateis left blank, the search range will include all dates beforeend_date. - Overrides the
cdrandcd_maxcomponents of thetbsparameter.
β
οΈ Advanced Filters
chipsOptionalThis parameter allows filtering of image search results using a suggested search term provided by Google, such as "red apple."
Details:- Suggested search terms (chips) are available under the
suggested_searchessection whenijn = 0. - Each suggested search includes both chip values and a scrapingdog_link.
- Suggested search terms (chips) are available under the
tbsOptionalto be searched - An advanced parameter to filter search results.
Type: StringimgarOptionalThis parameter specifies the aspect ratio for filtering images.
Available options:- s β Square
- t β Tall
- w β Wide
- xw β Panoramic
imgszOptionalThis parameter specifies the image size filter.
Available options:- l β Large
- m β Medium
- i β Icon
- qsvga β Larger than 400Γ300
- vga β Larger than 640Γ480
- svga β Larger than 800Γ600
- xga β Larger than 1024Γ768
- 2mp β Larger than 2 MP
- 4mp β Larger than 4 MP
- 6mp β Larger than 6 MP
- 8mp β Larger than 8 MP
- 10mp β Larger than 10 MP
- 12mp β Larger than 12 MP
- 15mp β Larger than 15 MP
- 20mp β Larger than 20 MP
- 40mp β Larger than 40 MP
- 70mp β Larger than 70 MP
image_colorOptionalThis parameter specifies the color filter for images.
Available options:- bw β Black and white
- trans β Transparent
- red β Red
- orange β Orange
- yellow β Yellow
- green β Green
- teal β Teal
- blue β Blue
- purple β Purple
- pink β Pink
- white β White
- gray β Gray
- black β Black
- brown β Brown
- This parameter overrides the
icandisccomponents of thetbsparameter.
image_typeOptionalThis parameter specifies the type of images to filter.
Available options:- face β Face
- photo β Photo
- clipart β Clip art
- lineart β Line drawing
- animated β Animated
- This parameter overrides the
itpcomponent of thetbsparameter.
licensesOptionalThis parameter specifies the license type for filtering images.
Available options:- f β Free to use or share
- fc β Free to use or share, even commercially
- fm β Free to use, share, or modify
- fmc β Free to use, share, or modify, even commercially
- cl β Creative Commons licenses
- ol β Commercial and other licenses
- This parameter overrides the
surcomponent of thetbsparameter.
safeOptionalTo filter the adult content setsafetoactiveor to disable it setoff.
Type: String [active/off]
Default:offnfprOptionalIt excludes the result from an auto-corrected query that is spelled wrong. It can be set to1to exclude these results or0to include them.
Type:Boolean
Default:0filterOptionalThis parameter controls whether the "Similar Results" and "Omitted Results" filters are enabled or disabled. Set it to1(default) to activate the filters or0to turn them off.
Type:Boolean
π
Pagination
pageOptionalThis is the page number of Google searches. Its value can be0for the first page,1for the second page, and so on.
Default Value -0
Type - String
API Examples
Code to Integrate
curl "https://api.scrapingdog.com/google_images?api_key=APIKEY&query=football&country=us"
import requests url = "https://api.scrapingdog.com/google_images" params = { "api_key": "APIKEY", "query": "football", "country": "us" } response = requests.get(url, params=params) if response.status_code == 200: print(response.json())
const axios = require('axios'); axios.get('https://api.scrapingdog.com/google_images', { params: { api_key: 'APIKEY', query: 'football', country: 'us' } }).then(response => console.log(response.data)) .catch(error => console.error(error.message));
<?php $url = 'https://api.scrapingdog.com/google_images/?' . http_build_query([ 'api_key' => 'APIKEY', 'query' => 'football', 'country' => 'us', ]); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); echo curl_exec($ch); curl_close($ch);
require 'net/http' require 'uri' url = URI.parse("https://api.scrapingdog.com/google_images/") url.query = URI.encode_www_form('api_key' => 'APIKEY', 'query' => 'football', 'country' => 'us') http = Net::HTTP.new(url.host, url.port) http.use_ssl = true response = http.request(Net::HTTP::Get.new(url)) puts response.body if response.is_a?(Net::HTTPSuccess)
import java.io.*; import java.net.*; public class Main { public static void main(String[] args) throws Exception { String apiUrl = "https://api.scrapingdog.com/google_images/?api_key=APIKEY&query=football&country=us"; URL url = new URL(apiUrl); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); String line; while ((line = reader.readLine()) != null) System.out.println(line); conn.disconnect(); } }
API Response
{
"images_results": [
{
"title": "File:American football.svg - Wikipedia",
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSchgavmZI04Z2kfeeJp_xoLasvhOVA4CvvfA&s",
"source": "en.m.wikipedia.org",
"original": "https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/American_football.svg/1024px-American_football.svg.png",
"link": "https://en.m.wikipedia.org/wiki/File:American_football.svg",
"original_height": 1024,
"original_width": 1024,
"original_size": "167KB",
"rank": 1
},
{
"title": "the-ball-football.jpg",
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTiNAaJQJum6GgYqytfKggAwhRlMCZ2nQMvmA&s",
"source": "operations.nfl.com",
"original": "https://operations.nfl.com/media/2948/the-ball-football.jpg",
"link": "https://operations.nfl.com/learn-the-game/nfl-basics/terms-glossary/",
"original_height": 663,
"original_width": 995,
"original_size": "317KB",
"rank": 2
}
]
}