Error Handling (Bing, Version 2.0)

This topic describes how the Bing API handles errors.

Error Messages

Table 1 shows Bing API error numbers and messages.

Table 1. Error Numbers and Messages

Number Message Comments

1001

Required parameter is missing

See Required Parameters (all SourceTypes)

1002

Parameter has invalid value

See documentation for the invalid parameter in API Reference (Bing, Version 2)

1005

Query is too long. Please refer to the HelpUrl for more information.

A query cannot exceed 2048 bytes.

2001

Your AppID is not functioning properly. Please check HelpUrl for more information.

See the "AppId Functionality" section in this topic.

2002

AppId has exceeded usage limit

See Bing API Terms of Use for information about usage limits.

2003

AppId does not have access to the SourceType <source type name>

Access to certain SourceTypes is reserved for users having an explicit contract with Microsoft. Please contact api_tou@microsoft.com for more information.

3001

Results temporarily unavailable for the SourceType. Please check back later.

One or more services that the API uses may be temporarily unavailable.

3002

Service temporarily unavailable. Please check back later.

The API is unavailable for unknown reasons.

4001

Please note the SourceType-specific error elements, then, for more information, refer to the HelpUrl.

SourceTypeErrorCode 22105 corresponds to “Caller Not Authenticated.”

AppId Functionality

Under certain conditions, an AppId may not function properly. These conditions are:

  • AppId is invalid. You must supply a valid AppId obtained from Bing Developer Center.

  • AppId is disabled. Review the status of the AppId at Bing Developer Center. If the AppId appears in strikethrough font (for example, AppId) then it has been disabled. Click the enable link to re-enable the AppId.

  • Your AppId has exceeded its traffic usage limit. For details on traffic usage, see the Bing Terms of Use. Please contact api_tou@microsoft.com for more information.

Response Contains No Results

In the event that a query does not find results for a particular SourceType, the Bing API does not return a SourceType element for that SourceType.

For example, if a request that includes web + image finds results for web but not for image, the request could produce the following response.

<?xml version="1.0" encoding="utf-8" ?>
<?pageview_candidate ?>
<SearchResponse xmlns="http://schemas.microsoft.com/LiveSearch/2008/04/XML/element">
  <Query>
    <SearchTerms>Noresultsreturned</SearchTerms>
  </Query>
  <Web>
    <Total>83</Total>
    <Offset>0</Offset>
    <Results>
      <WebResult>
        <Title>Britney Spears | Blackout Magazine - Britney.Com - Jive Records</Title>
        <Description>Britney Spears Official Site, Listen to the new album and watch her videos, It's Britney.com. ... MTV is letting YOU decide this year's VMA nominees! Help Britney earn as many ...</Description>
        <Url>http://www.britney.com/</Url>
        <DisplayUrl>http://www.britney.com/</DisplayUrl>
        <DateTime>2008-08-22T20:31:04Z</DateTime>
      </WebResult>
    </Results>
  </Web>
</SearchResponse>

SOAP Faults

SOAP faults are provided for all the errors documented in this topic. The detail element provides more information on the errors.

For example:

<soap:Fault>
  <faultcode>Client</faultcode>
  <faultstring>Client error</faultstring>
<!—In case of server error, the faultstring is set to Server error-->
  <faultactor>URL of the invoked web service</faultactor>
<!—either http://api.search.live.net or http://api.search.live.com-->
  <detail>
<Errors>
      <Error>
        <Code>1001</Code>
        <Message>Required parameter is missing.</Message>
        <Parameter>AppID</Parameter>
        <HelpUrl>TBD</HelpUrl>
        <Value>abc</Value>
      </Error>
    </Errors>
  </detail>
</soap:Fault>