Yandex.Translate API Developer's guide



Similar documents
Formatting Custom List Information

USER GUIDE: Trading Central Indicator for the MT4 platform

PRICE LIST. ALPHA TRANSLATION AGENCY

How do I translate...?

TRADING CENTRAL INDICATOR FOR METATRADER USERS GUIDE. Blue Capital Markets Limited All rights reserved.

ServiceAPI to the WorldLingo System

Who We Are. Services We Offer

Languages Supported. SpeechGear s products are being used to remove communications barriers throughout the world.

LANGUAGE CONNECTIONS YOUR LINGUISTIC GATEWAY

Trading Central Indicator for MetaTrader4 TRADER / USER SET UP & CONFIGURATION

Table 1: TSQM Version 1.4 Available Translations

INTERC O MBASE. Global Language Solution

INVESTING IN INTANGIBLES: ECONOMIC ASSETS AND INNOVATION DRIVERS FOR GROWTH

Remote Desktop Services Guide

SAP BusinessObjects Document Version: 4.1 Support Package Dashboards and Presentation Design Installation Guide

Tel: Fax: P.O. Box: 22392, Dubai - UAE info@communicationdubai.com comm123@emirates.net.ae

Designing Tablet Computer Keyboards for European Languages

Translating for a Multilingual European Union: Putting Multilingualism into Context Dr Angeliki PETRITS Language Officer European Commission, UK

Official Journal of the European Union

GUIDELINES FOR TRANSLATING THE EUROPASS CERTIFICATE SUPPLEMENT INTRODUCTION GENERAL RECOMMENDATIONS

Professional. Accurate. Fast.

LOCALIZATION PROCESS CHECKLIST

Xerox Easy Translator Service User Guide

Oracle Taleo Enterprise Mobile for Talent Management Cloud Service Administration Guide

We Answer To All Your Localization Needs!

Cross-Language Instant Messaging with Automatic Translation

EMC SourceOne. Products Compatibility Guide REV 54

Australian Embassy, Seoul List of Translators and Interpreters 2013 Seoul, Busan and Daejeon

Luxembourg-Luxembourg: FL/SCIENT15 Translation services 2015/S Contract notice. Services

We Answer All Your Localization Needs!

Media labels and their contents

Yandex.Widgets Quick start

A global leader in document translations

Microsoft stores badge guidelines. February 2016

RECENSEO Quick Reference

Luxembourg-Luxembourg: FL/TERM15 Translation services 2015/S Contract notice. Services

Cyclope Internet Filtering Proxy. - User Guide -

Safe Harbor Statement

HAZARD COMMUNICATION TRANSLATION RESOURCES Introduction

Data First Framework. How to Build Your Enterprise Data Hub. Luis Campos Big Data Solutions Director Oracle Europe, Middle East and Africa

Translution Price List GBP

We re talking your language

LSI TRANSLATION PLUG-IN FOR RELATIVITY. within

Translation/interpreting Services in Nottingham

CALL FOR EXPRESSIONS OF INTEREST FOR CONTRACT AGENTS CHILDCARE STAFF. Function Group II EPSO/CAST/S/2/2012 I. INTRODUCTION

AccuRead OCR. Administrator's Guide

Internet sites for machine translation available language-pairs ** Part 1 direct translation sites

Activities. but I will require that groups present research papers

HOW COMPANIES INFLUENCE OUR SOCIETY: CITIZENS VIEW

MT Search Elastic Search for Magento

webcertain Recruitment pack Ceri Wright [Pick the date]

Teaching Languages at School

Latin Alphabet special characters in Microsoft Word Article by: Stélios C. Alvarez 08

Europeans and their Languages

SWOT Assessment: BMC Remedy v9

Survey of University of Michigan Graduate-level Area Studies Alumni/ae & FLAS Recipients from : Selected Findings

Post Jobs Technical Integration

SMES, RESOURCE EFFICIENCY AND GREEN MARKETS

CALL FOR EXPRESSIONS OF INTEREST FOR CONTRACT STAFF

About CRC? What is Link?

Linking the world through professional language services

technical translation services, ltd. translation into 42 languages desktop publishing/typesetting multi-media presentations multi-lingual web sites

GET YOUR START MENU BACK IN MICROSOFT WINDOWS SERVER 2012

Financial Reporting Comparison Matrix

Automotive Technician Training (ATT)

Speaking your language...

Quality Data for Your Information Infrastructure

The most trusted name in translations.

Contents. BMC Atrium Core Compatibility Matrix

Poliscript Installation Guide

2011 Census: Language

Translation strategy decision support at the European Commission

FIRST-CLASS TRANSLATIONS WORLDWIDE

Luxembourg-Luxembourg: FL/RAIL16 Translation services 2016/S Contract notice. Services

