<p>Based on Google  transliteration API:
<a href="https://www.google.com/intl/en/inputtools/services/features/transliteration.html" rel="nofollow noreferrer">https://www.google.com/intl/en/inputtools/services/features/transliteration.html</a></p>

<p>You can use http request "<a href="https://www.google.com/inputtools/request?ime=pinyin&amp;ie=utf-8&amp;oe=utf-8&amp;app=translate&amp;num=10&amp;text=__wozaixuezhongwen__" rel="nofollow noreferrer">https://www.google.com/inputtools/request?ime=pinyin&amp;ie=utf-8&amp;oe=utf-8&amp;app=translate&amp;num=10&amp;text=<strong>wozaixuezhongwen</strong></a>" to convert text "wozaixuezhongwen" to "我在学中文" (I am learning Chinese)</p>

<p>so you can use any language (Python, JavaScript, Java, ...) to send the http request and read the response, and build you own application flexibility.</p>

CC BY-SA 3.0
2017-05-17T14:41:48.173Z
Thank you! That's exactly what I was looking for. I hope this is fast enough that on keyup I can get the new set of characters. Do you know what candidate_type and lc is for? I am hoping the annotations work when I do it in browser. I am looking at the text file and for mao they all just say mao, no annotation.
shellwe
CC BY-SA 3.0
2017-05-17T14:56:47.123Z
I do have to say, I searched that the Google Input tools back and front and could not find how to set up an HTTP request, how did you find it? I am asking to see if there is any extra info it gives. This is great though!
shellwe
CC BY-SA 3.0
2017-05-17T15:22:47.637Z
@shellwe how to send http request is a topic about programming. just search "send http request by python" or by java.
treesong
CC BY-SA 3.0
2017-05-17T19:44:18.623Z
Sorry, I know how to send HTTP requests, but how did you know that ime needs to equal 'pinyin' or app equals 'translate' and what num is and why it needs to be set to 10; that type of stuff? Like I am using the flickr API: https://www.flickr.com/services/api/flickr.photos.search.html and it has a huge list telling you what attributes you can use for a GET URL and what they do. Thank you again, this should allow me to make the character search to look how I want instead of having to use the pre-defined layout!
shellwe
CC BY-SA 3.0
2017-05-21T01:15:31.270Z
treesong, I guess my question is how did you know what parameters to put together to create that HTTP request. Surely there is some guide from google that told you that num needs to be 10 if you want this or that.
shellwe
CC BY-SA 3.0
2017-05-17T07:20:05.360Z
2017-05-17T07:20:05.360Z
treesong
<p>I need a tool that is like Google's transliterate that will convert Pinyin to Chinese Character. It works like this:</p>

<p><a href="http://shawnwow.com/chineseCharacterHelpr/transliterateTest.htm" rel="nofollow noreferrer">http://shawnwow.com/chineseCharacterHelpr/transliterateTest.htm</a></p>

<p>But since it is discontinued there isn't much of an API.</p>

<p>An alternative I found early on was this:</p>

<p><a href="http://yuhanz.github.io/chinese-ime.html" rel="nofollow noreferrer">http://yuhanz.github.io/chinese-ime.html</a></p>

<p>But that also didn't have much flexibility to its layout. It was made by a guy over the weekend while he was super kind he doesn't provide support.</p>

<p>Basically what I am looking for is the ability to grab the characters and display them how I want instead of in the box they provide. If you delete transliterateTest.htm from the URL of the first (limited to 2 URLs) and you type a Chinese character and click hint you will have a stronger idea of what I am looking for. What I need is to click a character and have the IME reset and do it all again. I tried to hack at this one but the functionality of the IME is acting funky.</p>

<p>What I would love is one that just goes out and grabs a Character array based on the JSON and gives me complete control on how I want to parse through the array. So far this site is entirely in JavaScript and while we will be getting Python later on I am only helping with the JavaScript phase.</p>

<p>I was asking on the stackoverflow (tech site) but I saw someone asking about Chinese to pinyin translation and having moderate luck.</p>

<p>Disclaimer: I do not speak Chinese. This is for my University's Masters project.</p>

<pinyin><simplified-characters>
Need an API to convert Pinyin to Simplified Chinese characters
# Need an API to convert Pinyin to Simplified Chinese characters

(Asked by: username_0 on 2017-05-17)

I need a tool that is like Google's transliterate that will convert Pinyin to Chinese Character. It works like this:

<http://shawnwow.com/chineseCharacterHelpr/transliterateTest.htm>

But since it is discontinued there isn't much of an API.

An alternative I found early on was this:

<http://yuhanz.github.io/chinese-ime.html>

But that also didn't have much flexibility to its layout. It was made by a guy over the weekend while he was super kind he doesn't provide support.

Basically what I am looking for is the ability to grab the characters and display them how I want instead of in the box they provide. If you delete transliterateTest.htm from the URL of the first (limited to 2 URLs) and you type a Chinese character and click hint you will have a stronger idea of what I am looking for. What I need is to click a character and have the IME reset and do it all again. I tried to hack at this one but the functionality of the IME is acting funky.

What I would love is one that just goes out and grabs a Character array based on the JSON and gives me complete control on how I want to parse through the array. So far this site is entirely in JavaScript and while we will be getting Python later on I am only helping with the JavaScript phase.

I was asking on the stackoverflow (tech site) but I saw someone asking about Chinese to pinyin translation and having moderate luck.

Disclaimer: I do not speak Chinese. This is for my University's Masters project.

**Tags:** pinyin, simplified-characters


---

## 1 answers

### Answer by username_1 on 2017-05-17. Score: 4 | Accepted answer

Based on Google transliteration API:
<https://www.google.com/intl/en/inputtools/services/features/transliteration.html>

You can use http request "[https://www.google.com/inputtools/request?ime=pinyin&ie=utf-8&oe=utf-8&app=translate&num=10&text=**wozaixuezhongwen**](https://www.google.com/inputtools/request?ime=pinyin&ie=utf-8&oe=utf-8&app=translate&num=10&text=__wozaixuezhongwen__)" to convert text "wozaixuezhongwen" to "我在学中文" (I am learning Chinese)

so you can use any language (Python, JavaScript, Java, ...) to send the http request and read the response, and build you own application flexibility.

> **Comments:**
> **username_0**: Thank you! That's exactly what I was looking for. I hope this is fast enough that on keyup I can get the new set of characters. Do you know what candidate_type and lc is for? I am hoping the annotations work when I do it in browser. I am looking at the text file and for mao they all just say mao, no annotation.  
> **username_0**: I do have to say, I searched that the Google Input tools back and front and could not find how to set up an HTTP request, how did you find it? I am asking to see if there is any extra info it gives. This is great though!  
> **username_1**: @username_0 how to send http request is a topic about programming. just search "send http request by python" or by java.  
> **username_0**: Sorry, I know how to send HTTP requests, but how did you know that ime needs to equal 'pinyin' or app equals 'translate' and what num is and why it needs to be set to 10; that type of stuff? Like I am using the flickr API: https://www.flickr.com/services/api/flickr.photos.search.html and it has a huge list telling you what attributes you can use for a GET URL and what they do. Thank you again, this should allow me to make the character search to look how I want instead of having to use the pre-defined layout!  
> **username_0**: username_1, I guess my question is how did you know what parameters to put together to create that HTTP request. Surely there is some guide from google that told you that num needs to be 10 if you want this or that.  

---

