News Search API v7 reference

The News Search API lets you send a search query to Bing and get back a list of relevant news articles. This section provides technical details about the query parameters and headers that you use to request news articles and the JSON response objects that contain them. For examples that show how to make requests, see Searching the Web for News.

For information about the headers that requests should include, see Request Headers.

For information about the query parameters that requests should include, see Query Parameters.

For information about the JSON objects that the response may include, see Response Objects.

For information about permitted use and display of results, see Bing Search API Use and Display requirements.

Endpoints

To request news articles, send a GET request to one of the following URLs:

URL Description
https://api.cognitive.microsoft.com/bing/v7.0/news Returns the top news articles by category. For example, you can request the top sports or entertainment articles. For information about specifying categories, see the category query parameter.
https://api.cognitive.microsoft.com/bing/v7.0/news/search Returns news articles based on the user's search query. If the search query is empty, the call returns the top news articles.
https://api.cognitive.microsoft.com/bing/v7.0/news/trendingtopics Returns trending news topics that are currently trending on social networks.

NOTE: Available only in the en-US and zh-CN markets.

The request must use the HTTPS protocol; HTTP is not supported.

Note

The maximum URL length is 2,048 characters. To ensure that your URL length does not exceed the limit, the maximum length of your query parameters should be less than 1,500 characters. If the URL exceeds 2,048 characters, the server returns 404 Not found.

Headers

The following are the headers that a request and response may include.

Header Description
Accept Optional request header.

The default media type is application/json. To specify that the response use JSON-LD, set the Accept header to application/ld+json.
Accept-Language Optional request header.

A comma-delimited list of languages to use for user interface strings. The list is in decreasing order of preference. For more information, including expected format, see RFC2616.

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

If you set this header, you must also specify the cc query parameter. To determine the market to return results for, Bing uses the first supported language it finds from the list and combines it with the cc parameter value. If the list does not include a supported language, Bing finds the closest language and market that supports the request or it uses an aggregated or default market for the results. To determine the market that Bing used, see the BingAPIs-Market header.

Use this header and the cc query parameter only if you specify multiple languages. Otherwise, use the mkt and setLang query parameters.

A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Any links to Bing.com properties in the response objects apply the specified language.
BingAPIs-Market Response header.

The market used by the request. The form is <languageCode>-<countryCode>. For example, en-US.

If you specify a market that is not listed in Market Codes, this value may differ from the market you specified in the mkt query parameter. The same is true if you specify values for cc and Accept-Language that can't be reconciled.
BingAPIs-TraceId Response header.

The ID of the log entry that contains the details of the request. When an error occurs, capture this ID. If you are not able to determine and resolve the issue, include this ID along with the other information that you provide the Support team.
Ocp-Apim-Subscription-Key Required request header.

The subscription key that you received when you signed up for this service in Cognitive Services.
Pragma Optional request header

By default, Bing returns cached content, if available. To prevent cached content, set the Pragma header to no-cache (for example, Pragma: no-cache).
Retry-After Response header.

The response includes this header if you exceed the number of queries allowed per second (QPS) or per month (QPM). The header contains the number of seconds that you must wait before sending another request.
User-Agent Optional request header.

The user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are encouraged to always specify this header.

The user-agent should be the same string that any commonly used browser sends. For information about user agents, see RFC 2616.

The following are examples of user-agent strings.
  • Windows Phone—Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 822)

  • Android—Mozilla/5.0 (Linux; U; Android 2.3.5; en-us; SCH-I500 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML; like Gecko) Version/4.0 Mobile Safari/533.1

  • iPhone—Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML; like Gecko) Mobile/10B142 iPhone4;1 BingWeb/3.03.1428.20120423

  • PC—Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko

  • iPad—Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53
X-MSEdge-ClientID Optional request and response header.

Bing uses this header to provide users with consistent behavior across Bing API calls. Bing often flights new features and improvements, and it uses the client ID as a key for assigning traffic on different flights. If you do not use the same client ID for a user across multiple requests, then Bing may assign the user to multiple conflicting flights. Being assigned to multiple conflicting flights can lead to an inconsistent user experience. For example, if the second request has a different flight assignment than the first, the experience may be unexpected. Also, Bing can use the client ID to tailor web results to that client ID’s search history, providing a richer experience for the user.

