7

iGoogle is shutting down.

There is an (undocumented?) currency conversion API available with URLs like: http://www.google.com/ig/calculator?hl=en&q=1GBP=?USD

The base of this url - google.com/ig - takes you to iGoogle. Will the API be available after iGoogle shuts down?

MachineElf
  • 1,231
  • 2
  • 15
  • 28

5 Answers5

19

I was having the same issue described here: https://stackoverflow.com/a/19786423/2819754

I used @hobailey answer for a temporary fix until i can update it to another version or google decide to do a proper api.

As google changed the URL to

  https://www.google.com/finance/converter?a

So the fix i found is below.

  $amount = urlencode($amount);
  $from_Currency = urlencode($from_Currency);
  $to_Currency = urlencode($to_Currency);
  $get = file_get_contents("https://www.google.com/finance/converter?a=$amount&from=$from_Currency&to=$to_Currency");
  $get = explode("<span class=bld>",$get);
  $get = explode("</span>",$get[1]);  
  $converted_amount = preg_replace("/[^0-9\.]/", null, $get[0]);

thanks to @hobailey for this little fix.

Community
  • 1
  • 1
Simon Davies
  • 3,668
  • 9
  • 41
  • 69
9

Alternatively you can use following:

But the first one is not that stable goes out of capacity very often. We had an extreme problem in our production environment using the first exchange service few months back. So far second one is stable, doesn't cause any problem.

Sougata Pal
  • 125
  • 1
  • 5
3

iGoogle has already expired but not the gadget link you have posted. Currently it returns 200 OK with probably your desired message.

Update: It got expired too. No Gadgets are available at the moment.

Update: Available from here https://www.google.com/finance/converter?a=16.6700&from=GBP&to=USD

John Cargo
  • 1,839
  • 2
  • 29
  • 59
  • Thx! Google APIs are pretty fly-by-night it seems! (e.g. Reader, although that was never official too) – MachineElf Nov 01 '13 at 16:44
  • 1
    It seems the gadget is retired now. I get a response error now – e3matheus Nov 04 '13 at 23:54
  • 2
    I am having same issue. they have changed the url to http://www.google.com/finance/converter?a=16.6700&from=GBP&to=USD so. But i cannot get the response i need anymore from this so trying to work it out. – Simon Davies Nov 07 '13 at 13:55
  • Thanks, the last one still works.. And if you go to the page on your browser , there's 1 text box (input) , 2 combo-boxes, and a submit button.. – Fx Mzt Dec 03 '15 at 18:35
  • Appears that google.com/finance/converter is now also shutdown. – Out of Control Nov 29 '17 at 22:27
0

Free Currency Converter API from http://mycurrency.net

  • It is 100% Free.
  • No API key is required!
  • No cap on frequency of API calls.
  • Currency price is updated every two hours.
  • Support json format.
  • Very fast and reliable.
  • The api address is here. It returns 176 currencies prices together with country name, country code, currency name and currency price. The base currency is USD.

    http://www.mycurrency.net/service/rates

There is also Free country flag API you may also need. Just replace the country code.

http://caches.space/flags/{countrycode}.png

Example:

http://caches.space/flags/sg.png sg

http://caches.space/flags/us.png enter image description here

Evan Lee
  • 738
  • 15
  • 36
0

Just use this URL

https://finance.google.com/bctzjpnsun/converter?a=1&from=USD&to=INR

Replace

 https://www.google.com/finance/

to

https://finance.google.com/bctzjpnsun/
4b0
  • 21,981
  • 30
  • 95
  • 142
Hisanth
  • 62
  • 2
  • 9