Skip to main content

Google Web Scraper API - Ads

Google parsing endpoint

http://scrape.infatica.io/serp

info

Google Web Scraper API google_ads 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_ads"}google_ads
pages (integer, optional)Number of pages{"pages":"4"}default=1, max is 10
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
info

google_ads - return data of paid and organic results ("paid": [];).

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_ads", "query": "google"}'

Or with optional parameters:

curl -X POST "http://scrape.infatica.io/serp" -d '{
"api_key": "API_KEY",
"source": "google_ads",
"query": "google",
# pages parameter is optional
"pages" : "4",
#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_ads',
'query': 'google',
"pages" : "4", # pages 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_ads',
query: 'google',
pages : '4', // pages 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 'google_ads'

curl -X POST "http://scrape.infatica.io/serp" -d '{"api_key": "API_KEY", "source": "google_ads", "query": "iphone 14 pro"}'

` Example of success response:

You can receive results from 1 page.

{
"source": "google_ads",
"query": "iphone 14 pro",
"pages": 1,
"language": "en-US",
"country_code": "us",
"created_at": "2023-07-31T10:29:27.520069",
"processed_at": "2023-07-31T10:29:29.497502",
"time_spent": 1977,
"credits_used": 20,
"results": [
{
"content": {
"page": 1,
"results": {
"paid": [
{
"title": "$830 Off iPhone 14 Pro - For New & Current Customers",
"url": "https://www.t-mobile.com/cell-phones/brand/apple",
"text": "Get $830 Off via 24 mo credits w eligible new line + trade on qual'g plan. See details. Explore...",
"position": 1
}
],
"organic": [
{
"title": "iPhone 14 Pro and iPhone 14 Pro Max - Apple",
"url": "https://www.apple.com/iphone-14-pro/",
"text": "Features · Meet Dynamic Island. · 48MP Main camera. Mind-blowing detail. · The mastermind behind it all. · A battery that's all in, all day. · Film like a Pro.",
"position": 1
},
{
"title": "iPhone 14 Pro and iPhone 14 Pro Max - Apple",
"url": "https://www.apple.com/iphone-14-pro/",
"text": "Features · Meet Dynamic Island. · 48MP Main camera. Mind-blowing detail. · The mastermind behind it all. · A battery that's all in, all day. · Film like a Pro.",
"position": 2
},
{
"title": "Image Carousel",
"url": "https://www.apple.com/us/shop/go/product/MQ163?cppart=ATT_IPHONE14PRO&purchaseOption=cp&cid=aos-us-seo-pla",
"text": "I'm writing this review because I've been buying the newest iPhone each year for the past four years and this is by far the greatest one I've bought thus far. In the past I kept my iPhones for two or three years to get the most for my money since trading in every year seemed to end up costing more than I wanted to spend. so I went from the iPhone 7 to the the iPhone 11 which I did only because the iPhone 7 was starting to give me problems. After that I started upgrading every year because I took advantage of different programs that saved money and so I ended up spending roughly $1,800.00 total for the last four models I bought. That was for the iPhone 11, the iPhone 12 Pro, the iPhone 13, and now currently the iPhone 14 Pro with 256GB of storage. Not bad paying a total of $1,800.00 when my newest one retails for $1,100.00That being said this new iPhone 14 Pro is worth every penny that it costs and is by far the best phone Apple has made to date. If you are considering either buying the iPhone 14 or the iPhone 14 pro and are torn between the two, my recommendation is that you spend the extra $100.00 because the differences between the two are worth it. The last phone I bought was the iPhone 13 and I purchased that because I didn't feel I needed the extra camera and the non pro model seemed to suit me just fine. Now think about having the 48 megapixel camera on the 14 Pro verses the 12 megapixel that's on the iPhone 14, and it doesn't make sense to purchase anything other than the Pro. You also get ProRes video on the Pro model which is worth considering as well, and something that I don't believe is available on the non Pro model. The Dynamic Island is also something that's only available on the Pro and it's pretty cool. The chip is better on the Pro model as well, going with the new A16 Bionic chip verses the A15 Bionic chip that was on last years iPhone 13 Pro. Between the two models this year, the Pro model also has better battery life.Other than these features, the two phones are identical but the one feature that makes going into the Pro worth the extra money over all the other features is the 48 megapixel camera and getting the Telephoto lens on top of it. It takes photos in 48 megapixels using any of the three lenses.I've been using the iPhone 14 Pro for two weeks now and the photos that it takes are amazing. I like a lot of detail in my pictures and this new iPhone hasn't disappointed me at all. The camera has had a nice improvement also in night mode over the camera in the iPhone 13. All in all I must say that Apple has finally made a significant change this year and it's worth upgrading even if you are going from last years model. I know that I can finally wait two or three years now before upgrading again because this new phone is way ahead of any phones that Apple has made in the past.Less",
"position": 3
},
{
"title": "iPhone 14 Pro: Should You Buy? Features, Advice ...",
"url": "https://www.macrumors.com/roundup/iphone-14-pro/",
"text": "5 days ago — The iPhone 14 Pro models are available in 128GB, 256GB, 512GB, and 1TB storage capacities. MagSafe charging up to 15W continues to be supported, ...",
"position": 4
},
{
"title": "Apple iPhone 14 Pro – Colors, Specs, Pricing & Reviews",
"url": "https://www.att.com/buy/phones/apple-iphone-14-pro.html",
"text": "iPhone 14 Pro. Capture incredible detail with a 48MP Main camera. Experience iPhone in a whole new way with Dynamic Island and Always-On display. And get peace ...",
"position": 5
},
{
"title": "Buy the New iPhone 14 Pro - Price, Colors",
"url": "https://www.verizon.com/smartphones/apple-iphone-14-pro/",
"text": "iPhone 14 Pro. Capture incredible detail with a 48MP Main camera. Experience iPhone in a whole new way with Dynamic Island and Always-On display.",
"position": 6
},
{
"title": "iPhone 14 Pro review: Pro perfection",
"url": "https://www.tomsguide.com/reviews/iphone-14-pro",
"text": "May 24, 2023 — The iPhone 14 Pro is the best phone for under $1,000. It's powerful, has amazing cameras, sports a beautiful display, and the notch is dead.",
"position": 7
},
{
"title": "Apple iPhone 14 Pro review: early adopter island",
"url": "https://www.theverge.com/23351948/apple-iphone-14-pro-review",
"text": "May 17, 2023 — The 14 Pro is a little cooler and captures a tiny bit more detail at 100 percent in dim lighting, but you really have to go looking for it.",
"position": 8
},
{
"title": "Apple - iPhone 14 Pro 128GB - Space Black (Verizon)",
"url": "https://www.bestbuy.com/site/apple-iphone-14-pro-128gb-space-black-verizon/6487386.p?skuId=6487386",
"text": "iPhone 14 Pro. Capture incredible detail with a 48MP Main camera. Experience iPhone in a whole new way with Dynamic Island and Always-On display. And get peace ...",
"position": 9
}
]
}
}
}
]
}

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 paid item

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