Bing also uses this header to help improve result rankings by analyzing the activity generated by a client ID. The relevance improvements help with better quality of results delivered by Bing APIs and in turn enables higher click-through rates for the API consumer.

IMPORTANT: Although optional, you should consider this header required. Persisting the client ID across multiple requests for the same end user and device combination enables 1) the API consumer to receive a consistent user experience, and 2) higher click-through rates via better quality of results from the Bing APIs.

The following are the basic usage rules that apply to this header.
  • Each user that uses your application on the device must have a unique, Bing generated client ID.

    If you do not include this header in the request, Bing generates an ID and returns it in the X-MSEdge-ClientID response header. The only time that you should NOT include this header in a request is the first time the user uses your app on that device.

  • ATTENTION: You must ensure that this Client ID is not linkable to any authenticatable user account information.

  • Use the client ID for each Bing API request that your app makes for this user on the device.

  • Persist the client ID. To persist the ID in a browser app, use a persistent HTTP cookie to ensure the ID is used across all sessions. Do not use a session cookie. For other apps such as mobile apps, use the device's persistent storage to persist the ID.

    The next time the user uses your app on that device, get the client ID that you persisted.

NOTE: Bing responses may or may not include this header. If the response includes this header, capture the client ID and use it for all subsequent Bing requests for the user on that device.

NOTE: If you include the X-MSEdge-ClientID, you must not include cookies in the request.
X-MSEdge-ClientIP Optional request header.

The IPv4 or IPv6 address of the client device. The IP address is used to discover the user's location. Bing uses the location information to determine safe search behavior.

NOTE: Although optional, you are encouraged to always specify this header and the X-Search-Location header.

Do not obfuscate the address (for example, by changing the last octet to 0). Obfuscating the address results in the location not being anywhere near the device's actual location, which may result in Bing serving erroneous results.
X-Search-Location Optional request header.

A semicolon-delimited list of key/value pairs that describe the client's geographical location. Bing uses the location information to determine safe search behavior and to return relevant local content. Specify the key/value pair as <key>:<value>. The following are the keys that you use to specify the user's location.

  • lat—Required. The latitude of the client's location, in degrees. The latitude must be greater than or equal to -90.0 and less than or equal to +90.0. Negative values indicate southern latitudes and positive values indicate northern latitudes.

  • long—Required. The longitude of the client's location, in degrees. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0. Negative values indicate western longitudes and positive values indicate eastern longitudes.

  • re—Required. The radius, in meters, which specifies the horizontal accuracy of the coordinates. Pass the value returned by the device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for reverse IP lookup.

  • ts—Optional. The UTC UNIX timestamp of when the client was at the location. (The UNIX timestamp is the number of seconds since January 1, 1970.)

  • head—Optional. The client's relative heading or direction of travel. Specify the direction of travel as degrees from 0 through 360, counting clockwise relative to true north. Specify this key only if the sp key is nonzero.

  • sp—Optional. The horizontal velocity (speed), in meters per second, that the client device is traveling.

  • alt—Optional. The altitude of the client device, in meters.

  • are—Optional. The radius, in meters, that specifies the vertical accuracy of the coordinates. Specify this key only if you specify the alt key.

NOTE: Although many of the keys are optional, the more information that you provide, the more accurate the location results are.

NOTE: Although optional, you are encouraged to always specify the user's geographical location. Providing the location is especially important if the client's IP address does not accurately reflect the user's physical location (for example, if the client uses VPN). For optimal results, you should include this header and the X-Search-ClientIP header, but at a minimum, you should include this header.

Note

Remember that the Terms of Use require compliance with all applicable laws, including regarding use of these headers. For example, in certain jurisdictions, such as Europe, there are requirements to obtain user consent before placing certain tracking devices on user devices.

Query parameters

The following are the query parameters that the request may include. The Required column indicates whether you must specify the parameter. You must URL encode the query parameter values.

Name Value Type Required
cc A 2-character country code of the country where the results come from. For a list of possible values, see Market Codes.

If you set this parameter, you must also specify the Accept-Language header. Bing uses the first supported language it finds in the specified languages and combines it with the country code to determine the market to return results for. If the languages list does not include a supported language, Bing finds the closest language and market that supports the request. Or, Bing may use an aggregated or default market for the results.

Use this query parameter and the Accept-Language header only if you specify multiple languages. Otherwise, you should use the mkt and setLang query parameters.

