serpGoogle

serpGoogle ( string searchExpression , int[default:1] _page , string[default:google.com] _search_engine , string _language , string _country , int[default:10] _numberOfResults , bool[default:true] _excludePDF , closure _actionOnError , string _method ) : array

Get the Google Search Results. It is free but it can block sometimes because Google does not like multiple calls.
If you use a rotating VPN, the following performance is observed on average: between 2 and 3 seconds per request (including VPN change) and 30 Google blocks per 1000 requests.
The value returned is a list of array. Ex: [ ["title":"My first Google result", "url":"http://first.com", "description":"Something describing", "rank":"1"] , ["title":"My second Google result", "url":"http://next.com", "description":"Wow it is amazing", "rank":"2"] ]

This function can have long pause times (up to 5 minutes) in case of difficulty to communicate with Google. Conflict resolution procedures are included in the function.

Parameters

searchExpression

search expression in the Google text field

_page (optional)

Number of the page (page 1,2,3...)

_search_engine (optional)

The domain name of google. Ex: google.com, google.fr, google.de

_language (optional)

Default:null. The language you need (en-US, fr-FR, de-DE, nl-NL, it-IT, en-GB, etc.). It is the hl parameter. Set null to have a "neutral" language.
Language Country Code
Bulgarian bg-bg
Chinese (Simplified) - PRC zh-CN
Chinese (Traditional) - Taiwan zh-TW
Czech cs-CZ
Danish da-DK
Dutch nl-NL
English UK en-UK
English US in US
Filipino (Tagalog) tl-PH
Finnish fi-FI
French fr-FR
German de-DE
Greek the-GR
Hungarian hu-HU
Indonesian id-ID
Italian it-IT
Japanese me-JP
Korean ko-KR
Lithuanian lt-LT
Norwegian nerd
Polish pl-PL
Portuguese Brazil pt-BR
Portuguese Portugal pt-pt
Russian ru-RU
Slovak sk-SK
Spanish en-ES
Swedish sv-SE
Thai th-TH
Turkish child-child
Vietnamese we-VN

_country (optional)

Default:null. Country code. It is the gl parameter. Set null to have a "neutral" country.
Country codeCountry
TJTajikistan
MYMalaysia
BZBelize
INIndia
PLPoland
FMMicronesia
SHSt. Helena
CKCook Islands
TRTurkey
ARArgentina
QAQatar
VNVietnam
LYLibya
IDIndonesia
KIKiribati
MDMoldova
UYUruguay
BABosnia & Herzegovina
MKNorth Macedonia
LALaos
MXMexico
SMSan Marino
GMGambia
AGAntigua & Barbuda
PAPanama
BTBhutan
UZUzbekistan
KWKuwait
MGMadagascar
TTTrinidad & Tobago
MTMalta
SCSeychelles
DJDjibouti
TWTaiwan
PKPakistan
KZKazakhstan
BSBahamas
DMDominica
GGGuernsey
AFAfghanistan
BHBahrain
CFCentral African Republic
BFBurkina Faso
RURussia
KHCambodia
PHPhilippines
MZMozambique
GRGreece
BJBenin
NENiger
MLMali
UAUkraine
NONorway
TDChad
LTLithuania
CICôte d’Ivoire
JPJapan
GBUnited Kingdom
VEVenezuela
CHSwitzerland
PTPortugal
GTGuatemala
AOAngola
DODominican Republic
IEIreland
JMJamaica
OMOman
BYBelarus
SOSomalia
TNTunisia
SNSenegal
CYCyprus
TMTurkmenistan
NUNiue
DZAlgeria
MSMontserrat
NRNauru
MWMalawi
ILIsrael
CGCongo - Brazzaville
JOJordan
BGBulgaria
BOBolivia
KGKyrgyzstan
GLGreenland
GAGabon
MAMorocco
VIU.S. Virgin Islands
SBSolomon Islands
LVLatvia
FIFinland
HKHong Kong
SVEl Salvador
AIAnguilla
GIGibraltar
NPNepal
FRFrance
SLSierra Leone
ESSpain
ASAmerican Samoa
BEBelgium
USUnited States
HNHonduras
CLChile
NZNew Zealand
BRBrazil
LSLesotho
FJFiji
LBLebanon
AUAustralia
CZCzechia
TLTimor-Leste
LULuxembourg
MVMaldives
BDBangladesh
MMMyanmar (Burma)
ITItaly
RWRwanda
IMIsle of Man
CVCape Verde
ZWZimbabwe
AMArmenia
AEUnited Arab Emirates
SESweden
BNBrunei
CUCuba
BIBurundi
PYParaguay
COColombia
PNPitcairn Islands
IQIraq
VUVanuatu
ETEthiopia
NLNetherlands
HUHungary
SASaudi Arabia
AZAzerbaijan
NANamibia
PEPeru
ZMZambia
CRCosta Rica
VGBritish Virgin Islands
TZTanzania
KEKenya
PGPapua New Guinea
EGEgypt
CMCameroon
RSSerbia
ADAndorra
WSSamoa
LILiechtenstein
GEGeorgia
CDCongo - Kinshasa
SGSingapore
JEJersey
SRSuriname
ISIceland
RORomania
KRSouth Korea
ATAustria
DKDenmark
TGTogo
THThailand
BWBotswana
DEGermany
ALAlbania
HRCroatia
NGNigeria
PSPalestine
ECEcuador
TOTonga
MUMauritius
NINicaragua
GYGuyana
SKSlovakia
PRPuerto Rico
STSão Tomé & Príncipe
MEMontenegro
UGUganda
MNMongolia
EEEstonia
HTHaiti
CACanada
LKSri Lanka
SISlovenia
VCSt. Vincent & Grenadines
GHGhana
ZASouth Africa

_numberOfResults (optional)

Number of the results per page. Possible values: 10,20,30,40,50,100.

_excludePDF (optional)

Exclude PDF from Google results

_actionOnError (optional)

Execute an action if Google return an error. Very useful to change IP or solve a captcha when Google think you are a robot. It is recommanded to use it with a VPN service. You can use an anticaptcha system too (ex: the extension 2Captcha on Firefox Developper), for 1000 requests you will have about 30 captchas to solve, which is a cost of 0.03€ / 1000 requests.
serpGoogle("keyword",null,null,null,null,null,null, {-> changeProxy(["method":"nordvpn_by_command","zone":"europe"]) })

_method (optional)

• "firefox" (by default): uses Firefox and the extension of firefox to communicate with Google. With this option, you must specify the Grimport key of the Firefox extension.
• "internalRequests": uses a series of queries programmed in Grimport to communicate with Google.