1

I've been using the Yahoo Currency Converter all along without issues.

Here is the function code in Java:

 public static Float convert(String currencyFrom, String currencyTo) throws IOException {
    HttpClient httpclient = new DefaultHttpClient();
    HttpGet httpGet = new HttpGet("http://quote.yahoo.com/d/quotes.csv?s=" + currencyFrom + currencyTo + "=X&f=l1&e=.csv");
    ResponseHandler<String> responseHandler = new BasicResponseHandler();
    String responseBody = httpclient.execute(httpGet, responseHandler);
    httpclient.getConnectionManager().shutdown();
    return Float.parseFloat(responseBody);

 }

However, just yesterday I realised it was throwing the following error:

It has come to our attention that this service is being used in violation of the Yahoo Terms of Service. As such, the service is being discontinued. For all future markets and equities data research, please refer to finance.yahoo.com.

Is there some problems with the code I'm using? Or has the service been discontinued permanently. Any alternative suggestion for real time currency conversion?

Mag
  • 13
  • 1
  • 4

2 Answers2

2

I can confirm that the service has been discontinued overnight.

https://forums.yahoo.net/t5/Yahoo-Finance-help/http-download-finance-yahoo-com-d-quotes-csv-s-GOOG-amp-f/m-p/387662/highlight/true#M6207

This is the answer from the admin of the community site.

db80
  • 4,157
  • 1
  • 38
  • 38
1

Although discontinued, you could look at an alternative such as http://fixer.io, which would allow you to do something similar via JSON

https://api.fixer.io/latest?base=currencyFrom&symbols=currencyTo

elfling
  • 645
  • 5
  • 10