# Introduction to Bing Search Scraper

This document provides information about the API endpoints, supported environments, and available GET parameters for the NetNut's Bing Scraper API. \
The API allows you to retrieve search engine results pages (SERPs) from Bing.

### Authentication[​](https://serp-api.netnut.io/docs/SERP/Getting%20Started#authentication) <a href="#authentication" id="authentication"></a>

To access the NetNut API, you must provide basic authentication credentials using the username and password provided by NetNut. Include these credentials in the HTTP request headers as follows:

`Authorization: Basic base64(username:password)`

Where `base64(username:password)` is the Base64-encoded string of your username and password concatenated with a colon (:) separator.

### Environments

Base URL: `https://serp-api.netnut.io`\
Endpoint: `/search/get-html?`

### API Parameters & Specifications

The following parameters are supported when retrieving Bing SERPs via the API. To target Bing specifically, you must include the parameter `siteType=bing` in your request.

#### &#x20;Search Query[​](https://serp-api.netnut.io/docs/SERP/Getting%20Started#----search-query-) <a href="#search-query" id="search-query"></a>

| Name | Status   | Description                                                 |
| ---- | -------- | ----------------------------------------------------------- |
| `q`  | Required | The 'q' parameter defines the query you want to search for. |

#### &#x20;Pagination[​](https://serp-api.netnut.io/docs/SERP/Getting%20Started#--pagination-) <a href="#pagination" id="pagination"></a>

| Name    | Status   | Description                                                                                                                                                                                                                                                                                          |
| ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `first` | Optional | <p>The 'start' parameter defines the results offset. It allows skipping the given number of results. <br>It is used for pagination. (e.g., <code>0</code> (default) is the first page of results, <code>10</code> is the 2nd page of results, <code>20</code> is the 3rd page of results, etc.).</p> |
| `sid`   | Optional | <p>The <code>sid</code> parameter defines a session identifier used to keep the same IP across multiple requests.<br>It is typically used to maintain session consistency when retrieving paginated results.</p>                                                                                     |

#### &#x20;Localization[​](https://serp-api.netnut.io/docs/SERP/Getting%20Started#--localization--) <a href="#localization" id="localization"></a>

| Name       | Status   | Description                                                                                                                                                                                                                                |
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `location` | Optional | <p>The <code>location</code> parameter defines the proxy being used to address Bing search. <br>It is a two-letter country code. <br>For example - use <code>us</code> for the United States, <code>uk</code> for United Kingdom, etc.</p> |
| `setLang`  | Optional | <p>The language setting for the browser interface.<br>It is a two-letter country code. For example - use <code>en</code> for English, <code>fr</code> for French, etc.</p>                                                                 |

#### &#x20;Advanced Filters[​](https://serp-api.netnut.io/docs/SERP/Getting%20Started#--advanced-filters--) <a href="#advanced-filters" id="advanced-filters"></a>

<table><thead><tr><th>Name</th><th width="222">Status</th><th>Description</th></tr></thead><tbody><tr><td><code>rawHtml</code></td><td>Optional</td><td>The 'rawHtml' parameter defines the final output you want. It can be set to <code>1 (true)</code> or <code>0 (false)</code> to get the raw html response.<br>for receiving html only (without parsing) set it to <code>2 (only)</code></td></tr><tr><td><code>safeSearch</code></td><td>Optional</td><td><p></p><p>Controls the Bing SafeSearch filter. <br>Acceptable values are:</p><p><code>safeSearch=strict</code><br><code>safeSearch=moderate</code><br><code>safeSearch=off</code></p></td></tr><tr><td><code>device</code></td><td>Optional</td><td>The 'device' parameter defines the device to use to get the Bing search results. <br>The parameter can be set to <code>desktop</code> (default) to use a regular browser, or <code>mobile</code> to use a mobile browser (currently using iPhones).</td></tr></tbody></table>

### API Results HTTP Response

The API currently supports JSON responses. Here is an example schema of the Bing SERP API response:

```json
{
    "url": "string",
    "engine": "bing",
    "general": {
        "id": "string",
        "timestamp": "string",
        "bing_url": "string",
        "resultscount": 0
    },
    "input": {
        "q": "string",
        "location": "string",
        "device": "string",
        "engine": "bing"
    },
    "organic_results": [
        {
            "position": 0,
            "title": "string",
            "snippet": "string",
            "link": "string",
            "displayed_link": "string",
            "tracking_link": "string",
            "thumbnail": "string"
        }
    ],
    "pagination": {
        "current": 0,
        "next": "string",
        "other_pages": {
            "2": "string",
            "3": "string"
        }
    },
    "html": "string"
}
```

#### Key Notes:

* The top-level `engine` field will always be `bing` when `siteType=bing` is specified.
* `organic_results` contains an array of result objects, each including position, title, snippet, URL, display link, and optional thumbnails.
* The `pagination` object includes current and next page indices and URLs.
* If `rawHtml=1` is set, the full HTML source of the search result page will be included under the `html` field.


---

# 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/introduction-to-bing-search-scraper.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.
