Time Series Response
A ticker's price series, or the message Alpha Vantage returned in place of one.
All four cadences answer with this same type, adjusted or not; what differs is the span each StockUnit covers, which of its fields carry values, and how much of the MetaData is filled in. The two snapshot endpoints in this package do not — they answer with QuoteResponse and RealtimeBulkQuoteResponse.
A response carries results or an error, never both. On success getErrorMessage is null, getMetaData describes the series and getStockUnits holds its bars. On failure the message is set, the bar list is empty, and the metadata is the empty placeholder whose fields are all null — so checking the error message is what tells the two apart, not checking for nulls.
The bars come out of the payload in the order its map iterated, which is not guaranteed to be chronological. Sort on getDate if order matters.
Author
Sylvester Sefa-Yeboah
Since
1.0.1