dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
1631
share rss forum feed


gorrillamcd
Hangin' Out

join:2010-04-01
mexico

Anyone know of an Exchange Rate API that offers a free tier?

I'm wanting to grab the current exchange rate in a cron job and update a variable accordingly in my application. I only want to do it once a week at most. I guess I could scrape the info from a page like xe.com, but I'd like to abide by any TOS policy they may have if possible since I'm open sourcing my code.
--
I'm an IT technician with a lot to learn, taught by viewers like you!


gorrillamcd
Hangin' Out

join:2010-04-01
mexico
I found »openexchangerates.org/, which offers a free plan with 1,000 requests/month which is more than enough for me. The api they use is open source as well.
--
I'm an IT technician with a lot to learn, taught by viewers like you!


cdru
Go Colts
Premium,MVM
join:2003-05-14
Fort Wayne, IN
kudos:7

1 recommendation

reply to gorrillamcd
Google's Calculator API will return a JSON formatted response for currency. If you don't need real time exchange rates, it's probably the simplest to use and can easily be parsed with command line tools.

For example, here's the query to convert $100 USD to GBP:
http://www.google.com/ig/calculator?hl=en&q=100USD=?GBP
 

And the response is:
{lhs: "100 U.S. dollars",rhs: "62.1967906 British pounds",error: "",icc: true}
 
lhs and rhs is left hand side and right hand side of the equation. error has any errors that occurred. Not sure what icc is for without poking around some.


gorrillamcd
Hangin' Out

join:2010-04-01
mexico
Thanks for that. I didn't know it would return a JSON response. That's great.
--
I'm an IT technician with a lot to learn, taught by viewers like you!