Home
POST/translate
This method translates listing title and listing description text from one language into another. For a full list of supported language translations, see the table in the API Overview page.
This method has no URI parameters.
All requests made to eBay REST operations require you to provide the Authorization
HTTP header for authentication authorization.
In addition, this method requires you to include the Content-Type header and its value should be set to "application/json". See HTTP request headers- opens rest request components page for details.
This request requires an access token created with the client credentials grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):
https://api.ebay.com/oauth/api_scope
See OAuth access tokens for more information.
Input container/field | Type | Description |
---|---|---|
from | LanguageEnum | The language of the input text to be translated. Not all LanguageEnum values are supported in this field. For a full list of supported language translations, see the table in the API Overview page. Occurrence: Required |
text | array of string | The input text to translate. For
Occurrence: Required |
to | LanguageEnum | The target language for the translation of the input text. Not all LanguageEnum values are supported in this field. For a full list of supported language translations, see the table in the API Overview page. Occurrence: Required |
translationContext | TranslationContextEnum | Input the listing entity to be translated. Occurrence: Required |
This call has no response headers.
Output container/field | Type | Description |
---|---|---|
from | LanguageEnum | The enumeration value indicates the language of the input text. Occurrence: Always |
to | LanguageEnum | The enumeration value indicates the language of the translated text. Occurrence: Always |
translations | array of Translation | An array showing the input and translated text. Only one input string can be translated at this time. Support for multiple continuous text strings is expected in the future. Occurrence: Always |
translations.originalText | string | The original text, in the language specified in the from field, that was input into the text field in the request. Occurrence: Always |
translations.translatedText | string | The translation of the original text into the language specified in the to field. Occurrence: Always |
This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.
Status | Meaning |
---|---|
200 | OK |
400 | Bad Request |
500 | Internal Server Error |
For more on errors, plus the codes of other common errors, see Handling errors.
Code | Domain | Category | Meaning |
---|---|---|---|
110000 | API_TRANSLATION | APPLICATION | There was a problem with an eBay internal system or process. Contact eBay developer support for assistance. |
110001 | API_TRANSLATION | REQUEST | From language is invalid, missing or not supported. For more information, see the API call reference documentation. |
110002 | API_TRANSLATION | REQUEST | To language is invalid, missing or not supported. For more information, see the API call reference documentation. |
110003 | API_TRANSLATION | REQUEST | Context is not supported. For more information, see the API call reference documentation. |
110004 | API_TRANSLATION | REQUEST | Maximum number of input text reached. For more information, see the API call reference documentation. |
110005 | API_TRANSLATION | REQUEST | Maximum length of input text reached. For more information, see the API call reference documentation. |
110006 | API_TRANSLATION | REQUEST | Unsupported from and to combination. |
110007 | API_TRANSLATION | REQUEST | Markups are not supported in input texts for title translation context. |
110008 | API_TRANSLATION | REQUEST | Input text missing. |
This call has no warnings.
New to making API calls? Please see Making a Call.
Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.
Translate a title of an item listing from English to Chinese (Mandarin).
The inputs are text (comma-separated array of strings to translate), translationContext (the translation rules to apply), from (the language of the source text), and to, (the language into which the text will be translated).
POSThttps://api.ebay.com/commerce/translation/v1_beta/translate
Upon success, the response includes a separate translation object for each string that was translated, including the original text, the source and target languages, and the translated text.
Translate a description of an item from English to Chinese (Mandarin).
The input fields for translating an item description are the same as those used for translating a title, but the translationContext sets the rules to apply to the translation (e.g., just one string, max string length is 2,000 characters, etc.).
POSThttps://apid.ebay.com/commerce/translation/v1/translate
Upon success, the response returns the translated item description.