-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error Code 401 #226
Comments
Anyone knows how to fix this? |
I'm having the same problem. |
Such a bad news. Does it mean if i need to purchase minimum Gold plan only we can get the token to access the yahoo finance API now? Is there an easy way to make it work with the current java API if we choose to subscribe the Gold plan? |
I added a LiveTest to this API in my PR #227. All of the previous tests were mocked. Take a look at the OnlineRequestTest class and feel free to add tests. getStats() seems to work. Historical Prices have the 401. |
To my understanding, now you need to have a crumb query parameter and possiblely cookie in the header for every API calls to prevent the 401 error. The source code has some code about crumb. Not sure why the 401 error still occurs. Once getting over this issue, the data is still accessible. |
Output:
SLF4J(I): Connected with provider of type [org.slf4j.simple.SimpleServiceProvider]
[main] INFO yahoofinance.quotes.query1v7.QuotesRequest - Sending request: https://query1.finance.yahoo.com/v7/finance/quote?symbols=INTC
Error retrieving stock data: Server returned HTTP response code: 401 for URL: https://query1.finance.yahoo.com/v7/finance/quote?symbols=INTC
I was just running a simple code given below:
import yahoofinance.Stock;
import yahoofinance.YahooFinance;
import java.io.IOException;
import java.math.BigDecimal;
public class StockMarket {
public static void main(String[] args) {
try {
Stock stock = YahooFinance.get("INTC");
}
The text was updated successfully, but these errors were encountered: