v1.1.0
Restructured GetQuotes
Method
Change to Function Signature
GetQuotes
now returns (Results, error)
. The error here should either be nil
or fmt.Errorf("error failed to generate rows from quote KVP map")
. If the latter occurs, feel free to raise an issue.
Results
is constructed as Results{Data: *dataframe.DataFrame, Warnings: []Warning, Errors: []Error}
. As follows:
Data
is the previously returned DataFrameWarnings
is a slice of newWarning
structs. An exampleWarning
is given byWarning{Ticker: "INVALID", Error: fmt.Errorf("resource not found")}
. Right now, warnings only indicate that Finviz does not support the given ticker.Errors
is a slice of newError
structs. An exampleError
is given byError{Ticker: "SNAP", Error: fmt.Errorf(...)}
. Errors could occur if Finviz has placed you on a block list (usually done via Cloudflare) or could be an internal library error.
If a Warning or Error exists for a Ticker, then the returned DataFrame will not have a row for that Ticker. The three sets, i.e., Data, Warnings, and Errors, are mutually exclusive.
Other Changes
- Added
Exchange
column to the returned DataFrame. - Fixed a bug that sometimes returned
S&P,500
as a stock's Index; now returnsS&P500
. - Added data cleaning to DataFrame results, i.e., most columns should now correspond to their actual data type.
- Added support for backoff algorithm on request frequency.