Skip to main content

Google Web Scraper API - Search

Google parsing endpoint

http://scrape.infatica.io/serp

info

Google Web Scraper API google_search allows to receive immediate result using our Residential Proxy

Scraping Google search costs 20 credits per page (without additional parameters).

API key:

'api_key': 'API_KEY', where API_KEY is your Infatica API key

Query Parameters

NameDescriptionExampleOptions
query (string, required)Destination query to retrieve{"query":"google"}default=null
api_key (string, required)Web Scraper API key{"api_key":"0de32912321"}default=null
source (string, required)Data source{"source":"google_search"}google_search
pages (integer, optional)Number of pages{"pages":"4"}default=1, max is 10
limit (integer, optional)Number of results to retrieve on each page{"limit":"20"}default=10, max is 100
country_code (str, optional)Proxy country code (geolocation){"country_code":"fr"}default=null, options - us, gb, de, fr, cn, jp. View all codes
language (str, optional)Language code in SERP (language){"language":"en-US"}default=en-US, options - en-US, en-CA, es-ES, fr-CA. View all codes
domain (str, optional)Google domains by country{"domain" : "google.com"}default=google.com, options - google.pl, google.no, google.ca View all codes
uule (str, optional)UULE parameter (geolocation){"uule":"uule_value"}default=null
safe (bool, optional)SafeSearch parameter (Safe Browsing){"safe":"true"}default=false
info

google_search - return data of organic results ("organic": [];)

Only "pages" is paid parameter. Each page with results costs 20 credits.

Returns

Status codeDescriptionExample
200 (Success)Request successful. Returns JSON with results fields{"results":[]}
401 (Unauthorized)API key is missing or wrong{'error':'API key is missing or wrong'}
422 (Unprocessable Entity)Error in query parameters{'error':'Wrong query'}
504 (Timeout)Site returned timeout after 3 attempts to reach it{'error':'Timeout'}

Country codes

If you want to define the geolocation for your request, you may set the country_code (string) parameter with one country code at the creation of the request.

Country codes can be found in the collapsible table below:

