Query with Localization

This documentation explains how to use localization parameters with the SERP API to tailor search results based on the user's preferred language and location.

Parameters for Localization

The SERP API provides three optional parameters for localization:

  • googleDomain (Optional): This parameter defines the Google domain to use. By default, it is set to www.google.com. Ensure you include "www" before the domain name.

  • gl (Optional): This parameter defines the country to use for the Google search. It should be a two-letter country code (e.g., us for the United States, uk for the United Kingdom, or fr for France).

  • hl (Optional): This parameter defines the language to use for the Google search. It should be a two-letter language code (e.g., en for English, es for Spanish, or fr for French). You can find a full list of supported Google languages on the Google languages page.

Using Localization Parameters

To customize your SERP API request for localization, include the localization parameters in your GET request. Here's an example using various programming languages:

  • Bash

  • Javascript

  • Python

  • Go

curl -L 'https://serp-api.netnut.io/search?device=desktop&q=news&gl=us&hl=en' \
-H 'Accept: application/json' \
-H 'Authorization: Basic base64(username:password)'

API Response

When you include localization parameters, the API response will contain search results tailored to the specified country and language preferences.

This documentation demonstrates how to use localization parameters to customize your SERP API requests. You can adjust the gl and hl parameters to provide users with search results that match their location and language preferences.

Last updated