Updated on December 6th 2017 to use Microsoft Azure accounts
Bing translator has changed its API recently again to migrate to the new Azure accounts on http://azure.com. Before this version, we used accounts on Azure Data Market. The new API still requires you to get an access token first before using any Bing service. The URL and parameters are changed to use the new Azure accounts.
Step 0: sign up for a Microsoft Azure account
To access the Microsoft Translator Text API you will need to sign up for Microsoft Azure. Follow these steps.
- Sign up for a Microsoft Azure account at http://azure.com
- After you have an account go to http://portal.azure.com
- Select the + New option.
- Select AI + Cognitive Services from the list of services.
- Select Translator Text API. You may need to click "See all" or search to see it.
- Fill out the rest of the form, and select the Create button.
- You are now subscribed to Microsoft Translator Text API.
- Go to All Resources and select the Microsoft Translator API you subscribed to.
- Go to the Keys option and copy your subscription key to access the service.
Step 1: get access token
$ curl --header 'Ocp-Apim-Subscription-Key: [Your-Azure-subscription-key]' --data "" 'https://api.cognitive.microsoft.com/sts/v1.0/issueToken'
After this curl command, you will get an access token which is valid for a short period.
After this curl command, you will get an access token which is valid for a short period.
For the details about this step, please refer to:
http://docs.microsofttranslator.com/oauth-token.htmlStep 2: get translation using the obtained access token
curl -i -H "Authorization: Bearer [access-token-obtained-in-step-1]" "http://api.microsofttranslator.com/V2/Http.svc/Translate?appid=&text=lol&from=en&to=zh-CHS"
You will get some output from curl like (the last line is the real HTTP response):
HTTP/1.1 200 OK
Content-Length: 83
Content-Type: application/xml;
charset=utf-8
X-MS-Trans-Info: 0916.V2_Rest.Translate.1D6C05C5
Date: Mon, 10 Apr 2017 17:50:43 GMT
<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">哈哈</string>
References
(1) For details about the Microsoft Translation APIs:
https://docs.microsofttranslator.com/text-translate.html(2) For details about what languages are supported and what languages are using Neural Machine Translation (NMT) models:
https://www.microsoft.com/en-us/translator/languages.aspx
26 comments:
great, the bing API is useful.
Thanks, it helped me build my tiny application.
hello, could you provide php code from requesting token, until getting the translation result?
thanks in advance
Very clear instructions. Thanks Wang.
http://code.google.com/p/micrsoft-translator-php-wrapper/
and you can see the demo also
http://renjith.co.in/translate/
Wang, thanks for providing clarity. I'm able to get the access_token (using perl). My access_token is a very large string, starts with http and contains "%" characters ..its kind of a big http url.
Is that how it should be?
Thanks!
I tried the code from: http://code.google.com/p/micrsoft-translator-php-wrapper/
I believe it doesn't have script to renew the token. I visited the demo too, and it happened to work only for several minutes.
make a translation, is a GET request
https://sites.google.com/site/reformascubiertastejadosmadrid/
masina s-a stricat, trebuie s-o repar
Can you post how to do the same with web searches. thx dude
omg this info is pointless for noobs (me me me me me). it's all so bloody confusing :(
:D
Technical Translation Services
Thanks for sharing this wonderful and useful information,Please keep updating.
mba courses in india
I trust it doesn't have content to restore the token. I went by the demo as well, and it happened to work just for a few minutes.
Thank you for share this post for us. This post is very helpful for me and I hope also other. Please keep update and add more topic.
I also write about the android app like Yowhatsapp APK Free Download
It gives the most beneficial, most elevated quality playback connections scratched from trickswithus.com dynamic servers around the world
Jetpack Jump MOD APK
Your article is very helpful.You can visit my website:gameguardian for android
I Love your article. You can visit my website : solitaire apk download
happy republic day 2020 images
Hello Admin, First off Congratulations on this Post and Nice information for a new blogger…it is really helpful.
Nepmod
Watch Pinoy Lambingan Orihinal na may Pinoy Tv Replay, Pinoy Tambayan, Pinoy Teleserye Replay, Pinoy Channel, Pinoy Ako, Pinoy TV ... People can come and enjoy watching the Pinoy channel shows online in super HD quality with us
Pinoy Teleserye
Pinoy TV
Thank you for sharing great information with us. Your contribution is very unique and all information is reliable for new readers. Keep up the good work in the future, thank you for sharing this useful post. smartphone price in bd
Hi This is SRK i'm suggesting you this is app Kisscartoon Apk
AmpMe Apk
Ehsaas Programme is a social safety and poverty alleviation launched by Government of Pakistan in 2019 by Party of IMRAN KHAN. Prime Minister of Pakistan Imran Khan called it a key initiative towards a welfare state.
BISP Program
Ehsaas Program Check Online
Post a Comment