import requests
import json


def get_translation(word, from_to):
    """
    Obtain translation of specified word from Yandex.

    API Documentation
        :param word: word to be translated
        :param from_to: language codes pair representing the src/target lang
        :type from_to: String
        :type word: String
        :return: translated word
        :rtype: :class:`String`
    """
    base_url = "https://translate.yandex.net/api/v1.5/tr.json/translate"
    options = {"lang": from_to, "key": "<Enter Key Here>", "text": word}
    response = requests.get(base_url, params=options)
    if response.status_code is 200:
        return json.loads(response.text)["text"][0]
    else:
        return ""