Skip to main content

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.

Input

Resource URI

POST https://api.ebay.com/commerce/translation/v1_beta/translate

This method is supported in Sandbox environment. To access the endpoint, just replace the api.ebay.com root URI with api.sandbox.ebay.com

URI parameters

This method has no URI parameters.

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

The table below shows additional HTTP request headers that are either required, conditionally required, or strongly recommended for this method. Other standard HTTP request headers- opens rest request components page (not in this table) can also be used, but they are optional.

HeaderTypeDescription
Content-TypestringThis header indicates the format of the request body provided by the client. Its value should be set to application/json.

For more information, refer to HTTP request headers.

Occurrence: Required

OAuth scope

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.

Request payload

Copy complete valid JSON to clipboard

Request fields

Input container/fieldTypeDescription
fromLanguageEnum

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 pairings, see the Supported languages table in the API Overview page.

Occurrence: Required

textarray of string

The input text to translate. The maximum number of characters permitted is determined by the translationContext value:

  • ITEM_TITLE: 1000 characters maximum
  • ITEM_DESCRIPTION: 20,000 characters maximum.
    Note: When translating ITEM_DESCRIPTION text, HTML/CSS markup and links can be included and will not count toward this 20,000 character limit.
Note: Currently, only one input string can be translated per API call. Support for multiple continuous text strings is expected in the future.

Occurrence: Required

toLanguageEnum

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 pairings, see the Supported languages table in the API Overview page.

Occurrence: Required

translationContextTranslationContextEnum

Input the listing entity to be translated.

Valid Values: ITEM_TITLE and ITEM_DESCRIPTION

Occurrence: Required

Output

HTTP response headers

This call has no response headers.

Response payload

Response fields

Output container/fieldTypeDescription
fromLanguageEnum

The enumeration value indicates the language of the input text.

Occurrence: Always

toLanguageEnum

The enumeration value indicates the language of the translated text.

Occurrence: Always

translationsarray 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.originalTextstring

The original text, in the language specified in the from field, that was input into the text field in the request.

Occurrence: Always

translations.translatedTextstring

The translation of the original text into the language specified in the to field.

Occurrence: Always

HTTP status codes

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.

StatusMeaning
200OK
400Bad Request
500Internal Server Error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
110000API_TRANSLATIONAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay developer support for assistance.
110001API_TRANSLATIONREQUESTFrom language is invalid, missing or not supported. For more information, see the API call reference documentation.
110002API_TRANSLATIONREQUESTTo language is invalid, missing or not supported. For more information, see the API call reference documentation.
110003API_TRANSLATIONREQUESTContext is not supported. For more information, see the API call reference documentation.
110004API_TRANSLATIONREQUESTMaximum number of input text reached. For more information, see the API call reference documentation.
110005API_TRANSLATIONREQUESTMaximum length of input text reached. For more information, see the API call reference documentation.
110006API_TRANSLATIONREQUESTUnsupported from and to combination.
110007API_TRANSLATIONREQUESTMarkups are not supported in input texts for title translation context.
110008API_TRANSLATIONREQUESTInput text missing.

Warnings

This call has no warnings.

Samples

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.

Sample 1: Translate an Item's Title

Translate the title of an item's listing from English to German.

Input

This sample translates an item's title from English to German.

POSThttps://api.ebay.com/commerce/translation/v1_beta/translate

Output

Upon success, the response includes the translated title, the original title, as well as the source and target languages.

Sample 2: Translate an Item's Description

Translate the description of an item from English to Chinese (Mandarin).

Input

This sample translates an item's description from English to Chinese (Mandarin).

POSThttps://apid.ebay.com/commerce/translation/v1/translate

Output

Upon success, the response includes the translated description, the original description, as well as the source and target languages.

Got thoughts? Click the feedback button – your insights help us improve!