List of Higher School Certificate Board Developed Courses

software technical reference

Cisco Unified IP Phone CP-6961 VoIP -puhelin

Contents. BMC Remedy AR System Compatibility Matrix

Reference Guide: Approved Vendors for Translation and In-Person Interpretation Services

Globalization Status of Citrix Products

2014 HIGHER SCHOOL CERTIFICATE EXAMINATION TIMETABLE Monday 13 October to Wednesday 5 November

Global Language Translation Services. Accurate, On Time and Within Budget

Intel Sideband Fabric Device (Intel MBI) Driver

Maximize the Value of Your Data and the Ability to Protect Privacy, by Design

PUBLISHING TRANSLATIONS IN EUROPE SURVEY OF PUBLISHERS

RESEARCH ASSISTANCE. The Portal is also accessible to the general public but restricted to the free case law databases.

SIN 382-1/1RC Translation Services SIN 382-2/2RC Interpretation Services Contract Number: GS-10F-034AA

DE,FR, ES,JA,Z H-CN AppDNA AppDNA Level-2 JA. 2.4 Level Level-2 Tier 1,NL Tier1, NL JA. XenCenter 6.5 Level-2 JA,Zh-CN JA,Zh-

HP Business Notebook Password Localization Guidelines V1.0

Cisco Unified Presence Server 1.0

RIVRS User Manual. Template: WCT-TMP-RS Effective: 20-Apr-2016 Version: 1.0 Page 1 of 18

placing people first SALARY REPORT Summary of 2014 Bratislava

MCO E I/IOP JUN

Transcription:

5.08.2015

.. Version 1.5 Document build date: 5.08.2015. This volume is a part of Yandex technical documentation. Yandex helpdesk site: http://help.yandex.ru 2008 2015 Yandex LLC. All rights reserved. Copyright Disclaimer Yandex (and its applicable licensor) has exclusive rights for all results of intellectual activity and equated to them means of individualization, used for development, support, and usage of the service. It may include, but not limited to, computer programs (software), databases, images, texts, other works and inventions, utility models, trademarks, service marks, and commercial denominations. The copyright is protected under provision of Part 4 of the Russian Civil Code and international laws. You may use or its components only within credentials granted by the Terms of Use of or within an appropriate Agreement. Any infringements of exclusive rights of the copyright owner are punishable under civil, administrative or criminal Russian laws. Contact information Yandex LLC http://www.yandex.com Phone: +7 495 739 7000 Email: pr@yandex-team.ru Headquarters: 16 L'va Tolstogo St., Moscow, Russia 119021

Contents About this guide... 4 API description... 4 Formatting results... 4 API methods... 5 getlangs method... 5 detect method... 7 translate method... 8 Supported languages... 11 Index... 13

4 About this guide The developer's guide describes the and explains how to enable and use the service. The guide is intended for web developers who want to add the text translation feature to pages on their web sites. API description Attention! Starting from version 1.5, all API methods must be accessed using a key. Please fill out this simple form to get your free API key. To access the over HTTPS, there are XML and JSON (JSONP) interfaces available. All the interfaces provide identical functionality and use the same set of input parameters. The XML interface returns a response in the form of an XML document, while the JSON interface returns JavaScript objects instead of XML elements, but with the same names and semantics; the JSONP interface returns the same JavaScript objects, but by calling a callback function with the specified name. Formatting results When formatting translation results, you must follow the rules set in the License for using the Yandex.Translate service. Each page that uses data from the Yandex.Translate service must display the text "Powered by Yandex.Translate" with an active hyperlink to the page http://translate.yandex.com/. The font size for the link must be no smaller than the font size for the main text, and the color must match the font color of the main text on the page.

API methods 5 API methods getlangs method Returns a list of translation directions supported by the service. Description Langs getlangs(string key, string ui); The service translates between any of the languages in the list of supported languages. To get this list, set the ui parameter when calling the method. Input parameters List of input parameters: Parameter Type Description Mandatory key string API key. Get a free API key on this page. Optional ui string If set, the service's response will contain a list of supported language codes and the corresponding language names (langs): en in English ru in Russian tr in Turkish uk in Ukrainian Sample request: XML interface: https://translate.yandex.net/api/v1.5/tr/getlangs?key=apikey&ui=uk JSON interface: https://translate.yandex.net/api/v1.5/tr.json/getlangs?key=apikey&ui=uk JSONP interface (for the "mycallback" function): https://translate.yandex.net/api/v1.5/tr.json/getlangs? key=apikey&ui=uk&callback=mycallback Returns In the XML interface it returns an XML document with the root element Langs. For example:

