Skip to content
Get started

Get Snapshots

MarketDataGetSnapshotsResponse v1().instrumentData().marketData().getSnapshots(MarketDataGetSnapshotsParamsparams = MarketDataGetSnapshotsParams.none(), RequestOptionsrequestOptions = RequestOptions.none())
GET/v1/market-data/snapshot

Get market data snapshots for one or more securities.

ParametersExpand Collapse
MarketDataGetSnapshotsParams params
Optional<List<String>> instrumentIds

Comma-separated OEMS instrument UUIDs.

ReturnsExpand Collapse
class MarketDataGetSnapshotsResponse:
String instrumentId

OEMS instrument identifier.

String symbol

Display symbol for the security.

Optional<Long> cumulativeVolume

Cumulative traded volume reported on the most recent trade, in shares for equities or contracts for options. Absent when no trade is available.

formatint64
minimum0
Optional<SnapshotQuote> lastQuote

Most recent quote if available.

String ask

Current best ask.

String bid

Current best bid.

String midpoint

Midpoint of bid and ask.

Optional<Long> askSize

Size at the best ask, in shares.

formatint32
minimum0
Optional<Long> bidSize

Size at the best bid, in shares.

formatint32
minimum0
Optional<SnapshotLastTrade> lastTrade

Most recent last-sale trade if available.

String price

Most recent last-sale eligible trade price.

Optional<String> name

Security name if available.

Optional<SnapshotSession> session

Session metrics computed from previous close and last trade, if available.

String change

Absolute change from previous close to last trade.

String changePercent

Percent change from previous close to last trade.

String previousClose

Previous session close price.

Get Snapshots

package com.clear_street.api.example;

import com.clear_street.api.client.ClearStreetClient;
import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsParams;
import com.clear_street.api.models.v1.instrumentdata.marketdata.MarketDataGetSnapshotsResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        ClearStreetClient client = ClearStreetOkHttpClient.builder()
            .fromEnv()
            .apiKey("My API Key")
            .build();

        MarketDataGetSnapshotsResponse response = client.v1().instrumentData().marketData().getSnapshots();
    }
}
{
  "data": [
    {
      "cumulative_volume": 12345678,
      "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
      "last_quote": {
        "ask": "210.14",
        "ask_size": 120,
        "bid": "210.10",
        "bid_size": 100,
        "midpoint": "210.12"
      },
      "last_trade": {
        "price": "210.12"
      },
      "name": "Apple Inc.",
      "session": {
        "change": "1.82",
        "change_percent": "0.8737",
        "previous_close": "208.30"
      },
      "symbol": "AAPL"
    }
  ],
  "error": null,
  "metadata": {
    "request_id": "2d0c9159-8f5d-49ca-a861-0d8346fd11da"
  }
}
{
  "error": {
    "code": 400,
    "message": "At least one instrument_id is required"
  },
  "metadata": {
    "request_id": "3af8662e-2dd9-4c59-8d32-7c167377fb8f"
  }
}
{
  "error": {
    "code": 404,
    "message": "Instrument not found for id `a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8`"
  },
  "metadata": {
    "request_id": "95683d84-2863-43f0-8f0a-63537c3cef85"
  }
}
Returns Examples
{
  "data": [
    {
      "cumulative_volume": 12345678,
      "instrument_id": "a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8",
      "last_quote": {
        "ask": "210.14",
        "ask_size": 120,
        "bid": "210.10",
        "bid_size": 100,
        "midpoint": "210.12"
      },
      "last_trade": {
        "price": "210.12"
      },
      "name": "Apple Inc.",
      "session": {
        "change": "1.82",
        "change_percent": "0.8737",
        "previous_close": "208.30"
      },
      "symbol": "AAPL"
    }
  ],
  "error": null,
  "metadata": {
    "request_id": "2d0c9159-8f5d-49ca-a861-0d8346fd11da"
  }
}
{
  "error": {
    "code": 400,
    "message": "At least one instrument_id is required"
  },
  "metadata": {
    "request_id": "3af8662e-2dd9-4c59-8d32-7c167377fb8f"
  }
}
{
  "error": {
    "code": 404,
    "message": "Instrument not found for id `a1a2a3a4-b1b2-c1c2-d1d2-d3d4d5d6d7d8`"
  },
  "metadata": {
    "request_id": "95683d84-2863-43f0-8f0a-63537c3cef85"
  }
}