Introducing

Track Movements Across Markets with our New Universal Snapshot API

Jun 20, 2023

We are excited to announce the launch of our Universal Snapshots API endpoint. This feature, tailored to your subscriptions, enables you to fetch multiple tickers across Stocks, Options, Indices, Forex, and Crypto assets with just one API call. Now you can efficiently track price movements throughout the day, along with pre-market and post-market change calculations, and quickly ascertain market status. In addition, we have streamlined our response format to offer you a cleaner, faster, and more consistent experience.

To start your journey with the Universal Snapshot API, we recommend checking out the documentation on our website. For even more guidance, we also offer demo code snippets available for Python, Go, and Javascript available in our client libraries.

Making a Universal Snapshot API Request

Let's get started by making a snapshot request for a variety of tickers spanning different asset classes, using

TSLA
for Stocks,
O:SPY250321C00380000
for Options,
I:SPX
for Indices,
C:EURUSD
for Forex, and
X:BTCUSD
for Crypto, we're able to cover a wide spectrum of market data.

The API call would look like the following and this single request fetches snapshots across multiple asset classes:

https://api.polygon.io/v3/snapshot?ticker.any_of=TSLA,O:SPY250321C00380000,C:EURUSD,X:BTCUSD,I:SPX&apiKey=XXXX

Now, let's dive into the resulting JSON response objects to better understand the Universal Snapshot API.

Exploring the Universal Snapshot API Response

In this example, we only requested 5 tickers, but this new API supports up to 250. Given the potentially large size of the response object, we have broken down the example response here to make it easier to explore the returned data.

In the stock snapshot example, we use Tesla Inc (TSLA). Key data points are provided, such as the current market status, session details such as the opening price, high, low, and closing prices. Additionally, the snapshot includes the last quote with bid-ask details and the last trade data. This comprehensive view allows you to get a clear point in time snapshot of TSLA's current trading status.

    {
      "market_status": "open",
      "name": "Tesla, Inc. Common Stock",
      "ticker": "TSLA",
      "type": "stocks",
      "session": {
        "change": -1.19,
        "change_percent": -0.584,
        "early_trading_change": -1.31,
        "early_trading_change_percent": -0.642,
        "close": 202.7,
        "high": 205.99,
        "low": 199.37,
        "open": 202.59,
        "volume": 45830521,
        "previous_close": 203.93,
        "price": 202.74
      },
      "last_quote": {
        "last_updated": 1685630462840663300,
        "timeframe": "REAL-TIME",
        "ask": 202.77,
        "ask_size": 2,
        "bid": 202.73,
        "bid_size": 2
      },
      "last_trade": {
        "last_updated": 1685630462764648000,
        "timeframe": "REAL-TIME",
        "id": "481",
        "price": 202.74,
        "size": 10,
        "exchange": 3,
        "conditions": [
          37
        ]
      }
    }

For options, we examine a SPY Call Option. Besides the standard session data, the snapshot includes option-specific details like the contract type, expiration date, and strike price. It also includes important metrics such as the Greeks and implied volatility. The last quote and trade data, along with the underlying asset's details, make this snapshot a treasure trove of information for option traders.

    {
      "break_even_price": 458.5,
      "session": {
        "change": 0,
        "change_percent": 0,
        "early_trading_change": 0,
        "early_trading_change_percent": 0,
        "close": 81.5,
        "high": 81.5,
        "low": 81.5,
        "open": 81.5,
        "volume": 1,
        "previous_close": 81.5
      },
      "details": {
        "contract_type": "call",
        "exercise_style": "american",
        "expiration_date": "2025-03-21",
        "shares_per_contract": 100,
        "strike_price": 380
      },
      "greeks": {
        "delta": 0.7430457230001798,
        "gamma": 0.0026398471936316206,
        "theta": -0.046401014843273115,
        "vega": 1.7809610260678774
      },
      "implied_volatility": 0.2072797221054741,
      "last_quote": {
        "ask": 81,
        "ask_size": 46,
        "bid": 76,
        "bid_size": 200,
        "last_updated": 1685630417164339700,
        "midpoint": 78.5,
        "timeframe": "REAL-TIME"
      },
      "last_trade": {
        "sip_timestamp": 1685118686609000000,
        "conditions": [
          219
        ],
        "price": 81.5,
        "size": 1,
        "exchange": 316
      },
      "open_interest": 70,
      "underlying_asset": {
        "change_to_break_even": 39.73,
        "last_updated": 1685630462835032800,
        "price": 418.77,
        "ticker": "SPY",
        "timeframe": "REAL-TIME"
      },
      "name": "SPY $380.00 call",
      "market_status": "open",
      "ticker": "O:SPY250321C00380000",
      "type": "options"
    }

