Editar

Compartir a través de


Spell Check API v7 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
actionType A string that's used by logging to determine whether the request is coming from an interactive session or a page load. The following are the possible values:
  • Edit — The request is from an interactive session
  • Load — The request is from a page load
String No
appName The unique name of your app.

The name must be known by Bing. Do not include this parameter unless you have previously contacted Bing to get a unique app name. To get a unique name, contact your Bing Business Development manager.
String No
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.

To know which market Bing used, get the BingAPIs-Market header in the response.

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
clientMachineName A unique name of the device that the request is being made from. Generate a unique value for each device (the value is unimportant).

The service uses the ID to help debug issues and improve the quality of corrections.
String No
docId A unique ID that identifies the document that the text belongs to. Generate a unique value for each document (the value is unimportant).

The service uses the ID to help debug issues and improve the quality of corrections.
String 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>-<country/region>. 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.

To know which market Bing used, get the BingAPIs-Market header in the response.

This parameter and the cc query parameter are mutually exclusive — do not specify both.
String No
mode The type of spelling and grammar checks to perform. The following are the possible case-sensitive values:
  • proof — For document scenarios

    Proof mode provides the most comprehensive checks, adding capitalization, basic punctuation, and other features to aid document creation, but it's available only in the en-US (English-United States), es-ES (Spanish-Spain), pt-BR (Portuguese-Brazil) markets. Note that Proof mode is a Beta in the Spanish and Portuguese markets. For all other markets, set the mode query parameter to Spell.

    NOTE: If the length of query text exceeds 4096 characters, it will be truncated to 4096 characters before being processed.


  • spell — For web search scenarios

    Spell mode is more aggressive in order to return better search results. The Spell mode finds most spelling mistakes but doesn't find some of the grammar errors that Proof catches; for example, capitalization and repeated words.

    NOTE: The text string is not checked for spelling mistakes if the string exceeds the following maximum lengths based on language code.
    • 130 characters for en, de, es, fr, pl, pt, sv, ru, nl, nb, tr-tr, it, zh, and ko.
    • 65 characters for all others.
    Also, Because square brackets ( '[' and ']' ) may cause inconsistent results, you should remove them before checking the string for spelling mistakes.
The default is Proof.
String No
preContextText A string that gives context to the text string. For example, although petal is a valid word, if you set preContextText to bike, the context changes and the text string becomes invalid. In this case, the response suggests that you change petal to pedal (as in bike pedal).

This text is not checked for grammar or spelling errors.

You may specify this parameter in the query string of a GET request or in the body of a POST request.
String No
postContextText A string that gives context to the text string. For example, although read is a valid word, if you set postContextText to carpet, the context changes and the text string becomes invalid. In this case, the response suggests that you change read to red (as in red carpet).

This text is not checked for grammar or spelling errors.

You may specify this parameter in the query string of a GET request or in the body of a POST request.
String No
sessionId A unique ID that identifies this user session. Generate a unique value for each user session (the value is unimportant).

The service uses the ID to help debug issues and improve the quality of corrections.
String No
setLang The language to use for user interface strings. You may specify the language using either a 2-letter or 4-letter code. Using 4-letter codes is preferred.

For a list of supported language codes, see Bing supported languages.

Bing loads the localized strings if setlang contains a valid 2-letter neutral culture code (fr) or a valid 4-letter specific culture code (fr-ca). For example, for fr-ca, Bing loads the fr neutral culture code strings.

If setlang is not valid (for example, zh) or Bing doesn’t support the language (for example, af, af-na), Bing defaults to en (English).

To specify the 2-letter code, set this parameter to an ISO 639-1 language code.

To specify the 4-letter code, use the form <language>-<country/region> where <language> is an ISO 639-1 language code (neutral culture) and <country/region> is an ISO 3166 country/region (specific culture) code. For example, use en-US for United States 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 use the specified language.
String No
text The text string to check for spelling and grammar errors. The text string may include any valid UTF-8 character.

You may specify this parameter in the query string of a GET request or in the body of a POST request. Because of the query string length limit, you'll typically use a POST request unless you're checking only short strings.
String Yes
userId A unique ID that identifies the user. Generate a unique value for each user (the value is unimportant).

The service uses the ID to help debug issues and improve the quality of corrections.
String No