API methods 6 <?xml version="1.0" encoding="utf-8"?> <Langs> <dirs> <string>ru-en</string> <string>ru-pl</string> <string>ru-uk</string> <string>ru-de</string> <string>ru-fr</string>... <string>sr-uk</string> </dirs> <langs> <Item key="ru" value="russian"/> <Item key="en" value="english"/> <Item key="pl" value="polish"/>... <Item key="tr" value="turkish"/> <Item key="ro" value="romanian"/> <Item key="sr" value="serbian"/> </langs> </Langs> Error codes Code Value Description ERR_KEY_INVALID 401 Invalid API key. ERR_KEY_BLOCKED 402 This API key has been blocked. In the JSON interface, instead of XML elements, JavaScript objects are returned with the same names and semantics: {"dirs": ["ru-en","ru-pl","ru-uk","ru-de","ru-fr","ru-es","ru-it","ru-bg","ru-cs","rutr","ru-ro","ru-sr","en-ru","en-uk","en-de","en-fr","en-es","en-it","en-cs","entr","pl-ru","pl-uk","uk-ru","uk-en","uk-pl","uk-de","uk-fr","uk-es","uk-it","ukbg","uk-cs","uk-tr","uk-ro","uk-sr","de-ru","de-en","de-uk","fr-ru","fr-en","fruk","es-ru","es-en","es-uk","it-ru","it-en","it-uk","bg-ru","bg-uk","cs-ru","csen","cs-uk","tr-ru","tr-en","tr-uk","ro-ru","ro-uk","sr-ru","sr-uk"], "langs": {"ru":"російська","en":"англійська","pl":"польська","uk":"українська","de":"німе цька","fr":"французька","es":"іспанська","it":"італійська","bg":"болгарська","cs ":"чеська","tr":"турецька","ro":"румунська","sr":"сербська"} } In the JSONP interface, the same JavaScript objects are returned to a callback function (for example, "mycallback"): mycallback( {"dirs":["ru-en","ru-pl","ru-uk","ru-de","ru-fr","ru-es","ru-it","ru-bg","rucs","ru-tr","ru-ro","ru-sr","en-ru","en-uk","en-de","en-fr","en-es","en-it","encs","en-tr","pl-ru","pl-uk","uk-ru","uk-en","uk-pl","uk-de","uk-fr","uk-es","ukit","uk-bg","uk-cs","uk-tr","uk-ro","uk-sr","de-ru","de-en","de-uk","fr-ru","fren","fr-uk","es-ru","es-en","es-uk","it-ru","it-en","it-uk","bg-ru","bg-uk","csru","cs-en","cs-uk","tr-ru","tr-en","tr-uk","ro-ru","ro-uk","sr-ru","sr-uk"], "langs": {"ru":"російська","en":"англійська","pl":"польська","uk":"українська","de":"німе цька","fr":"французька","es":"іспанська","it":"італійська","bg":"болгарська","cs ":"чеська","tr":"турецька","ro":"румунська","sr":"сербська"} })

API methods 7 detect method Detects the language of the specified text. Description DetectedLang detect(string key, string text[], string format); Input parameters Input parameters can be passed either using an HTTP GET request (see the example), or using an HTTP POST request where the parameters are passed in the body of the HTTP request. Parameter Type Description Mandatory key string API key. Get a free API key on this page. text Optional string[ ] The text to detect the language for. Restrictions: format string Text format. Although the text parameter is an array (you can pass multiple text parameters), only one language tag is returned for the entire text. To detect the language of each text item, call the detect method for each of them. Possible values: plain Text without markup (default value). html Text in HTML format. Sample request: XML interface: https://translate.yandex.net/api/v1.5/tr/detect?key=apikey&text=hello+world JSON interface: https://translate.yandex.net/api/v1.5/tr.json/detect?key=apikey&text=hello+world JSONP interface (for the "mycallback" function): https://translate.yandex.net/api/v1.5/tr.json/detect?key=apikey&text=hello +world&callback=mycallback Returns In the XML interface it returns the DetectedLang structure, which contains the return code (200 if successful) and the text language code (or an empty string, if the language could not be detected). For example: <?xml version="1.0" encoding="utf-8"?> <DetectedLang code="200" lang="en"/> Error codes Code Value Description ERR_OK 200 Operation completed successfully.

