POST/shorts.v1alpha1.StockService/GetStockPrices

GetStockPrices

Adjusted daily OHLCV for a stock, on the same codes and the same dates as the short-position series.

Parameters

Connect-Protocol-VersionheaderRequired
number [1]

Define the version of the Connect protocol

Connect-Timeout-Msheader
number

Define the timeout, in ms

Request Body

application/json
object

Request for GetStockPrices RPC. This exists so that short interest can be joined to returns without leaving the API. Doing it outside meant reconciling two ticker conventions (BHP here against BHP.AX elsewhere), two unauditable adjustment methodologies for splits and dividends, and two universes that need not agree on any given date — an error term on every result that no amount of care on the caller's side removes. Every question the product is actually asked ("do heavily shorted names underperform", "what happened after the squeeze") needs both series, and the harder half was already here.

fromstring

Explicit date range, YYYY-MM-DD. `from` alone runs to the end of the data. (proto string)

maxPointsinteger <int32>

Cap on returned points, 0 for no cap. Thinning keeps the first and last observation; `downsampled` reports whether it happened. (proto int32)

periodstring

Lookback window: 1D, 1W, 1M, 3M, 6M, 1Y, 2Y, 5Y, 10Y or MAX. Ignored when `from` is set. Defaults to 1Y. (proto string)

productCodestring

(proto string)

tostring

(proto string)

Responses

200Success
application/json
object
currencystring

Always "AUD" today; stated rather than assumed. (proto string)

downsampledboolean

(proto bool)

namestring

(proto string)

pointsarray

Oldest first. (proto shorts.v1alpha1.StockPricePoint)

Array Items:
productCodestring

(proto string)

totalObservationsinteger <int32>

Observations in the window before thinning. (proto int32)

defaultError
application/json
object

Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation

codestring [canceled, unknown, invalid_argument, deadline_exceeded, not_found, already_exists, permission_denied, resource_exhausted, failed_precondition, aborted, out_of_range, unimplemented, internal, unavailable, data_loss, unauthenticated]

The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].

detailsarray

A list of messages that carry the error details. There is no limit on the number of messages.

Array Items:
messagestring

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.

curl -X POST "https://api.shorted.com.au/shorts.v1alpha1.StockService/GetStockPrices" \
  -H "Content-Type: application/json" \
  -d '{
  "from": "string",
  "maxPoints": 0,
  "period": "string",
  "productCode": "string",
  "to": "string"
}'