All country codes (click here to expand)
CodeCountry nameCodeCountry nameCodeCountry name
adAndorraglGreenlandnoNorway
aeUnited Arab EmiratesgmGambianpNepal
afAfghanistangnGuineanrNauru
agAntigua and BarbudagpGuadeloupenuNiue
aiAnguillagqEquatorial GuineanzNew Zealand
alAlbaniagrGreeceomOman
amArmeniagsSouth Georgia and the South Sandwich IslandspaPanama
aoAngolagtGuatemalapePeru
aqAntarcticaguGuampfFrench Polynesia
arArgentinagwGuinea-BissaupgPapua New Guinea
asAmerican SamoagyGuyanaphPhilippines
atAustriahkHong KongpkPakistan
auAustraliahmHeard Island and McDonald IslandsplPoland
awArubahnHonduraspmSaint Pierre and Miquelon
axÅland IslandshrCroatiapnPitcairn
azAzerbaijanhtHaitiprPuerto Rico
baBosnia and HerzegovinahuHungarypsPalestine, State of
bbBarbadosidIndonesiaptPortugal
bdBangladeshieIrelandpwPalau
beBelgiumilIsraelpyParaguay
bfBurkina FasoimIsle of ManqaQatar
bgBulgariainIndiareRéunion
bhBahrainioBritish Indian Ocean TerritoryroRomania
biBurundiiqIraqrsSerbia
bjBeninirIran (Islamic Republic of)ruRussian Federation
blSaint BarthélemyisIcelandrwRwanda
bmBermudaitItalysaSaudi Arabia
bnBrunei DarussalamjeJerseysbSolomon Islands
boBolivia (Plurinational State of)jmJamaicascSeychelles
bqBonaire, Sint Eustatius and SabajoJordansdSudan
brBraziljpJapanseSweden
bsBahamaskeKenyasgSingapore
btBhutankgKyrgyzstanshSaint Helena, Ascension and Tristan da Cunha
bvBouvet IslandkhCambodiasiSlovenia
bwBotswanakiKiribatisjSvalbard and Jan Mayen
byBelaruskmComorosskSlovakia
bzBelizeknSaint Kitts and NevisslSierra Leone
caCanadakpKorea (Democratic People's Republic of)smSan Marino
ccCocos (Keeling) IslandskrKorea, Republic ofsnSenegal
cdCongo, Democratic Republic of thekwKuwaitsoSomalia
cfCentral African RepublickyCayman IslandssrSuriname
cgCongokzKazakhstanssSouth Sudan
chSwitzerlandlaLao People's Democratic RepublicstSao Tome and Principe
ciCôte d'IvoirelbLebanonsvEl Salvador
ckCook IslandslcSaint LuciasxSint Maarten (Dutch part)
clChileliLiechtensteinsySyrian Arab Republic
cmCameroonlkSri LankaszEswatini
cnChinalrLiberiatcTurks and Caicos Islands
coColombialsLesothotdChad
crCosta RicaltLithuaniatfFrench Southern Territories
cuCubaluLuxembourgtgTogo
cvCabo VerdelvLatviathThailand
cwCuraçaolyLibyatjTajikistan
cxChristmas IslandmaMoroccotkTokelau
cyCyprusmcMonacotlTimor-Leste
czCzechiamdMoldova, Republic oftmTurkmenistan
deGermanymeMontenegrotnTunisia
djDjiboutimfSaint Martin (French part)toTonga
dkDenmarkmgMadagascartrTürkiye
dmDominicamhMarshall IslandsttTrinidad and Tobago
doDominican RepublicmkNorth MacedoniatvTuvalu
dzAlgeriamlMalitwTaiwan, Province of China
ecEcuadormmMyanmartzTanzania, United Republic of
eeEstoniamnMongoliauaUkraine
egEgyptmoMacaougUganda
ehWestern SaharampNorthern Mariana IslandsumUnited States Minor Outlying Islands
erEritreamqMartiniqueusUnited States of America
esSpainmrMauritaniauyUruguay
etEthiopiamsMontserratuzUzbekistan
fiFinlandmtMaltavaHoly See
fjFijimuMauritiusvcSaint Vincent and the Grenadines
fkFalkland Islands (Malvinas)mvMaldivesveVenezuela (Bolivarian Republic of)
fmMicronesia (Federated States of)mwMalawivgVirgin Islands (British)
foFaroe IslandsmxMexicoviVirgin Islands (U.S.)
frFrancemyMalaysiavnViet Nam
gaGabonmzMozambiquevuVanuatu
gbUnited Kingdom of Great Britain and Northern IrelandnaNamibiawfWallis and Futuna
gdGrenadancNew CaledoniawsSamoa
geGeorgianeNigeryeYemen
gfFrench GuiananfNorfolk IslandytMayotte
ggGuernseyngNigeriazaSouth Africa
ghGhananiNicaraguazmZambia
giGibraltarnlNetherlandszwZimbabwe

Language codes

If you want to define the language in your request, you may set the language (string) parameter with one language tag at the creation of the request.

Language codes can be found in the collapsible table below:

All language codes/tags (click here to expand)
Language TagLanguageRegionDescription
ar-SAArabicSaudi ArabiaArabic (Saudi Arabia)
bn-BDBanglaBangladeshBangla (Bangladesh)
bn-INBanglaIndiaBangla (India)
cs-CZCzechCzech RepublicCzech (Czech Republic)
da-DKDanishDenmarkDanish (Denmark)
de-ATGermanAustriaAustrian German
de-CHGermanSwitzerland"Swiss" German
de-DEGermanGermanyStandard German (as spoken in Germany)
el-GRGreekGreeceModern Greek
en-AUEnglishAustraliaAustralian English
en-CAEnglishCanadaCanadian English
en-GBEnglishUnited KingdomBritish English
en-IEEnglishIrelandIrish English
en-INEnglishIndiaIndian English
en-NZEnglishNew ZealandNew Zealand English
en-USEnglishUnited StatesUS English
en-ZAEnglishSouth AfricaEnglish (South Africa)
es-ARSpanishArgentinaArgentine Spanish
es-CLSpanishChileChilean Spanish
es-COSpanishColumbiaColombian Spanish
es-ESSpanishSpainCastilian Spanish (as spoken in Central-Northern Spain)
es-MXSpanishMexicoMexican Spanish
es-USSpanishUnited StatesAmerican Spanish
fi-FIFinnishFinlandFinnish (Finland)
fr-BEFrenchBelgiumBelgian French
fr-CAFrenchCanadaCanadian French
fr-CHFrenchSwitzerland"Swiss" French
fr-FRFrenchFranceStandard French (especially in France)
he-ILHebrewIsraelHebrew (Israel)
hi-INHindiIndiaHindi (India)
hu-HUHungarianHungaryHungarian (Hungary)
id-IDIndonesianIndonesiaIndonesian (Indonesia)
it-CHItalianSwitzerland"Swiss" Italian
it-ITItalianItalyStandard Italian (as spoken in Italy)
ja-JPJapaneseJapanJapanese (Japan)
ko-KRKoreanRepublic of KoreaKorean (Republic of Korea)
nl-BEDutchBelgiumBelgian Dutch
nl-NLDutchThe NetherlandsStandard Dutch (as spoken in The Netherlands)
no-NONorwegianNorwayNorwegian (Norway)
pl-PLPolishPolandPolish (Poland)
pt-BRPortugeseBrazilBrazilian Portuguese
pt-PTPortugesePortugalEuropean Portuguese (as written and spoken in Portugal)
ro-RORomanianRomaniaRomanian (Romania)
ru-RURussianRussian FederationRussian (Russian Federation)
sk-SKSlovakSlovakiaSlovak (Slovakia)
sv-SESwedishSwedenSwedish (Sweden)
ta-INTamilIndiaIndian Tamil
ta-LKTamilSri LankaSri Lankan Tamil
th-THThaiThailandThai (Thailand)
tr-TRTurkishTurkeyTurkish (Turkey)
zh-CNChineseChinaMainland China, simplified characters
zh-HKChineseHond KongHong Kong, traditional characters
zh-TWChineseTaiwanTaiwan, traditional characters

Google Domains

If you want to define the Google domain in your request, you may set the domain (string) parameter with one Google domain at the creation of the request.

Language codes can be found in the collapsible table below:

All Google domains by country (click here to expand)
Google domainCountry
google.acAscension Island
google.adAndorra
google.aeUnited Arab Emirates
google.alAlbania
google.amArmenia
google.asAmerican Samoa
google.atAustria
google.azAzerbaijan
google.baBosnia and Herzegovina
google.beBelgium
google.bfBurkina Faso
google.bgBulgaria
google.biBurundi
google.bjBenin
google.bsBahamas
google.btBhutan
google.byBelarus
google.caCanada
google.catCatalan Countries
google.cdDemocratic Republic of the Congo
google.cfCentral African Republic
google.cgRepublic of the Congo
google.chSwitzerland
google.ciIvory Coast
google.clChile
google.cmCameroon
google.cnChina
google.co.aoAngola
google.co.bwBotswana
google.co.ckCook Islands
google.co.crCosta Rica
google.co.idIndonesia
google.co.ilIsrael
google.co.inIndia
google.co.jpJapan
google.co.keKenya
google.co.krSouth Korea
google.co.lsLesotho
google.co.maMorocco
google.co.mzMozambique
google.co.nzNew Zealand
google.co.thThailand
google.co.tzTanzania
google.co.ugUganda
google.co.ukUnited Kingdom
google.co.uzUzbekistan
google.co.veVenezuela
google.co.viUnited States Virgin Islands
google.co.zaSouth Africa
google.co.zmZambia
google.co.zwZimbabwe
google.comUnited States
google.com.afAfghanistan
google.com.agAntigua and Barbuda
google.com.aiAnguilla
google.com.arArgentina
google.com.auAustralia
google.com.bdBangladesh
google.com.bhBahrain
google.com.bnBrunei
google.com.boBolivia
google.com.brBrazil
google.com.bzBelize
google.com.coColombia
google.com.cuCuba
google.com.cyCyprus
google.com.doDominican Republic
google.com.ecEcuador
google.com.egEgypt
google.com.etEthiopia
google.com.fjFiji
google.com.ghGhana
google.com.giGibraltar
google.com.gtGuatemala
google.com.hkHong Kong
google.com.jmJamaica
google.com.khCambodia
google.com.kwKuwait
google.com.lbLebanon
google.com.lyLibya
google.com.mmMyanmar
google.com.mtMalta
google.com.mxMexico
google.com.myMalaysia
google.com.naNamibia
google.com.nfNorfolk Island
google.com.ngNigeria
google.com.niNicaragua
google.com.npNepal
google.com.omOman
google.com.paPanama
google.com.pePeru
google.com.pgPapua New Guinea
google.com.phPhilippines
google.com.pkPakistan
google.com.prPuerto Rico
google.com.pyParaguay
google.com.qaQatar
google.com.saSaudi Arabia
google.com.sbSolomon Islands
google.com.sgSingapore
google.com.slSierra Leone
google.com.svEl Salvador
google.com.tjTajikistan
google.com.trTurkey
google.com.twTaiwan
google.com.uaUkraine
google.com.uyUruguay
google.com.vcSaint Vincent and the Grenadines
google.com.vnVietnam
google.cvCape Verde
google.czCzech Republic
google.deGermany
google.djDjibouti
google.dkDenmark
google.dmDominica
google.dzAlgeria
google.eeEstonia
google.esSpain
google.fiFinland
google.fmMicronesia, Federated States of
google.frFrance
google.gaGabon
google.geGeorgia
google.ggGuernsey
google.glGreenland
google.gmGambia
google.gpGuadeloupe
google.grGreece
google.gyGuyana
google.hnHonduras
google.hrCroatia
google.htHaiti
google.huHungary
google.ieIreland
google.imIsle of Man
google.iqIraq
google.isIceland
google.itItaly
google.jeJersey
google.joJordan
google.kgKyrgyzstan
google.kiKiribati
google.kzKazakhstan
google.laLaos
google.liLiechtenstein
google.lkSri Lanka
google.ltLithuania
google.luLuxembourg
google.lvLatvia
google.mdMoldova
google.meMontenegro
google.mgMadagascar
google.mkMacedonia
google.mlMali
google.mnMongolia
google.msMontserrat
google.muMauritius
google.mvMaldives
google.mwMalawi
google.neNiger
google.nlNetherlands
google.noNorway
google.nrNauru
google.nuNiue
google.plPoland
google.pnPitcairn Islands
google.psPalestine
google.ptPortugal
google.roRomania
google.rsSerbia
google.ruRussia
google.rwRwanda
google.scSeychelles
google.seSweden
google.shSaint Helena, Ascension and Tristan da Cunha
google.siSlovenia
google.skSlovakia
google.smSan Marino
google.snSenegal
google.soSomalia
google.srSuriname
google.stSão Tomé and Príncipe
google.tdChad
google.tgTogo
google.tkTokelau
google.tlTimor-Leste
google.tmTurkmenistan
google.tnTunisia
google.toTonga
google.ttTrinidad and Tobago
google.vgBritish Virgin Islands
google.vuVanuatu
google.wsSamoa

Code examples

Curl

curl -X POST "http://scrape.infatica.io/serp" -d '{"api_key": "API_KEY", "source": "google_search", "query": "google"}'

Or with optional parameters:

curl -X POST "http://scrape.infatica.io/serp" -d '{
"api_key": "API_KEY",
"source": "google_search",
"query": "google",
# pages parameter is optional
"pages" : "4",
# limit parameter is optional
"limit" : "20",
#country_code parameter is optional
"country_code" : "gb",
# language parameter is optional
"language" : "en-US",
# domain parameter is optional
"domain" : "google.ca"
}'

