serpapi / public-roadmap

Public Roadmap for SerpApi, LLC (https://serpapi.com)
51 stars 4 forks source link

Localization parameter returning incorrect results. #1377

Open AndrejFLina opened 8 months ago

AndrejFLina commented 8 months ago

I am using the google-autocorrect engine with SERP API. I am inputting as the localisation parameter "gb-en" for UK results in English and I am receiving results taken from the US "best buy", "best restaurant in buffalo". Why is the following code returning US results?

` keywords= [ "best ", "best way to ", "fastest way to ", "cheapest ", "cheap " ]

suggestions_list = []

for keyword in keywords:

params = {

    "engine": "google_autocomplete",
    "q": keyword,
    "api_key": api_key, 
    "localization": "gb-en",
}

search = GoogleSearch(params)
results = search.get_dict()
suggestions = results["suggestions"]

suggestions_list.append(suggestions)

`

hilmanski commented 8 months ago

Hi, the localization for google_autocomplete API is using hl and gl parameter.

The parameter will looks like this:

"engine": "google_autocomplete",
"q": "best ",
"gl": "uk",
"hl": "en"

Feel free to reach us out at contact(at)serpapi(dot)com if you have any follow up questions.