Skip to main content

Google Web Scraper API - URL

Google parsing endpoint

http://scrape.infatica.io/serp

info

Google Web Scraper API google_url 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
url (string, required)Destination url to retrieve (url-encoded){"url":"https://www.google.com/search?q=news"}default=null
api_key (string, required)Web Scraper API key{"api_key":"0de32912321"}default=null
source (string, required)Data source{"source":"google_url"}google_url
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
info

google_url - return data of the URL in HTML ("html":"")

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

Returns

Status codeDescriptionExample
200 (Success)Request successful. Returns HTML code of the page{"html":[]}
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

Code examples

Curl

curl -X POST "http://scrape.infatica.io/serp" -d '{"api_key": "API_KEY", "source": "google_url", "url": "https://www.google.com/search?q=news"}'

Or with optional parameters:

curl -X POST "http://scrape.infatica.io/serp" -d '{
"api_key": "API_KEY",
"source": "google_url",
"url": "https://www.google.co.uk/search?q=news",
#country_code parameter is optional
"country_code" : "gb",
# language parameter is optional
"language" : "en-US"
}'

Python

import requests
import json

req = requests.post('http://scrape.infatica.io/serp', data = json.dumps({
'api_key': 'API_KEY',
'source': 'google_url',
'url': 'https://www.google.co.uk/search?q=news',
'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_url',
url : 'https://www.google.co.uk/search?q=news',
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 'google_url'

curl -X POST "http://scrape.infatica.io/serp" -d '{"api_key": "API_KEY", "source": "google_url", "url": "https://www.google.com/search?q=news"}'

` Example of success response:

You can receive code from the URL.

{
"source": "google_url",
"url": "https://www.google.com/search?q=news",
"pages": 1,
"language": "en-US",
"country_code": "us",
"created_at": "2023-08-04T09:28:58.520585",
"processed_at": "2023-08-04T09:28:59.747528",
"time_spent": 1226,
"credits_used": 20,
"html":"<!doctype html><html>{the code of the page}</html>"
}