I wrote a tool in C# that RETURN the search results in Google Search. However, even if i turn off the cookies and deleted the browser history. It still returns the search results for my local place: Chicago. The URL that i used is:
URL = “https://www.google.com/search?q=health and beauty&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&start=0&num=9&gl=us”
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Accept = "application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
request.Headers["Accept-Language"] = "en-US";
//request.UserAgent = "Mozilla/6.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/16.0.2";
request.UserAgent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)";
request.KeepAlive = true;
request.AllowAutoRedirect =true;
request.Timeout = 60000;
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK)
{
Stream responseStream = response.GetResponseStream();
StreamReader myStreamReader = new StreamReader(responseStream);
responseData = myStreamReader.ReadToEnd();
}
response.Close();
Within the tool, it keeps giving me the results for Chicago. Is there a way for me to get the results for US in stead of Chicago?
Instead of hitting google.com, hit google.ca, but continue to pass in the gl=us parameter. So your URL would look like:
https://www.google.ca/search?q=health and beauty&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&start=0&num=9&gl=us
This appears to bypass the geotargetting for the search terms I’ve tested.