https://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ("ARSARS")&env=store://datatables.org/alltableswithkeys

Damien Taylor picture Damien Taylor · Nov 2, 2017 · Viewed 10.3k times · Source

I have been using the following URL for the past 3 years without issue. However, it has stopped returning results.

URL: https://query.yahooapis.com/v1/public/yql?q=select * from yahoo.finance.xchange where pair in ("ARSARS")&env=store://datatables.org/alltableswithkeys

Now returns the following:

<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="0" yahoo:created="2017-11-02T09:33:25Z" yahoo:lang="en-AU">
    <results/>
</query><!-- total: 9 -->

Notice how there are no results, it simply has the tag "results".
I have tried on this many different computers and browsers. I have also tried changing the currency combinations, but no luck.

Can anybody spot what I am doing wrong?

Answer

rrudland picture rrudland · Nov 3, 2017

Yes, it looks like Yahoo has discontinued their Currency Converter API service.

I found a different site : https://currencylayer.com/

They let you request currency rates (1 USD = 168 other currencies). If you make less than 1000 requests per month, it is free (if you need more, they have different subscriptions : https://currencylayer.com/product).

You just need to sign up and receive your own Access Code. Once you have that, then you simply make the call http://apilayer.net/api/live?access_key= and it will return JSON of the other currency rates.

They also have code examples in PHP, JavaScript, and Java at https://currencylayer.com/documentation

Found it very easy to get started using their API right away.