API methods 8 Code Value Description ERR_KEY_INVALID 401 Invalid API key. ERR_KEY_BLOCKED 402 This API key has been blocked. ERR_DAILY_REQ_LIMIT _EXCEEDED ERR_DAILY_CHAR_LIMI T_EXCEEDED 403 You have reached the daily limit for requests (including calls of the translate method). 404 You have reached the daily limit for the volume of translated text (including calls of the translate method). In the JSON interface, instead of XML elements, JavaScript objects are returned with the same names and semantics: { } "code": 200, "lang": "en" In the JSONP interface, the same JavaScript objects are returned to a callback function (for example, "mycallback"): mycallback( { "code": 200, "lang": "en" } ) translate method Translates the text. Description Translation translate(string key, string lang, string text[], string format, string options); Input parameters Input parameters can be passed either using an HTTP GET request (see the example), or using an HTTP POST request where the parameters are passed in the body of the HTTP request. Sample request: XML interface: https://translate.yandex.net/api/v1.5/tr/translate?key=apikey&lang=en-ru&text=to +be,+or+not+to+be%3f&text=that+is+the+question. JSON interface: JSONP interface (for the "mycallback" function): https://translate.yandex.net/api/v1.5/tr.json/translate?key=apikey&lang=enru&text=to+be,+or+not+to+be%3f&text=that+is+the+question. https://translate.yandex.net/api/v1.5/tr.json/translate?key=apikey&lang=enru&text=to+be,+or+not+to+be%3f&text=that+is+the+question.&callback=mycallback

API methods 9 List of input parameters. Parameter Type Description Mandatory key string API key. Get a free API key on this page. lang string Translation direction (for example, "en-ru" or "ru"). Format: 1. A pair of language codes separated by a dash. For example, "en-ru" specifies to translate from English to Russian. 2. Single language code. For example, "ru" specifies to translate to Russian. In this case, the language of the original text is detected automatically. text string[ ] The text to be translated. Restrictions: For POST requests, the maximum size of the text being passed is 10000 characters. In GET requests, the restriction applies not to the text itself, but to the size of the entire request string, which can contain other parameters besides the text. The maximum size of the request string is 10 KB. Optional format string Text format. Possible values: plain Text without markup (default value). html Text in HTML format. options string Translation options. Possible values: 1 Automatically detect language. For example, if the lang parameter has reversed the translation direction for a pair, the service automatically detects the text language and returns it in the detected tag: https://translate.yandex.net/api/v1.5/tr/translate? key=apikey&lang=en-ru&text=привет&options=1 <Translation code="200" lang="en-ru"> <detected lang="ru"/> <text>привет</text> </Translation> Returns In the XML interface, it returns the Translation structure, which contains the translated text. For example: <?xml version="1.0" encoding="utf-8"?> <Translation code="200" lang="en-ru"> <text>быть или не быть?</text> <text>вот в чем вопрос.</text> </Translation> Elements of the response XML schema: Translation The root element, which contains text elements (one per fragment). The code attribute contains the return code (see the table) and the lang attribute, which is the language code of the text fragment detected by the service. text An array of strings with translated text (for the XML interface, a sequence of <text> elements). The number of items in the array corresponds to the number of text parameters in the request.

API methods 10 Error codes Code Value Description ERR_OK 200 Operation completed successfully. ERR_KEY_INVALID 401 Invalid API key. ERR_KEY_BLOCKED 402 This API key has been blocked. ERR_DAILY_REQ_LIMIT _EXCEEDED ERR_DAILY_CHAR_LIMI T_EXCEEDED 403 You have reached the daily limit for requests (including calls of the detect method). 404 You have reached the daily limit for the volume of translated text (including calls of the detect method). ERR_TEXT_TOO_LONG 413 The text size exceeds the maximum. ERR_UNPROCESSABLE_T EXT ERR_LANG_NOT_SUPPOR TED 422 The text could not be translated. 501 The specified translation direction is not supported. In the JSON interface, instead of XML elements, JavaScript objects are returned with the same names and semantics: { } "code": 200, "lang": "en-ru", "text": [ "Быть или не быть?", "Вот в чем вопрос." ] In the JSONP interface, the same JavaScript objects are returned to a callback function (for example, "mycallback"): mycallback({ "code": 200, "lang": "en-ru", "text": [ "Быть или не быть?", "Вот в чем вопрос." ] })

Supported languages Язык Код Albanian sq Arabian ar Armenian hy Azeri az Belarusian be Bosnian bs Bulgarian bg Catalan ca Croatian hr Czech cs Chinese zh Danish da Dutch nl English en Estonian et Finnish fi French fr Georgian ka German de Greek el Hebrew he Hungarian hu Icelandic is Indonesian id Italian it Japanese ja Korean ko Latvian lv Lithuanian lt Macedonian mk Malay ms Maltese mt Norwegian no Polish pl Portuguese pt Romanian ro Russian ru Spanish es Serbian sr Slovak sk Slovenian sl Swedish sv 11

12 Язык Thai Turkish Ukrainian Vietnamese Код th tr uk vi

Index detect 6 getlangs 5 JSON 4 8, 10 JSONP 5 8, 10 translate 8 XML 5, 7 9

5.08.2015