Crypto API Documentation

The Polygon.io Crypto API provides REST endpoints that let you query the latest market data for cryptocurrency pairs including trades and quotes, level 2 data, custom aggregate bars, and more.

Our REST APIs are based on entitlements that control which endpoints you can use and which kinds of data you can access. All users start with free access to reference data and end of day market data. If you decide to upgrade your account to access more recent market data or more historical data, your entitlements are automatically updated in the background and you can continue to use the same API keys to access the new data. You can login to see examples that include your API key and are personalized to your entitlements.

Looking for something else? Try our Crypto WebSocket Documentation, or the Stocks, Options, or Forex Docs.

Authentication

Pass your API key in the query string like follows:

https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/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.

Aggregates (Bars)

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

Get aggregate bars for a cryptocurrency pair 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 the currency pair.

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.

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

  • 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/{cryptoTicker}/range/{multiplier}/{timespan}/{from}/{to}?apiKey=*
    Response Attributes
    ticker*string

    The exchange symbol that this item is traded under.


    adjusted*boolean

    Whether or not this response was adjusted for splits.


    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 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.


    ninteger

    The number of transactions in the aggregate window.


    o*number

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


    t*integer

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


    v*number

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


    vwnumber

    The volume weighted average price.


    Was this helpful?
    Help us improve
    Response Object
    {
      "adjusted": true,
      "queryCount": 2,
      "request_id": "0cf72b6da685bcd386548ffe2895904a",
      "results": [
        {
          "c": 10094.75,
          "h": 10429.26,
          "l": 9490,
          "n": 1,
          "o": 9557.9,
          "t": 1590984000000,
          "v": 303067.6562332156,
          "vw": 9874.5529
        },
        {
          "c": 9492.62,
          "h": 10222.72,
          "l": 9135.68,
          "n": 1,
          "o": 10096.87,
          "t": 1591070400000,
          "v": 323339.6922892879,
          "vw": 9729.5701
        }
      ],
      "resultsCount": 2,
      "status": "OK",
      "ticker": "X:BTCUSD"
    }

    Grouped Daily (Bars)

    get
    /v2/aggs/grouped/locale/global/market/crypto/{date}

    Get the daily open, high, low, and close (OHLC) for the entire cryptocurrency markets.

    Parameters

    The beginning date for the aggregate window.

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

    https://api.polygon.io/v2/aggs/grouped/locale/global/market/crypto/{date}?apiKey=*
    Response Attributes
    adjusted*boolean

    Whether or not this response was adjusted for splits.


    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
    T*string

    The exchange symbol that this item is traded under.


    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.


    ninteger

    The number of transactions in the aggregate window.


    o*number

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


    t*integer

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


    v*number

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


    vwnumber

    The volume weighted average price.


    Was this helpful?
    Help us improve
    Response Object
    {
      "adjusted": true,
      "queryCount": 3,
      "results": [
        {
          "T": "X:ARDRUSD",
          "c": 0.0550762,
          "h": 0.0550762,
          "l": 0.0550762,
          "n": 18388,
          "o": 0.0550762,
          "t": 1580676480000,
          "v": 2,
          "vw": 0.0551
        },
        {
          "T": "X:NGCUSD",
          "c": 0.0272983,
          "h": 0.0273733,
          "l": 0.0272983,
          "n": 18,
          "o": 0.0273733,
          "t": 1580674080000,
          "v": 4734,
          "vw": 0.0273
        },
        {
          "T": "X:ZSCUSD",
          "c": 0.00028531,
          "h": 0.00028531,
          "l": 0.00028531,
          "n": 151,
          "o": 0.00028531,
          "t": 1580671080000,
          "v": 390,
          "vw": 0.0003
        }
      ],
      "resultsCount": 3,
      "status": "OK"
    }

    Daily Open/Close

    get
    /v1/open-close/crypto/{from}/{to}/{date}

    Get the open, close prices of a cryptocurrency symbol on a certain day.

    Parameters

    The "from" symbol of the pair.

    The "to" symbol of the pair.

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

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

    https://api.polygon.io/v1/open-close/crypto/{from}/{to}/{date}?apiKey=*
    Response Attributes
    close*number

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


    closingTrades*array
    c*array [integer]

    A list of condition codes.


    i*string

    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.


    p*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.


    s*number

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


    t*integer

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


    x*integer

    The exchange that this crypto trade happened on.
    See Exchanges for a mapping of exchanges to IDs.


    day*string

    The date requested.


    isUTC*boolean

    Whether or not the timestamps are in UTC timezone.


    open*number

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


    openTrades*array
    c*array [integer]

    A list of condition codes.


    i*string

    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.


    p*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.


    s*number

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


    t*integer

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


    x*integer

    The exchange that this crypto trade happened on.
    See Exchanges for a mapping of exchanges to IDs.


    symbol*string

    The symbol pair that was evaluated from the request.


    Was this helpful?
    Help us improve
    Response Object
    {
      "close": 11050.64,
      "closingTrades": [
        {
          "c": [
            2
          ],
          "i": "973323250",
          "p": 11050.64,
          "s": 0.006128,
          "t": 1602287999795,
          "x": 4
        },
        {
          "c": [
            1
          ],
          "i": "105717893",
          "p": 11049.4,
          "s": 0.014,
          "t": 1602287999659,
          "x": 17
        }
      ],
      "day": "2020-10-09T00:00:00.000Z",
      "isUTC": true,
      "open": 10932.44,
      "openTrades": [
        {
          "c": [
            2
          ],
          "i": "511235746",
          "p": 10932.44,
          "s": 0.002,
          "t": 1602201600056,
          "x": 1
        },
        {
          "c": [
            2
          ],
          "i": "511235751",
          "p": 10923.76,
          "s": 0.02,
          "t": 1602201600141,
          "x": 4
        }
      ],
      "symbol": "BTC-USD"
    }

    Previous Close

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

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

    Parameters

    The ticker symbol of the currency pair.

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

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

    The exchange symbol that this item is traded under.


    adjusted*boolean

    Whether or not this response was adjusted for splits.


    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
    T*string

    The exchange symbol that this item is traded under.


    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.


    ninteger

    The number of transactions in the aggregate window.


    o*number

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


    t*integer

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


    v*number

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


    vwnumber

    The volume weighted average price.


    Was this helpful?
    Help us improve
    Response Object
    {
      "adjusted": true,
      "queryCount": 1,
      "request_id": "b2170df985474b6d21a6eeccfb6bee67",
      "results": [
        {
          "T": "X:BTCUSD",
          "c": 16035.9,
          "h": 16180,
          "l": 15639.2,
          "o": 15937.1,
          "t": 1605416400000,
          "v": 95045.16897951,
          "vw": 15954.2111
        }
      ],
      "resultsCount": 1,
      "status": "OK",
      "ticker": "X:BTCUSD"
    }

    Trades

    get
    /v3/trades/{cryptoTicker}

    Get trades for a crypto ticker symbol in a given time range.

    This API is replacing Historic Crypto Trades on June 1, 2022View Deprecated Docs
    Parameters

    The ticker symbol to get trades for.

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

    timestamp.ltless than
    timestamp.lteless than or equal to
    timestamp.gtgreater than
    timestamp.gtegreater 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 50000.

  • Sort field used for ordering.

    https://api.polygon.io/v3/trades/{cryptoTicker}?apiKey=*
    Response Attributes
    next_urlstring

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


    resultsarray
    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 on the exchange that the trade happened on.


    participant_timestampinteger

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


    pricenumber

    The price of the trade in the base currency of the crypto pair.


    sizenumber

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


    statusstring

    The status of this request's response.


    Was this helpful?
    Help us improve
    Response Object
    {
      "next_url": "https://api.polygon.io/v3/trades/X:BTC-USD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy",
      "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3",
      "results": [
        {
          "conditions": [
            1
          ],
          "exchange": 1,
          "id": "191450340",
          "participant_timestamp": 1625097600103000000,
          "price": 35060,
          "size": 1.0434526
        },
        {
          "conditions": [
            2
          ],
          "exchange": 1,
          "id": "191450341",
          "participant_timestamp": 1625097600368000000,
          "price": 35059.99,
          "size": 0.0058883
        }
      ],
      "status": "OK"
    }

    Last Trade for a Crypto Pair

    get
    /v1/last/crypto/{from}/{to}

    Get the last trade tick for a cryptocurrency pair.

    Parameters

    The "from" symbol of the pair.

    The "to" symbol of the pair.

    https://api.polygon.io/v1/last/crypto/{from}/{to}?apiKey=*
    Response Attributes
    lastobject
    conditionsarray [integer]

    A list of condition codes.


    exchangeinteger

    The exchange that this crypto trade happened on.
    See Exchanges for a mapping of exchanges to IDs.


    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.


    sizenumber

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


    timestampinteger

    The Unix millisecond timestamp.


    request_idstring

    A request id assigned by the server.


    statusstring

    The status of this request's response.


    symbolstring

    The symbol pair that was evaluated from the request.


    Was this helpful?
    Help us improve
    Response Object
    {
      "last": {
        "conditions": [
          1
        ],
        "exchange": 4,
        "price": 16835.42,
        "size": 0.006909,
        "timestamp": 1605560885027
      },
      "request_id": "d2d779df015fe2b7fbb8e58366610ef7",
      "status": "success",
      "symbol": "BTC-USD"
    }

    All Tickers

    get
    /v2/snapshot/locale/global/markets/crypto/tickers

    Get the current minute, day, and previous day’s aggregate, as well as the last trade and quote for all traded cryptocurrency symbols.

    Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.

    Parameters

    A comma separated list of tickers to get snapshots for.

    https://api.polygon.io/v2/snapshot/locale/global/markets/crypto/tickers?apiKey=*
    Response Attributes
    status*string

    The status of this request's response.


    tickersarray
    day*object

    The most recent daily bar for this ticker.

    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.


    o*number

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


    v*number

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


    vw*number

    The volume weighted average price.


    lastTrade*object

    The most recent trade for this ticker.

    c*array [string]

    The trade conditions.


    i*string

    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.


    p*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.


    s*integer

    The size (volume) of the trade.


    t*integer

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


    x*integer

    The exchange that this crypto trade happened on.
    See Exchanges for a mapping of exchanges to IDs.


    min*object

    The most recent minute bar for this ticker.

    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.


    o*number

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


    v*number

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


    vw*number

    The volume weighted average price.


    prevDay*object

    The previous day's bar for this ticker.

    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.


    o*number

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


    v*number

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


    vw*number

    The volume weighted average price.


    ticker*string

    The exchange symbol that this item is traded under.


    todaysChange*number

    The value of the change the from previous day.


    todaysChangePerc*number

    The percentage change since the previous day.


    updated*integer

    The last updated timestamp.


    Was this helpful?
    Help us improve
    Response Object
    {
      "status": "OK",
      "tickers": [
        {
          "day": {
            "c": 0.296,
            "h": 0.59714,
            "l": 0.23706,
            "o": 0.28,
            "v": 4097699.5691991993,
            "vw": 0
          },
          "lastTrade": {
            "c": [
              1
            ],
            "i": 413131,
            "p": 0.293,
            "s": 13.6191,
            "t": 1605292686010,
            "x": 17
          },
          "min": {
            "c": 0.296,
            "h": 0.296,
            "l": 0.294,
            "o": 0.296,
            "v": 123.4866,
            "vw": 0
          },
          "prevDay": {
            "c": 0.281,
            "h": 0.59714,
            "l": 0.23706,
            "o": 0.27,
            "v": 6070178.786154971,
            "vw": 0.4076
          },
          "ticker": "X:FSNUSD",
          "todaysChange": 0.012,
          "todaysChangePerc": 4.270463,
          "updated": 1605330008999
        }
      ]
    }

    Gainers/Losers

    get
    /v2/snapshot/locale/global/markets/crypto/{direction}

    Get the current top 20 gainers or losers of the day in cryptocurrency markets.

    Top gainers are those tickers whose price has increased by the highest percentage since the previous day's close. Top losers are those tickers whose price has decreased by the highest percentage since the previous day's close.

    Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.

    Parameters
  • The direction of the snapshot results to return.

    https://api.polygon.io/v2/snapshot/locale/global/markets/crypto/{direction}?apiKey=*
    Response Attributes
    tickersarray
    day*object

    The most recent daily bar for this ticker.

    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.


    o*number

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


    v*number

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


    vw*number

    The volume weighted average price.


    lastTrade*object

    The most recent trade for this ticker.

    c*array [string]

    The trade conditions.


    i*string

    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.


    p*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.


    s*integer

    The size (volume) of the trade.


    t*integer

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


    x*integer

    The exchange that this crypto trade happened on.
    See Exchanges for a mapping of exchanges to IDs.


    min*object

    The most recent minute bar for this ticker.

    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.


    o*number

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


    v*number

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


    vw*number

    The volume weighted average price.


    prevDay*object

    The previous day's bar for this ticker.

    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.


    o*number

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


    v*number

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


    vw*number

    The volume weighted average price.


    ticker*string

    The exchange symbol that this item is traded under.


    todaysChange*number

    The value of the change the from previous day.


    todaysChangePerc*number

    The percentage change since the previous day.


    updated*integer

    The last updated timestamp.


    Was this helpful?
    Help us improve
    Response Object
    {
      "status": "OK",
      "tickers": [
        {
          "day": {
            "c": 0.0374,
            "h": 0.062377,
            "l": 0.01162,
            "o": 0.044834,
            "v": 27313165.159427017,
            "vw": 0
          },
          "lastTrade": {
            "c": [
              2
            ],
            "i": "517478762",
            "p": 0.0374,
            "s": 499,
            "t": 1604409649544,
            "x": 2
          },
          "min": {
            "c": 0.062377,
            "h": 0.062377,
            "l": 0.062377,
            "o": 0.062377,
            "v": 35420,
            "vw": 0
          },
          "prevDay": {
            "c": 0.01162,
            "h": 0.044834,
            "l": 0.01162,
            "o": 0.044834,
            "v": 53616273.36827199,
            "vw": 0.0296
          },
          "ticker": "X:DRNUSD",
          "todaysChange": 0.02578,
          "todaysChangePerc": 221.858864,
          "updated": 1605330008999
        }
      ]
    }

    Ticker

    get
    /v2/snapshot/locale/global/markets/crypto/tickers/{ticker}

    Get the current minute, day, and previous day’s aggregate, as well as the last trade and quote for a single traded cryptocurrency symbol.

    Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.

    Parameters

    Ticker of the snapshot

    https://api.polygon.io/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}?apiKey=*
    Response Attributes
    status*string

    The status of this request's response.


    request_id*string

    A request id assigned by the server.


    tickerobject
    day*object

    The most recent daily bar for this ticker.

    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.


    o*number

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


    v*number

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


    vw*number

    The volume weighted average price.


    lastTrade*object

    The most recent trade for this ticker.

    c*array [string]

    The trade conditions.


    i*string

    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.


    p*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.


    s*integer

    The size (volume) of the trade.


    t*integer

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


    x*integer

    The exchange that this crypto trade happened on.
    See Exchanges for a mapping of exchanges to IDs.


    min*object

    The most recent minute bar for this ticker.

    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.


    o*number

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


    v*number

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


    vw*number

    The volume weighted average price.


    prevDay*object

    The previous day's bar for this ticker.

    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.


    o*number

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


    v*number

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


    vw*number

    The volume weighted average price.


    ticker*string

    The exchange symbol that this item is traded under.


    todaysChange*number

    The value of the change the from previous day.


    todaysChangePerc*number

    The percentage change since the previous day.


    updated*integer

    The last updated timestamp.


    Was this helpful?
    Help us improve
    Response Object
    {
      "request_id": "ad92e92ce183112c593717f00dfebd2c",
      "status": "OK",
      "ticker": {
        "day": {
          "c": 16260.85,
          "h": 16428.4,
          "l": 15830.4,
          "o": 16418.07,
          "v": 105008.84231068,
          "vw": 0
        },
        "lastTrade": {
          "c": [
            2
          ],
          "i": "464569520",
          "p": 16242.31,
          "s": 0.001933,
          "t": 1605294230780,
          "x": 4
        },
        "min": {
          "c": 16235.1,
          "h": 16264.29,
          "l": 16129.3,
          "o": 16257.51,
          "v": 19.30791925,
          "vw": 0
        },
        "prevDay": {
          "c": 16399.24,
          "h": 16418.07,
          "l": 16399.24,
          "o": 16418.07,
          "v": 0.99167108,
          "vw": 16402.6893
        },
        "ticker": "X:BTCUSD",
        "todaysChange": -156.93,
        "todaysChangePerc": -0.956935,
        "updated": 1605330008999
      }
    }

    Ticker Full Book (L2)

    get
    /v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book

    Get the current level 2 book of a single ticker. This is the combined book from all of the exchanges.

    Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.

    Parameters

    The cryptocurrency ticker.

    https://api.polygon.io/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book?apiKey=*
    Response Attributes
    dataobject
    askCount*number

    The combined total number of asks in the book.


    asks*array
    p*number

    The price of this book level.


    x*object

    A map of the exchange ID to number of shares at this price level.

    Example:
    { "p": 16302.94, "x": { "1": 0.02859424, "6": 0.023455 } }

    In this example, exchange ID 1 has 0.02859424 shares available at $16,302.94, and exchange ID 6 has 0.023455 shares at the same price level.

    bidCount*number

    The combined total number of bids in the book.


    bids*array
    p*number

    The price of this book level.


    x*object

    A map of the exchange ID to number of shares at this price level.

    Example:
    { "p": 16302.94, "x": { "1": 0.02859424, "6": 0.023455 } }

    In this example, exchange ID 1 has 0.02859424 shares available at $16,302.94, and exchange ID 6 has 0.023455 shares at the same price level.

    spread*number

    The difference between the best bid and the best ask price accross exchanges.


    ticker*string

    The exchange symbol that this item is traded under.


    updated*integer

    The last updated timestamp.


    Was this helpful?
    Help us improve
    Response Object
    {
      "data": {
        "askCount": 593.1412981600005,
        "asks": [
          {
            "p": 11454,
            "x": {
              "2": 1
            }
          },
          {
            "p": 11455,
            "x": {
              "2": 1
            }
          }
        ],
        "bidCount": 694.951789670001,
        "bids": [
          {
            "p": 16303.17,
            "x": {
              "1": 2
            }
          },
          {
            "p": 16302.94,
            "x": {
              "1": 0.02859424,
              "6": 0.023455
            }
          }
        ],
        "spread": -4849.17,
        "ticker": "X:BTCUSD",
        "updated": 1605295074162
      },
      "status": "OK"
    }

    Simple Moving Average (SMA)

    get
    /v1/indicators/sma/{cryptoTicker}

    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.ltless than
    timestamp.lteless than or equal to
    timestamp.gtgreater than
    timestamp.gtegreater than or equal to
    Learn More
  • The size of the aggregate time window.

    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 price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices 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/{cryptoTicker}?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/X:BTCUSD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy",
      "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3",
      "results": {
        "underlying": {
          "aggregates": [
            {
              "c": 75.0875,
              "h": 75.15,
              "l": 73.7975,
              "n": 1,
              "o": 74.06,
              "t": 1577941200000,
              "v": 135647456,
              "vw": 74.6099
            },
            {
              "c": 74.3575,
              "h": 75.145,
              "l": 74.125,
              "n": 1,
              "o": 74.2875,
              "t": 1578027600000,
              "v": 146535512,
              "vw": 74.7026
            }
          ],
          "url": "https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/range/1/day/2003-01-01/2022-07-25"
        },
        "values": [
          {
            "timestamp": 1517562000016,
            "value": 140.139
          }
        ]
      },
      "status": "OK"
    }

    Exponential Moving Average (EMA)

    get
    /v1/indicators/ema/{cryptoTicker}

    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.ltless than
    timestamp.lteless than or equal to
    timestamp.gtgreater than
    timestamp.gtegreater than or equal to
    Learn More
  • The size of the aggregate time window.

    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 price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices 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/{cryptoTicker}?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/X:BTCUSD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy",
      "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3",
      "results": {
        "underlying": {
          "url": "https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/range/1/day/2003-01-01/2022-07-25"
        },
        "values": [
          {
            "timestamp": 1517562000016,
            "value": 140.139
          }
        ]
      },
      "status": "OK"
    }

    Moving Average Convergence/Divergence (MACD)

    get
    /v1/indicators/macd/{cryptoTicker}

    Get moving average convergence/divergence (MACD) data 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.ltless than
    timestamp.lteless than or equal to
    timestamp.gtgreater than
    timestamp.gtegreater than or equal to
    Learn More
  • The size of the aggregate time window.

    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 price in the aggregate which will be used to calculate MACD data. i.e. 'close' will result in using close prices 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/{cryptoTicker}?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/X:BTCUSD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy",
      "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3",
      "results": {
        "underlying": {
          "url": "https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/range/1/day/2003-01-01/2022-07-25"
        },
        "values": [
          {
            "histogram": 38.3801666667,
            "signal": 106.9811666667,
            "timestamp": 1517562000016,
            "value": 145.3613333333
          },
          {
            "histogram": 41.098859136,
            "signal": 102.7386283473,
            "timestamp": 1517562001016,
            "value": 143.8374874833
          }
        ]
      },
      "status": "OK"
    }

    Relative Strength Index (RSI)

    get
    /v1/indicators/rsi/{cryptoTicker}

    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.ltless than
    timestamp.lteless than or equal to
    timestamp.gtgreater than
    timestamp.gtegreater than or equal to
    Learn More
  • The size of the aggregate time window.

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

  • The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices 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/{cryptoTicker}?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/X:BTCUSD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy",
      "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3",
      "results": {
        "underlying": {
          "url": "https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/range/1/day/2003-01-01/2022-07-25"
        },
        "values": [
          {
            "timestamp": 1517562000016,
            "value": 140.139
          }
        ]
      },
      "status": "OK"
    }

    Tickers

    get
    /v3/reference/tickers

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

    Parameters

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

    ticker.ltless than
    ticker.lteless than or equal to
    ticker.gtgreater than
    ticker.gtegreater 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]

    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"
    }

    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-26T00:00:00.000Z",
        "exchange": "NYSE",
        "name": "Thanksgiving",
        "status": "closed"
      },
      {
        "date": "2020-11-26T00:00:00.000Z",
        "exchange": "NASDAQ",
        "name": "Thanksgiving",
        "status": "closed"
      },
      {
        "date": "2020-11-26T00:00:00.000Z",
        "exchange": "OTC",
        "name": "Thanksgiving",
        "status": "closed"
      },
      {
        "close": "2020-11-27T18:00:00.000Z",
        "date": "2020-11-27T00:00:00.000Z",
        "exchange": "NASDAQ",
        "name": "Thanksgiving",
        "open": "2020-11-27T14:30:00.000Z",
        "status": "early-close"
      },
      {
        "close": "2020-11-27T18:00:00.000Z",
        "date": "2020-11-27T00:00:00.000Z",
        "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.


    marketstring

    The status of the market as a whole.


    serverTimestring

    The current time of the server.


    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-10T22:37:37.000Z"
    }

    Conditions

    get
    /v3/reference/conditions

    List all conditions that Polygon.io uses.

    Parameters
  • Filter for conditions within a given asset class.

  • Filter by data type.

    Filter for conditions with a given ID.

  • Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned.

  • Order results based on the sort field.

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

  • Sort field used for ordering.

    https://api.polygon.io/v3/reference/conditions?apiKey=*
    Response Attributes
    count*integer

    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_id*string

    A request ID assigned by the server.


    results*array

    An array of conditions that match your query.

    abbreviationstring

    A commonly-used abbreviation for this condition.


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

    An identifier for a group of similar financial instruments.


    data_types*array [string]

    Data types that this condition applies to.


    descriptionstring

    A short description of the semantics of this condition.


    exchangeinteger

    If present, mapping this condition from a Polygon.io code to a SIP symbol depends on this attribute. In other words, data with this condition attached comes exclusively from the given exchange.


    id*integer

    An identifier used by Polygon.io for this condition. Unique per data type.


    legacyboolean

    If true, this condition is from an old version of the SIPs' specs and no longer is used. Other conditions may or may not reuse the same symbol as this one.


    name*string

    The name of this condition.


    sip_mapping*object

    A mapping to a symbol for each SIP that has this condition.

    CTAstring

    OPRAstring

    UTPstring

    type*enum [sale_condition, quote_condition, sip_generated_flag, financial_status_indicator, short_sale_restriction_indicator, settlement_condition, market_condition, trade_thru_exempt]

    An identifier for a collection of related conditions.


    update_rulesobject

    A list of aggregation rules.

    consolidated*object

    Describes aggregation rules on a consolidated (all exchanges) basis.

    updates_high_low*boolean

    Whether or not trades with this condition update the high/low.


    updates_open_close*boolean

    Whether or not trades with this condition update the open/close.


    updates_volume*boolean

    Whether or not trades with this condition update the volume.


    market_center*object

    Describes aggregation rules on a per-market-center basis.

    updates_high_low*boolean

    Whether or not trades with this condition update the high/low.


    updates_open_close*boolean

    Whether or not trades with this condition update the open/close.


    updates_volume*boolean

    Whether or not trades with this condition update the volume.


    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",
          "data_types": [
            "trade"
          ],
          "id": 2,
          "name": "Average Price Trade",
          "sip_mapping": {
            "CTA": "B",
            "UTP": "W"
          },
          "type": "condition",
          "update_rules": {
            "consolidated": {
              "updates_high_low": false,
              "updates_open_close": false,
              "updates_volume": true
            },
            "market_center": {
              "updates_high_low": false,
              "updates_open_close": false,
              "updates_volume": true
            }
          }
        }
      ],
      "status": "OK"
    }

    Exchanges

    get
    /v3/reference/exchanges

    List all exchanges that Polygon.io knows about.

    Parameters
  • Filter by asset class.

  • Filter by locale.

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

    The total number of results for this request.


    request_id*string

    A request ID assigned by the server.


    resultsarray
    acronymstring

    A commonly used abbreviation for this exchange.


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

    An identifier for a group of similar financial instruments.


    id*integer

    A unique identifier used by Polygon.io for this exchange.


    locale*enum [us, global]

    An identifier for a geographical location.


    micstring

    The Market Identifer Code of this exchange (see ISO 10383).


    name*string

    Name of this exchange.


    operating_micstring

    The MIC of the entity that operates this exchange.


    participant_idstring

    The ID used by SIP's to represent this exchange.


    type*enum [exchange, TRF, SIP]

    Represents the type of exchange.


    urlstring

    A link to this exchange's website, if one exists.


    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": [
        {
          "acronym": "AMEX",
          "asset_class": "stocks",
          "id": 1,
          "locale": "us",
          "mic": "XASE",
          "name": "NYSE American, LLC",
          "operating_mic": "XNYS",
          "participant_id": "A",
          "type": "exchange",
          "url": "https://www.nyse.com/markets/nyse-american"
        }
      ],
      "status": "OK"
    }

    Crypto WebSocket Documentation

    The Polygon.io Crypto WebSocket API provides streaming access to the latest financial market data for cryptocurrency pairs. 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 Crypto plan, you will be able to use a single connection to the Crypto Cluster. If another connection attempts to connect to the Crypto 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:

    Real-time:wscat -c wss://socket.polygon.io/crypto

    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":"XT.X:BTC-USD"}

    You can also request multiple streams from the same cluster.

    {"action":"subscribe","params":"XT.X:BTC-USD,XT.X:ETH-USD"}

    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":"T","sym":"XT.X:BTC-USD","i":"50578","x":4,"p":215.9721,"s":100,"t":1611082428813,"z":3}
    ]

    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":"T","sym":"XT.X:BTC-USD","i":"50578","x":4,"p":215.9721,"s":100,"t":1611082428813,"z":3}, 
        {"ev":"T","sym":"XT.X:ETH-USD","i":"12856","x":4,"p":215.989,"s":1,"c":[37],"t":1611082428814,"z":3}
    ]

    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://socket.polygon.io/crypto

    Stream real-time per-minute crypto aggregates for a given crypto pair.

    Parameters

    Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs. You can also use a comma separated list to subscribe to multiple crypto pairs. You can retrieve active crypto tickers from our Crypto Tickers API.

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

    The event type.


    pairstring

    The crypto pair.


    onumber

    The open price for this aggregate window.


    cnumber

    The close price for this aggregate window.


    hnumber

    The high price for this aggregate window.


    lnumber

    The low price for this aggregate window.


    vinteger

    The volume of trades during this aggregate window.


    sinteger

    The start time for this aggregate window in Unix Milliseconds.


    einteger

    The end time for this aggregate window in Unix Milliseconds.


    vwnumber

    The volume weighted average price.


    zinteger

    The average trade size for this aggregate window.


    Was this helpful?
    Help us improve
    Response Object
    {
      "ev": "XA",
      "pair": "BCD-USD",
      "v": 951.6112,
      "vw": 0.7756,
      "z": 73,
      "o": 0.772,
      "c": 0.784,
      "h": 0.784,
      "l": 0.771,
      "s": 1610463240000,
      "e": 1610463300000
    }

    Trades

    ws
    wss://socket.polygon.io/crypto

    Stream real-time crypto trades for a given crypto pair.

    Parameters

    Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs. You can also use a comma separated list to subscribe to multiple crypto pairs. You can retrieve active crypto tickers from our Crypto Tickers API.

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

    The event type.


    pairstring

    The crypto pair.


    pnumber

    The price.


    tinteger

    The Timestamp in Unix MS.


    snumber

    The size.


    carray [integer]

    The conditions. 0 (or empty array): empty 1: sellside 2: buyside


    iinteger

    The ID of the trade (optional).


    xinteger

    The crypto exchange ID. See Exchanges for a list of exchanges and their IDs.


    rinteger

    The timestamp that the tick was received by Polygon.


    Was this helpful?
    Help us improve
    Response Object
    {
      "ev": "XT",
      "pair": "BTC-USD",
      "p": 33021.9,
      "t": 1610462007425,
      "s": 0.01616617,
      "c": [
        2
      ],
      "i": 14272084,
      "x": 3,
      "r": 1610462007576
    }

    Quotes

    ws
    wss://socket.polygon.io/crypto

    Stream real-time crypto quotes for a given crypto pair.

    Parameters

    Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs. You can also use a comma separated list to subscribe to multiple crypto pairs. You can retrieve active crypto tickers from our Crypto Tickers API.

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

    The event type.


    pairstring

    The crypto pair.


    bpnumber

    The bid price.


    bsnumber

    The bid size.


    apnumber

    The ask price.


    asnumber

    The ask size.


    tinteger

    The Timestamp in Unix MS.


    xinteger

    The crypto exchange ID. See Exchanges for a list of exchanges and their IDs.


    rinteger

    The timestamp that the tick was received by Polygon.


    Was this helpful?
    Help us improve
    Response Object
    {
      "ev": "XQ",
      "pair": "BTC-USD",
      "bp": 33052.79,
      "bs": 0.48,
      "ap": 33073.19,
      "as": 0.601,
      "t": 1610462411115,
      "x": 1,
      "r": 1610462411128
    }

    Level 2 Book

    ws
    wss://socket.polygon.io/crypto

    Stream real-time level 2 book data for a given crypto pair.

    Parameters

    Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs. You can also use a comma separated list to subscribe to multiple crypto pairs. You can retrieve active crypto tickers from our Crypto Tickers API.

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

    The event type.


    pairstring

    The crypto pair.


    barray

    An array of bid prices with a maximum depth of 100.

    aarray

    An array of ask prices with a maximum depth of 100.

    tinteger

    The Timestamp in Unix MS.


    xinteger

    The crypto exchange ID. See Exchanges for a list of exchanges and their IDs.


    rinteger

    The timestamp that the tick was received by Polygon.


    Was this helpful?
    Help us improve
    Response Object
    {
      "ev": "XL2",
      "pair": "BTC-USD",
      "t": 1610462411115,
      "r": 1610462411128,
      "x": 1,
      "b": [
        [
          33712.71,
          0.18635
        ],
        [
          33712.7,
          0.134
        ]
      ],
      "a": [
        [
          33718.23,
          3.5527483
        ],
        [
          33718.24,
          0.1
        ]
      ]
    }
    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