19

I noticed that Google accepts transliteration and IME requests in any language through the url:

https://inputtools.google.com/request?text=$&itc=$&num=$\
    &cp=0&cs=1&ie=utf-8&oe=utf-8&app=test

where $ is a variable below, for any language and text.

For example, French (try it):

var text = "ca me plait",
    itc = "fr-t-i0-und",
    num = 10;
// Result:
[
    "SUCCESS",
    [
        [
            "ca me plait",
            [
                "ça me plaît"
            ]
        ]
    ]
]

Or, Mandarin (try it):

var text = "shide",
    itc = "zh-t-i0-pinyin",
    num = 5;
// Result: 
[
    "SUCCESS",
    [
        [
            "shide",
            [
                "使得",
                "似的",
                "是的",
                "实德",
                "似地"
            ],
            [],
            {
                "annotation": [
                    "shi de",
                    "shi de",
                    "shi de",
                    "shi de",
                    "shi de"
                ]
            }
        ]
    ]
]

All languages work and return great suggestions. The thing is I can't find documentation for this anywhere on the web, although it clearly looks like an API. Does anyone know if there is an official Google client or if they're okay with raw, unauthenticated requests?

It's used perhaps unofficially by plugins like jQuery.chineseIME.js, but I would appreciate any official usage information.

sarabdeep singh
  • 878
  • 1
  • 11
  • 16
atp
  • 30,132
  • 47
  • 125
  • 187

1 Answers1

13

Whatever. I created my own plugin that uses it for Chinese, and can be extended easily: https://bitbucket.org/purohit/jquery.intlkeyboard.js.

atp
  • 30,132
  • 47
  • 125
  • 187
  • Hey Ash, I am also working on a similar problem. In your opinion, does it violate any google's policy ? I mean, would google have any problem if I use it on my website ? – Amit Gupta Apr 26 '14 at 12:16
  • 1
    I can't speak to this legally. However, it's client-side code that means Google is still benefiting from collecting a user's keystrokes which is probably what they want. As long as you don't store the results (like all other Google services), and provide Google attribution, I don't see the problem. – atp Apr 26 '14 at 19:51
  • 1
    @ash Hi, I have been trying to use your plugin, but cannot get it working. Could you please check here what I am doing wrong. http://jsfiddle.net/7dk6L9b0/1/ . Thanks a lot. – black_belt Jan 06 '15 at 15:37