From e78a67f6b677445570717fbd14097d30e325c247 Mon Sep 17 00:00:00 2001
From: justinpolygon <123573436+justinpolygon@users.noreply.github.com>
Date: Tue, 12 Dec 2023 00:21:43 -0800
Subject: [PATCH] Update rest and ws spec
---
.polygon/rest.json | 22 +-
.polygon/websocket.json | 511 +++++++++++++++++++++++++++++++++++++++-
2 files changed, 520 insertions(+), 13 deletions(-)
diff --git a/.polygon/rest.json b/.polygon/rest.json
index a521672..62cb1de 100644
--- a/.polygon/rest.json
+++ b/.polygon/rest.json
@@ -220,7 +220,7 @@
}
},
"StocksTickerPathParam": {
- "description": "The ticker symbol of the stock/equity.",
+ "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.",
"example": "AAPL",
"in": "path",
"name": "stocksTicker",
@@ -230,7 +230,7 @@
}
},
"TickersQueryParam": {
- "description": "A comma separated list of tickers to get snapshots for.",
+ "description": "A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers.",
"in": "query",
"name": "tickers",
"schema": {
@@ -3602,7 +3602,7 @@
"type": "boolean"
},
"t": {
- "description": "The Unix Msec timestamp for the start of the aggregate window.",
+ "description": "The Unix Msec timestamp for the end of the aggregate window.",
"type": "integer"
},
"v": {
@@ -13387,7 +13387,7 @@
"description": "Get the open, close and afterhours prices of a stock symbol on a certain date.\n",
"parameters": [
{
- "description": "The ticker symbol of the stock/equity.",
+ "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.",
"example": "AAPL",
"in": "path",
"name": "stocksTicker",
@@ -15387,7 +15387,7 @@
"type": "boolean"
},
"t": {
- "description": "The Unix Msec timestamp for the start of the aggregate window.",
+ "description": "The Unix Msec timestamp for the end of the aggregate window.",
"type": "integer"
},
"v": {
@@ -17177,7 +17177,7 @@
"description": "Get the previous day's open, high, low, and close (OHLC) for the specified stock ticker.\n",
"parameters": [
{
- "description": "The ticker symbol of the stock/equity.",
+ "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.",
"example": "AAPL",
"in": "path",
"name": "stocksTicker",
@@ -17360,7 +17360,7 @@
"description": "Get aggregate bars for a stock over a given date range in custom time window sizes.\n
\n
\nFor example, if timespan = \u2018minute\u2019 and multiplier = \u20185\u2019 then 5-minute bars will be returned.\n",
"parameters": [
{
- "description": "The ticker symbol of the stock/equity.",
+ "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.",
"example": "AAPL",
"in": "path",
"name": "stocksTicker",
@@ -18579,7 +18579,7 @@
"description": "Get the current minute, day, and previous day\u2019s aggregate, as well as the last trade and quote for all traded cryptocurrency symbols.\n
\n
\nNote: 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.\n",
"parameters": [
{
- "description": "A comma separated list of tickers to get snapshots for.",
+ "description": "A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers.",
"in": "query",
"name": "tickers",
"schema": {
@@ -19840,7 +19840,7 @@
"description": "Get the current minute, day, and previous day\u2019s aggregate, as well as the last trade and quote for all traded forex symbols.\n
\n
\nNote: 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.\n",
"parameters": [
{
- "description": "A comma separated list of tickers to get snapshots for.",
+ "description": "A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers.",
"in": "query",
"name": "tickers",
"schema": {
@@ -20789,7 +20789,7 @@
"description": "Get the most up-to-date market data for all traded stock symbols.\n
\n
\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
"parameters": [
{
- "description": "A comma separated list of tickers to get snapshots for.",
+ "description": "A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers.",
"in": "query",
"name": "tickers",
"schema": {
@@ -21204,7 +21204,7 @@
"description": "Get the most up-to-date market data for a single traded stock ticker.\n
\n
\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n",
"parameters": [
{
- "description": "The ticker symbol of the stock/equity.",
+ "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.",
"example": "AAPL",
"in": "path",
"name": "stocksTicker",
diff --git a/.polygon/websocket.json b/.polygon/websocket.json
index c4f7e5c..b02db44 100644
--- a/.polygon/websocket.json
+++ b/.polygon/websocket.json
@@ -115,6 +115,11 @@
"/forex/CA"
]
},
+ {
+ "paths": [
+ "/forex/CAS"
+ ]
+ },
{
"paths": [
"/forex/C"
@@ -146,6 +151,11 @@
"/crypto/XA"
]
},
+ {
+ "paths": [
+ "/crypto/XAS"
+ ]
+ },
{
"paths": [
"/crypto/XT"
@@ -187,6 +197,11 @@
"/indices/AM"
]
},
+ {
+ "paths": [
+ "/indices/A"
+ ]
+ },
{
"paths": [
"/indices/V"
@@ -2171,6 +2186,106 @@
]
}
},
+ "/forex/CAS": {
+ "get": {
+ "summary": "Aggregates (Per Second)",
+ "description": "Stream real-time per-second forex aggregates for a given forex pair.\n",
+ "parameters": [
+ {
+ "name": "ticker",
+ "in": "query",
+ "description": "Specify a forex pair in the format {from}/{to} or use * to subscribe to all forex pairs.\nYou can also use a comma separated list to subscribe to multiple forex pairs.\nYou can retrieve active forex tickers from our [Forex Tickers API](https://polygon.io/docs/forex/get_v3_reference_tickers).\n",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "pattern": "/^(?([A-Z]{3})\\/?([A-Z]{3}))$/"
+ },
+ "example": "*"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The WebSocket message for a forex per-second aggregate event.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ev": {
+ "type": "string",
+ "enum": [
+ "CAS"
+ ],
+ "description": "The event type."
+ },
+ "pair": {
+ "type": "string",
+ "description": "The currency pair."
+ },
+ "o": {
+ "type": "number",
+ "format": "double",
+ "description": "The open price for this aggregate window."
+ },
+ "c": {
+ "type": "number",
+ "format": "double",
+ "description": "The close price for this aggregate window."
+ },
+ "h": {
+ "type": "number",
+ "format": "double",
+ "description": "The high price for this aggregate window."
+ },
+ "l": {
+ "type": "number",
+ "format": "double",
+ "description": "The low price for this aggregate window."
+ },
+ "v": {
+ "type": "integer",
+ "description": "The volume of trades during this aggregate window."
+ },
+ "s": {
+ "type": "integer",
+ "description": "The start time for this aggregate window in Unix Milliseconds."
+ },
+ "e": {
+ "type": "integer",
+ "description": "The end time for this aggregate window in Unix Milliseconds."
+ }
+ }
+ },
+ "example": {
+ "ev": "CAS",
+ "pair": "USD/EUR",
+ "o": 0.8687,
+ "c": 0.86889,
+ "h": 0.86889,
+ "l": 0.8686,
+ "v": 20,
+ "s": 1539145740000
+ }
+ }
+ }
+ }
+ },
+ "x-polygon-entitlement-data-type": {
+ "name": "aggregates",
+ "description": "Aggregate data"
+ },
+ "x-polygon-entitlement-market-type": {
+ "name": "fx",
+ "description": "Forex data"
+ },
+ "x-polygon-entitlement-allowed-timeframes": [
+ {
+ "name": "realtime",
+ "description": "Real Time Data"
+ }
+ ]
+ }
+ },
"/business/forex/FMV": {
"get": {
"summary": "Fair Market Value",
@@ -2885,6 +3000,118 @@
]
}
},
+ "/crypto/XAS": {
+ "get": {
+ "summary": "Aggregates (Per Second)",
+ "description": "Stream real-time per-second crypto aggregates for a given crypto pair.\n",
+ "parameters": [
+ {
+ "name": "ticker",
+ "in": "query",
+ "description": "Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs.\nYou can also use a comma separated list to subscribe to multiple crypto pairs.\nYou can retrieve active crypto tickers from our [Crypto Tickers API](https://polygon.io/docs/crypto/get_v3_reference_tickers).\n",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "pattern": "/^(?([A-Z]*)-(?[A-Z]{3}))$/"
+ },
+ "example": "*"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The WebSocket message for a crypto per-second aggregate event.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "ev": {
+ "type": "string",
+ "enum": [
+ "XAS"
+ ],
+ "description": "The event type."
+ },
+ "pair": {
+ "type": "string",
+ "description": "The crypto pair."
+ },
+ "o": {
+ "type": "number",
+ "format": "double",
+ "description": "The open price for this aggregate window."
+ },
+ "c": {
+ "type": "number",
+ "format": "double",
+ "description": "The close price for this aggregate window."
+ },
+ "h": {
+ "type": "number",
+ "format": "double",
+ "description": "The high price for this aggregate window."
+ },
+ "l": {
+ "type": "number",
+ "format": "double",
+ "description": "The low price for this aggregate window."
+ },
+ "v": {
+ "type": "integer",
+ "description": "The volume of trades during this aggregate window."
+ },
+ "s": {
+ "type": "integer",
+ "description": "The start time for this aggregate window in Unix Milliseconds."
+ },
+ "e": {
+ "type": "integer",
+ "description": "The end time for this aggregate window in Unix Milliseconds."
+ },
+ "vw": {
+ "type": "number",
+ "format": "double",
+ "description": "The volume weighted average price."
+ },
+ "z": {
+ "type": "integer",
+ "description": "The average trade size for this aggregate window."
+ }
+ }
+ },
+ "example": {
+ "ev": "XAS",
+ "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
+ }
+ }
+ }
+ }
+ },
+ "x-polygon-entitlement-data-type": {
+ "name": "aggregates",
+ "description": "Aggregate data"
+ },
+ "x-polygon-entitlement-market-type": {
+ "name": "crypto",
+ "description": "Crypto data"
+ },
+ "x-polygon-entitlement-allowed-timeframes": [
+ {
+ "name": "realtime",
+ "description": "Real Time Data"
+ }
+ ]
+ }
+ },
"/business/crypto/FMV": {
"get": {
"summary": "Fair Market Value",
@@ -3160,6 +3387,122 @@
]
}
},
+ "/indices/A": {
+ "get": {
+ "summary": "Aggregates (Per Second)",
+ "description": "Stream real-time second aggregates for a given index ticker symbol.\n",
+ "parameters": [
+ {
+ "name": "ticker",
+ "in": "query",
+ "description": "Specify an index ticker using \"I:\" prefix or use * to subscribe to all index tickers.\nYou can also use a comma separated list to subscribe to multiple index tickers.\nYou can retrieve available index tickers from our [Index Tickers API](https://polygon.io/docs/indices/get_v3_reference_tickers).\n",
+ "required": true,
+ "schema": {
+ "type": "string",
+ "pattern": "/^(I:[a-zA-Z0-9]+)$/"
+ },
+ "example": "*"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "The WebSocket message for a second aggregate event.",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "ev": {
+ "description": "The event type."
+ },
+ "sym": {
+ "type": "string",
+ "description": "The symbol representing the given index."
+ },
+ "op": {
+ "type": "number",
+ "format": "double",
+ "description": "Today's official opening value."
+ },
+ "o": {
+ "type": "number",
+ "format": "double",
+ "description": "The opening index value for this aggregate window."
+ },
+ "c": {
+ "type": "number",
+ "format": "double",
+ "description": "The closing index value for this aggregate window."
+ },
+ "h": {
+ "type": "number",
+ "format": "double",
+ "description": "The highest index value for this aggregate window."
+ },
+ "l": {
+ "type": "number",
+ "format": "double",
+ "description": "The lowest index value for this aggregate window."
+ },
+ "s": {
+ "type": "integer",
+ "description": "The timestamp of the starting index for this aggregate window in Unix Milliseconds."
+ },
+ "e": {
+ "type": "integer",
+ "description": "The timestamp of the ending index for this aggregate window in Unix Milliseconds."
+ }
+ }
+ },
+ {
+ "properties": {
+ "ev": {
+ "enum": [
+ "A"
+ ],
+ "description": "The event type."
+ }
+ }
+ }
+ ]
+ },
+ "example": {
+ "ev": "A",
+ "sym": "I:SPX",
+ "op": 3985.67,
+ "o": 3985.67,
+ "c": 3985.67,
+ "h": 3985.67,
+ "l": 3985.67,
+ "s": 1678220675805,
+ "e": 1678220675805
+ }
+ }
+ }
+ }
+ },
+ "x-polygon-entitlement-data-type": {
+ "name": "aggregates",
+ "description": "Aggregate data"
+ },
+ "x-polygon-entitlement-market-type": {
+ "name": "indices",
+ "description": "Indices data"
+ },
+ "x-polygon-entitlement-allowed-timeframes": [
+ {
+ "name": "delayed",
+ "description": "15 minute delayed data"
+ },
+ {
+ "name": "realtime",
+ "description": "Real Time Data"
+ }
+ ]
+ }
+ },
"/indices/AM": {
"get": {
"summary": "Aggregates (Per Minute)",
@@ -4454,7 +4797,7 @@
}
]
},
- "ForexAggregateEvent": {
+ "ForexMinuteAggregateEvent": {
"type": "object",
"properties": {
"ev": {
@@ -4502,6 +4845,54 @@
}
}
},
+ "ForexSecondAggregateEvent": {
+ "type": "object",
+ "properties": {
+ "ev": {
+ "type": "string",
+ "enum": [
+ "CAS"
+ ],
+ "description": "The event type."
+ },
+ "pair": {
+ "type": "string",
+ "description": "The currency pair."
+ },
+ "o": {
+ "type": "number",
+ "format": "double",
+ "description": "The open price for this aggregate window."
+ },
+ "c": {
+ "type": "number",
+ "format": "double",
+ "description": "The close price for this aggregate window."
+ },
+ "h": {
+ "type": "number",
+ "format": "double",
+ "description": "The high price for this aggregate window."
+ },
+ "l": {
+ "type": "number",
+ "format": "double",
+ "description": "The low price for this aggregate window."
+ },
+ "v": {
+ "type": "integer",
+ "description": "The volume of trades during this aggregate window."
+ },
+ "s": {
+ "type": "integer",
+ "description": "The start time for this aggregate window in Unix Milliseconds."
+ },
+ "e": {
+ "type": "integer",
+ "description": "The end time for this aggregate window in Unix Milliseconds."
+ }
+ }
+ },
"CryptoQuoteEvent": {
"type": "object",
"properties": {
@@ -4600,7 +4991,7 @@
}
}
},
- "CryptoAggregateEvent": {
+ "CryptoMinuteAggregateEvent": {
"type": "object",
"properties": {
"ev": {
@@ -4657,6 +5048,63 @@
}
}
},
+ "CryptoSecondAggregateEvent": {
+ "type": "object",
+ "properties": {
+ "ev": {
+ "type": "string",
+ "enum": [
+ "XAS"
+ ],
+ "description": "The event type."
+ },
+ "pair": {
+ "type": "string",
+ "description": "The crypto pair."
+ },
+ "o": {
+ "type": "number",
+ "format": "double",
+ "description": "The open price for this aggregate window."
+ },
+ "c": {
+ "type": "number",
+ "format": "double",
+ "description": "The close price for this aggregate window."
+ },
+ "h": {
+ "type": "number",
+ "format": "double",
+ "description": "The high price for this aggregate window."
+ },
+ "l": {
+ "type": "number",
+ "format": "double",
+ "description": "The low price for this aggregate window."
+ },
+ "v": {
+ "type": "integer",
+ "description": "The volume of trades during this aggregate window."
+ },
+ "s": {
+ "type": "integer",
+ "description": "The start time for this aggregate window in Unix Milliseconds."
+ },
+ "e": {
+ "type": "integer",
+ "description": "The end time for this aggregate window in Unix Milliseconds."
+ },
+ "vw": {
+ "type": "number",
+ "format": "double",
+ "description": "The volume weighted average price."
+ },
+ "z": {
+ "type": "integer",
+ "description": "The average trade size for this aggregate window."
+ }
+ }
+ },
"CryptoL2BookEvent": {
"type": "object",
"properties": {
@@ -4825,6 +5273,65 @@
}
]
},
+ "IndicesSecondAggregateEvent": {
+ "allOf": [
+ {
+ "type": "object",
+ "properties": {
+ "ev": {
+ "description": "The event type."
+ },
+ "sym": {
+ "type": "string",
+ "description": "The symbol representing the given index."
+ },
+ "op": {
+ "type": "number",
+ "format": "double",
+ "description": "Today's official opening value."
+ },
+ "o": {
+ "type": "number",
+ "format": "double",
+ "description": "The opening index value for this aggregate window."
+ },
+ "c": {
+ "type": "number",
+ "format": "double",
+ "description": "The closing index value for this aggregate window."
+ },
+ "h": {
+ "type": "number",
+ "format": "double",
+ "description": "The highest index value for this aggregate window."
+ },
+ "l": {
+ "type": "number",
+ "format": "double",
+ "description": "The lowest index value for this aggregate window."
+ },
+ "s": {
+ "type": "integer",
+ "description": "The timestamp of the starting index for this aggregate window in Unix Milliseconds."
+ },
+ "e": {
+ "type": "integer",
+ "description": "The timestamp of the ending index for this aggregate window in Unix Milliseconds."
+ }
+ }
+ },
+ {
+ "properties": {
+ "ev": {
+ "enum": [
+ "A"
+ ],
+ "description": "The event type."
+ }
+ }
+ }
+ ]
+ },
"IndicesValueEvent": {
"type": "object",
"properties": {