Google Images API
The Google Images API allows developers to access images from Google Search results. It is an easy way to add image search functionality to your website or application.
Here is the list of default parameters for this API :
Parameters | Description |
---|---|
api_key
required | This is your API key. |
q
required | Type: String
Google Search Query |
gl | Type: String
|
hl | Type: String
Default: "en_us"
The language of the requested results. |
ijn | Type: Number(Integer)
[0,1,2....]
Default: 0
(Enter 1 for 2nd-page results, 2 for 3rd, etc .)
The page number to get targeted search results. |
lr | Type: String
Limit the search to one or multiple languages.
It is used as lang_{language code} . For example - "lang_us". |
uule | Type: String
Used to encode a place an exact location(with latitude and longitude) into a value used in a cookie, an URL, or an HTTP header. |
duration | Type: String
Use this as "d/w/m/mn/y"
where n is from 0-10 .d - the previous 24 hours, w - the previous seven days, m - the previous month, mn - the previous n number of months, y - past year
The duration parameter requests search results from a specified time period (quick date range). |
nfpr | Type: Boolean
Default: 0
It excludes the result from an auto-corrected query that is spelled wrong. It can be set to 1 to exclude these results or 0 to include them. |
tbs | Type: String
to be searched - An advanced parameter to filter search results. |
chips | Type: String
Used to filter image results. They are provided under the section suggested_searches when ijn = 0 . |
safe | Type: String
[active/off]
Default: off
To filter the adult content set safe to active or to disable it set it off . |
html | Type: Boolean
Default: false
To render response as raw HTML. |
TBS | Parameters |
---|---|
Size | tbs = size:l
l - for large-sized images
tbs = size:m
m - for medium-sized images
tbs = size:i
i - for icon-sized images |
Images of specific color | tbs=ic:specific,isc:color
color = [orange, yellow, green, teal, blue, purple, pink, white, gray, black, brown] |
Creative Common licenses images | tbs=il:cl |
Commercial and other licenses | tbs=il:ol |
cURL
Node JS
Python
Java
Ruby
PHP
cURL "https://api.serpdog.io/images?api_key=APIKEY&q=football&gl=us"
const axios = require('axios');
axios.get('https://api.serpdog.io/images?api_key=APIKEY&q=football&gl=us')
.then(response => {
console.log(response.data);
})
.catch(error => {
console.log(error);
});
import requests
payload = {'api_key': 'APIKEY', 'q':'football', 'gl' : 'us'}
resp = requests.get('https://api.scrapingdog.io/google', params=payload)
print (resp.text)
try {
String apiKey = "APIKEY";
String url = "https://api.serpdog.io/images?api_key=APIKEY&q=football&gl=us";
URL urlForGetRequest = new URL(url);
String readLine = null;
HttpURLConnection conection = (HttpURLConnection) urlForGetRequest.openConnection();
conection.setRequestMethod("GET");
int responseCode = conection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
BufferedReader in = new BufferedReader(new InputStreamReader(conection.getInputStream()));
StringBuffer response = new StringBuffer();
while ((readLine = in.readLine()) != null) {
response.append(readLine);
}
in.close();
System.out.println(response.toString());
} else {
throw new Exception("Error in API Call");
}
} catch (Exception ex) {
ex.printStackTrace();
}
require 'net/http'
require 'json'
params = {
:api_key => "APIKEY",
:q => "football",
:gl => "us"
}
uri = URI('https://api.serpdog.io/images')
uri.query = URI.encode_www_form(params)
website_content = Net::HTTP.get(uri)
print(website_content)
<?php
$url = "https://api.serpdog.io/images?api_key=APIKEY&q=footbal&gl=us";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
print_r($response);
{
"meta": {
"api_key": "APIKEY",
"q": "football",
"gl": "us"
},
"image_results": [
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS_Tu78LWxIu_M_sN_kMfj2guqIbu2VcSLyI84CQGbuFRIyTCVR&s",
"title": "Football - Wikipedia",
"source": "en.wikipedia.org",
"link": "https://en.wikipedia.org/wiki/Football",
"original": "https://upload.wikimedia.org/wikipedia/commons/b/b9/Football_iu_1996.jpg",
"rank": 1
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTxvsz_pjLnFyCnYyCxxY5rSHQCHjNJyYGFZqhQUtTm0XOzOWw&s",
"title": "Soft toy, American football/brown - IKEA",
"source": "www.ikea.com · In stock",
"link": "https://www.ikea.com/us/en/p/oenskad-soft-toy-american-football-brown-90506769/",
"original": "https://www.ikea.com/us/en/images/products/oenskad-soft-toy-american-football-brown__0982285_pe815602_s5.jpg",
"rank": 2
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTNJYuYBLrUxLrXkbnP18Y6DEgKf_H4HYGCzecsGRAoFtkiGEM&s",
"title": "NFL postpones three games due to Covid ...",
"source": "www.cnbc.com",
"link": "https://www.cnbc.com/2021/12/17/nfl-will-postpone-some-games-over-covid-surge-source-says.html",
"original": "https://image.cnbcfm.com/api/v1/image/106991253-1639786378304-GettyImages-1185558312r.jpg?v=1639786403",
"rank": 3
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTg4WJ88A83JqXwGXsWtiB5qSoHrU_RukbrfXdkWggEKMsJ5Ro1&s",
"title": "USFL schedule Week 2: What football ...",
"source": "www.sportingnews.com",
"link": "https://www.sportingnews.com/us/nfl/news/usfl-schedule-week-2-football-tv-channels-times-scores/oadvrtsc5vn9l4knu8hvnpo0",
"original": "https://library.sportingnews.com/2022-04/usfl-football-042122-getty-ftr.jpg",
"rank": 4
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTsOPQ2-nzsTrdRK1HHXIqB-x96yuiPg7pwfJsm8mToVlw5-UaM&s",
"title": "Why is football called 'football'?",
"source": "www.newsnationnow.com",
"link": "https://www.newsnationnow.com/us-news/hold-why-is-football-called-football/",
"original": "https://www.newsnationnow.com/wp-content/uploads/sites/108/2022/02/FootballGettyImages-78457130.jpg?w=1280",
"rank": 5
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS0WimlY0Nykjy8k5An6k4wViDvyVZzo_0K1MSZNZcwDFGsugNW&s",
"title": "The Duke NFL Football | Wilson Sporting ...",
"source": "www.wilson.com · In stock",
"link": "https://www.wilson.com/en-gb/product/the-duke-nfl-football-wf10011",
"original": "https://www.wilson.com/en-gb/media/catalog/product/b/c/bc340309-c2a3-441d-ac36-a26187fd94f0_yceho2py9sgzklxk.png",
"rank": 6
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ6ZuMtA_I4WZZKXPhiqMpIHsdKJX-SVkcN2yo1KAQ9SQuxdCI&s",
"title": "National Football League",
"source": "www.nfl.com",
"link": "https://www.nfl.com/",
"original": "https://static.www.nfl.com/image/private/t_editorial_landscape_mobile/f_auto/league/iaesayubxpbxmbxfwm3b.jpg",
"rank": 7
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTBsiF6SkhqAc0yJt-uNXVPpo8bvS-cgcnv6NbXGGJf6DuvH0A&s",
"title": "Who Invented (American) Football - HISTORY",
"source": "www.history.com",
"link": "https://www.history.com/news/who-invented-football",
"original": "https://www.history.com/.image/ar_4:3%2Cc_fill%2Ccs_srgb%2Cfl_progressive%2Cq_auto:good%2Cw_1200/MTgyODAxOTQ1NzM4NjE4Mjc1/whoinventedfootball.jpg",
"rank": 8
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR8xdCSnDPsO1wgzP55WJW3EgsTaA03snLx87YZH7vH1tftK973&s",
"title": "NCAA Football - College Football News ...",
"source": "www.cbssports.com",
"link": "https://www.cbssports.com/college-football/",
"original": "https://sportshub.cbsistatic.com/i/r/2022/06/23/1d4d3695-76d3-4ec4-900a-c95a21ee6736/thumbnail/450x253/f9e52fd2041021143dec867fce61ff8b/quinn-ewers-ut-spring-getty.jpg",
"rank": 9
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRYoOyUNPtfEHupSubUij7_88Tj-FD0slK2WJGANAP0igxgaGc&s",
"title": "Football | Videos | Watch ESPN",
"source": "www.espn.com",
"link": "https://www.espn.com/watch/catalog/60459870-f8fc-3b3a-a6b9-d8af4bf19223/football",
"original": "https://artwork.espncdn.com/categories/60459870-f8fc-3b3a-a6b9-d8af4bf19223/1x1Feature/1440_201903062025.jpg",
"rank": 10
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQgFBkr-DEdsMCBGRhKuBjqOVMjzn33MIARq_f2I-VnpjC5hRA&s",
"title": "Olympic flag football ...",
"source": "olympics.nbcsports.com",
"link": "https://olympics.nbcsports.com/2022/04/05/flag-football-olympics-nfl/",
"original": "https://olympics.nbcsports.com/wp-content/uploads/sites/10/2022/04/GettyImages-1237679853-e1649181927440.jpg?w=811",
"rank": 11
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR_ID5wsyiMn-hrORJBFJ3tC4ZqDt1TGPUekV7SF9CfoGi8f9N3&s",
"title": "Call Football “Soccer”? | Britannica",
"source": "www.britannica.com",
"link": "https://www.britannica.com/story/why-do-some-people-call-football-soccer",
"original": "https://cdn.britannica.com/51/190751-050-147B93F7/soccer-ball-goal.jpg?q=60",
"rank": 12
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcT87bnoeOqGX_yt5XI4K2T88zAN3QOHlFZggNgSK0xMcrM683ae&s",
"title": "Football - News, Athletes, Highlights ...",
"source": "olympics.com",
"link": "https://olympics.com/en/sports/football/",
"original": "https://img.olympicchannel.com/images/image/private/t_social_share_thumb/f_auto/primary/qjxgsf7pqdmyqzsptxju",
"rank": 13
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSM4FRwtIQRJUVeS7DZl_Lhihi4H_64esiFnJSHwBGwuS3_Gtqc&s",
"title": "Contenders for 2022 College Football ...",
"source": "bleacherreport.com",
"link": "https://bleacherreport.com/articles/2956222-buying-or-selling-top-contenders-for-2022-college-football-playoff",
"original": "https://img.bleacherreport.net/img/slides/photos/004/518/828/512481ab6d70f9d3660891e778786d86_crop_exact.jpg?w=2975&h=2048&q=85",
"rank": 14
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRXWTpsr6MX9r1w7CUAfa3Ewfh8uvUDMuN9uAGz0NMkhOU5htk&s",
"title": "College football rankings 2022: Alabama ...",
"source": "www.sportingnews.com",
"link": "https://www.sportingnews.com/us/ncaa-division-i-fbs/news/college-football-rankings-top-25-alabama-ohio-state/hvqw0stg7d4jvimndjuf6ip2",
"original": "https://library.sportingnews.com/2021-12/bryce-young-120421-getty-ftr_1q4nq494zev631bgr3qbc1zvap.jpg",
"rank": 15
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQuvr-VyKe5QAP5QspJh5fuI-rn5M_wVwJQt6uzE6GqN746-8qb&s",
"title": "National Football League - HISTORY",
"source": "www.history.com",
"link": "https://www.history.com/news/the-birth-of-the-national-football-league",
"original": "https://www.history.com/.image/ar_4:3%2Cc_fill%2Ccs_srgb%2Cfl_progressive%2Cq_auto:good%2Cw_1200/MTU3ODc4NjAwMDI2ODkxNTkz/the-nfl-begins-football-grass-2014-hero-2.jpg",
"rank": 16
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTrb7Br2V9vL9dS0cKP2gMvpVl_JQ_oR-HwvclzFJbDnVUf6685&s",
"title": "File:Football (soccer ball).svg - Wikipedia",
"source": "en.wikipedia.org",
"link": "https://en.wikipedia.org/wiki/File:Football_(soccer_ball).svg",
"original": "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Football_%28soccer_ball%29.svg/1928px-Football_%28soccer_ball%29.svg.png",
"rank": 17
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ7OnRj5tm8V9jeP50bJxvnDeA91FOanwppImIQ-z-nFN01p5El&s",
"title": "NCAA football: College players could ...",
"source": "sports.yahoo.com",
"link": "https://sports.yahoo.com/could-hundreds-of-college-football-players-be-left-stranded-by-ncaa-apathy-014322627.html",
"original": "https://s.yimg.com/os/creatr-uploaded-images/2020-12/e3514670-3fbf-11eb-b67f-efeaa313555f",
"rank": 18
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3jIzJvWYzX9cl4nIHyCIL5Fe_lbKo1ChNzNV6HZtsudkiTZX_&s",
"title": "Concerns raised over how football clubs ...",
"source": "www.theguardian.com",
"link": "https://www.theguardian.com/football/2021/jul/28/major-heading-restrictions-agreed-for-english-football-at-all-levels-from-this-season",
"original": "https://i.guim.co.uk/img/media/1388397fc76bf11b35cbebe73e18f9098b58ef58/0_0_3878_2327/master/3878.jpg?width=1200&quality=85&auto=format&fit=max&s=8724b4198ece7b3b0f71cdfa0cbb11cb",
"rank": 19
},
{
"image": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTHr10vi61VGARt5FCndZ1xOpgRFpG_WOvALQdJfWQQ8a_c7jpT&s",
"title": "Virtual reality football video game ...",
"source": "sportsnaut.com",
"link": "https://sportsnaut.com/virtual-reality-football-video-game-nfl-licensing/",
"original": "https://sportsnaut.com/wp-content/uploads/2022/04/generic-football-18139090-scaled.jpg",
"rank": 20
},
]
}
Last modified 11mo ago