For Indices, we take a snapshot of the S&P 500 Index. Here, you will find key metrics such as the index value, its last update time, and the current market status. This also includes details about the session, capturing the overall movement of this key market indicator throughout the day.

    {
      "value": 4189.87,
      "last_updated": 1685630462024000000,
      "timeframe": "REAL-TIME",
      "name": "Standard & Poor's 500",
      "ticker": "I:SPX",
      "market_status": "open",
      "type": "indices",
      "session": {
        "change": 22.81,
        "change_percent": 0.547,
        "close": 4189.36,
        "high": 4190.65,
        "low": 4171.64,
        "open": 4183.03,
        "previous_close": 4167.06
      }
    }

In our Forex example, we look at the EUR/USD pair. It provides essential market information, including the current market status, session data, and the most recent quote.

    {
      "market_status": "open",
      "name": "Euro - United States Dollar",
      "ticker": "C:EURUSD",
      "type": "fx",
      "session": {
        "change": 0.00323,
        "change_percent": 0.302,
        "close": 1.07255,
        "high": 1.0742,
        "low": 1.066,
        "open": 1.06867,
        "volume": 109735,
        "previous_close": 1.06932
      },
      "last_quote": {
        "last_updated": 1685630462000000000,
        "timeframe": "REAL-TIME",
        "ask": 1.07257,
        "bid": 1.07255,
        "exchange": 48
      }
    }

Finally, the Crypto snapshot showcases Bitcoin against USD. Apart from typical session data, it also includes the last trade information, which gives users an immediate understanding of the latest market conditions for the BTC/USD pair.

    {
      "market_status": "open",
      "name": "Bitcoin - United States Dollar",
      "ticker": "X:BTCUSD",
      "type": "crypto",
      "session": {
        "change": -331,
        "change_percent": -1.22,
        "close": 26879.3,
        "high": 27176.94,
        "low": 26571.5,
        "open": 27075.79,
        "volume": 9369.28490913,
        "previous_close": 27223.08,
        "price": 26892
      },
      "last_trade": {
        "participant_timestamp": 1685630462726000000,
        "timeframe": "REAL-TIME",
        "id": "1371270597",
        "price": 26892,
        "exchange": 2,
        "conditions": [
          2
        ]
      }
    }

There is now a common and consistent response format across assets, this not only streamlines your data analysis, but also provides a comprehensive view across asset classes for the data you care about most.

Next Steps

The Universal Snapshots API, enables you to efficiently track price movements and other crucial market data points across multiple asset classes, all based on your subscription.

We encourage you to dive deeper by exploring the documentation available on our website. To help you even further, we have demo code snippets in our client libraries for Python, Go, and Javascript.

Happy exploring!

From the blog

See what's happening at polygon.io

integration quantconnect Feature Image
featured

Integration: QuantConnect

We are excited to announce our integration with QuantConnect! This offering empowers users with state-of-the-art research, backtesting, parameter optimization, and live trading capabilities, all fueled by the robust market data APIs and WebSocket Streams of Polygon.io.