This parameter and the mkt query parameter are mutually exclusive—do not specify both.
String No
category The category of articles to return. For example, Sports articles or Entertainment articles. For a list of possible categories, see News Categories by Market.

Use this parameter only with news category requests (see the /news endpoint).

If you do not specify this parameter, the response includes both:
  • Headline articles typically published in the last 24 hours from any category, but some articles may be older.

    If the article is a headline, the article's headline field is set to true. By default, the response includes up to 12 headline articles and clusters. To specify the number of headline articles to return, set the headlineCount query parameter.

  • Articles from each parent category (up to four articles and clusters from each category).

If you do not specify headlineCount and the market supports eight categories, the response includes up to 44 articles and clusters (12 headline articles and clusters plus 32 category-specific articles and clusters). Because a cluster contains more than one article, the number of articles in this example, 44, could be more. For example, the response may include 11 headline articles and one cluster, which contains four related headline articles for a total of 15 headline articles.
String No
count The number of news articles to return in the response. The actual number delivered may be less than requested. The default is 10 and the maximum value is 100.

For trending topics, the default is all trending news topics (approximately 55 articles).

You may use this parameter along with the offset parameter to page results. For example, if your user interface displays 20 articles per page, set count to 20 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 20 (for example, 0, 20, 40). It is possible for multiple pages to include some overlap in results.

NOTE: Clusters are counted as a single item. For example, if you set the count to 10, the response may include 9 articles and 1 cluster but the cluster may contain 5 articles.

NOTE: If you're requesting news categories, specify this parameter only if you specify the category parameter. If you do not specify the category parameter, Bing ignores this parameter.
UnsignedShort No
freshness Filter news articles by the following age values:
  • Day—Return news articles that Bing discovered within the last 24 hours
  • Week—Return news articles that Bing discovered within the last 7 days
  • Month—Return news articles that Bing discovered within the last 30 days

Trending Topics ignores this parameter.
String No
headlineCount The number of headline articles and clusters to return. The default is 12.

Specify this parameter only if you do not specify the category parameter. If you specify the category parameter, Bing ignores this parameter.

Use this parameter only with news category requests.
UnsignedShort No
mkt The market where the results come from. 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.
String No
offset The zero-based offset that indicates the number of news articles to skip before returning articles. The default is 0. The offset should be less than (totalEstimatedMatches - count).

Use this parameter along with the count parameter to page results. For example, if your user interface displays 20 articles per page, set count to 20 and offset to 0 to get the first page of results. For each subsequent page, increment offset by 20 (for example, 0, 20, 40). It is possible for multiple pages to include some overlap in results.

NOTE: Clusters are counted as a single item. For example, if you set the count to 10, the response may include 9 articles and 1 cluster but the cluster may contain 5 articles.

NOTE: If requesting news categories, specify this parameter only if you specify the category parameter. If you do not specify the category parameter, Bing ignores this parameter.
Unsigned Short No
originalImg A Boolean value that determines whether the image's contentUrl contains a URL that points to a thumbnail of the original article's image or the image itself.

If the article includes an image, and this parameter is set to true, the image's contentUrl property contains a URL that you may use to download the original image from the publisher's website. Otherwise, if this parameter is false, the image's contentUrl and thumbnailUrl URLs both point to the same thumbnail image.

The default is false.

Use this parameter only with the News Search API. Do not specify this parameter when calling the Web Search API. Trending Topics ignores this parameter.
Boolean No
q The user's search query term. If the term is empty (for example, q=), the response includes the top news stories.

The term string may contain Bing Advanced Operators. For example, to limit news to a specific domain, use the site: operator.

If you're getting news articles by category, do not include this parameter. Trending Topics ignores this parameter.
String Yes
safeSearch Filter news articles for adult content. The following are the possible filter values.
  • Off—Return news articles with adult text, images, or videos.

  • Moderate—Return news articles with adult text but not adult images or videos.

  • Strict—Do not return news articles with adult text, images, or videos.

The default is Moderate.

NOTE: If the request comes from a market that Bing's adult policy requires that safeSearch is set to Strict, Bing ignores the safeSearch value and uses Strict.
String No
setLang The language to use for user interface strings. Specify the language using the ISO 639-1 2-letter language code. For example, the language code for English is EN. The default is EN (English).

