Google Currency Convertor JSON API

Posted by Gopinath on Tech Dreams See other posts from Tech Dreams or by Gopinath
Published on Fri, 14 Dec 2012 04:13:46 +0000 Indexed on 2012/12/14 5:15 UTC
Read the original article Hit count: 227

Filed under:
|

There are many live currency conversion services available on the web and the popular one’s among them are – Google, Yahoo, MSN & XE. Among all these four Google is the developer’s darling and it provides a simple JSON API that can be integrated in your applications

google_currency_convertor_api

http://www.google.com/ig/calculator?hl=en&q=1USD=?INR

Using the API is very simple and it takes two parameters as input. The first parameter “hl” is the language code in which you want output. The second parameter “q” is the conversion query in the format <number><from currency code>=?<to currency code>. In the URL give above the query requests for conversion of 1 USD in INR.

JSON output for the above query would be  similar to

{lhs: "1 U.S. dollar",rhs: "54.4602984 Indian rupees",error: "",icc: true}

Examples: 100 USD in INR 

http://www.google.com/ig/calculator?hl=en&q=100USD=?INR

Example 2: 1 GBP in INR

http://www.google.com/ig/calculator?hl=en&q=1GBP=?INR

Example 3: 1 USD in INR, output the data in French language

http://www.google.com/ig/calculator?hl=fr&q=1USD=?INR

 

This is an undocumented service and expect changes at any time. But as long as it works, you got a programmatic way to convert currencies.

© Tech Dreams or respective owner

Related posts about google

Related posts about programming