Google Web Scraper API - Search
Google parsing endpoint
http://scrape.infatica.io/serp
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'
, where API_KEY is your Infatica API key
Query Parameters
Name | Description | Example | Options |
---|---|---|---|
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 |
google_search
- return data of organic results ("organic": [];)
Only "pages"
is paid parameter. Each page with results costs 20 credits.
Returns
Status code | Description | Example |
---|---|---|
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)
Code | Country name | Code | Country name | Code | Country name |
---|---|---|---|---|---|
ad | Andorra | gl | Greenland | no | Norway |
ae | United Arab Emirates | gm | Gambia | np | Nepal |
af | Afghanistan | gn | Guinea | nr | Nauru |
ag | Antigua and Barbuda | gp | Guadeloupe | nu | Niue |
ai | Anguilla | gq | Equatorial Guinea | nz | New Zealand |
al | Albania | gr | Greece | om | Oman |
am | Armenia | gs | South Georgia and the South Sandwich Islands | pa | Panama |
ao | Angola | gt | Guatemala | pe | Peru |
aq | Antarctica | gu | Guam | pf | French Polynesia |
ar | Argentina | gw | Guinea-Bissau | pg | Papua New Guinea |
as | American Samoa | gy | Guyana | ph | Philippines |
at | Austria | hk | Hong Kong | pk | Pakistan |
au | Australia | hm | Heard Island and McDonald Islands | pl | Poland |
aw | Aruba | hn | Honduras | pm | Saint Pierre and Miquelon |
ax | Åland Islands | hr | Croatia | pn | Pitcairn |
az | Azerbaijan | ht | Haiti | pr | Puerto Rico |
ba | Bosnia and Herzegovina | hu | Hungary | ps | Palestine, State of |
bb | Barbados | id | Indonesia | pt | Portugal |
bd | Bangladesh | ie | Ireland | pw | Palau |
be | Belgium | il | Israel | py | Paraguay |
bf | Burkina Faso | im | Isle of Man | qa | Qatar |
bg | Bulgaria | in | India | re | Réunion |
bh | Bahrain | io | British Indian Ocean Territory | ro | Romania |
bi | Burundi | iq | Iraq | rs | Serbia |
bj | Benin | ir | Iran (Islamic Republic of) | ru | Russian Federation |
bl | Saint Barthélemy | is | Iceland | rw | Rwanda |
bm | Bermuda | it | Italy | sa | Saudi Arabia |
bn | Brunei Darussalam | je | Jersey | sb | Solomon Islands |
bo | Bolivia (Plurinational State of) | jm | Jamaica | sc | Seychelles |
bq | Bonaire, Sint Eustatius and Saba | jo | Jordan | sd | Sudan |
br | Brazil | jp | Japan | se | Sweden |
bs | Bahamas | ke | Kenya | sg | Singapore |
bt | Bhutan | kg | Kyrgyzstan | sh | Saint Helena, Ascension and Tristan da Cunha |
bv | Bouvet Island | kh | Cambodia | si | Slovenia |
bw | Botswana | ki | Kiribati | sj | Svalbard and Jan Mayen |
by | Belarus | km | Comoros | sk | Slovakia |
bz | Belize | kn | Saint Kitts and Nevis | sl | Sierra Leone |
ca | Canada | kp | Korea (Democratic People's Republic of) | sm | San Marino |
cc | Cocos (Keeling) Islands | kr | Korea, Republic of | sn | Senegal |
cd | Congo, Democratic Republic of the | kw | Kuwait | so | Somalia |
cf | Central African Republic | ky | Cayman Islands | sr | Suriname |
cg | Congo | kz | Kazakhstan | ss | South Sudan |
ch | Switzerland | la | Lao People's Democratic Republic | st | Sao Tome and Principe |
ci | Côte d'Ivoire | lb | Lebanon | sv | El Salvador |
ck | Cook Islands | lc | Saint Lucia | sx | Sint Maarten (Dutch part) |
cl | Chile | li | Liechtenstein | sy | Syrian Arab Republic |
cm | Cameroon | lk | Sri Lanka | sz | Eswatini |
cn | China | lr | Liberia | tc | Turks and Caicos Islands |
co | Colombia | ls | Lesotho | td | Chad |
cr | Costa Rica | lt | Lithuania | tf | French Southern Territories |
cu | Cuba | lu | Luxembourg | tg | Togo |
cv | Cabo Verde | lv | Latvia | th | Thailand |
cw | Curaçao | ly | Libya | tj | Tajikistan |
cx | Christmas Island | ma | Morocco | tk | Tokelau |
cy | Cyprus | mc | Monaco | tl | Timor-Leste |
cz | Czechia | md | Moldova, Republic of | tm | Turkmenistan |
de | Germany | me | Montenegro | tn | Tunisia |
dj | Djibouti | mf | Saint Martin (French part) | to | Tonga |
dk | Denmark | mg | Madagascar | tr | Türkiye |
dm | Dominica | mh | Marshall Islands | tt | Trinidad and Tobago |
do | Dominican Republic | mk | North Macedonia | tv | Tuvalu |
dz | Algeria | ml | Mali | tw | Taiwan, Province of China |
ec | Ecuador | mm | Myanmar | tz | Tanzania, United Republic of |
ee | Estonia | mn | Mongolia | ua | Ukraine |
eg | Egypt | mo | Macao | ug | Uganda |
eh | Western Sahara | mp | Northern Mariana Islands | um | United States Minor Outlying Islands |
er | Eritrea | mq | Martinique | us | United States of America |
es | Spain | mr | Mauritania | uy | Uruguay |
et | Ethiopia | ms | Montserrat | uz | Uzbekistan |
fi | Finland | mt | Malta | va | Holy See |
fj | Fiji | mu | Mauritius | vc | Saint Vincent and the Grenadines |
fk | Falkland Islands (Malvinas) | mv | Maldives | ve | Venezuela (Bolivarian Republic of) |
fm | Micronesia (Federated States of) | mw | Malawi | vg | Virgin Islands (British) |
fo | Faroe Islands | mx | Mexico | vi | Virgin Islands (U.S.) |
fr | France | my | Malaysia | vn | Viet Nam |
ga | Gabon | mz | Mozambique | vu | Vanuatu |
gb | United Kingdom of Great Britain and Northern Ireland | na | Namibia | wf | Wallis and Futuna |
gd | Grenada | nc | New Caledonia | ws | Samoa |
ge | Georgia | ne | Niger | ye | Yemen |
gf | French Guiana | nf | Norfolk Island | yt | Mayotte |
gg | Guernsey | ng | Nigeria | za | South Africa |
gh | Ghana | ni | Nicaragua | zm | Zambia |
gi | Gibraltar | nl | Netherlands | zw | Zimbabwe |
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 Tag | Language | Region | Description |
---|---|---|---|
ar-SA | Arabic | Saudi Arabia | Arabic (Saudi Arabia) |
bn-BD | Bangla | Bangladesh | Bangla (Bangladesh) |
bn-IN | Bangla | India | Bangla (India) |
cs-CZ | Czech | Czech Republic | Czech (Czech Republic) |
da-DK | Danish | Denmark | Danish (Denmark) |
de-AT | German | Austria | Austrian German |
de-CH | German | Switzerland | "Swiss" German |
de-DE | German | Germany | Standard German (as spoken in Germany) |
el-GR | Greek | Greece | Modern Greek |
en-AU | English | Australia | Australian English |
en-CA | English | Canada | Canadian English |
en-GB | English | United Kingdom | British English |
en-IE | English | Ireland | Irish English |
en-IN | English | India | Indian English |
en-NZ | English | New Zealand | New Zealand English |
en-US | English | United States | US English |
en-ZA | English | South Africa | English (South Africa) |
es-AR | Spanish | Argentina | Argentine Spanish |
es-CL | Spanish | Chile | Chilean Spanish |
es-CO | Spanish | Columbia | Colombian Spanish |
es-ES | Spanish | Spain | Castilian Spanish (as spoken in Central-Northern Spain) |
es-MX | Spanish | Mexico | Mexican Spanish |
es-US | Spanish | United States | American Spanish |
fi-FI | Finnish | Finland | Finnish (Finland) |
fr-BE | French | Belgium | Belgian French |
fr-CA | French | Canada | Canadian French |
fr-CH | French | Switzerland | "Swiss" French |
fr-FR | French | France | Standard French (especially in France) |
he-IL | Hebrew | Israel | Hebrew (Israel) |
hi-IN | Hindi | India | Hindi (India) |
hu-HU | Hungarian | Hungary | Hungarian (Hungary) |
id-ID | Indonesian | Indonesia | Indonesian (Indonesia) |
it-CH | Italian | Switzerland | "Swiss" Italian |
it-IT | Italian | Italy | Standard Italian (as spoken in Italy) |
ja-JP | Japanese | Japan | Japanese (Japan) |
ko-KR | Korean | Republic of Korea | Korean (Republic of Korea) |
nl-BE | Dutch | Belgium | Belgian Dutch |
nl-NL | Dutch | The Netherlands | Standard Dutch (as spoken in The Netherlands) |
no-NO | Norwegian | Norway | Norwegian (Norway) |
pl-PL | Polish | Poland | Polish (Poland) |
pt-BR | Portugese | Brazil | Brazilian Portuguese |
pt-PT | Portugese | Portugal | European Portuguese (as written and spoken in Portugal) |
ro-RO | Romanian | Romania | Romanian (Romania) |
ru-RU | Russian | Russian Federation | Russian (Russian Federation) |
sk-SK | Slovak | Slovakia | Slovak (Slovakia) |
sv-SE | Swedish | Sweden | Swedish (Sweden) |
ta-IN | Tamil | India | Indian Tamil |
ta-LK | Tamil | Sri Lanka | Sri Lankan Tamil |
th-TH | Thai | Thailand | Thai (Thailand) |
tr-TR | Turkish | Turkey | Turkish (Turkey) |
zh-CN | Chinese | China | Mainland China, simplified characters |
zh-HK | Chinese | Hond Kong | Hong Kong, traditional characters |
zh-TW | Chinese | Taiwan | Taiwan, 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 domain | Country |
---|---|
google.ac | Ascension Island |
google.ad | Andorra |
google.ae | United Arab Emirates |
google.al | Albania |
google.am | Armenia |
google.as | American Samoa |
google.at | Austria |
google.az | Azerbaijan |
google.ba | Bosnia and Herzegovina |
google.be | Belgium |
google.bf | Burkina Faso |
google.bg | Bulgaria |
google.bi | Burundi |
google.bj | Benin |
google.bs | Bahamas |
google.bt | Bhutan |
google.by | Belarus |
google.ca | Canada |
google.cat | Catalan Countries |
google.cd | Democratic Republic of the Congo |
google.cf | Central African Republic |
google.cg | Republic of the Congo |
google.ch | Switzerland |
google.ci | Ivory Coast |
google.cl | Chile |
google.cm | Cameroon |
google.cn | China |
google.co.ao | Angola |
google.co.bw | Botswana |
google.co.ck | Cook Islands |
google.co.cr | Costa Rica |
google.co.id | Indonesia |
google.co.il | Israel |
google.co.in | India |
google.co.jp | Japan |
google.co.ke | Kenya |
google.co.kr | South Korea |
google.co.ls | Lesotho |
google.co.ma | Morocco |
google.co.mz | Mozambique |
google.co.nz | New Zealand |
google.co.th | Thailand |
google.co.tz | Tanzania |
google.co.ug | Uganda |
google.co.uk | United Kingdom |
google.co.uz | Uzbekistan |
google.co.ve | Venezuela |
google.co.vi | United States Virgin Islands |
google.co.za | South Africa |
google.co.zm | Zambia |
google.co.zw | Zimbabwe |
google.com | United States |
google.com.af | Afghanistan |
google.com.ag | Antigua and Barbuda |
google.com.ai | Anguilla |
google.com.ar | Argentina |
google.com.au | Australia |
google.com.bd | Bangladesh |
google.com.bh | Bahrain |
google.com.bn | Brunei |
google.com.bo | Bolivia |
google.com.br | Brazil |
google.com.bz | Belize |
google.com.co | Colombia |
google.com.cu | Cuba |
google.com.cy | Cyprus |
google.com.do | Dominican Republic |
google.com.ec | Ecuador |
google.com.eg | Egypt |
google.com.et | Ethiopia |
google.com.fj | Fiji |
google.com.gh | Ghana |
google.com.gi | Gibraltar |
google.com.gt | Guatemala |
google.com.hk | Hong Kong |
google.com.jm | Jamaica |
google.com.kh | Cambodia |
google.com.kw | Kuwait |
google.com.lb | Lebanon |
google.com.ly | Libya |
google.com.mm | Myanmar |
google.com.mt | Malta |
google.com.mx | Mexico |
google.com.my | Malaysia |
google.com.na | Namibia |
google.com.nf | Norfolk Island |
google.com.ng | Nigeria |
google.com.ni | Nicaragua |
google.com.np | Nepal |
google.com.om | Oman |
google.com.pa | Panama |
google.com.pe | Peru |
google.com.pg | Papua New Guinea |
google.com.ph | Philippines |
google.com.pk | Pakistan |
google.com.pr | Puerto Rico |
google.com.py | Paraguay |
google.com.qa | Qatar |
google.com.sa | Saudi Arabia |
google.com.sb | Solomon Islands |
google.com.sg | Singapore |
google.com.sl | Sierra Leone |
google.com.sv | El Salvador |
google.com.tj | Tajikistan |
google.com.tr | Turkey |
google.com.tw | Taiwan |
google.com.ua | Ukraine |
google.com.uy | Uruguay |
google.com.vc | Saint Vincent and the Grenadines |
google.com.vn | Vietnam |
google.cv | Cape Verde |
google.cz | Czech Republic |
google.de | Germany |
google.dj | Djibouti |
google.dk | Denmark |
google.dm | Dominica |
google.dz | Algeria |
google.ee | Estonia |
google.es | Spain |
google.fi | Finland |
google.fm | Micronesia, Federated States of |
google.fr | France |
google.ga | Gabon |
google.ge | Georgia |
google.gg | Guernsey |
google.gl | Greenland |
google.gm | Gambia |
google.gp | Guadeloupe |
google.gr | Greece |
google.gy | Guyana |
google.hn | Honduras |
google.hr | Croatia |
google.ht | Haiti |
google.hu | Hungary |
google.ie | Ireland |
google.im | Isle of Man |
google.iq | Iraq |
google.is | Iceland |
google.it | Italy |
google.je | Jersey |
google.jo | Jordan |
google.kg | Kyrgyzstan |
google.ki | Kiribati |
google.kz | Kazakhstan |
google.la | Laos |
google.li | Liechtenstein |
google.lk | Sri Lanka |
google.lt | Lithuania |
google.lu | Luxembourg |
google.lv | Latvia |
google.md | Moldova |
google.me | Montenegro |
google.mg | Madagascar |
google.mk | Macedonia |
google.ml | Mali |
google.mn | Mongolia |
google.ms | Montserrat |
google.mu | Mauritius |
google.mv | Maldives |
google.mw | Malawi |
google.ne | Niger |
google.nl | Netherlands |
google.no | Norway |
google.nr | Nauru |
google.nu | Niue |
google.pl | Poland |
google.pn | Pitcairn Islands |
google.ps | Palestine |
google.pt | Portugal |
google.ro | Romania |
google.rs | Serbia |
google.ru | Russia |
google.rw | Rwanda |
google.sc | Seychelles |
google.se | Sweden |
google.sh | Saint Helena, Ascension and Tristan da Cunha |
google.si | Slovenia |
google.sk | Slovakia |
google.sm | San Marino |
google.sn | Senegal |
google.so | Somalia |
google.sr | Suriname |
google.st | São Tomé and Príncipe |
google.td | Chad |
google.tg | Togo |
google.tk | Tokelau |
google.tl | Timor-Leste |
google.tm | Turkmenistan |
google.tn | Tunisia |
google.to | Tonga |
google.tt | Trinidad and Tobago |
google.vg | British Virgin Islands |
google.vu | Vanuatu |
google.ws | Samoa |
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 'google_search'
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
Organic 'google_search'
"position": "number"
- it's position on the page.