Although optional, you should always specify the language. Typically, you set setLang to the same language specified by mkt unless the user wants the user interface strings displayed in a different language.

This parameter and the Accept-Language header are mutually exclusive—do not specify both.

A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Also, any links to Bing.com properties in the response objects apply the specified language.
String No
since The Unix epoch time (Unix timestamp) that Bing uses to select the trending topics. Bing returns trending topics that it discovered on or after the specified date and time, not the date the topic was published.

To use this parameter, also specify the sortBy parameter.
Integer No
sortBy The order to return the trending topics in. The following are the possible case-insensitive values.
  • Date—Returns trending topics sorted by date from the most recent to the oldest

If you do not specify this parameter, there is no specific ordering. However, topic freshness, category, global user engagement, and personalized features are taken into account.
String No
textDecorations A Boolean value that determines whether display strings should contain decoration markers such as hit highlighting characters. If true, the strings may include markers. The default is false.

To specify whether to use Unicode characters or HTML tags as the markers, see the textFormat query parameter.

For information about hit highlighting, see Hit Highlighting.
Boolean No
textFormat The type of markers to use for text decorations (see the textDecorations query parameter).

The following are the possible values.
  • Raw—Use Unicode characters to mark content that needs special formatting. The Unicode characters are in the range E000 through E019. For example, Bing uses E000 and E001 to mark the beginning and end of query terms for hit highlighting.

  • HTML—Use HTML tags to mark content that needs special formatting. For example, use <b> tags to highlight query terms in display strings.

The default is Raw.

For a list of markers, see Hit Highlighting.

For display strings that contain escapable HTML characters such as <, >, and &, if textFormat is set to HTML, Bing escapes the characters as appropriate (for example, < is escaped to &lt;).

For information about processing strings with embedded Unicode characters, see Hit Highlighting.
String No

Response objects

The following are the JSON objects that the response may include. If the request succeeds, the top-level object in the response is the News object if the endpoint is /news/search or /news, and TrendingTopicAnswer if the endpoint is /news/trendingtopics. If the request fails, the top-level object is the ErrorResponse object.

Object Description
Error Defines an error that occurred.
ErrorResponse Defines the top-level object that the response includes when the request fails.
Image Defines a thumbnail of a news-related image.
MediaSize Defines the size of the media content.
News Defines the top-level object that the response includes when the news request succeeds.
NewsArticle Defines a news article.
Organization Defines the provider that ran the article.
Query Defines the search query string.
RelatedTopic Defines a list of news articles that are related to the search query.
Thumbnail Defines a link to the related image.
Topic Defines a trending news topic.
TrendingTopics Defines the top-level object that the response includes when the trending topics request succeeds.
VideoDefines a video that's related to the news article.

Error

Defines the error that occurred.

Element Description Type
code The error code that identifies the category of error. For a list of possible codes, see Error Codes. String
message A description of the error. String
moreDetails A description that provides additional information about the error. String
parameter The query parameter in the request that caused the error. String
subCode The error code that identifies the error. For example, if code is InvalidRequest, subCode may be ParameterInvalid or ParameterInvalidValue. String
value The query parameter's value that was not valid. String

ErrorResponse

The top-level object that the response includes when the request fails.

Name Value Type
_type Type hint. String
errors A list of errors that describe the reasons why the request failed. Error[]

Image

Defines a thumbnail of a news-related image.

Name Value Type
provider A list of owners of the image. Organization
thumbnail A link to a thumbnail of the image. Thumbnail
url The URL to the image. String

MediaSize

Defines the size of the media content.

Name Value Type
height The height of the media content, in pixels. Integer
width The width of the media content, in pixels. Integer

News

Defines the top-level object that the response includes when the news request succeeds.

If the service suspects a denial of service attack, the request succeeds (HTTP status code is 200 OK), but the body of the response is empty.

Name Value Type
_type Type hint. String
id An ID that uniquely identifies the news answer.

For information about how to use this field, see Using Ranking to Display Results in the Web Search API guide.
String
readLink The URL that returns this answer. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header.

The Web Search API includes this field. Typically, you'd use the URL if you want to query the News Search API directly.
String
relatedTopics A list of news articles that are related to the search term. RelatedTopic[]
sort A list of options for sorting the news articles. For example, sort by relevance (default) or date. To determine which sort order the request used, see the isSelected field. SortValue[]
totalEstimatedMatches The estimated number of news articles that are relevant to the query. Use this number along with the count and offset query parameters to page the results.

