sstrickx / yahoofinance-api

Java Client API for Yahoo Finance
MIT License
507 stars 222 forks source link

java.io.FileNotFoundException when calling data for a particular date #161

Open shiv-24 opened 4 years ago

shiv-24 commented 4 years ago

Hello, I have been using the api to fetch data for some time but recently started facing issues with fetching data for a particular date. The ticker I'm requesting for is valid and I was able to fetch the data before. ex:


 java.io.FileNotFoundException: https://query2.finance.yahoo.com/v7/finance/download/AAPL?period1=1577880000&period2=1577880000&interval=1d&crumb=2FSjnBGRwMD
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1909)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
    at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
    at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:329)
    at yahoofinance.util.RedirectableRequest.openConnection(RedirectableRequest.java:54)
    at yahoofinance.histquotes2.HistQuotes2Request.getResult(HistQuotes2Request.java:130)

I tried following the solution provided in one of the other open issues but it didn't work. Anyone else facing the same issue recently?

arya6000 commented 4 years ago

I am facing a similar issue, but the link looks to be valid when I paste in my browser. Example

java.io.FileNotFoundException: https://query1.finance.yahoo.com/v7/finance/download/VZ?period1=1442030400&period2=1599883200&interval=1d&crumb=XGpumOcU1qH