androidgoogle-searchgoogle-custom-searchgoogle-search-api

Setting Language on URL Google Custom Search


I'm developing an Android app which allows users to make a Google Search in a specific language they want. The app provides the list of languages. I was using &hl=LANGUAGE_CODE for normal Google Search and it was working. Now I've changed to Google Custom Search Engine and I'm using Google Custom Search API. However, I'm unable to find a way to set the search language.

On Google's developer website:

[https://developers.google.com/custom-search/docs/xml_results#request-parameters][1]

it says i need to use &ip=10.10.10.10&ad=w5&hl=frto set the advertisement language to french. I tried it but it didn't work.

The exact url i'm trying to pass is:

First Part of The URL + "gsc.tab=0&" + "gsc.sort=&gsc.q=" + searchQuery + "&hl=fr" (fr for french in this specific example.

So if anyone has an idea about how to set the language using URL in Google Custom Search Engine please help.

Thanks in advance.


Solution

  • You can use the following in your search bar to filter the websites. It won't have the same effect but it should help.

    "site=.fr"
    

    for French for example.