Only the News Search API includes this field (the Web Search API does not).
Long
value A list of news articles that are relevant to the query term.

If there are no results to return for the request, the array is empty.
NewsArticle[]

NewsArticle

Defines a news article.

Name Value Type
category The news category that the article belongs to. For example, Sports. If the news category cannot be determined, the article does not include this field.

For a list of possible categories, see News Categories by Market.

If your request specifies the Sports-Tennis category, the category property may contain Sports-Tennis or Sports.
String
clusteredArticles A list of related news articles. NewsArticle[]
contractualRules A list of rules that you must adhere to if you display the article. For example, the rules may govern whether you must provide attribution.

The following contractual rules may apply.

If the article provides contractual rules, you must abide by them.

NOTE: Only articles returned by the Web Search API contains contractual rules. Articles returned by the News endpoints do not include contractual rules.
Object[]
datePublished The date and time that Bing discovered the article. The date is in the format, YYYY-MM-DDTHH:MM:SS. String
description A short description of the news article. String
headline A Boolean value that indicates whether the news article is a headline. If true, the article is a headline.

NOTE: The article includes this field only for news categories requests that do not specify the category query parameter.
Boolean
id An ID that uniquely identifies this article in the list of articles.

For information about how to use this field, see Using Ranking to Display Results in the Web Search API guide.
String
image An image related to the new article.

The Image object in this context contains only the thumbnail field.
Image
mentions A list of entities (places or persons) mentioned in the article. Thing[]
name The name of the article.

Use this name along with the URL to create a hyperlink that when clicked takes the user to the news article.
String
provider A list of providers that ran the article. Organization[]
url The URL to the news article.

Use this URL along with name to create a hyperlink that when clicked takes the user to the news article.
String
video A video that's related to the news article. Video

Organization

Defines the provider that ran the article.

Name Value Type
_type Type hint. String
name The name of the provider that ran the article. String

Query

Defines the search query string.

Name Value Type
text A query string that returns the trending topic. String

RelatedTopic

Defines a list of news articles that are related to the search query.

Name Value Type
relatedNews A list of related news articles. NewsArticle
name The related query term that returned the related news articles. String
webSearchUrl The URL that takes the user to the Bing search results for the related query. String

SortValue

Defines a sort order to use for the request.

Name Value Type
id An identifier that identifies the articles sort order. The following are the possible values.
  • date—Sort by date
  • relevance—Sort by relevance
String
isSelected A Boolean value that determines whether the response used this sort order. If true, the response used this sort order. Boolean
name The display name of the sort order. String
url A URL that you can use to make the same request using this sort order. String

TextAttribution

Defines a contractual rule for plain text attribution.

Name Value Type
_type A type hint, which is set to TextAttribution. String
text The attribution text.

Text attribution applies to the news article as a whole and should be displayed immediately following the article's presentation. If there are multiple text or link attribution rules that do not specify a target, you should concatenate them and display them using a "Data from: " label.
String

Thing

Defines an entity that the article mentions.

Name Value Type
name The name of the entity that the article mentions. String

Thumbnail

Defines a link to the related image.

Name Value Type
contentUrl The URL to the image. String
height The height of the image, in pixels. Unsigned Short
width The width of the image, in pixels. Unsigned Short

Topic

Defines a trending news topic.

Name Value Type
image A link to a related image.

The Image object in this context contains only the url and provider field. The provider field is an array of Organization objects that identify the image providers.
Image
isBreakingNews A Boolean value that indicates whether the topic is considered breaking news. If the topic is considered breaking news, the value is true. Boolean
name The title of the trending topic. String
newsSearchUrl The URL to the Bing News search results for the search query term (see the query field). String
query A search query term that returns this trending topic. Query
webSearchUrl The URL to the Bing search results for the search query term (see the query field). String

TrendingTopics

Defines the top-level object that the response includes when the trending topics request succeeds.

Name Value Type
value A list of trending news topics on Bing.

If there are no results to return for the request, the array is empty.
Topic[]

Video

Defines a video that's related to the news article.

Note

Because the URL format and parameters are subject to change without notice, use all URLs as-is. You should not take dependencies on the URL format or parameters.

