Recently, I am working on a task, but there is little information on the Internet. After several twists and turns, I finally got it done. The implementation process is very simple. Share it out so that you do not need to find it for a long time like me. Google Translate changed to a paid version after upgrading to 2.0. Therefore, you must first apply for a key from Google. The billing standard is $20 for every 1 million characters in text ). Google Translate work process: 1. Google Translate request URL: https://www.googleapis.com/language/translate/v2? Three parameters of the {parameters} Translation request: 1) API key: A key will be assigned to you after payment is made to Google; 2) Target language: the Target language you need to translate; 3) Source text string: the text to be translated (less than 2 kb ). 2. The following are examples of different parameters. You can pass parameters to the url as needed: 1) specify source and targethttps: // www.googleapis.com/language/translate/v2? Key = INSERT-YOUR-KEY & source = en & target = de & q = Hello % 20 worldJSON {"data": {"translations": [{"translatedText ": "Hallo Welt"}]} 2) when multiple q is passed in, the multi-segment text is translated into https://www.googleapis.com/language/translate/v2? Key = INSERT-YOUR-KEY & source = en & target = de & q = Hello % 20 world & q = My % 20 name % 20is % 20 JeffJSON {"data ": {"translations": [{"translatedText": "Hallo Welt" },{ "translatedText": "Mein Name ist Jeff"}] }3) do not specify source, translate directly into target language https://www.googleapis.com/language/translate/v2? Key = INSERT-YOUR-KEY & target = de & q = Hello % 20 worldJSON {"data": {"translations": [{"translatedText": "Hallo Welt ", "detectedSourceLanguage": "en"}]} 3. python-implemented Google Translate source code: # coding: utf8 import urllib2import jsonimport OS, sys reload (sys) sys. setdefaultencoding ("UTF-8") _ author _ = 'chenyu 'class GoogleTranslate: "Google translation" def google_translate (slef, text, targetlanguage ): text = urllib2.quote (text) www.2 Cto.com url = "https://www.googleapis.com/language/translate/v2? Key = YOUR_KEY & target = "+ targetlanguage +" & q = "+ text res = urllib2.urlopen (urllib2.Request (url) dirt = json. JSONDecoder (). decode (res. read () return dirt ["data"] ["translations"] [0] ["translatedText"]