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 code | Country |
| TJ | Tajikistan |
| MY | Malaysia |
| BZ | Belize |
| IN | India |
| PL | Poland |
| FM | Micronesia |
| SH | St. Helena |
| CK | Cook Islands |
| TR | Turkey |
| AR | Argentina |
| QA | Qatar |
| VN | Vietnam |
| LY | Libya |
| ID | Indonesia |
| KI | Kiribati |
| MD | Moldova |
| UY | Uruguay |
| BA | Bosnia & Herzegovina |
| MK | North Macedonia |
| LA | Laos |
| MX | Mexico |
| SM | San Marino |
| GM | Gambia |
| AG | Antigua & Barbuda |
| PA | Panama |
| BT | Bhutan |
| UZ | Uzbekistan |
| KW | Kuwait |
| MG | Madagascar |
| TT | Trinidad & Tobago |
| MT | Malta |
| SC | Seychelles |
| DJ | Djibouti |
| TW | Taiwan |
| PK | Pakistan |
| KZ | Kazakhstan |
| BS | Bahamas |
| DM | Dominica |
| GG | Guernsey |
| AF | Afghanistan |
| BH | Bahrain |
| CF | Central African Republic |
| BF | Burkina Faso |
| RU | Russia |
| KH | Cambodia |
| PH | Philippines |
| MZ | Mozambique |
| GR | Greece |
| BJ | Benin |
| NE | Niger |
| ML | Mali |
| UA | Ukraine |
| NO | Norway |
| TD | Chad |
| LT | Lithuania |
| CI | Côte d’Ivoire |
| JP | Japan |
| GB | United Kingdom |
| VE | Venezuela |
| CH | Switzerland |
| PT | Portugal |
| GT | Guatemala |
| AO | Angola |
| DO | Dominican Republic |
| IE | Ireland |
| JM | Jamaica |
| OM | Oman |
| BY | Belarus |
| SO | Somalia |
| TN | Tunisia |
| SN | Senegal |
| CY | Cyprus |
| TM | Turkmenistan |
| NU | Niue |
| DZ | Algeria |
| MS | Montserrat |
| NR | Nauru |
| MW | Malawi |
| IL | Israel |
| CG | Congo - Brazzaville |
| JO | Jordan |
| BG | Bulgaria |
| BO | Bolivia |
| KG | Kyrgyzstan |
| GL | Greenland |
| GA | Gabon |
| MA | Morocco |
| VI | U.S. Virgin Islands |
| SB | Solomon Islands |
| LV | Latvia |
| FI | Finland |
| HK | Hong Kong |
| SV | El Salvador |
| AI | Anguilla |
| GI | Gibraltar |
| NP | Nepal |
| FR | France |
| SL | Sierra Leone |
| ES | Spain |
| AS | American Samoa |
| BE | Belgium |
| US | United States |
| HN | Honduras |
| CL | Chile |
| NZ | New Zealand |
| BR | Brazil |
| LS | Lesotho |
| FJ | Fiji |
| LB | Lebanon |
| AU | Australia |
| CZ | Czechia |
| TL | Timor-Leste |
| LU | Luxembourg |
| MV | Maldives |
| BD | Bangladesh |
| MM | Myanmar (Burma) |
| IT | Italy |
| RW | Rwanda |
| IM | Isle of Man |
| CV | Cape Verde |
| ZW | Zimbabwe |
| AM | Armenia |
| AE | United Arab Emirates |
| SE | Sweden |
| BN | Brunei |
| CU | Cuba |
| BI | Burundi |
| PY | Paraguay |
| CO | Colombia |
| PN | Pitcairn Islands |
| IQ | Iraq |
| VU | Vanuatu |
| ET | Ethiopia |
| NL | Netherlands |
| HU | Hungary |
| SA | Saudi Arabia |
| AZ | Azerbaijan |
| NA | Namibia |
| PE | Peru |
| ZM | Zambia |
| CR | Costa Rica |
| VG | British Virgin Islands |
| TZ | Tanzania |
| KE | Kenya |
| PG | Papua New Guinea |
| EG | Egypt |
| CM | Cameroon |
| RS | Serbia |
| AD | Andorra |
| WS | Samoa |
| LI | Liechtenstein |
| GE | Georgia |
| CD | Congo - Kinshasa |
| SG | Singapore |
| JE | Jersey |
| SR | Suriname |
| IS | Iceland |
| RO | Romania |
| KR | South Korea |
| AT | Austria |
| DK | Denmark |
| TG | Togo |
| TH | Thailand |
| BW | Botswana |
| DE | Germany |
| AL | Albania |
| HR | Croatia |
| NG | Nigeria |
| PS | Palestine |
| EC | Ecuador |
| TO | Tonga |
| MU | Mauritius |
| NI | Nicaragua |
| GY | Guyana |
| SK | Slovakia |
| PR | Puerto Rico |
| ST | São Tomé & Príncipe |
| ME | Montenegro |
| UG | Uganda |
| MN | Mongolia |
| EE | Estonia |
| HT | Haiti |
| CA | Canada |
| LK | Sri Lanka |
| SI | Slovenia |
| VC | St. Vincent & Grenadines |
| GH | Ghana |
| ZA | South 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.
• "internalRequests": uses a series of queries programmed in Grimport to communicate with Google.