Name Value Type
allowHttpsEmbed A Boolean value that determines whether you may embed the video (see the embedHtml field) on pages that use the HTTPS protocol. Boolean
embedHtml An iframe that lets you embed and run the video in your webpage. String
motionThumbnailUrl The URL to an animated thumbnail that shows a preview of the video. Typically, you would use this URL to play a preview of the video when the user mouses over the thumbnail of the video on your results page. String
name The name of the video. String
thumbnail The width and height of the thumbnail image or motion thumbnail. MediaSize
thumbnailUrl The URL to a thumbnail image of the video. For information about resizing the image, see Resizing Thumbnails. String

News Categories by Market

The following are the possible news categories that you may set the category query parameter to. You may set category to a parent category such as Entertainment or one of its subcategories such as Entertainment_MovieAndTV. If you set category to a parent category, it includes articles from one or more of its subcategories. If you set category to a subcategory, it includes articles only from the subcategory.

Market Supported Categories
Australia (en-AU)
  • Australia
  • Business
  • Entertainment
  • Politics
  • Sports
  • World
Canada (en-CA)
  • Business
  • Canada
  • Entertainment
  • LifeStyle
  • Politics
  • ScienceAndTechnology
  • Sports
  • World
China (zh-CN)
  • Auto
  • Business
  • China
  • Education
  • Entertainment
  • Military
  • RealEstate
  • ScienceAndTechnology
  • Society
  • Sports
  • World
India (en-IN)
  • Business
  • Entertainment
  • India
  • LifeStyle
  • Politics
  • ScienceAndTechnology
  • Sports
  • World
Japan (ja-JP)
  • Business
  • Entertainment
  • Japan
  • LifeStyle
  • Politics
  • ScienceAndTechnology
  • Sports
  • World
United Kingdom (en-GB)
  • Business
  • Entertainment
  • Health
  • Politics
  • ScienceAndTechnology
  • Sports
  • UK
  • World
United States (en-US)
  • Business
  • Entertainment
    • Entertainment_MovieAndTV
    • Entertainment_Music
  • Health
  • Politics
  • Products
  • ScienceAndTechnology
    • Technology
    • Science
  • Sports
    • Sports_Golf
    • Sports_MLB
    • Sports_NBA
    • Sports_NFL
    • Sports_NHL
    • Sports_Soccer
    • Sports_Tennis
    • Sports_CFB
    • Sports_CBB
  • US
    • US_Northeast
    • US_South
    • US_Midwest
    • US_West
  • World
  • World_Africa
  • World_Americas
  • World_Asia
  • World_Europe
  • World_MiddleEast

Error codes

The following are the possible HTTP status codes that a request returns.

Status Code Description
200 Success.
400 One of the query parameters is missing or not valid.
401 The subscription key is missing or is not valid.
403 The user is authenticated (for example, they used a valid subscription key) but they don’t have permission to the requested resource.

Bing may also return this status if the caller exceeded their queries per month quota.
410 The request used HTTP instead of the HTTPS protocol. HTTPS is the only supported protocol.
429 The caller exceeded their queries per second quota.
500 Unexpected server error.

If the request fails, the response contains an ErrorResponse object, which contains a list of Error objects that describe what caused of error. If the error is related to a parameter, the parameter field identifies the parameter that is the issue. And if the error is related to a parameter value, the value field identifies the value that is not valid.

{
  "_type": "ErrorResponse", 
  "errors": [
    {
      "code": "InvalidRequest", 
      "subCode": "ParameterMissing", 
      "message": "Required parameter is missing.", 
      "parameter": "q" 
    }
  ]
}

{
  "_type": "ErrorResponse", 
  "errors": [
    {
      "code": "InvalidAuthorization", 
      "subCode": "AuthorizationMissing", 
      "message": "Authorization is required.", 
      "moreDetails": "Subscription key is not recognized."
    }
  ]
}

The following are the possible error code and sub-error code values.

Code SubCode Description
ServerError UnexpectedError
ResourceError
NotImplemented
HTTP status code is 500.
InvalidRequest ParameterMissing
ParameterInvalidValue
HttpNotAllowed
Blocked
Bing returns InvalidRequest whenever any part of the request is not valid. For example, a required parameter is missing or a parameter value is not valid.

If the error is ParameterMissing or ParameterInvalidValue, the HTTP status code is 400.

