TimeSeriesResponse

public class TimeSeriesResponse

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

Types

Link copied to clipboard
Turns a decoded stock time series payload into a TimeSeriesResponse.

Properties

Link copied to clipboard
public final String errorMessage
Link copied to clipboard
public final MetaData metaData
Link copied to clipboard
public final List<StockUnit> stockUnits

Functions

Link copied to clipboard
Gets the reason no series was returned, as reported by the API.
Link copied to clipboard
Gets the header describing the series: its ticker, freshness and sampling.
Link copied to clipboard
Gets the price bars making up the series, each carrying its own timestamp in getDate.
Link copied to clipboard
public static TimeSeriesResponse of(Map<String, Object> stringObjectMap, boolean adjusted)
Builds a response from a decoded stock time series payload, whichever cadence produced it.
Link copied to clipboard
public String toString()