Indices API Documentation

The Polygon.io Indices API provides REST endpoints that let you query the latest indices data from thousands of industry leaders including S&P, Dow Jones, FTSE Russell, and more. You can find candlesticks, snapshots, and more for each index.

Documentation

Authentication

Pass your API key in the query string like follows:

https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2023-01-09/2023-01-09?apiKey=*

Alternatively, you can add an Authorization header to the request with your API Key as the token in the following form:

Authorization: Bearer <token>

Usage

Many of Polygon.io's REST endpoints allow you to extend query parameters with inequalities like date.lt=2023-01-01 (less than) and date.gte=2023-01-01 (greater than or equal to) to search ranges of values. You can also use the field name without any extension to query for exact equality. Fields that support extensions will have an "Additional filter parameters" dropdown beneath them in the docs that detail the supported extensions for that parameter.

Response Types

By default, all endpoints return a JSON response. Users with Indices Starter plan and above can request a CSV response by including 'Accept': 'text/csv' as a request parameter.

Aggregates (Bars)

get
/v2/aggs/ticker/{indicesTicker}/range/{multiplier}/{timespan}/{from}/{to}

Get aggregate bars for an index over a given date range in custom time window sizes.

For example, if timespan = ‘minute’ and multiplier = ‘5’ then 5-minute bars will be returned.

Parameters

The ticker symbol of Index.

