Skip to content

Translation API v1_beta.1.6 eBay Docs

The Translation API provides machine translation to help bring inventory to new markets. The Translation API translates common commerce content, such as the title of an item to help present marketplace listings to buyers in different countries or regions. The Translation API takes foreign language search queries from the buyer and translates them for the target marketplace, as well.

Language

Translate eBay Docs

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 TranslationLanguage Enum.

php
use Rat\eBaySDK\API\TranslationAPI\Language\Translate;
use Rat\eBaySDK\Client;

$client = app(Client::class);
$request = new Translate(
    payload: (array) $payload,
);
$response = $client->execute($request);
Example Request Payload
php
use Rat\eBaySDK\Enums\TranslationContext;
use Rat\eBaySDK\Enums\TranslationLanguage;

$payload = [
    'from' => TranslationLanguage::EN,
    'text' => ['Hello World'],
    'to' => TranslationLanguage::DE,
    'translationContext' => TranslationContext::ITEM_TITLE,
];
Example Response Body
php
$response = [
    'from' => 'en',
    'to' => 'de',
    'translations' => [
        [
            'originalText' => 'Hello World',
            'translatedText' => 'Hallo Welt'
        ]
    ]
];

This software is not an official eBay product and is not associated with, sponsored by, or endorsed by eBay Inc.