Copied to clipboard!

Bing Search Engine Results API

/search?engine=bing API endpoint allows you to scrape the results from the Bing search engine via our SerpApi service.

Search Query

Name
Required
Description

q

Required

The search query. You can use anything that you would use in a regular Bing search. (e.g., "query", NOT, OR, site:, filetype:, near:, ip:, loc:, feed: etc.)

Geographic Location

Name
Required
Description

mkt

Optional

The market where the results come from (e.g. en-US). Typically, mkt is the country where the user is making the request from. However, it could be a different country if the user is not located in a country where Bing delivers results. The market must be in the form <language code>-<country code>. For example, en-US. The string is case insensitive. For a list of possible market values, see Market Codes.

NOTE: If known, you are encouraged to always specify the market. Specifying the market helps Bing route the request and return an appropriate and optimal response. If you specify a market that is not listed in Market Codes, Bing uses a best fit market code based on an internal mapping that is subject to change.

This parameter and the cc query parameter are mutually exclusive—do not specify both.

Localization

Name
Required
Description

cc

Optional

Defines the country to search from. It follows the 2-character ISO_3166-1 format. (e.g., us for United States, de for Germany, gb for United Kingdom, etc.)

Pagination

Name
Required
Description

first

Optional

controls the offset of the organic results. This parameter defaults to 1. (e.g., first=10 will move the 10th organic result to the first position).

count

Optional

Controls the number of results per page. Minimum: 1, Maximum: 50. This parameter is only a suggestion and might not reflect actual results returned.

Advanced Filters

Name
Required
Description

safeSearch

Optional

Defines the level of filtering for adult content.
It can be set to:

  • Off to return webpages with adult text, images, or videos.
  • Moderate to return webpages with adult text, but not adult images or videos.
  • Strict to not return webpages with adult text, images, or videos.

SerpApi Parameters

Name
Required
Description

engine=bing

Required

Parameter to select the Bing search engine.

device

Optional

Parameter defines the device to use to get the results. It can be set to desktop (default) to use a regular browser, tablet to use a tablet browser (currently using iPads), or mobile to use a mobile browser (currently using iPhones).

async

Optional

Parameter defines the way you want to submit your search to SerpApi. It can be set to false (default) to open an HTTP connection and keep it open until you got your search results, or true to just submit your search to SerpApi and retrieve them later. In this case, you'll need to use our Searches Archive API to retrieve your results. async and no_cache parameters should not be used together.

no_cache

Optional

Parameter will force SerpApi to fetch the Bing results even if a cached version is already present. A cache is served only if the query and all parameters are exactly the same. Cache expires after 1h. Cached searches are free, and are not counted towards your searches per month. It can be set to false (default) to allow results from the cache, or true to disallow results from the cache. no_cache and async parameters should not be used together.

api_key

Optional

Parameter defines the SerpApi private key to use.

output

Optional

Parameter defines the final output you want. It can be set to json (default) to get a structured JSON of the results, or html to get the raw html retrieved.

Results


JSON Results

JSON output includes structured data for organic results, ad results, and more.


A search status is accessible through search_metadata.status. It flows this way: Queued -> Processing -> Success || Error. If a search has failed, error will contain an error message. search_metadata.id is the search ID inside SerpApi.

HTML Results

HTML output is useful to debug JSON results or support features not supported yet by SerpApi.
HTML output gives you the raw HTML results from Bing.

Organic Results

Examples


Example with q parameter only:
{
  "search_metadata": {
    "id": "5ce77fe05f59e47e5d8d7f4a",
    "status": "Success",
    "created_at": "2019-05-24 05:23:44 UTC",
    "processed_at": "2019-05-24 05:23:44 UTC",
    "bing_url": "https://www.bing.com/search?form=QBRE&q=Coffee",
    "total_time_taken": 4.27
  },
  "search_parameters": {
    "q": "Coffee",
    "device": "desktop"
  },
  "organic_results": [
    {
      "position": 1,
      "title": "Coffee - Wikipedia",
      "link": "https://en.wikipedia.org/wiki/Coffee",
      "displayed_link": "https://en.wikipedia.org/wiki/Coffee",
      "snippet": "Coffee is a brewed drink prepared from roasted coffee beans, the seeds of berries from certain Coffea species. The genus Coffea is native to tropical Africa (specifically having its origin in Ethiopia and Sudan) and Madagascar, the Comoros, Mauritius, and Réunion in the Indian Ocean. Coffee plants are now cultivated in over 70 countries, primarily in the equatorial regions of the Americas ..."
    },
    ...
  ],
  "ads": [
    {
      "position": 1,
      "block_position": "bottom",
      "tracking_link": "...",
      "displayed_link": "http://www.activebeat.com",
      "description": "Want to Know More About Coffee? Learn All You Need to Know Here!"
    }
  ]
}

The URL above fetches global results for the search "Coffee".

Example with optional parameters:
{
  "search_metadata": {
    "id": "5ce77e9e5f59e47e5d8d7f49",
    "status": "Cached",
    "created_at": "2019-05-24 05:18:22 UTC",
    "processed_at": "2019-05-24 05:18:22 UTC",
    "bing_url": "https://www.bing.com/search?form=QBRE&q=Fresh+Bagels&first=20&count=30&safeSearch=Strict",
    "total_time_taken": 3.0
  },
  "search_parameters": {
    "q": "Fresh Bagels",
    "device": "desktop",
    "first": "20",
    "count": "30",
    "safe_search": "Strict"
  },
  "organic_results": [
    {
      "position": 1,
      "title": "Fresh Bagels & Wraps for Dine In, Take Out & Catering in ...",
      "link": "http://bageljays.com/",
      "displayed_link": "bageljays.com",
      "snippet": "Bagel Jay’s started the fresh bagel tradition in Buffalo, NY in 1976. Perfect for a quick bite to meet family, friends or business associates. Breakfast or Lunch. Specializing in homemade cream cheese …"
    },
    ...
  ],
  "ads": [
    {
      "position": 1,
      "block_position": "top",
      "tracking_link": "...",
      "displayed_link": "https://www.ezcater.com/Catering/Menu",
      "sitelinks": {
        "inline": [
          {
            "title": "Enterprise solutions",
            "tracking_link": "..."
          },
          {
            "title": "Our team",
            "tracking_link": "..."
          },
          ...
        ]
      },
      "thumbnail": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAATklEQVR4AWP4//8/HJeVlQkA8QIg/g/CULYAshoUDVAFB4BYAYSh7AX4NPwHKUTiK4DE8GoA0ciYYg0wwQsgCQL4ArKG/8Tg4aCBrFACANnEb3hNDHmBAAAAAElFTkSuQmCC",
      "description": "Place your catering order. Free & easy online ordering. On time delivery."
    },
    {
      "position": 2,
      "block_position": "bottom",
      "tracking_link": "...",
      "displayed_link": "http://www.Amazon.com/Grocery",
      "description": "Free Shipping on Qualified Orders. Buy Groceries at Amazon & Save."
    },
    ...
  ]
}