Python

import requests
import json

req = requests.post('http://scrape.infatica.io/serp', data = json.dumps({
'api_key': 'API_KEY',
'source': 'google_search',
'query': 'google',
"pages" : "4", # pages parameter is optional
"limit" : "20", # limit parameter is optional
'country_code': 'gb', # country_code parameter is optional
'language' : 'en-US' # language parameter is optional
}))

content = json.loads(req.content)
print(content)

Javascript / NodeJS

const axios = require('axios')
const options = {
method: 'POST',
responseType: 'json',
data: {
api_key: 'API_KEY',
source: 'google_search',
query: 'google',
pages : '4', // pages parameter is optional
limit : '20', // limit parameter is optional
country_code: 'gb', // country_code parameter is optional
language: 'en-US' // country_code parameter is optional
},
url: 'http://scrape.infatica.io/serp'
}

axios(options)
.then((result) => {
console.log(result)
})
.catch((err) => {
console.error(err)
})

Examples & success response

curl -X POST "http://scrape.infatica.io/serp" -d '{"api_key": "API_KEY", "source": "google_search", "query": "news"}'

` Example of success response:

You can receive results from 1 page.

{
"source": "google_search",
"query": "news",
"pages": 1,
"language": "en-US",
"country_code": "us",
"created_at": "2023-07-31T09:55:26.627255",
"processed_at": "2023-07-31T09:55:27.940142",
"time_spent": 1312,
"credits_used": 20,
"results": [
{
"content": {
"page": 1,
"results": {
"paid": [],
"organic": [
{
"title": "Google News",
"url": "https://news.google.com/",
"text": "4 hours ago — Comprehensive up-to-date news coverage, aggregated from sources all over the world by Google News.",
"position": 1
},
{
"title": "NBC News - Breaking News & Top Stories - Latest World, US ...",
"url": "https://www.nbcnews.com/",
"text": "22 hours ago — Go to NBCNews.com for breaking news, videos, and the latest top stories in world news, business, politics, health and pop culture.",
"position": 2
},
{
"title": "CNN: Breaking News, Latest News and Videos",
"url": "https://www.cnn.com/",
"text": "4 hours ago — View the latest news and breaking news today for U.S., world, weather, entertainment, politics and health at CNN.com.",
"position": 3
},
{
"title": "ABC News - Breaking News, Latest News and Videos",
"url": "https://abcnews.go.com/",
"text": "4 hours ago — Your trusted source for breaking news, analysis, exclusive interviews, headlines, and videos at ABCNews.com.",
"position": 4
},
{
"title": "Fox News - Breaking News Updates | Latest News Headlines ...",
"url": "https://www.foxnews.com/",
"text": "3 days ago — Breaking News, Latest News and Current News from FOXNews.com. Breaking news and video. Latest Current News: U.S., World, Entertainment, ...",
"position": 5
},
{
"title": "U.S. and World News Headlines",
"url": "https://www.npr.org/sections/news/",
"text": "8 hours ago — Coverage of breaking stories, national and world news, politics, business, science, technology, and extended coverage of major national and world events.",
"position": 6
},
{
"title": "CBS News - Breaking news, 24/7 live streaming news & top ...",
"url": "https://www.cbsnews.com/",
"text": "5 hours ago — Watch CBS News live and get the latest, breaking news headlines of the day for national news and world news today.",
"position": 7
}
]
}
}
}
]
}

Metadata

Also, metadata is returned in response:

  • "source" - Google data source;
  • "query" - your search query on Google;
  • "pages" - number of pages;
  • "language" - language of search query on Google;
  • "country_code" - country code;
  • "created_at" - request created time;
  • "processed_at" - request processed time;
  • "time_spent" - request execution time;
  • "credits_used" - number of queries used,
  • "total_search_results" - total number of search results.
  • "organic" - organic results;
  • "paid" - paid results.

Description of fields

google serp item

"position": "number" - it's position on the page.