zacmarcus / yahoofinance.net Goto Github PK
View Code? Open in Web Editor NEWYahooFinance.NET allows you to easily download historical end of day stock data and historical dividend data from Yahoo Finance.
License: MIT License
YahooFinance.NET allows you to easily download historical end of day stock data and historical dividend data from Yahoo Finance.
License: MIT License
Would it be possible to get the name of the historicprice??
Im trying to get it 2 or 3 symbols in one .csv file
Hi ZacMarcus,
I noticed the values returned from this package are far too big (usually x10000 of the correct value).
The reason for this is quite simple: Yahoo, of course, delivers its values in US format. My default thread culture however is German. I took a look in the source code and noticed you're using the default parse methods like decimal.Parse(values[1])
without specifying the culture explicitly.
So the problem would be solved by specifying the US format explicitly to the parse methods.
Thanks a lot,
Zacko
Hi ZacMarcus,
I have tried YahooFinance API, YahooFinance.GetDailyHistoricalPriceData is working to get the historical data.
However, when I call the YahooFinance.GetRealTimeData(yahoostockcode), there is WebException: The remote name could not be resolved: 'download.finance.yahoo.com'
I also tried Dim listdividendhistory As Object = YahooFinance.GetHistoricalDividendData(yahoostockcode), but no record count returns .
Here is my coding, do I need to handle the cookie and crumb ?
Dim cookie As String = "YOUR_COOKIE"
Dim crumb As String = "YOUR_CRUMB"
Dim exchange As String = "HKG"
Dim symbol As String = "0001"
Dim YahooFinance As New YahooFinance.NET.YahooFinanceClient(cookie, crumb) 'retrieve cookies
Dim yahoostockcode = YahooFinance.GetYahooStockCode(exchange, symbol)
Dim listhistoricalprice As Object = YahooFinance.GetDailyHistoricalPriceData(yahoostockcode)
Console.WriteLine("Historical Price")
For Each histprice In listhistoricalprice
With histprice
Console.WriteLine("Date: " & .Date & " Open: " & .Open & " High: " & .High & " Low: " & .Low & " Close: " & .Close & " AdjClose: " & .AdjClose & " Volume: " & .Volume)
End With
Next
Dim listrealtimeprice As Object = YahooFinance.GetRealTimeData(yahoostockcode)
Console.WriteLine("Real Time Price")
For Each realtimeprice In listrealtimeprice
With realtimeprice
Console.WriteLine("Ask: " & .Ask & " Bid: " & .Bid & " Last: " & .Last & " PreviousClose: " & .PreviousClose _
& " Open: " & .Open & " High: " & .High & " Low: " & .Low & " LastTradeTime: " & .LastTradeTime & " Volume: " & .Volume _
& "Symbol: " & .Symbol & " Name: " & .Name)
End With
Next
Thanks
Davy
try various times other cookies and crumbs... and don't work.
it worked for me fine until 10 days ago.
it's and excelent API,thank's Zac.
can be yahoo has changed anything?
thank's
Hello,
The following method do not return correct values except for US, UK & australian market (ok, the most important ones ;) )
public string GetYahooStockCode(string exchange, string code)
{
switch (exchange)
{
case "ASX":
return $"{code}.AX";
default:
return code;
}
}
The complete list of suffix is available on http://finance.yahoo.com/exchanges
Maybe an enum of MarketExchange can make the use of the API easier ?
Install-Package : Could not install package 'YahooFinance.NET 4.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
My Computer W10 Prof, VS 2013 Prof
Any ideas
Hi Team,
Love your work!! everything is working great except i cannot get the historical date for a given start date and end date, does this still work for you?
Dim exchange As String = "ASX"
Dim symbol As String = "ABC"
Dim yahooFinance As YahooFinanceClient = New YahooFinanceClient(cookie, crumb)
Dim yahooStockCode As String = yahooFinance.GetYahooStockCode(exchange, symbol)
Dim yahooPriceHistory As List(Of YahooHistoricalPriceData) = yahooFinance.GetDailyHistoricalPriceData(yahooStockCode, New DateTime(2017, 12, 5), New DateTime(2017, 12, 8))
Yahoo changed url couple of days ago, so connection with a server cannot be established. New url starts with https://query1.finance.yahoo.com/v7/finance/download...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.