How to trick location so google autocomplete API will provide local results, ideally - R

Google has an API for loading search suggestions:

https://www.google.com/support/enterprise/static/gsa/docs/admin/70/gsa_doc_set/xml_reference/query_suggestion.html

Unfortunately, as far as I can tell, these results are specific to your location. for analysis, I would like to be able to determine the city / location at which Google believes that it makes an offer. here, what happens when I scrape from dars salaam, tanzania:

http://suggestqueries.google.com/complete/search?client=firefox&q=insurance

["insurance",["insurance","insurance companies in tanzania","insurance group of tanzania","insurance principles","insurance act","insurance policy","insurance act tanzania","insurance act 2009","insurance definition","insurance industry in tanzania"]] 

I understand that vpn will partially solve this problem, but only by giving me another place and not many places. Is there any reasonable way to quickly and easily reproduce such things, for example, from the 100 largest cities in the United States?

confirmation that results differ in enter image description here

thanks!

+7
r web-scraping geolocation spoofing vpn
source share
2 answers

Google will use your IP address and your location history (if enabled) to determine your location.

To get around this, you can spoof your IP address when logging out of your google account (but I don’t know if Google will consider this a hacking attempt regardless of your intentions).

Another way is to use the Tor browser (although this is not the original purpose). You can configure tor to exit a specific country using the Exitnode parameter in the Exitnode configuration file

As found in docs :

ExitNodes node, node, ...

List of fingerprints, country codes, and host address patterns to use as node output

But if you need a quick way to do this, I don’t think it’s possible, since Google wants to know the real location of users and put a lot of effort into making such tricks fail.

+1
source share

The hl parameter for the interface language modifies the search results, but I cannot determine if it really changes location. For example:

http://suggestqueries.google.com/complete/search?client=chrome&q=why&hl=FR

Here is an example with 5 different hl values:

http://jsbin.com/tusacufaza/edit?js,output

+1
source share

All Articles