How to restrict Bing Search API Queries by language & region

1.1k views Asked by At

Using Bing Search API, is there any way to restrict searches by country? That is, an equivalent of Google Custom Search Engine's 'cr' parameter?

For instance, let's say I only want to find web pages from Spain that are available in English.

With Google Custom Search Engine I would use the parameters:

lr=lang_en    # language = English 
cr=countryES  # country = Spain

However, the only related parameters I found for Bing Search API are

  • Markets, which seems to affect only the page's language
  • latitude & longitude: user's location (gl with Google), which weighs in location, but is not a strict filter.
1

There are 1 answers

0
Tristan Tao On

The simplest way is not through the param, but rather modifying the search term (which is actually easier).

So let's say you want to search for the term London in Japanese> Simply do so by leveraging their advanced syntax and search for:

London language:ja

Where language:ja restricts the result to Japanese. You can see a list of language codes here.

If you want to include a region with it, add another advanced operator, loc:

London language:ja loc:es

The above search should return search for "London" written in Japanese, while being from Spain. The country code should be the same in the reference.