If you use the HTTP protocol instead of HTTPS, Bing returns HttpNotAllowed, and the HTTP status code is 410.
RateLimitExceeded No sub-codes Bing returns RateLimitExceeded whenever you exceed your queries per second (QPS) or queries per month (QPM) quota.

If you exceed QPS, Bing returns HTTP status code 429, and if you exceed QPM, Bing returns 403.
InvalidAuthorization AuthorizationMissing
AuthorizationRedundancy
Bing returns InvalidAuthorization when Bing cannot authenticate the caller. For example, the Ocp-Apim-Subscription-Key header is missing or the subscription key is not valid.

Redundancy occurs if you specify more than one authentication method.

If the error is InvalidAuthorization, the HTTP status code is 401.
InsufficientAuthorization AuthorizationDisabled
AuthorizationExpired
Bing returns InsufficientAuthorization when the caller does not have permissions to access the resource. This can occur if the subscription key has been disabled or has expired.

If the error is InsufficientAuthorization, the HTTP status code is 403.

Market codes

For the /news/search endpointhe following table lists the market code values that you may use to specify the mkt query parameter. Bing returns content for only these markets. The list is subject to change.

For a list of country codes that you may specify in the cc query parameter, see Country Codes.

Country/Region Language Market Code
Denmark Danish da-DK
Austria German de-AT
Belgium Dutch nl-BE
Switzerland German de-CH
Germany German de-DE
Australia English en-AU
Canada English en-CA
United Kingdom English en-GB
Indonesia English en-ID
Ireland English en-IE
India English en-IN
Malaysia English en-MY
New Zealand English en-NZ
Republic of the Philippines English en-PH
Singapore English en-SG
United States English en-US
English general en-WW
English genearl en-XA
South Africa English en-ZA
Argentina Spanish es-AR
Chile Spanish es-CL
Spain Spanish es-ES
Mexico Spanish es-MX
United States Spanish es-US
Spanish general es-XL
Finland Finnish fi-FI
France French fr-BE
Canada French fr-CA
Switzerland French fr-CH
France French fr-FR
Italy Italian it-IT
Hong Kong SAR Traditional Chinese zh-HK
Taiwan Traditional Chinese zh-TW
Japan Japanese ja-JP
Korea Korean ko-KR
Netherlands Dutch nl-NL
People's republic of China Chinese zh-CN
Poland Polish pl-PL
Brazil Portuguese pt-BR
Russia Russian ru-RU
Sweden Swedish sv-SE
Turkey Turkish tr-TR

For the /news endpoint, the following table lists the market code values that you may use to specify the mkt query parameter. Bing returns content for only these markets. The list is subject to change.

For a list of country codes that you may specify in the cc query parameter, see Country Codes.

Country/Region Language Market Code
Denmark Danish da-DK
Germany German de-DE
Australia English en-AU
United Kingdom English en-GB
United States English en-US
English general en-WW
Chile Spanish es-CL
Mexico Spanish es-MX
United States Spanish es-US
Finland Finnish fi-FI
Canada French fr-CA
France French fr-FR
Italy Italian it-IT
Portuguese Brazil pt-BR
People's republic of China Chinese zh-CN

For the /news/trendingtopics endpointhe following table lists the market code values that you may use to specify the mkt query parameter. Bing returns content for only these markets. The list is subject to change.

For a list of country codes that you may specify in the cc query parameter, see Country Codes.

Country/Region Language Market Code
Germany German de-DE
Australia English en-AU
United Kingdom English en-GB
United States English en-US
Canada English en-CA
India English en-IN
France French fr-FR
Canada French fr-CA
Portuguese Brazil pt-BR
People's republic of China Chinese zh-CN

Country Codes

The following are the country codes that you may specify in the cc query parameter. The list is subject to change.

Country/Region Country Code
Argentina AR
Australia AU
Austria AT
Belgium BE
Brazil BR
Canada CA
Chile CL
Denmark DK
Finland FI
France FR
Germany DE
Hong Kong SAR HK
India IN
Indonesia ID
Italy IT
Japan JP
Korea KR
Malaysia MY
Mexico MX
Netherlands NL
New Zealand NZ
Norway NO
People's Republic of China CN
Poland PL
Portugal PT
Republic of the Philippines PH
Russia RU
Saudi Arabia SA
South Africa ZA
Spain ES
Sweden SE
Switzerland CH
Taiwan TW
Turkey TR
United Kingdom GB
United States US