# Query with Geographic Location

This documentation explains how to specify a geographic location for your Bing searches using the SERP API. \
Bing uses a combination of `location` and `setLang` parameters to localize search results.

### Parameter for Geographic Location[​](https://serp-api.netnut.io/docs/SERP/API%20Examples/Query%20with%20Location#parameter-for-geographic-location) <a href="#parameter-for-geographic-location" id="parameter-for-geographic-location"></a>

The SERP API provides optional parameters for specifying the desired location and language for your Bing search:

* `location` (Optional): A two-letter country code ([ISO 3166-1 Alpha-2](https://www.iso.org/obp/ui/#search)) to indicate the country context (e.g., `us`, `uk`, `de`, `cn`).
* `setLang` (Optional)**:** A two-letter language code ([ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes)) to specify the interface language (e.g., `en`, `fr`, `zh-cn`).

These parameters influence the localization of search results and the language of the Bing interface used in the query.

### Example

To customize your SERP API request with a specific geographic context, include the `location` and `setLang` parameters in your GET request.

```bash
curl --location 'https://serp-api.netnut.io/search/get-html?siteType=bing&q=Netnut&setLang=en&location=us&rawHtml=1&device=desktop' \
--header 'Authorization: Basic base64(username:password)'
```

**Expected Result:**

* Search country is United States.
* Results are returned in English .
* Bing will simulate a user searching from Bing in the United States.

***

### API Response Example

The API responds with a structured JSON containing the Bing SERP results localized based on the specified geographic context.

```json
{
    "url": "https://www.bing.com/search?q=Netnut&setLang=en&device=desktop",
    "engine": "bing",
    "general": {
        "id": "d04bda34-681e-4a40-929c-34a86994cde5",
        "timestamp": "2025-08-05 11:54:21 UTC",
        "bing_url": "https://www.bing.com/search?q=Netnut&setLang=en&device=desktop",
        "resultscount": 20800
    },
    "input": {
        "q": "Netnut",
        "location": "us",
        "device": "desktop",
        "engine": "bing"
    },
    "organic_results": [
        {
            "position": 1,
            "title": "NetNut - High Quality Proxies Network For Web Data Collection",
            "snippet": "Extract structured data from any website with our proxy network—Powering AI models & complex pipelines. Trusted by Fortune 500. Fueling the infrastructure for AI. Residential proxies for data …",
            "link": "https://netnut.io/",
            "displayed_link": "https://netnut.io",
            "tracking_link": "https://netnut.io/",
            "thumbnail": "https://www.bing.com/th/id/ODF.EmGmOVJsPKHe3JA9Fb9Qpg?w=32&h=32&qlt=90&pcl=fffffa&o=6&pid=1.2"
        },
        // More results...
    ],
    "pagination": {
        "current": 1,
        "next": "https://www.bing.com/search?q=Netnut&setLang=en&device=mobile&FPIG=CCDA11C5299645EA9A801E357DD1764E&first=11&FORM=PORE",
        "other_pages": {
            "2": "https://www.bing.com/search?q=Netnut&setLang=en&device=mobile&FPIG=CCDA11C5299645EA9A801E357DD1764E&first=11&FORM=PERE",
            "3": "https://www.bing.com/search?q=Netnut&setLang=en&device=mobile&FPIG=CCDA11C5299645EA9A801E357DD1764E&first=21&FORM=PERE1",
            "4": "https://www.bing.com/search?q=Netnut&setLang=en&device=mobile&FPIG=CCDA11C5299645EA9A801E357DD1764E&first=31&FORM=PERE2"
    }
},
   "html": "<!DOCTYPE html><html dir=\...."
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.netnut.io/netnut-documentation/netnut-scraper-apis/serp-api/bing-search/api-example/query-with-geographic-location.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
