Answered by:
The maximum length of each translated string through Translator API

Question
-
Hi,
I'm calling Translator Web Service from local program. Thinking that there should be no upper bound on HTTP POST body, I fed in a string of length around 12000. Then exception message says: The remote server returned an error: (400) Bad Request.
Then I did some tests and found the boundary is around 10X00. If more than this level, server would return the error above.
So is there official explanation of such error and is this really a "defined" value?
Thanks so much for your help!
Best Regards,
Lynn
- Edited by Lynn404 Wednesday, September 24, 2014 1:35 PM
Wednesday, September 24, 2014 1:21 PM
Answers
-
Hi Lynn,
the maximum request length is 10000 characters.
Chris Wendt
Microsoft Translator- Marked as answer by Chris WendtMicrosoft employee Wednesday, September 24, 2014 9:37 PM
Wednesday, September 24, 2014 9:37 PM
All replies
-
Hi Lynn,
the maximum request length is 10000 characters.
Chris Wendt
Microsoft Translator- Marked as answer by Chris WendtMicrosoft employee Wednesday, September 24, 2014 9:37 PM
Wednesday, September 24, 2014 9:37 PM -
Thanks a lot Chris,
It's nice to have a defined number. So does it mean that such error would not occur if length is less than 10000? (Although I did successfully got translation with length around 10500...)
Best Regards,
LynnThursday, September 25, 2014 3:48 AM -
Hi Lynn,
correct, this error is not going to happen with requests of 10000 characters or less.
Chris Wendt
Microsoft Translator
Thursday, September 25, 2014 4:23 AM -
Thank you very much Chris for your great help!Thursday, September 25, 2014 6:12 AM
-
Hi Chris,
Does the maximum length of 10000 characters apply to the source text in the original language (e.g. chinese characters) or it considers the encoded (UTF-8) version of the content request?
Thanks!
Friday, January 23, 2015 6:18 PM -
Hi PublicRelay,
UTF-8 is the only character encoding accepted by the API. The maximum length of the input is 10000 characters (in UTF-8 encoding). The length of the input counts when calculating the balance of your account.
Hope that helps,
Chris Wendt
Microsoft Translator- Proposed as answer by nicolaspedrozapataorellana Monday, February 16, 2015 8:33 AM
- Edited by Chris WendtMicrosoft employee Monday, February 16, 2015 3:54 PM addition
Friday, January 23, 2015 6:42 PM