The size of the timespan multiplier.

  • The size of the time window.

    The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.

    The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.

  • Sort the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return results in descending order (newest at the top).

    Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements.

    https://api.polygon.io/v2/aggs/ticker/{indicesTicker}/range/{multiplier}/{timespan}/{from}/{to}?apiKey=*
  • Response Attributes
    ticker*string

    The exchange symbol that this item is traded under.


    queryCount*integer

    The number of aggregates (minute or day) used to generate the response.


    request_id*string

    A request id assigned by the server.


    resultsCount*integer

    The total number of results for this request.


    status*string

    The status of this request's response.


    resultsarray
    c*number

    The close value for the symbol in the given time period.


    h*number

    The highest value for the symbol in the given time period.


    l*number

    The lowest value for the symbol in the given time period.


    o*number

    The open value for the symbol in the given time period.


    t*integer

    The Unix Msec timestamp for the start of the aggregate window.


    Was this helpful?
    Help us improve
    Response Object
    {
      "count": 2,
      "queryCount": 2,
      "request_id": "0cf72b6da685bcd386548ffe2895904a",
      "results": [
        {
          "c": 11995.88235998666,
          "h": 12340.44936267155,
          "l": 11970.34221717375,
          "o": 12230.83658266843,
          "t": 1678341600000
        },
        {
          "c": 11830.28178808306,
          "h": 12069.62262033557,
          "l": 11789.85923449393,
          "o": 12001.69552583921,
          "t": 1678428000000
        }
      ],
      "status": "OK",
      "ticker": "I:NDX"
    }

    Previous Close

    get
    /v2/aggs/ticker/{indicesTicker}/prev

    Get the previous day's open, high, low, and close (OHLC) for the specified index.

    Parameters

    The ticker symbol of Index.

    https://api.polygon.io/v2/aggs/ticker/{indicesTicker}/prev?apiKey=*
  • Response Attributes
    ticker*string

    The exchange symbol that this item is traded under.


    queryCount*integer

    The number of aggregates (minute or day) used to generate the response.


    request_id*string

    A request id assigned by the server.


    resultsCount*integer

    The total number of results for this request.


    status*string

    The status of this request's response.


    resultsarray
    c*number

    The close value for the symbol in the given time period.


    h*number

    The highest value for the symbol in the given time period.


    l*number

    The lowest value for the symbol in the given time period.


    o*number

    The open value for the symbol in the given time period.


    t*integer

    The Unix Msec timestamp for the start of the aggregate window.


    Was this helpful?
    Help us improve
    Response Object
    {
      "queryCount": 1,
      "request_id": "b2170df985474b6d21a6eeccfb6bee67",
      "results": [
        {
          "T": "I:NDX",
          "c": 15070.14948566977,
          "h": 15127.4195807999,
          "l": 14946.7243781848,
          "o": 15036.48391066877,
          "t": 1687291200000
        }
      ],
      "resultsCount": 1,
      "status": "OK",
      "ticker": "I:NDX"
    }

    Daily Open/Close

    get
    /v1/open-close/{indicesTicker}/{date}

    Get the open, close and afterhours values of a index symbol on a certain date.

    Parameters

    The ticker symbol of Index.

    The date of the requested open/close in the format YYYY-MM-DD.

    https://api.polygon.io/v1/open-close/{indicesTicker}/{date}?apiKey=*
  • Response Attributes
    afterHoursnumber

    The close value of the ticker symbol in after hours trading.


    close*number

    The close value for the symbol in the given time period.


    from*string

    The requested date.


    high*number

    The highest value for the symbol in the given time period.


    low*number

    The lowest value for the symbol in the given time period.


    open*number

    The open value for the symbol in the given time period.


    preMarketinteger

    The open value of the ticker symbol in pre-market trading.


    status*string

    The status of this request's response.


    symbol*string

    The exchange symbol that this item is traded under.


    Was this helpful?
    Help us improve
    Response Object
    {
      "afterHours": 11830.43006295237,
      "close": 11830.28178808306,
      "from": "2023-03-10T00:00:00.000Z",
      "high": 12069.62262033557,
      "low": 11789.85923449393,
      "open": 12001.69552583921,
      "preMarket": 12001.69552583921,
      "status": "OK",
      "symbol": "I:NDX"
    }

    Simple Moving Average (SMA)

    get
    /v1/indicators/sma/{indicesTicker}

    Get the simple moving average (SMA) for a ticker symbol over a given time range.

    Parameters

    The ticker symbol for which to get simple moving average (SMA) data.

    Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.

    timestamp.gtgreater than
    timestamp.gtegreater than or equal to
    timestamp.ltless than
    timestamp.lteless than or equal to
    Learn More
  • The size of the aggregate time window.

  • Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits.

    The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.

  • The value in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close values to calculate the simple moving average (SMA).

  • Whether or not to include the aggregates used to calculate this indicator in the response.

  • The order in which to return the results, ordered by timestamp.

    Limit the number of results returned, default is 10 and max is 5000

    https://api.polygon.io/v1/indicators/sma/{indicesTicker}?apiKey=*
    Response Attributes
    next_urlstring

    If present, this value can be used to fetch the next page of data.


    request_idstring

    A request id assigned by the server.


    resultsobject
    underlyingobject
    aggregatesarray
    c*number

    The close price for the symbol in the given time period.


    h*number

    The highest price for the symbol in the given time period.


    l*number

    The lowest price for the symbol in the given time period.


    n*integer

    The number of transactions in the aggregate window.


    o*number

    The open price for the symbol in the given time period.


    otcboolean

    Whether or not this aggregate is for an OTC ticker. This field will be left off if false.


    t*number

    The Unix Msec timestamp for the start of the aggregate window.


    v*number

    The trading volume of the symbol in the given time period.


    vw*number

    The volume weighted average price.


    urlstring

    The URL which can be used to request the underlying aggregates used in this request.


    valuesarray
    timestampinteger

    The Unix Msec timestamp from the last aggregate used in this calculation.


    valuenumber

    The indicator value for this period.


    statusstring

    The status of this request's response.


    Was this helpful?
    Help us improve
    Response Object
    {
      "next_url": "https://api.polygon.io/v1/indicators/sma/I:NDX?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTE1MDg0Ljk5OTM4OTgyMDAzJTJDJTIyaCUyMiUzQTAlMkMlMjJsJTIyJTNBMCUyQyUyMnQlMjIlM0ExNjg3MjE5MjAwMDAwJTdEJmFzPSZleHBhbmRfdW5kZXJseWluZz1mYWxzZSZsaW1pdD0xJm9yZGVyPWRlc2Mmc2VyaWVzX3R5cGU9Y2xvc2UmdGltZXNwYW49ZGF5JnRpbWVzdGFtcC5sdD0xNjg3MjM3MjAwMDAwJndpbmRvdz01Mw",
      "request_id": "4cae270008cb3f947e3f92c206e3888a",
      "results": {
        "underlying": {
          "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366378997?limit=240&sort=desc"
        },
        "values": [
          {
            "timestamp": 1687237200000,
            "value": 14362.676417589264
          }
        ]
      },
      "status": "OK"
    }

    Exponential Moving Average (EMA)

    get
    /v1/indicators/ema/{indicesTicker}

    Get the exponential moving average (EMA) for a ticker symbol over a given time range.

    Parameters

    The ticker symbol for which to get exponential moving average (EMA) data.

    Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.

    timestamp.gtgreater than
    timestamp.gtegreater than or equal to
    timestamp.ltless than
    timestamp.lteless than or equal to
    Learn More
  • The size of the aggregate time window.

  • Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits.

    The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.

  • The value in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close values to calculate the exponential moving average (EMA).

  • Whether or not to include the aggregates used to calculate this indicator in the response.

  • The order in which to return the results, ordered by timestamp.

    Limit the number of results returned, default is 10 and max is 5000

    https://api.polygon.io/v1/indicators/ema/{indicesTicker}?apiKey=*
    Response Attributes
    next_urlstring

    If present, this value can be used to fetch the next page of data.


    request_idstring

    A request id assigned by the server.


    resultsobject
    underlyingobject
    aggregatesarray
    c*number

    The close price for the symbol in the given time period.


    h*number

    The highest price for the symbol in the given time period.


    l*number

    The lowest price for the symbol in the given time period.


    n*integer

    The number of transactions in the aggregate window.


    o*number

    The open price for the symbol in the given time period.


    otcboolean

    Whether or not this aggregate is for an OTC ticker. This field will be left off if false.


    t*number

    The Unix Msec timestamp for the start of the aggregate window.


    v*number

    The trading volume of the symbol in the given time period.


    vw*number

    The volume weighted average price.


    urlstring

    The URL which can be used to request the underlying aggregates used in this request.


    valuesarray
    timestampinteger

    The Unix Msec timestamp from the last aggregate used in this calculation.


    valuenumber

    The indicator value for this period.


    statusstring

    The status of this request's response.


    Was this helpful?
    Help us improve
    Response Object
    {
      "next_url": "https://api.polygon.io/v1/indicators/ema/I:NDX?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTE1MDg0Ljk5OTM4OTgyMDAzJTJDJTIyaCUyMiUzQTAlMkMlMjJsJTIyJTNBMCUyQyUyMnQlMjIlM0ExNjg3MjE5MjAwMDAwJTdEJmFzPSZleHBhbmRfdW5kZXJseWluZz1mYWxzZSZsaW1pdD0xJm9yZGVyPWRlc2Mmc2VyaWVzX3R5cGU9Y2xvc2UmdGltZXNwYW49ZGF5JnRpbWVzdGFtcC5sdD0xNjg3MjM3MjAwMDAwJndpbmRvdz01MA",
      "request_id": "b9201816341441eed663a90443c0623a",
      "results": {
        "underlying": {
          "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366449650?limit=226&sort=desc"
        },
        "values": [
          {
            "timestamp": 1687237200000,
            "value": 14452.002555459003
          }
        ]
      },
      "status": "OK"
    }

    Moving Average Convergence/Divergence (MACD)

    get
    /v1/indicators/macd/{indicesTicker}

    Get moving average convergence/divergence (MACD) for a ticker symbol over a given time range.

    Parameters

    The ticker symbol for which to get MACD data.

    Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.

    timestamp.gtgreater than
    timestamp.gtegreater than or equal to
    timestamp.ltless than
    timestamp.lteless than or equal to
    Learn More
  • The size of the aggregate time window.

  • Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits.

    The short window size used to calculate MACD data.

    The long window size used to calculate MACD data.

    The window size used to calculate the MACD signal line.

  • The value in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close values to calculate the MACD.

  • Whether or not to include the aggregates used to calculate this indicator in the response.

  • The order in which to return the results, ordered by timestamp.

    Limit the number of results returned, default is 10 and max is 5000

    https://api.polygon.io/v1/indicators/macd/{indicesTicker}?apiKey=*
    Response Attributes
    next_urlstring

    If present, this value can be used to fetch the next page of data.


    request_idstring

    A request id assigned by the server.


    resultsobject
    underlyingobject
    aggregatesarray
    c*number

    The close price for the symbol in the given time period.


    h*number

    The highest price for the symbol in the given time period.


    l*number

    The lowest price for the symbol in the given time period.


    n*integer

    The number of transactions in the aggregate window.


    o*number

    The open price for the symbol in the given time period.


    otcboolean

    Whether or not this aggregate is for an OTC ticker. This field will be left off if false.


    t*number

    The Unix Msec timestamp for the start of the aggregate window.


    v*number

    The trading volume of the symbol in the given time period.


    vw*number

    The volume weighted average price.


    urlstring

    The URL which can be used to request the underlying aggregates used in this request.


    valuesarray
    histogramnumber

    The indicator value for this period.


    signalnumber

    The indicator value for this period.


    timestampinteger

    The Unix Msec timestamp from the last aggregate used in this calculation.


    valuenumber

    The indicator value for this period.


    statusstring

    The status of this request's response.


    Was this helpful?
    Help us improve
    Response Object
    {
      "next_url": "https://api.polygon.io/v1/indicators/macd/I:NDX?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTE1MDg0Ljk5OTM4OTgyMDAzJTJDJTIyaCUyMiUzQTAlMkMlMjJsJTIyJTNBMCUyQyUyMnQlMjIlM0ExNjg3MTUwODAwMDAwJTdEJmFzPSZleHBhbmRfdW5kZXJseWluZz1mYWxzZSZsaW1pdD0yJmxvbmdfd2luZG93PTI2Jm9yZGVyPWRlc2Mmc2VyaWVzX3R5cGU9Y2xvc2Umc2hvcnRfd2luZG93PTEyJnNpZ25hbF93aW5kb3c9OSZ0aW1lc3Bhbj1kYXkmdGltZXN0YW1wLmx0PTE2ODcyMTkyMDAwMDA",
      "request_id": "2eeda0be57e83cbc64cc8d1a74e84dbd",
      "results": {
        "underlying": {
          "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366537196?limit=121&sort=desc"
        },
        "values": [
          {
            "histogram": -4.7646219788108795,
            "signal": 220.7596784587801,
            "timestamp": 1687237200000,
            "value": 215.9950564799692
          },
          {
            "histogram": 3.4518937661882205,
            "signal": 221.9508339534828,
            "timestamp": 1687219200000,
            "value": 225.40272771967102
          }
        ]
      },
      "status": "OK"
    }

    Relative Strength Index (RSI)

    get
    /v1/indicators/rsi/{indicesTicker}

    Get the relative strength index (RSI) for a ticker symbol over a given time range.

    Parameters

    The ticker symbol for which to get relative strength index (RSI) data.

    Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.

    timestamp.gtgreater than
    timestamp.gtegreater than or equal to
    timestamp.ltless than
    timestamp.lteless than or equal to
    Learn More
  • The size of the aggregate time window.

  • Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits.

    The window size used to calculate the relative strength index (RSI).

  • The value in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close values to calculate the relative strength index (RSI).

  • Whether or not to include the aggregates used to calculate this indicator in the response.

  • The order in which to return the results, ordered by timestamp.

    Limit the number of results returned, default is 10 and max is 5000

    https://api.polygon.io/v1/indicators/rsi/{indicesTicker}?apiKey=*
    Response Attributes
    next_urlstring

    If present, this value can be used to fetch the next page of data.


    request_idstring

    A request id assigned by the server.


    resultsobject
    underlyingobject
    aggregatesarray
    c*number

    The close price for the symbol in the given time period.


    h*number

    The highest price for the symbol in the given time period.


    l*number

    The lowest price for the symbol in the given time period.


    n*integer

    The number of transactions in the aggregate window.


    o*number

    The open price for the symbol in the given time period.


    otcboolean

    Whether or not this aggregate is for an OTC ticker. This field will be left off if false.


    t*number

    The Unix Msec timestamp for the start of the aggregate window.


    v*number

    The trading volume of the symbol in the given time period.


    vw*number

    The volume weighted average price.


    urlstring

    The URL which can be used to request the underlying aggregates used in this request.


    valuesarray
    timestampinteger

    The Unix Msec timestamp from the last aggregate used in this calculation.


    valuenumber

    The indicator value for this period.


    statusstring

    The status of this request's response.


    Was this helpful?
    Help us improve
    Response Object
    {
      "next_url": "https://api.polygon.io/v1/indicators/rsi/I:NDX?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTE1MDg0Ljk5OTM4OTgyMDAzJTJDJTIyaCUyMiUzQTAlMkMlMjJsJTIyJTNBMCUyQyUyMnQlMjIlM0ExNjg3MjE5MjAwMDAwJTdEJmFzPSZleHBhbmRfdW5kZXJseWluZz1mYWxzZSZsaW1pdD0xJm9yZGVyPWRlc2Mmc2VyaWVzX3R5cGU9Y2xvc2UmdGltZXNwYW49ZGF5JnRpbWVzdGFtcC5sdD0xNjg3MjM3MjAwMDAwJndpbmRvdz0xNA",
      "request_id": "28a8417f521f98e1d08f6ed7d1fbcad3",
      "results": {
        "underlying": {
          "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366658253?limit=66&sort=desc"
        },
        "values": [
          {
            "timestamp": 1687237200000,
            "value": 73.98019439047955
          }
        ]
      },
      "status": "OK"
    }

    Indices Snapshot

    get
    /v3/snapshot/indices

    Get a Snapshot of indices data for said tickers

    Parameters

    Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner.

    Warning: The maximum number of characters allowed in a URL are subject to your technology stack.

    ticker.gtgreater than
    ticker.gtegreater than or equal to
    ticker.ltless than
    ticker.lteless than or equal to
    Learn More
  • Order results based on the sort field.

    Limit the number of results returned, default is 10 and max is 250.

  • Sort field used for ordering.

    https://api.polygon.io/v3/snapshot/indices?apiKey=*
    Response Attributes
    next_urlstring

    If present, this value can be used to fetch the next page of data.


    request_id*string

    resultsarray
    errorstring

    The error while looking for this ticker.


    last_updatedinteger

    The nanosecond timestamp of when this information was updated.


    market_statusstring

    The market status for the market that trades this ticker.


    messagestring

    The error message while looking for this ticker.


    namestring

    Name of Index.


    sessionobject
    changenumber

    The value of the change for the index from the previous trading day.


    change_percentnumber

    The percent of the change for the index from the previous trading day.


    closenumber

    The closing value for the index of the day.


    highnumber

    The highest value for the index of the day.


    lownumber

    The lowest value for the index of the day.


    opennumber

    The open value for the index of the day.


    previous_closenumber

    The closing value for the index of previous trading day.


    ticker*string

    Ticker of asset queried.


    timeframeenum [DELAYED, REAL-TIME]

    The time relevance of the data.


    typeenum [indices]

    The indices market.


    valuenumber

    Value of Index.


    status*string

    The status of this request's response.


    Was this helpful?
    Help us improve
    Response Object
    {
      "request_id": "6a7e466379af0a71039d60cc78e72282",
      "results": [
        {
          "last_updated": 1679597116344223500,
          "market_status": "closed",
          "name": "Dow Jones Industrial Average",
          "session": {
            "change": -50.01,
            "change_percent": -1.45,
            "close": 3822.39,
            "high": 3834.41,
            "low": 38217.11,
            "open": 3827.38,
            "previous_close": 3812.19
          },
          "ticker": "I:DJI",
          "timeframe": "REAL-TIME",
          "type": "indices",
          "value": 3822.39
        },
        {
          "error": "NOT_FOUND",
          "message": "Ticker not found.",
          "ticker": "APx"
        },
        {
          "error": "NOT_ENTITLED",
          "message": "Not entitled to this ticker.",
          "ticker": "APy"
        }
      ],
      "status": "OK"
    }

    Universal Snapshot

    get
    /v3/snapshot

    Get snapshots for assets of all types

    Parameters

    Comma separated list of tickers, up to a maximum of 250. If no tickers are passed then all results will be returned in a paginated manner.

    Warning: The maximum number of characters allowed in a URL are subject to your technology stack.

    ticker.gtgreater than
    ticker.gtegreater than or equal to
    ticker.ltless than
    ticker.lteless than or equal to
    Learn More
  • Query by the type of asset.

  • Order results based on the sort field.

    Limit the number of results returned, default is 10 and max is 250.

  • Sort field used for ordering.

    https://api.polygon.io/v3/snapshot?apiKey=*
    Response Attributes
    next_urlstring

    If present, this value can be used to fetch the next page of data.


    request_id*string

    resultsarray
    break_even_pricenumber

    The price of the underlying asset for the contract to break even. For a call, this value is (strike price + premium paid). For a put, this value is (strike price - premium paid).


    detailsobject

    The details for this contract.

    contract_type*enum [put, call, other]

    The type of contract. Can be "put", "call", or in some rare cases, "other".


    exercise_style*enum [american, european, bermudan]

    The exercise style of this contract. See this link for more details on exercise styles.


    expiration_date*string

    The contract's expiration date in YYYY-MM-DD format.


    shares_per_contract*number

    The number of shares per contract for this contract.


    strike_price*number

    The strike price of the option contract.


    errorstring

    The error while looking for this ticker.


    fmvnumber

    Fair market value is only available on Business plans. It's it our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us.


    greeksobject

    The greeks for this contract. There are certain circumstances where greeks will not be returned, such as options contracts that are deep in the money. See this article for more information.

    delta*number

    The change in the option's price per $0.01 increment in the price of the underlying asset.


    gamma*number

    The change in delta per $0.01 change in the price of the underlying asset.


    theta*number

    The change in the option's price per day.


    vega*number

    The change in the option's price per 1% increment in volatility.


    implied_volatilitynumber

    The market's forecast for the volatility of the underlying asset, based on this option's current price.


    last_quoteobject

    The most recent quote for this contract. This is only returned if your current plan includes quotes.

    ask*number

    The ask price.


    ask_exchangeinteger

    The ask side exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.


    ask_sizenumber

    The ask size. This represents the number of round lot orders at the given ask price. The normal round lot size is 100 shares. An ask size of 2 means there are 200 shares available to purchase at the given ask price.


    bid*number

    The bid price.


    bid_exchangeinteger

    The bid side exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.


    bid_sizenumber

    The bid size. This represents the number of round lot orders at the given bid price. The normal round lot size is 100 shares. A bid size of 2 means there are 200 shares for purchase at the given bid price.


    last_updated*integer

    The nanosecond timestamp of when this information was updated.


    midpointnumber

    The average of the bid and ask price.


    timeframe*enum [DELAYED, REAL-TIME]

    The time relevance of the data.


    last_tradeobject

    The most recent quote for this contract. This is only returned if your current plan includes trades.

    conditionsarray [integer]

    A list of condition codes.


    exchangeinteger

    The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.


    idstring

    The Trade ID which uniquely identifies a trade. These are unique per combination of ticker, exchange, and TRF. For example: A trade for AAPL executed on NYSE and a trade for AAPL executed on NASDAQ could potentially have the same Trade ID.


    last_updatedinteger

    The nanosecond timestamp of when this information was updated.


    participant_timestampinteger

    The nanosecond Exchange Unix Timestamp. This is the timestamp of when the trade was generated at the exchange.


    price*number

    The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00.


    sip_timestampinteger

    The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this trade from the exchange which produced it.


    size*integer

    The size of a trade (also known as volume).


    timeframeenum [DELAYED, REAL-TIME]

    The time relevance of the data.


    market_statusstring

    The market status for the market that trades this ticker. Possible values for stocks, options, crypto, and forex snapshots are open, closed, early_trading, or late_trading. Possible values for indices snapshots are regular_trading, closed, early_trading, and late_trading.


    messagestring

    The error message while looking for this ticker.


    namestring

    The name of this contract.


    open_interestnumber

    The quantity of this contract held at the end of the last trading day.


    sessionobject
    change*number

    The value of the price change for the asset from the previous trading day.


    change_percent*number

    The percent of the price change for the asset from the previous trading day.


    close*number

    The closing price of the asset for the day.


    early_trading_changenumber

    Today's early trading change amount, difference between price and previous close if in early trading hours, otherwise difference between last price during early trading and previous close.


    early_trading_change_percentnumber

    Today's early trading change as a percentage.


    high*number

    The highest price of the asset for the day.


    late_trading_changenumber

    Today's late trading change amount, difference between price and today's close if in late trading hours, otherwise difference between last price during late trading and today's close.


    late_trading_change_percentnumber

    Today's late trading change as a percentage.


    low*number

    The lowest price of the asset for the day.


    open*number

    The open price of the asset for the day.


    previous_close*number

    The closing price of the asset for the previous trading day.


    pricenumber

    The price of the most recent trade or bid price for this asset.


    regular_trading_changenumber

    Today's change in regular trading hours, difference between current price and previous trading day's close, otherwise difference between today's close and previous day's close.


    regular_trading_change_percentnumber

    Today's regular trading change as a percentage.


    volumenumber

    The trading volume for the asset for the day.


    ticker*string

    The ticker symbol for the asset.


    typeenum [stocks, options, fx, crypto, indices]

    The asset class for this ticker.


    underlying_assetobject

    Information on the underlying stock for this options contract. The market data returned depends on your current stocks plan.

    change_to_break_even*number

    The change in price for the contract to break even.


    last_updatedinteger

    The nanosecond timestamp of when this information was updated.


    pricenumber

    The price of the trade. This is the actual dollar value per whole share of this trade. A trade of 100 shares with a price of $2.00 would be worth a total dollar value of $200.00.


    ticker*string

    The ticker symbol for the contract's underlying asset.


    timeframeenum [DELAYED, REAL-TIME]

    The time relevance of the data.


    valuenumber

    The value of the underlying index.


    valuenumber

    Value of Index.


    status*string

    The status of this request's response.


    Was this helpful?
    Help us improve
    Response Object
    {
      "request_id": "abc123",
      "results": [
        {
          "break_even_price": 171.075,
          "details": {
            "contract_type": "call",
            "exercise_style": "american",
            "expiration_date": "2022-10-14",
            "shares_per_contract": 100,
            "strike_price": 5,
            "underlying_ticker": "NCLH"
          },
          "fmv": 0.05,
          "greeks": {
            "delta": 0.5520187372272933,
            "gamma": 0.00706756515659829,
            "theta": -0.018532772783847958,
            "vega": 0.7274811132998142
          },
          "implied_volatility": 0.3048997097864957,
          "last_quote": {
            "ask": 21.25,
            "ask_exchange": 12,
            "ask_size": 110,
            "bid": 20.9,
            "bid_exchange": 10,
            "bid_size": 172,
            "last_updated": 1636573458756383500,
            "midpoint": 21.075,
            "timeframe": "REAL-TIME"
          },
          "last_trade": {
            "conditions": [
              209
            ],
            "exchange": 316,
            "price": 0.05,
            "sip_timestamp": 1675280958783136800,
            "size": 2,
            "timeframe": "REAL-TIME"
          },
          "market_status": "closed",
          "name": "NCLH $5 Call",
          "open_interest": 8921,
          "session": {
            "change": -0.05,
            "change_percent": -1.07,
            "close": 6.65,
            "early_trading_change": -0.01,
            "early_trading_change_percent": -0.03,
            "high": 7.01,
            "late_trading_change": -0.4,
            "late_trading_change_percent": -0.02,
            "low": 5.42,
            "open": 6.7,
            "previous_close": 6.71,
            "volume": 67
          },
          "ticker": "O:NCLH221014C00005000",
          "type": "options",
          "underlying_asset": {
            "change_to_break_even": 23.123999999999995,
            "last_updated": 1636573459862384600,
            "price": 147.951,
            "ticker": "AAPL",
            "timeframe": "REAL-TIME"
          }
        },
        {
          "fmv": 0.05,
          "last_quote": {
            "ask": 21.25,
            "ask_exchange": 300,
            "ask_size": 110,
            "bid": 20.9,
            "bid_exchange": 323,
            "bid_size": 172,
            "last_updated": 1636573458756383500,
            "timeframe": "REAL-TIME"
          },
          "last_trade": {
            "conditions": [
              209
            ],
            "exchange": 316,
            "id": "4064",
            "last_updated": 1675280958783136800,
            "price": 0.05,
            "size": 2,
            "timeframe": "REAL-TIME"
          },
          "market_status": "closed",
          "name": "Apple Inc.",
          "session": {
            "change": -1.05,
            "change_percent": -4.67,
            "close": 21.4,
            "early_trading_change": -0.39,
            "early_trading_change_percent": -0.07,
            "high": 22.49,
            "late_trading_change": 1.2,
            "late_trading_change_percent": 3.92,
            "low": 21.35,
            "open": 22.49,
            "previous_close": 22.45,
            "volume": 37
          },
          "ticker": "AAPL",
          "type": "stocks"
        },
        {
          "error": "NOT_FOUND",
          "message": "Ticker not found.",
          "ticker": "TSLAAPL"
        }
      ],
      "status": "OK"
    }

    Tickers

    get
    /v3/reference/tickers

    Query all ticker symbols which are supported by Polygon.io. This API currently includes Stocks/Equities, Indices, Forex, and Crypto.

    Parameters

    Specify a ticker symbol. Defaults to empty string which queries all tickers.

    ticker.gtgreater than
    ticker.gtegreater than or equal to
    ticker.ltless than
    ticker.lteless than or equal to
    Learn More
  • Specify the type of the tickers. Find the types that we support via our Ticker Types API. Defaults to empty string which queries all types.

  • Filter by market type. By default all markets are included.

    Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes at the ISO org website. Defaults to empty string which queries all exchanges.

    Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes at their website. Defaults to empty string which queries all CUSIPs.

    Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response.

    Specify the CIK of the asset you want to search for. Find more information about CIK codes at their website. Defaults to empty string which queries all CIKs.

    Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date.

    Search for terms within the ticker and/or company name.

  • Specify if the tickers returned should be actively traded on the queried date. Default is true.

  • Order results based on the sort field.

    Limit the number of results returned, default is 100 and max is 1000.

  • Sort field used for ordering.

    https://api.polygon.io/v3/reference/tickers?apiKey=*
  • Response Attributes
    countinteger

    The total number of results for this request.


    next_urlstring

    If present, this value can be used to fetch the next page of data.


    request_idstring

    A request id assigned by the server.


    resultsarray

    An array of tickers that match your query.

    Note: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response.

    activeboolean

    Whether or not the asset is actively traded. False means the asset has been delisted.


    cikstring

    The CIK number for this ticker. Find more information here.


    composite_figistring

    The composite OpenFIGI number for this ticker. Find more information here


    currency_namestring

    The name of the currency that this asset is traded with.


    delisted_utcstring

    The last date that the asset was traded.


    last_updated_utcstring

    The information is accurate up to this time.


    locale*enum [us, global]

    The locale of the asset.


    market*enum [stocks, crypto, fx, otc, indices]

    The market type of the asset.


    name*string

    The name of the asset. For stocks/equities this will be the companies registered name. For crypto/fx this will be the name of the currency or coin pair.


    primary_exchangestring

    The ISO code of the primary listing exchange for this asset.


    share_class_figistring

    The share Class OpenFIGI number for this ticker. Find more information here


    ticker*string

    The exchange symbol that this item is traded under.


    typestring

    The type of the asset. Find the types that we support via our Ticker Types API.


    statusstring

    The status of this request's response.


    Was this helpful?
    Help us improve
    Response Object
    {
      "count": 1,
      "next_url": "https://api.polygon.io/v3/reference/tickers?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy",
      "request_id": "e70013d92930de90e089dc8fa098888e",
      "results": [
        {
          "active": true,
          "cik": "0001090872",
          "composite_figi": "BBG000BWQYZ5",
          "currency_name": "usd",
          "last_updated_utc": "2021-04-25T00:00:00Z",
          "locale": "us",
          "market": "stocks",
          "name": "Agilent Technologies Inc.",
          "primary_exchange": "XNYS",
          "share_class_figi": "BBG001SCTQY4",
          "ticker": "A",
          "type": "CS"
        }
      ],
      "status": "OK"
    }

    Ticker Types

    get
    /v3/reference/tickers/types

    List all ticker types that Polygon.io has.

    Parameters
  • Filter by asset class.

  • Filter by locale.

    https://api.polygon.io/v3/reference/tickers/types?apiKey=*
  • Response Attributes
    countinteger

    The total number of results for this request.


    request_id*string

    A request ID assigned by the server.


    resultsarray
    asset_class*enum [stocks, options, crypto, fx, indices]

    An identifier for a group of similar financial instruments.


    code*string

    A code used by Polygon.io to refer to this ticker type.


    description*string

    A short description of this ticker type.


    locale*enum [us, global]

    An identifier for a geographical location.


    status*string

    The status of this request's response.


    Was this helpful?
    Help us improve
    Response Object
    {
      "count": 1,
      "request_id": "31d59dda-80e5-4721-8496-d0d32a654afe",
      "results": [
        {
          "asset_class": "stocks",
          "code": "CS",
          "description": "Common Stock",
          "locale": "us"
        }
      ],
      "status": "OK"
    }

    Market Holidays

    get
    /v1/marketstatus/upcoming

    Get upcoming market holidays and their open/close times.

    https://api.polygon.io/v1/marketstatus/upcoming?apiKey=*
    Response Attributes
    responsearray
    closestring

    The market close time on the holiday (if it's not closed).


    datestring

    The date of the holiday.


    exchangestring

    Which market the record is for.


    namestring

    The name of the holiday.


    openstring

    The market open time on the holiday (if it's not closed).


    statusstring

    The status of the market on the holiday.


    Was this helpful?
    Help us improve
    Response Object
    [
      {
        "date": "2020-11-26",
        "exchange": "NYSE",
        "name": "Thanksgiving",
        "status": "closed"
      },
      {
        "date": "2020-11-26",
        "exchange": "NASDAQ",
        "name": "Thanksgiving",
        "status": "closed"
      },
      {
        "date": "2020-11-26",
        "exchange": "OTC",
        "name": "Thanksgiving",
        "status": "closed"
      },
      {
        "close": "2020-11-27T18:00:00.000Z",
        "date": "2020-11-27",
        "exchange": "NASDAQ",
        "name": "Thanksgiving",
        "open": "2020-11-27T14:30:00.000Z",
        "status": "early-close"
      },
      {
        "close": "2020-11-27T18:00:00.000Z",
        "date": "2020-11-27",
        "exchange": "NYSE",
        "name": "Thanksgiving",
        "open": "2020-11-27T14:30:00.000Z",
        "status": "early-close"
      }
    ]

    Market Status

    get
    /v1/marketstatus/now

    Get the current trading status of the exchanges and overall financial markets.

    https://api.polygon.io/v1/marketstatus/now?apiKey=*
    Response Attributes
    afterHoursboolean

    Whether or not the market is in post-market hours.


    currenciesobject
    cryptostring

    The status of the crypto market.


    fxstring

    The status of the forex market.


    earlyHoursboolean

    Whether or not the market is in pre-market hours.


    exchangesobject
    nasdaqstring

    The status of the Nasdaq market.


    nysestring

    The status of the NYSE market.


    otcstring

    The status of the OTC market.


    indicesGroupsobject
    cccystring

    The status of Cboe Streaming Market Indices Cryptocurrency ("CCCY") indices trading hours.


    cgistring

    The status of Cboe Global Indices ("CGI") trading hours.


    dow_jonesstring

    The status of Dow Jones indices trading hours


    ftse_russellstring

    The status of Financial Times Stock Exchange Group ("FTSE") Russell indices trading hours.


    mscistring

    The status of Morgan Stanley Capital International ("MSCI") indices trading hours.


    mstarstring

    The status of Morningstar ("MSTAR") indices trading hours.


    mstarc

    The status of Morningstar Customer ("MSTARC") indices trading hours.


    nasdaqstring

    The status of National Association of Securities Dealers Automated Quotations ("Nasdaq") indices trading hours.


    s_and_pstring

    The status of Standard & Poors's ("S&P") indices trading hours.


    societe_generalestring

    The status of Societe Generale indices trading hours.


    marketstring

    The status of the market as a whole.


    serverTimestring

    The current time of the server, returned as a date-time in RFC3339 format.


    Was this helpful?
    Help us improve
    Response Object
    {
      "afterHours": true,
      "currencies": {
        "crypto": "open",
        "fx": "open"
      },
      "earlyHours": false,
      "exchanges": {
        "nasdaq": "extended-hours",
        "nyse": "extended-hours",
        "otc": "closed"
      },
      "market": "extended-hours",
      "serverTime": "2020-11-10T17:37:37-05:00"
    }

    Indices WebSocket Documentation

    The Polygon.io Indices WebSocket API provides streaming access to the latest stock market data from all US stock exchanges. You can specify which channels you want to consume by sending instructions in the form of actions. Our WebSockets emit events to notify you when an event has occurred in a channel you've subscribed to.

    Our WebSocket APIs are based on entitlements that control which WebSocket Clusters you can connect to and which kinds of data you can access. You can login to see examples that include your API key and are personalized to your entitlements.

    Step 1: Connect

    With a premium Indices plan, you will be able to use a single connection to the Indices Cluster. If another connection attempts to connect to the Indices Cluster simultaneously, the current connection will be disconnected. If you need more simultaneous connections to this cluster, you can contact support.

    Connecting to a cluster:

    Delayed:wscat -c wss://delayed.polygon.io/indices
    Real-time:wscat -c wss://socket.polygon.io/indices

    On connection you will receive the following message:

    [{
    	"ev":"status",
    	"status":"connected",
    	"message": "Connected Successfully"
    }]

    Step 2: Authenticate

    You must authenticate before you can make any other requests.

    {"action":"auth","params":"********"}

    On successful authentication you will receive the following message:

    [{
    	"ev":"status",
    	"status":"auth_success",
    	"message": "authenticated"
    }]

    Step 3: Subscribe

    Once authenticated, you can request a stream. You can request multiple streams in the same request.

    {"action":"subscribe","params":"AM.I:SPX"}

    You can also request multiple streams from the same cluster.

    {"action":"subscribe","params":"AM.I:SPX,AM.I:DJI"}

    Usage

    Things happen very quickly in the world of finance, which means a Polygon.io WebSocket client must be able to handle many incoming messages per second. Due to the nature of the WebSocket protocol, if a client is slow to consume messages from the server, Polygon.io's server must buffer messages and send them only as fast as the client can consume them. To help prevent the message buffer from getting too long, Polygon.io may send more than one JSON object in a single WebSocket message. We accomplish this by wrapping all messages in a JSON array, and adding more objects to the array if the message buffer is getting longer. For example, consider a WebSocket message with a single trade event in it:

    [
    	{"ev":"V","val":4514.12,"T":"I:SPX","t":1700244915037}
    ]

    If your client is consuming a bit slow, or 2+ events happened in very short succession, you may receive a single WebSocket message with more than one event inside it, like this:

    [
    	{"ev":"V","val":4514.13,"T":"I:SPX","t":1700244916059},
    	{"ev":"V","val":4514.17,"T":"I:SPX","t":1700244917031}
    ]

    Note that if a client is consuming messages too slowly for too long, Polygon.io's server-side buffer may get too large. If that happens, Polygon.io will terminate the WebSocket connection. You can check your account dashboard to see if a connection was terminated as a slow consumer. If this happens to you consistently, consider subscribing to fewer symbols or channels.

    Aggregates (Per Minute)

    ws
    wss://delayed.polygon.io/indices
    wss://socket.polygon.io/indices

    Stream real-time minute aggregates for a given index ticker symbol.

    Parameters

    Specify an index ticker using "I:" prefix or use * to subscribe to all index tickers. You can also use a comma separated list to subscribe to multiple index tickers. You can retrieve available index tickers from our Index Tickers API.

    {"action":"subscribe", "params":"AM.{ticker}"}
    Response Attributes
    evenum [AM]

    The event type.


    symstring

    The symbol representing the given index.


    opnumber

    Today's official opening value.


    onumber

    The opening index value for this aggregate window.


    cnumber

    The closing index value for this aggregate window.


    hnumber

    The highest index value for this aggregate window.


    lnumber

    The lowest index value for this aggregate window.


    sinteger

    The start timestamp of this aggregate window in Unix Milliseconds.


    einteger

    The end timestamp of this aggregate window in Unix Milliseconds.


    Was this helpful?
    Help us improve
    Response Object
    {
      "ev": "AM",
      "sym": "I:SPX",
      "op": 3985.67,
      "o": 3985.67,
      "c": 3985.67,
      "h": 3985.67,
      "l": 3985.67,
      "s": 1678220675805,
      "e": 1678220675805
    }

    Aggregates (Per Second)

    ws
    wss://delayed.polygon.io/indices
    wss://socket.polygon.io/indices

    Stream real-time second aggregates for a given index ticker symbol.

    Parameters

    Specify an index ticker using "I:" prefix or use * to subscribe to all index tickers. You can also use a comma separated list to subscribe to multiple index tickers. You can retrieve available index tickers from our Index Tickers API.

    {"action":"subscribe", "params":"A.{ticker}"}
    Response Attributes
    evenum [A]

    The event type.


    symstring

    The symbol representing the given index.


    opnumber

    Today's official opening value.


    onumber

    The opening index value for this aggregate window.


    cnumber

    The closing index value for this aggregate window.


    hnumber

    The highest index value for this aggregate window.


    lnumber

    The lowest index value for this aggregate window.


    sinteger

    The start timestamp of this aggregate window in Unix Milliseconds.


    einteger

    The end timestamp of this aggregate window in Unix Milliseconds.


    Was this helpful?
    Help us improve
    Response Object
    {
      "ev": "A",
      "sym": "I:SPX",
      "op": 3985.67,
      "o": 3985.67,
      "c": 3985.67,
      "h": 3985.67,
      "l": 3985.67,
      "s": 1678220675805,
      "e": 1678220675805
    }

    Value

    ws
    wss://delayed.polygon.io/indices
    wss://socket.polygon.io/indices

    Real-time value for a given index ticker symbol.

    Parameters

    Specify an index ticker using "I:" prefix or use * to subscribe to all index tickers. You can also use a comma separated list to subscribe to multiple index tickers. You can retrieve available index tickers from our Index Tickers API.

    {"action":"subscribe", "params":"V.{ticker}"}
    Response Attributes
    evenum [V]

    The event type.


    val

    The value of the index.


    T

    The assigned ticker of the index.


    t

    The Timestamp in Unix MS.


    Was this helpful?
    Help us improve
    Response Object
    {
      "ev": "V",
      "val": 3988.5,
      "T": "I:SPX",
      "t": 1678220098130
    }
    All data provided on Polygon is provided for informational purposes only, and is not intended for trading or investing purposes. Polygon provides all information as is. You must not redistribute information displayed on or provided by Polygon. Stock prices displayed in the ticker are from a subset of exchanges, this price does not represent the real-time price from the SIP.

    © Polygon.io, Inc