From 5a9f97f9b99f50070bae374dc19d171cf86dcbfc Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Wed, 18 Oct 2023 11:30:35 -0400 Subject: [PATCH 01/13] update rest snapshot models, add FMV data types and new feed urls for websockets --- .github/workflows/lint.yml | 2 +- .github/workflows/test-coverage.yml | 2 +- .github/workflows/test.yml | 2 +- .polygon/rest.json | 2458 ++++++++++++++++++--------- go.mod | 2 +- go.sum | 2 + rest/models/snapshot.go | 3 + websocket/config.go | 54 +- websocket/models/models.go | 14 + 9 files changed, 1738 insertions(+), 801 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0ac81bf4..c53327dd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - go-version: [1.20.x] + go-version: [1.21.x] name: golangci-lint runs-on: ${{ matrix.os }} steps: diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml index 482bf1ef..3e29517b 100644 --- a/.github/workflows/test-coverage.yml +++ b/.github/workflows/test-coverage.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.20.x + go-version: 1.21.x - uses: actions/checkout@v2 with: fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 02d4ba20..7b00cfb5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - go-version: [1.18.x, 1.19.x, 1.20.x] + go-version: [1.18.x, 1.19.x, 1.20.x, 1.21.x] name: go-test runs-on: ${{ matrix.os }} steps: diff --git a/.polygon/rest.json b/.polygon/rest.json index 7861863c..5382b1b9 100644 --- a/.polygon/rest.json +++ b/.polygon/rest.json @@ -79,6 +79,7 @@ "required": true, "schema": { "enum": [ + "second", "minute", "hour", "day", @@ -150,7 +151,7 @@ }, "IndicesTickerPathParam": { "description": "The ticker symbol of Index.", - "example": "I:DJI", + "example": "I:NDX", "in": "path", "name": "indicesTicker", "required": true, @@ -826,11 +827,19 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -848,7 +857,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -966,11 +977,19 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -988,7 +1007,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -1269,11 +1290,19 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -1291,7 +1320,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -2410,24 +2441,25 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", "type": "number" } }, - "required": [ - "o", - "h", - "l", - "c", - "v" - ], "type": "object" }, "prevDay": { @@ -2599,24 +2631,25 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", "type": "number" } }, - "required": [ - "o", - "h", - "l", - "c", - "v" - ], "type": "object" }, "prevDay": { @@ -3273,6 +3306,44 @@ "format": "double", "type": "number" }, + "SnapshotMinOHLCV": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + } + }, + "type": "object" + }, "SnapshotOHLCV": { "properties": { "c": { @@ -3657,11 +3728,19 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -3680,7 +3759,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -3705,6 +3786,10 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", @@ -3714,6 +3799,10 @@ "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", "type": "boolean" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -3732,7 +3821,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -3887,6 +3978,10 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", @@ -3896,6 +3991,10 @@ "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", "type": "boolean" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -3914,7 +4013,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -4142,6 +4243,10 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", @@ -4151,6 +4256,10 @@ "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", "type": "boolean" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -4169,7 +4278,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -5047,9 +5158,8 @@ "example": 100, "in": "query", "name": "amount", - "required": true, "schema": { - "default": 100, + "default": 1, "type": "number" } }, @@ -5132,6 +5242,12 @@ } } }, + "required": [ + "exchange", + "timestamp", + "ask", + "bid" + ], "type": "object", "x-polygon-go-type": { "name": "LastQuoteCurrencies" @@ -5154,6 +5270,15 @@ "type": "string" } }, + "required": [ + "status", + "request_id", + "from", + "to", + "symbol", + "initialAmount", + "converted" + ], "type": "object" } }, @@ -5688,7 +5813,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -5696,7 +5821,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -5704,7 +5829,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -5712,7 +5837,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -5897,7 +6022,7 @@ "parameters": [ { "description": "The ticker symbol for which to get exponential moving average (EMA) data.", - "example": "C:EUR-USD", + "example": "C:EURUSD", "in": "path", "name": "fxTicker", "required": true, @@ -6006,7 +6131,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -6014,7 +6139,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -6022,7 +6147,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -6030,7 +6155,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -6215,7 +6340,7 @@ "parameters": [ { "description": "The ticker symbol for which to get exponential moving average (EMA) data.", - "example": "I:DJI", + "example": "I:NDX", "in": "path", "name": "indicesTicker", "required": true, @@ -6324,7 +6449,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -6332,7 +6457,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -6340,7 +6465,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -6348,7 +6473,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -6361,16 +6486,16 @@ "content": { "application/json": { "example": { - "next_url": "https://api.polygon.io/v1/indicators/ema/I:DJI?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTQwNDcuNDEwMDAwMDAwMDAwMyUyQyUyMmglMjIlM0EwJTJDJTIybCUyMiUzQTAlMkMlMjJ0JTIyJTNBMTY3ODA4MjQwMDAwMCU3RCZhcz0mZXhwYW5kX3VuZGVybHlpbmc9ZmFsc2UmbGltaXQ9MTAmb3JkZXI9ZGVzYyZzZXJpZXNfdHlwZT1jbG9zZSZ0aW1lc3Bhbj1kYXkmdGltZXN0YW1wLmx0PTE2NzgxNjUyMDAwMDAmd2luZG93PTU", - "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "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:DJI/range/1/day/1063281600000/1678726291180?limit=35\u0026sort=desc" + "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366449650?limit=226\u0026sort=desc" }, "values": [ { - "timestamp": 1681966800000, - "value": 33355.64416487007 + "timestamp": 1687237200000, + "value": 14452.002555459003 } ] }, @@ -6509,6 +6634,7 @@ "tags": [ "indices:aggregates" ], + "x-polygon-entitlement-allowed-limited-tickers": true, "x-polygon-entitlement-data-type": { "description": "Aggregate data", "name": "aggregates" @@ -6636,7 +6762,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -6644,7 +6770,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -6652,7 +6778,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -6660,7 +6786,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -6954,7 +7080,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -6962,7 +7088,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -6970,7 +7096,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -6978,7 +7104,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -7281,7 +7407,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -7289,7 +7415,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -7297,7 +7423,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -7305,7 +7431,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -7514,7 +7640,7 @@ "parameters": [ { "description": "The ticker symbol for which to get MACD data.", - "example": "C:EUR-USD", + "example": "C:EURUSD", "in": "path", "name": "fxTicker", "required": true, @@ -7643,7 +7769,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -7651,7 +7777,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -7659,7 +7785,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -7667,7 +7793,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -7876,7 +8002,7 @@ "parameters": [ { "description": "The ticker symbol for which to get MACD data.", - "example": "I:DJI", + "example": "I:NDX", "in": "path", "name": "indicesTicker", "required": true, @@ -8005,7 +8131,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -8013,7 +8139,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -8021,7 +8147,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -8029,7 +8155,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -8042,24 +8168,24 @@ "content": { "application/json": { "example": { - "next_url": "https://api.polygon.io/v1/indicators/macd/I:DJI?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", - "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "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:DJI/range/1/day/1063281600000/1678726155743?limit=129\u0026sort=desc" + "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366537196?limit=121\u0026sort=desc" }, "values": [ { - "histogram": -48.29157370302107, - "signal": 225.60959338746886, - "timestamp": 1681966800000, - "value": 177.3180196844478 + "histogram": -4.7646219788108795, + "signal": 220.7596784587801, + "timestamp": 1687237200000, + "value": 215.9950564799692 }, { - "histogram": -37.55634001543484, - "signal": 237.6824868132241, - "timestamp": 1681963200000, - "value": 200.12614679778926 + "histogram": 3.4518937661882205, + "signal": 221.9508339534828, + "timestamp": 1687219200000, + "value": 225.40272771967102 } ] }, @@ -8214,6 +8340,7 @@ "tags": [ "indices:aggregates" ], + "x-polygon-entitlement-allowed-limited-tickers": true, "x-polygon-entitlement-data-type": { "description": "Aggregate data", "name": "aggregates" @@ -8361,7 +8488,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -8369,7 +8496,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -8377,7 +8504,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -8385,7 +8512,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -8723,7 +8850,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -8731,7 +8858,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -8739,7 +8866,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -8747,7 +8874,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -9054,7 +9181,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -9062,7 +9189,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -9070,7 +9197,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -9078,7 +9205,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -9100,7 +9227,7 @@ "values": [ { "timestamp": 1517562000016, - "value": 140.139 + "value": 82.19 } ] }, @@ -9263,7 +9390,7 @@ "parameters": [ { "description": "The ticker symbol for which to get relative strength index (RSI) data.", - "example": "C:EUR-USD", + "example": "C:EURUSD", "in": "path", "name": "fxTicker", "required": true, @@ -9372,7 +9499,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -9380,7 +9507,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -9388,7 +9515,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -9396,7 +9523,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -9418,7 +9545,7 @@ "values": [ { "timestamp": 1517562000016, - "value": 140.139 + "value": 82.19 } ] }, @@ -9581,7 +9708,7 @@ "parameters": [ { "description": "The ticker symbol for which to get relative strength index (RSI) data.", - "example": "I:DJI", + "example": "I:NDX", "in": "path", "name": "indicesTicker", "required": true, @@ -9690,7 +9817,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -9698,7 +9825,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -9706,7 +9833,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -9714,7 +9841,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -9727,16 +9854,16 @@ "content": { "application/json": { "example": { - "next_url": "https://api.polygon.io/v1/indicators/rsi/I:DJI?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTQwNDcuNDEwMDAwMDAwMDAwMyUyQyUyMmglMjIlM0EwJTJDJTIybCUyMiUzQTAlMkMlMjJ0JTIyJTNBMTY3ODA4MjQwMDAwMCU3RCZhcz0mZXhwYW5kX3VuZGVybHlpbmc9ZmFsc2UmbGltaXQ9MTAmb3JkZXI9ZGVzYyZzZXJpZXNfdHlwZT1jbG9zZSZ0aW1lc3Bhbj1kYXkmdGltZXN0YW1wLmx0PTE2NzgxNjUyMDAwMDAmd2luZG93PTU", - "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "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:DJI/range/1/day/1063281600000/1678725829099?limit=35\u0026sort=desc" + "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366658253?limit=66\u0026sort=desc" }, "values": [ { - "timestamp": 1681966800000, - "value": 55.89394103205648 + "timestamp": 1687237200000, + "value": 73.98019439047955 } ] }, @@ -9875,6 +10002,7 @@ "tags": [ "indices:aggregates" ], + "x-polygon-entitlement-allowed-limited-tickers": true, "x-polygon-entitlement-data-type": { "description": "Aggregate data", "name": "aggregates" @@ -10002,7 +10130,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -10010,7 +10138,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -10018,7 +10146,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -10026,7 +10154,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -10048,7 +10176,7 @@ "values": [ { "timestamp": 1517562000016, - "value": 140.139 + "value": 82.19 } ] }, @@ -10320,7 +10448,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -10328,7 +10456,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -10336,7 +10464,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -10344,7 +10472,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -10366,7 +10494,7 @@ "values": [ { "timestamp": 1517562000016, - "value": 140.139 + "value": 82.19 } ] }, @@ -10627,7 +10755,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -10635,7 +10763,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -10643,7 +10771,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -10651,7 +10779,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -10858,7 +10986,7 @@ "parameters": [ { "description": "The ticker symbol for which to get simple moving average (SMA) data.", - "example": "C:EUR-USD", + "example": "C:EURUSD", "in": "path", "name": "fxTicker", "required": true, @@ -10967,7 +11095,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -10975,7 +11103,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -10983,7 +11111,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -10991,7 +11119,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -11198,7 +11326,7 @@ "parameters": [ { "description": "The ticker symbol for which to get simple moving average (SMA) data.", - "example": "I:DJI", + "example": "I:NDX", "in": "path", "name": "indicesTicker", "required": true, @@ -11307,7 +11435,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -11315,7 +11443,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -11323,7 +11451,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -11331,7 +11459,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -11344,16 +11472,16 @@ "content": { "application/json": { "example": { - "next_url": "https://api.polygon.io/v1/indicators/sma/I:DJI?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTQwNDcuNDEwMDAwMDAwMDAwMyUyQyUyMmglMjIlM0EwJTJDJTIybCUyMiUzQTAlMkMlMjJ0JTIyJTNBMTY3ODA4MjQwMDAwMCU3RCZhcz0mZXhwYW5kX3VuZGVybHlpbmc9ZmFsc2UmbGltaXQ9MTAmb3JkZXI9ZGVzYyZzZXJpZXNfdHlwZT1jbG9zZSZ0aW1lc3Bhbj1kYXkmdGltZXN0YW1wLmx0PTE2NzgxNjUyMDAwMDAmd2luZG93PTU", - "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "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:DJI/range/1/day/1063281600000/1678725829099?limit=35\u0026sort=desc" + "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366378997?limit=240\u0026sort=desc" }, "values": [ { - "timestamp": 1681966800000, - "value": 33236.3424 + "timestamp": 1687237200000, + "value": 14362.676417589264 } ] }, @@ -11492,6 +11620,7 @@ "tags": [ "indices:aggregates" ], + "x-polygon-entitlement-allowed-limited-tickers": true, "x-polygon-entitlement-data-type": { "description": "Aggregate data", "name": "aggregates" @@ -11619,7 +11748,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -11627,7 +11756,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -11635,7 +11764,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -11643,7 +11772,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -11959,7 +12088,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -11967,7 +12096,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -11975,7 +12104,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -11983,7 +12112,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -12265,6 +12394,12 @@ } } }, + "required": [ + "exchange", + "price", + "size", + "timestamp" + ], "type": "object", "x-polygon-go-type": { "name": "LastTradeCrypto" @@ -12283,6 +12418,11 @@ "type": "string" } }, + "required": [ + "status", + "request_id", + "symbol" + ], "type": "object" } }, @@ -12381,6 +12521,12 @@ } } }, + "required": [ + "ask", + "bid", + "exchange", + "timestamp" + ], "type": "object", "x-polygon-go-type": { "name": "LastQuoteCurrencies" @@ -12399,6 +12545,11 @@ "type": "string" } }, + "required": [ + "status", + "request_id", + "symbol" + ], "type": "object" } }, @@ -12892,7 +13043,7 @@ "parameters": [ { "description": "The ticker symbol of Index.", - "example": "I:DJI", + "example": "I:NDX", "in": "path", "name": "indicesTicker", "required": true, @@ -12907,7 +13058,6 @@ "name": "date", "required": true, "schema": { - "format": "date", "type": "string" } } @@ -12917,15 +13067,15 @@ "content": { "application/json": { "example": { - "afterHours": 31909.64, - "close": 32245.14, - "from": "2023-03-10", - "high": 32988.26, - "low": 32200.66, - "open": 32922.75, - "preMarket": 32338.23, + "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:DJI" + "symbol": "I:NDX" }, "schema": { "properties": { @@ -12983,6 +13133,12 @@ ], "type": "object" } + }, + "text/csv": { + "example": "from,open,high,low,close,afterHours,preMarket\n2023-01-10,12001.69552583921,12069.62262033557,11789.85923449393,11830.28178808306,26122646,11830.43006295237,12001.69552583921\n", + "schema": { + "type": "string" + } } }, "description": "The open/close of this stock symbol." @@ -12995,6 +13151,7 @@ "tags": [ "stocks:open-close" ], + "x-polygon-entitlement-allowed-limited-tickers": true, "x-polygon-entitlement-data-type": { "description": "Aggregate data", "name": "aggregates" @@ -14256,6 +14413,7 @@ "icon_url": "https://api.polygon.io/icon.png", "logo_url": "https://api.polygon.io/logo.svg" }, + "last_updated": 1679597116344223500, "market_status": "closed", "name": "Norwegian Cruise Lines", "price": 22.3, @@ -14277,6 +14435,7 @@ "type": "stock" }, { + "last_updated": 1679597116344223500, "market_status": "closed", "name": "NCLH $5 Call", "options": { @@ -14306,6 +14465,7 @@ "type": "options" }, { + "last_updated": 1679597116344223500, "market_status": "open", "name": "Euro - United States Dollar", "price": 0.97989, @@ -14326,6 +14486,7 @@ "icon_url": "https://api.polygon.io/icon.png", "logo_url": "https://api.polygon.io/logo.svg" }, + "last_updated": 1679597116344223500, "market_status": "open", "name": "Bitcoin - United States Dollar", "price": 32154.68, @@ -14377,6 +14538,15 @@ "description": "The error while looking for this ticker.", "type": "string" }, + "last_updated": { + "description": "The nanosecond timestamp of when this information was updated.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + }, "market_status": { "description": "The market status for the market that trades this ticker.", "type": "string" @@ -14424,7 +14594,7 @@ "type": "number" }, "strike_price": { - "description": "The strike price of the option contract", + "description": "The strike price of the option contract.", "format": "double", "type": "number" }, @@ -14469,12 +14639,12 @@ "type": "number" }, "early_trading_change": { - "description": "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.", + "description": "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.", "format": "double", "type": "number" }, "early_trading_change_percent": { - "description": "Today’s early trading change as a percentage.", + "description": "Today's early trading change as a percentage.", "format": "double", "type": "number" }, @@ -14484,12 +14654,12 @@ "type": "number" }, "late_trading_change": { - "description": "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.", + "description": "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.", "format": "double", "type": "number" }, "late_trading_change_percent": { - "description": "Today’s late trading change as a percentage.", + "description": "Today's late trading change as a percentage.", "format": "double", "type": "number" }, @@ -14508,6 +14678,11 @@ "format": "double", "type": "number" }, + "price": { + "description": "The price of the most recent trade or bid price for this asset.", + "format": "double", + "type": "number" + }, "volume": { "description": "The trading volume for the asset for the day.", "format": "double", @@ -14551,7 +14726,8 @@ "market_status", "type", "session", - "options" + "options", + "last_updated" ], "type": "object", "x-polygon-go-type": { @@ -15410,6 +15586,7 @@ "required": true, "schema": { "enum": [ + "second", "minute", "hour", "day", @@ -15862,6 +16039,7 @@ "required": true, "schema": { "enum": [ + "second", "minute", "hour", "day", @@ -16089,7 +16267,7 @@ "parameters": [ { "description": "The ticker symbol of Index.", - "example": "I:DJI", + "example": "I:NDX", "in": "path", "name": "indicesTicker", "required": true, @@ -16107,17 +16285,17 @@ "request_id": "b2170df985474b6d21a6eeccfb6bee67", "results": [ { - "T": "I:DJI", - "c": 33786.62, - "h": 33786.62, - "l": 33677.74, - "o": 33677.74, - "t": 1682020800000 + "T": "I:NDX", + "c": 15070.14948566977, + "h": 15127.4195807999, + "l": 14946.7243781848, + "o": 15036.48391066877, + "t": 1687291200000 } ], "resultsCount": 1, "status": "OK", - "ticker": "I:DJI" + "ticker": "I:NDX" }, "schema": { "allOf": [ @@ -16206,6 +16384,12 @@ } ] } + }, + "text/csv": { + "example": "T,c,h,l,o,t,v,vw\nI:NDX,15036.48391066877,15070.14948566977,15127.4195807999,14946.7243781848,1687291200000\n", + "schema": { + "type": "string" + } } }, "description": "The previous day OHLC for a index." @@ -16218,6 +16402,7 @@ "tags": [ "indices:aggregates" ], + "x-polygon-entitlement-allowed-limited-tickers": true, "x-polygon-entitlement-data-type": { "description": "Aggregate data", "name": "aggregates" @@ -16234,7 +16419,7 @@ "parameters": [ { "description": "The ticker symbol of Index.", - "example": "I:DJI", + "example": "I:NDX", "in": "path", "name": "indicesTicker", "required": true, @@ -16260,6 +16445,7 @@ "required": true, "schema": { "enum": [ + "second", "minute", "hour", "day", @@ -16323,22 +16509,22 @@ "request_id": "0cf72b6da685bcd386548ffe2895904a", "results": [ { - "c": 32245.14, - "h": 32988.26, - "l": 32200.66, - "o": 32922.75, + "c": 11995.88235998666, + "h": 12340.44936267155, + "l": 11970.34221717375, + "o": 12230.83658266843, "t": 1678341600000 }, { - "c": 31787.7, - "h": 32422.100000000002, - "l": 31786.06, - "o": 32198.9, + "c": 11830.28178808306, + "h": 12069.62262033557, + "l": 11789.85923449393, + "o": 12001.69552583921, "t": 1678428000000 } ], "status": "OK", - "ticker": "I:DJI" + "ticker": "I:NDX" }, "schema": { "allOf": [ @@ -16427,6 +16613,12 @@ } ] } + }, + "text/csv": { + "example": "c,h,l,n,o,t\n11995.88235998666,12340.44936267155,11970.34221717375,12230.83658266843,1678341600000\n11830.28178808306,12069.62262033557,11789.85923449393,12001.69552583921,1678341600000\n", + "schema": { + "type": "string" + } } }, "description": "Index Aggregates." @@ -16439,6 +16631,7 @@ "tags": [ "indices:aggregates" ], + "x-polygon-entitlement-allowed-limited-tickers": true, "x-polygon-entitlement-data-type": { "description": "Aggregate data", "name": "aggregates" @@ -16665,6 +16858,7 @@ "required": true, "schema": { "enum": [ + "second", "minute", "hour", "day", @@ -17112,6 +17306,7 @@ "required": true, "schema": { "enum": [ + "second", "minute", "hour", "day", @@ -17479,6 +17674,12 @@ "type": "integer" } }, + "required": [ + "T", + "t", + "y", + "q" + ], "type": "object", "x-polygon-go-type": { "name": "LastQuoteResult" @@ -17489,6 +17690,10 @@ "type": "string" } }, + "required": [ + "status", + "request_id" + ], "type": "object" } }, @@ -17642,6 +17847,15 @@ "type": "integer" } }, + "required": [ + "T", + "t", + "y", + "q", + "i", + "p", + "x" + ], "type": "object", "x-polygon-go-type": { "name": "LastTradeResult" @@ -17652,6 +17866,10 @@ "type": "string" } }, + "required": [ + "status", + "request_id" + ], "type": "object" } }, @@ -17809,6 +18027,15 @@ "type": "integer" } }, + "required": [ + "T", + "t", + "y", + "q", + "i", + "p", + "x" + ], "type": "object", "x-polygon-go-type": { "name": "LastTradeResult" @@ -17819,6 +18046,10 @@ "type": "string" } }, + "required": [ + "status", + "request_id" + ], "type": "object" } }, @@ -18307,7 +18538,9 @@ "c": 0.296, "h": 0.296, "l": 0.294, + "n": 2, "o": 0.296, + "t": 1684427880000, "v": 123.4866, "vw": 0 }, @@ -18455,11 +18688,19 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -18477,7 +18718,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -18646,7 +18889,9 @@ "c": 16235.1, "h": 16264.29, "l": 16129.3, + "n": 558, "o": 16257.51, + "t": 1684428960000, "v": 19.30791925, "vw": 0 }, @@ -18804,11 +19049,19 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -18826,7 +19079,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -19185,7 +19440,9 @@ "c": 0.062377, "h": 0.062377, "l": 0.062377, + "n": 2, "o": 0.062377, + "t": 1684426740000, "v": 35420, "vw": 0 }, @@ -19325,11 +19582,19 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -19347,7 +19612,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -19512,7 +19779,9 @@ "c": 0.117769, "h": 0.11779633, "l": 0.11773698, + "n": 1, "o": 0.11778, + "t": 1684422000000, "v": 202 }, "prevDay": { @@ -19635,24 +19904,25 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", "type": "number" } }, - "required": [ - "o", - "h", - "l", - "c", - "v" - ], "type": "object" }, "prevDay": { @@ -19816,7 +20086,9 @@ "c": 1.18396, "h": 1.18423, "l": 1.1838, + "n": 85, "o": 1.18404, + "t": 1684422000000, "v": 41 }, "prevDay": { @@ -19949,24 +20221,25 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", "type": "number" } }, - "required": [ - "o", - "h", - "l", - "c", - "v" - ], "type": "object" }, "prevDay": { @@ -20131,7 +20404,9 @@ "c": 0.886156, "h": 0.886156, "l": 0.886156, + "n": 1, "o": 0.886156, + "t": 1684422000000, "v": 1 }, "prevDay": { @@ -20254,24 +20529,25 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", "type": "number" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", "type": "number" } }, - "required": [ - "o", - "h", - "l", - "c", - "v" - ], "type": "object" }, "prevDay": { @@ -20460,7 +20736,9 @@ "c": 20.506, "h": 20.506, "l": 20.506, + "n": 1, "o": 20.506, + "t": 1684428600000, "v": 5000, "vw": 20.5105 }, @@ -20649,6 +20927,10 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", @@ -20658,6 +20940,10 @@ "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", "type": "boolean" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -20676,7 +20962,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -20848,7 +21136,9 @@ "c": 120.4201, "h": 120.468, "l": 120.37, + "n": 762, "o": 120.435, + "t": 1684428720000, "v": 270796, "vw": 120.4129 }, @@ -21043,6 +21333,10 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", @@ -21052,6 +21346,10 @@ "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", "type": "boolean" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -21070,7 +21368,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -21251,7 +21551,9 @@ "c": 14.2284, "h": 14.325, "l": 14.2, + "n": 5, "o": 14.28, + "t": 1684428600000, "v": 6108, "vw": 14.2426 }, @@ -21436,6 +21738,10 @@ "format": "double", "type": "number" }, + "n": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, "o": { "description": "The open price for the symbol in the given time period.", "format": "double", @@ -21445,6 +21751,10 @@ "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", "type": "boolean" }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, "v": { "description": "The trading volume of the symbol in the given time period.", "format": "double", @@ -21463,7 +21773,9 @@ "l", "c", "v", - "vw" + "vw", + "t", + "n" ], "type": "object" }, @@ -22245,7 +22557,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -22253,7 +22565,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -22261,7 +22573,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -22269,7 +22581,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -22378,6 +22690,9 @@ } } }, + "required": [ + "participant_timestamp" + ], "type": "object" }, "type": "array" @@ -22387,6 +22702,9 @@ "type": "string" } }, + "required": [ + "status" + ], "type": "object" } }, @@ -22464,7 +22782,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -22472,7 +22790,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -22480,7 +22798,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -22488,7 +22806,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -22618,6 +22936,10 @@ } } }, + "required": [ + "sip_timestamp", + "sequence_number" + ], "type": "object" }, "type": "array" @@ -22627,6 +22949,9 @@ "type": "string" } }, + "required": [ + "status" + ], "type": "object" } }, @@ -22697,7 +23022,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -22705,7 +23030,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -22713,7 +23038,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -22721,7 +23046,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -22908,7 +23233,15 @@ } } }, - "type": "object" + "required": [ + "participant_timestamp", + "sequence_number", + "sip_timestamp" + ], + "type": "object", + "x-polygon-go-type": { + "name": "CommonQuote" + } }, "type": "array" }, @@ -22917,6 +23250,9 @@ "type": "string" } }, + "required": [ + "status" + ], "type": "object" } }, @@ -23830,7 +24166,7 @@ } }, { - "description": "Search by ticker.", + "description": "Range by ticker.", "in": "query", "name": "ticker.gte", "schema": { @@ -23838,7 +24174,7 @@ } }, { - "description": "Search by ticker.", + "description": "Range by ticker.", "in": "query", "name": "ticker.gt", "schema": { @@ -23846,7 +24182,7 @@ } }, { - "description": "Search by ticker.", + "description": "Range by ticker.", "in": "query", "name": "ticker.lte", "schema": { @@ -23854,7 +24190,7 @@ } }, { - "description": "Search by ticker.", + "description": "Range by ticker.", "in": "query", "name": "ticker.lt", "schema": { @@ -23862,7 +24198,7 @@ } }, { - "description": "Search by ex_dividend_date.", + "description": "Range by ex_dividend_date.", "in": "query", "name": "ex_dividend_date.gte", "schema": { @@ -23871,7 +24207,7 @@ } }, { - "description": "Search by ex_dividend_date.", + "description": "Range by ex_dividend_date.", "in": "query", "name": "ex_dividend_date.gt", "schema": { @@ -23880,7 +24216,7 @@ } }, { - "description": "Search by ex_dividend_date.", + "description": "Range by ex_dividend_date.", "in": "query", "name": "ex_dividend_date.lte", "schema": { @@ -23889,7 +24225,7 @@ } }, { - "description": "Search by ex_dividend_date.", + "description": "Range by ex_dividend_date.", "in": "query", "name": "ex_dividend_date.lt", "schema": { @@ -23898,7 +24234,7 @@ } }, { - "description": "Search by record_date.", + "description": "Range by record_date.", "in": "query", "name": "record_date.gte", "schema": { @@ -23907,7 +24243,7 @@ } }, { - "description": "Search by record_date.", + "description": "Range by record_date.", "in": "query", "name": "record_date.gt", "schema": { @@ -23916,7 +24252,7 @@ } }, { - "description": "Search by record_date.", + "description": "Range by record_date.", "in": "query", "name": "record_date.lte", "schema": { @@ -23925,7 +24261,7 @@ } }, { - "description": "Search by record_date.", + "description": "Range by record_date.", "in": "query", "name": "record_date.lt", "schema": { @@ -23934,7 +24270,7 @@ } }, { - "description": "Search by declaration_date.", + "description": "Range by declaration_date.", "in": "query", "name": "declaration_date.gte", "schema": { @@ -23943,7 +24279,7 @@ } }, { - "description": "Search by declaration_date.", + "description": "Range by declaration_date.", "in": "query", "name": "declaration_date.gt", "schema": { @@ -23952,7 +24288,7 @@ } }, { - "description": "Search by declaration_date.", + "description": "Range by declaration_date.", "in": "query", "name": "declaration_date.lte", "schema": { @@ -23961,7 +24297,7 @@ } }, { - "description": "Search by declaration_date.", + "description": "Range by declaration_date.", "in": "query", "name": "declaration_date.lt", "schema": { @@ -23970,7 +24306,7 @@ } }, { - "description": "Search by pay_date.", + "description": "Range by pay_date.", "in": "query", "name": "pay_date.gte", "schema": { @@ -23979,7 +24315,7 @@ } }, { - "description": "Search by pay_date.", + "description": "Range by pay_date.", "in": "query", "name": "pay_date.gt", "schema": { @@ -23988,7 +24324,7 @@ } }, { - "description": "Search by pay_date.", + "description": "Range by pay_date.", "in": "query", "name": "pay_date.lte", "schema": { @@ -23997,7 +24333,7 @@ } }, { - "description": "Search by pay_date.", + "description": "Range by pay_date.", "in": "query", "name": "pay_date.lt", "schema": { @@ -24006,7 +24342,7 @@ } }, { - "description": "Search by cash_amount.", + "description": "Range by cash_amount.", "in": "query", "name": "cash_amount.gte", "schema": { @@ -24014,7 +24350,7 @@ } }, { - "description": "Search by cash_amount.", + "description": "Range by cash_amount.", "in": "query", "name": "cash_amount.gt", "schema": { @@ -24022,7 +24358,7 @@ } }, { - "description": "Search by cash_amount.", + "description": "Range by cash_amount.", "in": "query", "name": "cash_amount.lte", "schema": { @@ -24030,7 +24366,7 @@ } }, { - "description": "Search by cash_amount.", + "description": "Range by cash_amount.", "in": "query", "name": "cash_amount.lt", "schema": { @@ -24276,471 +24612,128 @@ ] } } - }, - "post": { - "description": "Manually add Polygon a dividend.", - "operationId": "CreateDividend", + } + }, + "/v3/reference/exchanges": { + "get": { + "description": "List all exchanges that Polygon.io knows about.", + "operationId": "ListExchanges", "parameters": [ { - "description": "If true don't trigger overlay", + "description": "Filter by asset class.", "in": "query", - "name": "skip_overlay_trigger", + "name": "asset_class", "schema": { - "default": false, - "type": "boolean" + "description": "An identifier for a group of similar financial instruments.", + "enum": [ + "stocks", + "options", + "crypto", + "fx" + ], + "example": "stocks", + "type": "string" + } + }, + { + "description": "Filter by locale.", + "in": "query", + "name": "locale", + "schema": { + "description": "An identifier for a geographical location.", + "enum": [ + "us", + "global" + ], + "example": "us", + "type": "string" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "cash_amount": { - "description": "The cash amount of the dividend per share owned.", - "type": "number", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - }, - "currency": { - "description": "The currency in which the dividend is paid.", - "type": "string", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - }, - "declaration_date": { - "description": "The date that the dividend was announced.", - "type": "string" - }, - "dividend_type": { - "description": "The type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD.\nSpecial Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC.\nLong-Term and Short-Term capital gain distributions are denoted as LT and ST, respectively.", - "enum": [ - "CD", - "SC", - "LT", - "ST" - ], - "type": "string", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - }, - "ex_dividend_date": { - "description": "The date that the stock first trades without the dividend, determined by the exchange.", - "type": "string", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - }, - "frequency": { - "description": "The number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly).", - "type": "integer", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - }, - "pay_date": { - "description": "The date that the dividend is paid out.", - "type": "string" - }, - "record_date": { - "description": "The date that the stock must be held to receive the dividend, set by the company.", - "type": "string" - }, - "ticker": { - "description": "The ticker symbol of the dividend.", - "type": "string", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - } - }, - "required": [ - "ticker", - "ex_dividend_date", - "frequency", - "cash_amount", - "dividend_type" - ], - "type": "object", - "x-polygon-go-struct-tags": { - "tags": [ - "db" - ] - } - } - } - }, - "description": "Pass the desired dividend in the request body.", - "required": true - }, "responses": { "200": { "content": { "application/json": { "schema": { "properties": { + "count": { + "description": "The total number of results for this request.", + "example": 1, + "type": "integer" + }, "request_id": { + "description": "A request ID assigned by the server.", + "example": "31d59dda-80e5-4721-8496-d0d32a654afe", "type": "string" }, "results": { - "properties": { - "cash_amount": { - "description": "The cash amount of the dividend per share owned.", - "type": "number", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - }, - "currency": { - "description": "The currency in which the dividend is paid.", - "type": "string", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - }, - "declaration_date": { - "description": "The date that the dividend was announced.", - "type": "string" - }, - "dividend_type": { - "description": "The type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD.\nSpecial Cash dividends that have been paid that are infrequent or unusual, and/or can not be expected to occur in the future are denoted as SC.\nLong-Term and Short-Term capital gain distributions are denoted as LT and ST, respectively.", - "enum": [ - "CD", - "SC", - "LT", - "ST" - ], - "type": "string", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - }, - "ex_dividend_date": { - "description": "The date that the stock first trades without the dividend, determined by the exchange.", - "type": "string", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - }, - "frequency": { - "description": "The number of times per year the dividend is paid out. Possible values are 0 (one-time), 1 (annually), 2 (bi-annually), 4 (quarterly), and 12 (monthly).", - "type": "integer", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - }, - "pay_date": { - "description": "The date that the dividend is paid out.", - "type": "string" - }, - "record_date": { - "description": "The date that the stock must be held to receive the dividend, set by the company.", - "type": "string" - }, - "ticker": { - "description": "The ticker symbol of the dividend.", - "type": "string", - "x-polygon-go-field-tags": { - "tags": [ - { - "key": "binding", - "value": "required" - } - ] - } - } - }, - "required": [ - "ticker", - "ex_dividend_date", - "frequency", - "cash_amount", - "dividend_type" - ], - "type": "object", - "x-polygon-go-struct-tags": { - "tags": [ - "db" - ] - } - }, - "status": { - "type": "string" - } - }, - "required": [ - "request_id" - ], - "type": "object" - } - } - }, - "description": "OK" - }, - "400": { - "content": { - "application/json": { - "schema": { - "properties": { - "error": { - "type": "string" - }, - "request_id": { - "type": "string" - }, - "status": { - "type": "string" - } - }, - "required": [ - "request_id", - "error" - ], - "type": "object" - } - } - }, - "description": "the requested update was unable to be performed due to an invalid request body" - }, - "409": { - "content": { - "application/json": { - "schema": { - "properties": { - "error": { - "type": "string" - }, - "request_id": { - "type": "string" - }, - "status": { - "type": "string" - } - }, - "required": [ - "request_id", - "error" - ], - "type": "object" - } - } - }, - "description": "a dividend already exists for this date and ticker" - }, - "default": { - "content": { - "application/json": { - "schema": { - "properties": { - "error": { - "type": "string" - }, - "request_id": { - "type": "string" - }, - "status": { - "type": "string" - } - }, - "required": [ - "request_id", - "error" - ], - "type": "object" - } - } - }, - "description": "unknown error" - } - }, - "summary": "Dividends v3", - "tags": [ - "reference:stocks" - ], - "x-polygon-entitlement-data-type": { - "description": "Reference data", - "name": "reference" - } - } - }, - "/v3/reference/exchanges": { - "get": { - "description": "List all exchanges that Polygon.io knows about.", - "operationId": "ListExchanges", - "parameters": [ - { - "description": "Filter by asset class.", - "in": "query", - "name": "asset_class", - "schema": { - "description": "An identifier for a group of similar financial instruments.", - "enum": [ - "stocks", - "options", - "crypto", - "fx" - ], - "example": "stocks", - "type": "string" - } - }, - { - "description": "Filter by locale.", - "in": "query", - "name": "locale", - "schema": { - "description": "An identifier for a geographical location.", - "enum": [ - "us", - "global" - ], - "example": "us", - "type": "string" - } - } - ], - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "properties": { - "count": { - "description": "The total number of results for this request.", - "example": 1, - "type": "integer" - }, - "request_id": { - "description": "A request ID assigned by the server.", - "example": "31d59dda-80e5-4721-8496-d0d32a654afe", - "type": "string" - }, - "results": { - "items": { - "description": "An entity that reports trades.", - "properties": { - "acronym": { - "description": "A commonly used abbreviation for this exchange.", - "example": "AMEX", - "type": "string" - }, - "asset_class": { - "description": "An identifier for a group of similar financial instruments.", - "enum": [ - "stocks", - "options", - "crypto", - "fx" - ], - "example": "stocks", - "type": "string" - }, - "id": { - "description": "A unique identifier used by Polygon.io for this exchange.", - "example": 1, - "type": "integer" - }, - "locale": { - "description": "An identifier for a geographical location.", - "enum": [ - "us", - "global" - ], - "example": "us", - "type": "string" - }, - "mic": { - "description": "The Market Identifer Code of this exchange (see ISO 10383).", - "example": "XASE", - "type": "string" - }, - "name": { - "description": "Name of this exchange.", - "example": "NYSE American, LLC", - "type": "string" - }, - "operating_mic": { - "description": "The MIC of the entity that operates this exchange.", - "example": "XNYS", - "type": "string" - }, - "participant_id": { - "description": "The ID used by SIP's to represent this exchange.", - "example": "A", - "type": "string" - }, - "type": { - "description": "Represents the type of exchange.", - "enum": [ - "exchange", - "TRF", - "SIP" - ], - "example": "exchange", - "type": "string" - }, - "url": { - "description": "A link to this exchange's website, if one exists.", - "example": "https://www.nyse.com/markets/nyse-american", - "type": "string" + "items": { + "description": "An entity that reports trades.", + "properties": { + "acronym": { + "description": "A commonly used abbreviation for this exchange.", + "example": "AMEX", + "type": "string" + }, + "asset_class": { + "description": "An identifier for a group of similar financial instruments.", + "enum": [ + "stocks", + "options", + "crypto", + "fx" + ], + "example": "stocks", + "type": "string" + }, + "id": { + "description": "A unique identifier used by Polygon.io for this exchange.", + "example": 1, + "type": "integer" + }, + "locale": { + "description": "An identifier for a geographical location.", + "enum": [ + "us", + "global" + ], + "example": "us", + "type": "string" + }, + "mic": { + "description": "The Market Identifer Code of this exchange (see ISO 10383).", + "example": "XASE", + "type": "string" + }, + "name": { + "description": "Name of this exchange.", + "example": "NYSE American, LLC", + "type": "string" + }, + "operating_mic": { + "description": "The MIC of the entity that operates this exchange.", + "example": "XNYS", + "type": "string" + }, + "participant_id": { + "description": "The ID used by SIP's to represent this exchange.", + "example": "A", + "type": "string" + }, + "type": { + "description": "Represents the type of exchange.", + "enum": [ + "exchange", + "TRF", + "SIP" + ], + "example": "exchange", + "type": "string" + }, + "url": { + "description": "A link to this exchange's website, if one exists.", + "example": "https://www.nyse.com/markets/nyse-american", + "type": "string" } }, "required": [ @@ -24926,7 +24919,7 @@ } }, { - "description": "Search by underlying_ticker.", + "description": "Range by underlying_ticker.", "in": "query", "name": "underlying_ticker.gte", "schema": { @@ -24934,7 +24927,7 @@ } }, { - "description": "Search by underlying_ticker.", + "description": "Range by underlying_ticker.", "in": "query", "name": "underlying_ticker.gt", "schema": { @@ -24942,7 +24935,7 @@ } }, { - "description": "Search by underlying_ticker.", + "description": "Range by underlying_ticker.", "in": "query", "name": "underlying_ticker.lte", "schema": { @@ -24950,7 +24943,7 @@ } }, { - "description": "Search by underlying_ticker.", + "description": "Range by underlying_ticker.", "in": "query", "name": "underlying_ticker.lt", "schema": { @@ -24958,7 +24951,7 @@ } }, { - "description": "Search by expiration_date.", + "description": "Range by expiration_date.", "in": "query", "name": "expiration_date.gte", "schema": { @@ -24966,7 +24959,7 @@ } }, { - "description": "Search by expiration_date.", + "description": "Range by expiration_date.", "in": "query", "name": "expiration_date.gt", "schema": { @@ -24974,7 +24967,7 @@ } }, { - "description": "Search by expiration_date.", + "description": "Range by expiration_date.", "in": "query", "name": "expiration_date.lte", "schema": { @@ -24982,7 +24975,7 @@ } }, { - "description": "Search by expiration_date.", + "description": "Range by expiration_date.", "in": "query", "name": "expiration_date.lt", "schema": { @@ -24990,7 +24983,7 @@ } }, { - "description": "Search by strike_price.", + "description": "Range by strike_price.", "in": "query", "name": "strike_price.gte", "schema": { @@ -24998,7 +24991,7 @@ } }, { - "description": "Search by strike_price.", + "description": "Range by strike_price.", "in": "query", "name": "strike_price.gt", "schema": { @@ -25006,7 +24999,7 @@ } }, { - "description": "Search by strike_price.", + "description": "Range by strike_price.", "in": "query", "name": "strike_price.lte", "schema": { @@ -25014,7 +25007,7 @@ } }, { - "description": "Search by strike_price.", + "description": "Range by strike_price.", "in": "query", "name": "strike_price.lt", "schema": { @@ -25667,7 +25660,7 @@ }, "/v3/reference/tickers": { "get": { - "description": "Query all ticker symbols which are supported by Polygon.io. This API currently includes Stocks/Equities, Crypto, and Forex.", + "description": "Query all ticker symbols which are supported by Polygon.io. This API currently includes Stocks/Equities, Indices, Forex, and Crypto.", "operationId": "ListTickers", "parameters": [ { @@ -25780,7 +25773,7 @@ } }, { - "description": "Search by ticker.", + "description": "Range by ticker.", "in": "query", "name": "ticker.gte", "schema": { @@ -25788,7 +25781,7 @@ } }, { - "description": "Search by ticker.", + "description": "Range by ticker.", "in": "query", "name": "ticker.gt", "schema": { @@ -25796,7 +25789,7 @@ } }, { - "description": "Search by ticker.", + "description": "Range by ticker.", "in": "query", "name": "ticker.lte", "schema": { @@ -25804,7 +25797,7 @@ } }, { - "description": "Search by ticker.", + "description": "Range by ticker.", "in": "query", "name": "ticker.lt", "schema": { @@ -26465,54 +26458,771 @@ "description": "The type of the asset. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types).", "type": "string" }, - "weighted_shares_outstanding": { - "description": "The shares outstanding calculated assuming all shares of other share classes are converted to this share class.", - "format": "double", - "type": "number" + "weighted_shares_outstanding": { + "description": "The shares outstanding calculated assuming all shares of other share classes are converted to this share class.", + "format": "double", + "type": "number" + } + }, + "required": [ + "ticker", + "name", + "market", + "locale", + "active", + "currency_name" + ], + "type": "object", + "x-polygon-go-type": { + "name": "ReferenceTicker", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "ticker,name,market,locale,primary_exchange,type,active,currency_name,cik,composite_figi,share_class_figi,share_class_shares_outstanding,weighted_shares_outstanding,round_lot,market_cap,phone_number,address1,city,state,postal_code,sic_code,sic_description,ticker_root,total_employees,list_date,homepage_url,description,branding/logo_url,branding/icon_url\nAAPL,Apple Inc.,stocks,us,XNAS,CS,true,usd,0000320193,BBG000B9XRY4,BBG001S5N8V8,16406400000,16334371000,100,2771126040150,(408) 996-1010,One Apple Park Way,Cupertino,CA,95014,3571,ELECTRONIC COMPUTERS,AAPL,154000,1980-12-12,https://www.apple.com,\"Apple designs a wide variety of consumer electronic devices, including smartphones (iPhone), tablets (iPad), PCs (Mac), smartwatches (Apple Watch), AirPods, and TV boxes (Apple TV), among others. The iPhone makes up the majority of Apple's total revenue. In addition, Apple offers its customers a variety of services such as Apple Music, iCloud, Apple Care, Apple TV+, Apple Arcade, Apple Card, and Apple Pay, among others. Apple's products run internally developed software and semiconductors, and the firm is well known for its integration of hardware, software and services. Apple's products are distributed online as well as through company-owned stores and third-party retailers. The company generates roughly 40% of its revenue from the Americas, with the remainder earned internationally.\",https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-01-10_logo.svg,https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-01-10_icon.png\n", + "schema": { + "type": "string" + } + } + }, + "description": "Reference Tickers." + }, + "401": { + "description": "Unauthorized - Check our API Key and account status" + } + }, + "summary": "Ticker Details v3", + "tags": [ + "reference:tickers:get" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + } + } + }, + "/v3/snapshot": { + "get": { + "description": "Get snapshots for assets of all types", + "operationId": "Snapshots", + "parameters": [ + { + "in": "query", + "name": "ticker", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "anyOf": { + "description": "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.\n\nWarning: The maximum number of characters allowed in a URL are subject to your technology stack.\n", + "enabled": true, + "example": "NCLH,O:SPY250321C00380000,C:EURUSD,X:BTCUSD,I:SPX" + }, + "range": true, + "type": "string" + } + }, + { + "description": "Query by the type of asset.", + "in": "query", + "name": "type", + "schema": { + "enum": [ + "stocks", + "options", + "crypto", + "fx", + "indices" + ], + "type": "string" + } + }, + { + "description": "Range by ticker.", + "in": "query", + "name": "ticker.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by ticker.", + "in": "query", + "name": "ticker.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by ticker.", + "in": "query", + "name": "ticker.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by ticker.", + "in": "query", + "name": "ticker.lt", + "schema": { + "type": "string" + } + }, + { + "description": "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.\n\nWarning: The maximum number of characters allowed in a URL are subject to your technology stack.\n", + "example": "NCLH,O:SPY250321C00380000,C:EURUSD,X:BTCUSD,I:SPX", + "in": "query", + "name": "ticker.any_of", + "schema": { + "type": "string" + } + }, + { + "description": "Order results based on the `sort` field.", + "in": "query", + "name": "order", + "schema": { + "enum": [ + "asc", + "desc" + ], + "example": "asc", + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 250.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 250, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "ticker", + "enum": [ + "ticker" + ], + "example": "ticker", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "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" + }, + "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" + } + }, + { + "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" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "type": "string" + }, + "results": { + "items": { + "properties": { + "break_even_price": { + "description": "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).", + "format": "double", + "type": "number" + }, + "details": { + "description": "The details for this contract.", + "properties": { + "contract_type": { + "description": "The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\".", + "enum": [ + "put", + "call", + "other" + ], + "type": "string" + }, + "exercise_style": { + "description": "The exercise style of this contract. See \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://en.wikipedia.org/wiki/Option_style\"\u003ethis link\u003c/a\u003e for more details on exercise styles.", + "enum": [ + "american", + "european", + "bermudan" + ], + "type": "string" + }, + "expiration_date": { + "description": "The contract's expiration date in YYYY-MM-DD format.", + "format": "date", + "type": "string", + "x-polygon-go-type": { + "name": "IDaysPolygonDateString", + "path": "github.com/polygon-io/ptime" + } + }, + "shares_per_contract": { + "description": "The number of shares per contract for this contract.", + "type": "number" + }, + "strike_price": { + "description": "The strike price of the option contract.", + "format": "double", + "type": "number" + } + }, + "required": [ + "contract_type", + "exercise_style", + "expiration_date", + "shares_per_contract", + "strike_price" + ], + "type": "object" + }, + "error": { + "description": "The error while looking for this ticker.", + "type": "string" + }, + "greeks": { + "description": "The greeks for this contract. \nThere are certain circumstances where greeks will not be returned, such as options contracts that are deep in the money.\nSee this \u003ca href=\"https://polygon.io/blog/greeks-and-implied-volatility/#testing\"\nalt=\"link\"\u003earticle\u003c/a\u003e for more information.", + "properties": { + "delta": { + "description": "The change in the option's price per $0.01 increment in the price of the underlying asset.", + "format": "double", + "type": "number" + }, + "gamma": { + "description": "The change in delta per $0.01 change in the price of the underlying asset.", + "format": "double", + "type": "number" + }, + "theta": { + "description": "The change in the option's price per day.", + "format": "double", + "type": "number" + }, + "vega": { + "description": "The change in the option's price per 1% increment in volatility.", + "format": "double", + "type": "number" + } + }, + "required": [ + "delta", + "gamma", + "theta", + "vega" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Greeks" + } + }, + "implied_volatility": { + "description": "The market's forecast for the volatility of the underlying asset, based on this option's current price.", + "format": "double", + "type": "number" + }, + "last_quote": { + "description": "The most recent quote for this contract. This is only returned if your current plan includes quotes.", + "properties": { + "ask": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "ask_exchange": { + "description": "The ask side exchange ID. See \u003ca href=\"https://polygon.io/docs/options/get_v3_reference_exchanges\" alt=\"Exchanges\"\u003eExchanges\u003c/a\u003e for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "ask_size": { + "description": "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.", + "format": "double", + "type": "number" + }, + "bid": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "bid_exchange": { + "description": "The bid side exchange ID. See \u003ca href=\"https://polygon.io/docs/options/get_v3_reference_exchanges\" alt=\"Exchanges\"\u003eExchanges\u003c/a\u003e for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "bid_size": { + "description": "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.", + "format": "double", + "type": "number" + }, + "last_updated": { + "description": "The nanosecond timestamp of when this information was updated.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "midpoint": { + "description": "The average of the bid and ask price.", + "format": "double", + "type": "number" + }, + "timeframe": { + "description": "The time relevance of the data.", + "enum": [ + "DELAYED", + "REAL-TIME" + ], + "type": "string" + } + }, + "required": [ + "last_updated", + "timeframe", + "ask", + "bid", + "last_updated", + "timeframe" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SnapshotLastQuote" + } + }, + "last_trade": { + "description": "The most recent quote for this contract. This is only returned if your current plan includes quotes.", + "properties": { + "conditions": { + "description": "A list of condition codes.", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/stocks/get_v3_reference_conditions)\nfor a mapping to exchange conditions.", + "format": "int32", + "type": "integer" + }, + "type": "array" + }, + "exchange": { + "description": "The exchange ID. See \u003ca href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\"\u003eExchanges\u003c/a\u003e for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "id": { + "description": "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.", + "type": "string" + }, + "last_updated": { + "description": "The nanosecond timestamp of when this information was updated.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "participant_timestamp": { + "description": "The nanosecond Exchange Unix Timestamp. This is the timestamp of when the trade was generated at the exchange.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "price": { + "description": "The price of the trade. This is the actual dollar value per whole share of\nthis trade. A trade of 100 shares with a price of $2.00 would be worth a\ntotal dollar value of $200.00.", + "format": "double", + "type": "number" + }, + "sip_timestamp": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this trade from the exchange which produced it.", + "format": "int64", + "type": "integer" + }, + "size": { + "description": "The size of a trade (also known as volume).", + "format": "int32", + "type": "integer" + }, + "timeframe": { + "description": "The time relevance of the data.", + "enum": [ + "DELAYED", + "REAL-TIME" + ], + "type": "string" + } + }, + "required": [ + "last_updated", + "timeframe", + "participant_timestamp", + "price", + "size" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SnapshotLastTrade" + } + }, + "market_status": { + "description": "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.\nPossible values for indices snapshots are regular_trading, closed, early_trading, and late_trading.", + "type": "string" + }, + "message": { + "description": "The error message while looking for this ticker.", + "type": "string" + }, + "name": { + "description": "The name of this contract.", + "type": "string" + }, + "open_interest": { + "description": "The quantity of this contract held at the end of the last trading day.", + "format": "double", + "type": "number" + }, + "session": { + "properties": { + "change": { + "description": "The value of the price change for the asset from the previous trading day.", + "format": "double", + "type": "number" + }, + "change_percent": { + "description": "The percent of the price change for the asset from the previous trading day.", + "format": "double", + "type": "number" + }, + "close": { + "description": "The closing price of the asset for the day.", + "format": "double", + "type": "number" + }, + "early_trading_change": { + "description": "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.", + "format": "double", + "type": "number" + }, + "early_trading_change_percent": { + "description": "Today's early trading change as a percentage.", + "format": "double", + "type": "number" + }, + "high": { + "description": "The highest price of the asset for the day.", + "format": "double", + "type": "number" + }, + "late_trading_change": { + "description": "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.", + "format": "double", + "type": "number" + }, + "late_trading_change_percent": { + "description": "Today's late trading change as a percentage.", + "format": "double", + "type": "number" + }, + "low": { + "description": "The lowest price of the asset for the day.", + "format": "double", + "type": "number" + }, + "open": { + "description": "The open price of the asset for the day.", + "format": "double", + "type": "number" + }, + "previous_close": { + "description": "The closing price of the asset for the previous trading day.", + "format": "double", + "type": "number" + }, + "price": { + "description": "The price of the most recent trade or bid price for this asset.", + "format": "double", + "type": "number" + }, + "volume": { + "description": "The trading volume for the asset for the day.", + "format": "double", + "type": "number" + } + }, + "required": [ + "change", + "change_percent", + "close", + "high", + "low", + "open", + "previous_close" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Session" + } + }, + "ticker": { + "description": "The ticker symbol for the asset.", + "type": "string" + }, + "type": { + "description": "The asset class for this ticker.", + "enum": [ + "stocks", + "options", + "fx", + "crypto" + ], + "type": "string" + }, + "underlying_asset": { + "description": "Information on the underlying stock for this options contract. The market data returned depends on your current stocks plan.", + "properties": { + "change_to_break_even": { + "description": "The change in price for the contract to break even.", + "format": "double", + "type": "number" + }, + "last_updated": { + "description": "The nanosecond timestamp of when this information was updated.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "price": { + "description": "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.", + "format": "double", + "type": "number" + }, + "ticker": { + "description": "The ticker symbol for the contract's underlying asset.", + "type": "string" + }, + "timeframe": { + "description": "The time relevance of the data.", + "enum": [ + "DELAYED", + "REAL-TIME" + ], + "type": "string" + }, + "value": { + "description": "The value of the underlying index.", + "format": "double", + "type": "number" + } + }, + "required": [ + "last_updated", + "timeframe", + "ticker", + "change_to_break_even" + ], + "type": "object", + "x-polygon-go-type": { + "name": "UnderlyingAsset" + } + }, + "value": { + "description": "Value of Index.", + "type": "number" + } + }, + "required": [ + "ticker" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SnapshotResponseModel" } }, - "required": [ - "ticker", - "name", - "market", - "locale", - "active", - "currency_name" - ], - "type": "object", - "x-polygon-go-type": { - "name": "ReferenceTicker", - "path": "github.com/polygon-io/go-lib-models/v2/globals" - } + "type": "array" }, "status": { "description": "The status of this request's response.", "type": "string" } }, + "required": [ + "status", + "request_id" + ], "type": "object" } - }, - "text/csv": { - "example": "ticker,name,market,locale,primary_exchange,type,active,currency_name,cik,composite_figi,share_class_figi,share_class_shares_outstanding,weighted_shares_outstanding,round_lot,market_cap,phone_number,address1,city,state,postal_code,sic_code,sic_description,ticker_root,total_employees,list_date,homepage_url,description,branding/logo_url,branding/icon_url\nAAPL,Apple Inc.,stocks,us,XNAS,CS,true,usd,0000320193,BBG000B9XRY4,BBG001S5N8V8,16406400000,16334371000,100,2771126040150,(408) 996-1010,One Apple Park Way,Cupertino,CA,95014,3571,ELECTRONIC COMPUTERS,AAPL,154000,1980-12-12,https://www.apple.com,\"Apple designs a wide variety of consumer electronic devices, including smartphones (iPhone), tablets (iPad), PCs (Mac), smartwatches (Apple Watch), AirPods, and TV boxes (Apple TV), among others. The iPhone makes up the majority of Apple's total revenue. In addition, Apple offers its customers a variety of services such as Apple Music, iCloud, Apple Care, Apple TV+, Apple Arcade, Apple Card, and Apple Pay, among others. Apple's products run internally developed software and semiconductors, and the firm is well known for its integration of hardware, software and services. Apple's products are distributed online as well as through company-owned stores and third-party retailers. The company generates roughly 40% of its revenue from the Americas, with the remainder earned internationally.\",https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-01-10_logo.svg,https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-01-10_icon.png\n", - "schema": { - "type": "string" - } } }, - "description": "Reference Tickers." - }, - "401": { - "description": "Unauthorized - Check our API Key and account status" + "description": "Snapshots for the ticker list" } }, - "summary": "Ticker Details v3", - "tags": [ - "reference:tickers:get" + "summary": "Universal Snapshot", + "x-polygon-entitlement-allowed-timeframes": [ + { + "description": "Real Time Data", + "name": "realtime" + }, + { + "description": "15 minute delayed data", + "name": "delayed" + } ], "x-polygon-entitlement-data-type": { - "description": "Reference data", - "name": "reference" + "description": "Snapshot data", + "name": "snapshots" + }, + "x-polygon-entitlement-market-type": { + "description": "All asset classes", + "name": "universal" + }, + "x-polygon-paginate": { + "limit": { + "default": 10, + "max": 250, + "min": 1 + }, + "sort": { + "default": "ticker", + "enum": [ + "ticker" + ] + } } } }, @@ -26523,12 +27233,94 @@ "parameters": [ { "description": "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.\n\nWarning: The maximum number of characters allowed in a URL are subject to your technology stack.", - "example": "I:SPX", + "example": "I:DJI", "in": "query", "name": "ticker.any_of", "schema": { "type": "string" } + }, + { + "description": "Search a range of tickers lexicographically.", + "in": "query", + "name": "ticker", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true, + "type": "string" + } + }, + { + "description": "Range by ticker.", + "in": "query", + "name": "ticker.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by ticker.", + "in": "query", + "name": "ticker.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by ticker.", + "in": "query", + "name": "ticker.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by ticker.", + "in": "query", + "name": "ticker.lt", + "schema": { + "type": "string" + } + }, + { + "description": "Order results based on the `sort` field.", + "in": "query", + "name": "order", + "schema": { + "enum": [ + "asc", + "desc" + ], + "example": "asc", + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 250.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 250, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "ticker", + "enum": [ + "ticker" + ], + "example": "ticker", + "type": "string" + } } ], "responses": { @@ -26539,8 +27331,9 @@ "request_id": "6a7e466379af0a71039d60cc78e72282", "results": [ { + "last_updated": 1679597116344223500, "market_status": "closed", - "name": "S\u0026P 500", + "name": "Dow Jones Industrial Average", "session": { "change": -50.01, "change_percent": -1.45, @@ -26550,7 +27343,7 @@ "open": 3827.38, "previous_close": 3812.19 }, - "ticker": "I:SPX", + "ticker": "I:DJI", "timeframe": "REAL-TIME", "type": "indices", "value": 3822.39 @@ -26570,6 +27363,10 @@ }, "schema": { "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, "request_id": { "type": "string" }, @@ -26580,6 +27377,15 @@ "description": "The error while looking for this ticker.", "type": "string" }, + "last_updated": { + "description": "The nanosecond timestamp of when this information was updated.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + }, "market_status": { "description": "The market status for the market that trades this ticker.", "type": "string" @@ -26639,6 +27445,14 @@ "description": "Ticker of asset queried.", "type": "string" }, + "timeframe": { + "description": "The time relevance of the data.", + "enum": [ + "DELAYED", + "REAL-TIME" + ], + "type": "string" + }, "type": { "description": "The indices market.", "enum": [ @@ -26652,7 +27466,9 @@ } }, "required": [ - "ticker" + "ticker", + "timeframe", + "last_updated" ], "type": "object", "x-polygon-go-type": { @@ -26698,6 +27514,18 @@ "x-polygon-entitlement-market-type": { "description": "Indices data", "name": "indices" + }, + "x-polygon-paginate": { + "limit": { + "default": 10, + "max": 250 + }, + "sort": { + "default": "ticker", + "enum": [ + "ticker" + ] + } } } }, @@ -26708,7 +27536,7 @@ "parameters": [ { "description": "The underlying ticker symbol of the option contract.", - "example": "AAPL", + "example": "EVRI", "in": "path", "name": "underlyingAsset", "required": true, @@ -26752,7 +27580,7 @@ } }, { - "description": "Search by strike_price.", + "description": "Range by strike_price.", "in": "query", "name": "strike_price.gte", "schema": { @@ -26760,7 +27588,7 @@ } }, { - "description": "Search by strike_price.", + "description": "Range by strike_price.", "in": "query", "name": "strike_price.gt", "schema": { @@ -26768,7 +27596,7 @@ } }, { - "description": "Search by strike_price.", + "description": "Range by strike_price.", "in": "query", "name": "strike_price.lte", "schema": { @@ -26776,7 +27604,7 @@ } }, { - "description": "Search by strike_price.", + "description": "Range by strike_price.", "in": "query", "name": "strike_price.lt", "schema": { @@ -26784,7 +27612,7 @@ } }, { - "description": "Search by expiration_date.", + "description": "Range by expiration_date.", "in": "query", "name": "expiration_date.gte", "schema": { @@ -26792,7 +27620,7 @@ } }, { - "description": "Search by expiration_date.", + "description": "Range by expiration_date.", "in": "query", "name": "expiration_date.gt", "schema": { @@ -26800,7 +27628,7 @@ } }, { - "description": "Search by expiration_date.", + "description": "Range by expiration_date.", "in": "query", "name": "expiration_date.lte", "schema": { @@ -26808,7 +27636,7 @@ } }, { - "description": "Search by expiration_date.", + "description": "Range by expiration_date.", "in": "query", "name": "expiration_date.lt", "schema": { @@ -26935,7 +27763,7 @@ "items": { "properties": { "break_even_price": { - "description": "The price the underlying asset for the contract to break even. For a call this value is (strike price + premium paid), where a put this value is (strike price - premium paid)", + "description": "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).", "format": "double", "type": "number" }, @@ -27016,6 +27844,7 @@ } }, "details": { + "description": "The details for this contract.", "properties": { "contract_type": { "description": "The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\".", @@ -27054,7 +27883,7 @@ "type": "number" }, "ticker": { - "description": "The ticker for the option contract.", + "description": "The ticker symbol for the asset.", "type": "string" } }, @@ -27072,7 +27901,7 @@ } }, "greeks": { - "description": "The greeks for this contract. This is only returned if your current plan includes greeks.", + "description": "The greeks for this contract. \nThere are certain circumstances where greeks will not be returned, such as options contracts that are deep in the money.\nSee this \u003ca href=\"https://polygon.io/blog/greeks-and-implied-volatility/#testing\"\nalt=\"link\"\u003earticle\u003c/a\u003e for more information.", "properties": { "delta": { "description": "The change in the option's price per $0.01 increment in the price of the underlying asset.", @@ -27095,6 +27924,12 @@ "type": "number" } }, + "required": [ + "delta", + "gamma", + "theta", + "vega" + ], "type": "object", "x-polygon-go-type": { "name": "Greeks" @@ -27113,6 +27948,11 @@ "format": "double", "type": "number" }, + "ask_exchange": { + "description": "The ask side exchange ID. See \u003ca href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\"\u003eExchanges\u003c/a\u003e for Polygon.io's mapping of exchange IDs.", + "format": "int32", + "type": "number" + }, "ask_size": { "description": "The ask size.", "format": "double", @@ -27123,6 +27963,11 @@ "format": "double", "type": "number" }, + "bid_exchange": { + "description": "The bid side exchange ID. See \u003ca href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\"\u003eExchanges\u003c/a\u003e for Polygon.io's mapping of exchange IDs.", + "format": "int32", + "type": "number" + }, "bid_size": { "description": "The bid size.", "format": "double", @@ -27279,8 +28124,8 @@ "last_quote", "underlying_asset", "details", + "cha", "break_even_price", - "implied_volatility", "open_interest" ], "type": "object", @@ -27351,7 +28196,7 @@ "parameters": [ { "description": "The underlying ticker symbol of the option contract.", - "example": "AAPL", + "example": "EVRI", "in": "path", "name": "underlyingAsset", "required": true, @@ -27361,7 +28206,7 @@ }, { "description": "The option contract identifier.", - "example": "O:AAPL230616C00150000", + "example": "O:EVRI240119C00002500", "in": "path", "name": "optionContract", "required": true, @@ -27407,8 +28252,10 @@ "implied_volatility": 0.3048997097864957, "last_quote": { "ask": 21.25, + "ask_exchange": 301, "ask_size": 110, "bid": 20.9, + "bid_exchange": 301, "bid_size": 172, "last_updated": 1636573458756383500, "midpoint": 21.075, @@ -27447,7 +28294,7 @@ "results": { "properties": { "break_even_price": { - "description": "The price the underlying asset for the contract to break even. For a call this value is (strike price + premium paid), where a put this value is (strike price - premium paid)", + "description": "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).", "format": "double", "type": "number" }, @@ -27528,6 +28375,7 @@ } }, "details": { + "description": "The details for this contract.", "properties": { "contract_type": { "description": "The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\".", @@ -27566,7 +28414,7 @@ "type": "number" }, "ticker": { - "description": "The ticker for the option contract.", + "description": "The ticker symbol for the asset.", "type": "string" } }, @@ -27584,7 +28432,7 @@ } }, "greeks": { - "description": "The greeks for this contract. This is only returned if your current plan includes greeks.", + "description": "The greeks for this contract. \nThere are certain circumstances where greeks will not be returned, such as options contracts that are deep in the money.\nSee this \u003ca href=\"https://polygon.io/blog/greeks-and-implied-volatility/#testing\"\nalt=\"link\"\u003earticle\u003c/a\u003e for more information.", "properties": { "delta": { "description": "The change in the option's price per $0.01 increment in the price of the underlying asset.", @@ -27607,6 +28455,12 @@ "type": "number" } }, + "required": [ + "delta", + "gamma", + "theta", + "vega" + ], "type": "object", "x-polygon-go-type": { "name": "Greeks" @@ -27625,6 +28479,11 @@ "format": "double", "type": "number" }, + "ask_exchange": { + "description": "The ask side exchange ID. See \u003ca href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\"\u003eExchanges\u003c/a\u003e for Polygon.io's mapping of exchange IDs.", + "format": "int32", + "type": "number" + }, "ask_size": { "description": "The ask size.", "format": "double", @@ -27635,6 +28494,11 @@ "format": "double", "type": "number" }, + "bid_exchange": { + "description": "The bid side exchange ID. See \u003ca href=\"https://polygon.io/docs/stocks/get_v3_reference_exchanges\" alt=\"Exchanges\"\u003eExchanges\u003c/a\u003e for Polygon.io's mapping of exchange IDs.", + "format": "int32", + "type": "number" + }, "bid_size": { "description": "The bid size.", "format": "double", @@ -27791,8 +28655,8 @@ "last_quote", "underlying_asset", "details", + "cha", "break_even_price", - "implied_volatility", "open_interest" ], "type": "object", @@ -27873,7 +28737,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -27881,7 +28745,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -27889,7 +28753,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -27897,7 +28761,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -28024,6 +28888,12 @@ "type": "number" } }, + "required": [ + "exchange", + "price", + "size", + "id" + ], "type": "object" }, "type": "array" @@ -28033,6 +28903,9 @@ "type": "string" } }, + "required": [ + "status" + ], "type": "object" } }, @@ -28110,7 +28983,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -28118,7 +28991,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -28126,7 +28999,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -28134,7 +29007,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -28267,6 +29140,12 @@ "type": "number" } }, + "required": [ + "exchange", + "price", + "sip_timestamp", + "size" + ], "type": "object" }, "type": "array" @@ -28276,6 +29155,9 @@ "type": "string" } }, + "required": [ + "status" + ], "type": "object" } }, @@ -28346,7 +29228,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gte", "schema": { @@ -28354,7 +29236,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.gt", "schema": { @@ -28362,7 +29244,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lte", "schema": { @@ -28370,7 +29252,7 @@ } }, { - "description": "Search by timestamp.", + "description": "Range by timestamp.", "in": "query", "name": "timestamp.lt", "schema": { @@ -28541,7 +29423,19 @@ } } }, - "type": "object" + "required": [ + "exchange", + "id", + "price", + "sequence_number", + "sip_timestamp", + "participant_timestamp", + "size" + ], + "type": "object", + "x-polygon-go-type": { + "name": "CommonTrade" + } }, "type": "array" }, @@ -28550,6 +29444,9 @@ "type": "string" } }, + "required": [ + "status" + ], "type": "object" } }, @@ -29565,7 +30462,8 @@ "/v2/snapshot/locale/global/markets/crypto/tickers", "/v2/snapshot/locale/global/markets/crypto/{direction}", "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}", - "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book" + "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book", + "/v3/snapshot" ] }, { @@ -29655,7 +30553,8 @@ "paths": [ "/v2/snapshot/locale/global/markets/forex/tickers", "/v2/snapshot/locale/global/markets/forex/{direction}", - "/v2/snapshot/locale/global/markets/forex/tickers/{ticker}" + "/v2/snapshot/locale/global/markets/forex/tickers/{ticker}", + "/v3/snapshot" ] }, { @@ -29726,7 +30625,8 @@ { "group": "Snapshots", "paths": [ - "/v3/snapshot/indices" + "/v3/snapshot/indices", + "/v3/snapshot" ] } ], @@ -29796,7 +30696,8 @@ "group": "Snapshots", "paths": [ "/v3/snapshot/options/{underlyingAsset}/{optionContract}", - "/v3/snapshot/options/{underlyingAsset}" + "/v3/snapshot/options/{underlyingAsset}", + "/v3/snapshot" ] }, { @@ -29931,7 +30832,8 @@ "paths": [ "/v2/snapshot/locale/us/markets/stocks/tickers", "/v2/snapshot/locale/us/markets/stocks/{direction}", - "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}" + "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}", + "/v3/snapshot" ] }, { diff --git a/go.mod b/go.mod index 9038c4cd..fcf6731f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/polygon-io/client-go -go 1.20 +go 1.21 require ( github.com/cenkalti/backoff/v4 v4.2.1 diff --git a/go.sum b/go.sum index ba9e5cc5..7cd9ec48 100644 --- a/go.sum +++ b/go.sum @@ -7,6 +7,7 @@ github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/form/v4 v4.2.1 h1:HjdRDKO0fftVMU5epjPW2SOREcZ6/wLUzEobqUGJuPw= github.com/go-playground/form/v4 v4.2.1/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= @@ -24,6 +25,7 @@ github.com/jarcoal/httpmock v1.3.1/go.mod h1:3yb8rc4BI7TCBhFY8ng0gjuLKJNquuDNiPa github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/maxatome/go-testdeep v1.12.0 h1:Ql7Go8Tg0C1D/uMMX59LAoYK7LffeJQ6X2T04nTH68g= +github.com/maxatome/go-testdeep v1.12.0/go.mod h1:lPZc/HAcJMP92l7yI6TRz1aZN5URwUBUAfUNvrclaNM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= diff --git a/rest/models/snapshot.go b/rest/models/snapshot.go index e07b98af..7418e17c 100644 --- a/rest/models/snapshot.go +++ b/rest/models/snapshot.go @@ -224,6 +224,7 @@ type TickerSnapshot struct { TodaysChange float64 `json:"todaysChange,omitempty"` TodaysChangePerc float64 `json:"todaysChangePerc,omitempty"` Updated Nanos `json:"updated,omitempty"` + FairMarketValue float64 `json:"fmv,omitempty"` } // DaySnapshot is the most recent day agg for a ticker. @@ -282,6 +283,7 @@ type OptionContractSnapshot struct { LastTrade LastTradeOptionContractSnapshot `json:"last_trade,omitempty"` OpenInterest float64 `json:"open_interest,omitempty"` UnderlyingAsset UnderlyingAsset `json:"underlying_asset,omitempty"` + FairMarketValue float64 `json:"fmv,omitempty"` } // IndexSnapshot is a collection of data for an index ticker including the current session information and the most recent value. @@ -454,6 +456,7 @@ type SnapshotResponseModel struct { Value float64 `json:"value,omitempty"` LastUpdated int64 `json:"last_updated,omitempty"` Timeframe string `json:"timeframe,omitempty"` + FairMarketValue float64 `json:"fmv,omitempty"` Error string `json:"error"` Message string `json:"message"` } diff --git a/websocket/config.go b/websocket/config.go index d8f7250f..278b5925 100644 --- a/websocket/config.go +++ b/websocket/config.go @@ -51,13 +51,19 @@ func (c *Config) validate() error { type Feed string const ( - Delayed Feed = "wss://delayed.polygon.io" - RealTime Feed = "wss://socket.polygon.io" - Nasdaq Feed = "wss://nasdaqfeed.polygon.io" - PolyFeed Feed = "wss://polyfeed.polygon.io" - PolyFeedPlus Feed = "wss://polyfeedplus.polygon.io" - StarterFeed Feed = "wss://starterfeed.polygon.io" - LaunchpadFeed Feed = "wss://launchpad.polygon.io" + Delayed Feed = "wss://delayed.polygon.io" + RealTime Feed = "wss://socket.polygon.io" + Nasdaq Feed = "wss://nasdaqfeed.polygon.io" + PolyFeed Feed = "wss://polyfeed.polygon.io" + PolyFeedPlus Feed = "wss://polyfeedplus.polygon.io" + StarterFeed Feed = "wss://starterfeed.polygon.io" + LaunchpadFeed Feed = "wss://launchpad.polygon.io" + BusinessFeed Feed = "wss://business.polygon.io" + EdgxBusinessFeed Feed = "wss://edgx-business.polygon.io" + DelayedBusinessFeed Feed = "wss://delayed-business.polygon.io" + FullMarketBusinessFeed Feed = "wss://fullmarket-business.polygon.io" + NasdaqfeedLastSaleBusinessFeed Feed = "wss://nasdaqfeed-last-sale-business.polygon.io" + NasdaqfeedBasicBusinessFeed Feed = "wss://nasdaqfeed-basic-business.polygon.io" ) // Market is the type of market (e.g. Stocks, Crypto) used to connect to the server. @@ -112,23 +118,27 @@ const ( optionsMax Topic = 37 forexMin Topic = 50 - ForexMinAggs Topic = 51 - ForexQuotes Topic = 52 - ForexLaunchpadMinAggs Topic = 53 - ForexLaunchpadValue Topic = 54 - forexMax Topic = 55 + ForexSecAggs Topic = 51 + ForexMinAggs Topic = 52 + ForexQuotes Topic = 53 + ForexLaunchpadMinAggs Topic = 54 + ForexLaunchpadValue Topic = 55 + forexMax Topic = 56 cryptoMin Topic = 70 - CryptoMinAggs Topic = 71 - CryptoTrades Topic = 72 - CryptoQuotes Topic = 73 - CryptoL2Book Topic = 74 - CryptoLaunchpadMinAggs Topic = 75 - CryptoLaunchpadValue Topic = 76 - cryptoMax Topic = 77 + CryptoSecAggs Topic = 71 + CryptoMinAggs Topic = 72 + CryptoTrades Topic = 73 + CryptoQuotes Topic = 74 + CryptoL2Book Topic = 75 + CryptoLaunchpadMinAggs Topic = 76 + CryptoLaunchpadValue Topic = 77 + cryptoMax Topic = 78 IndexMinAggs Topic = 90 IndexValue Topic = 91 + + BusinuessFairMarketValue Topic = 100 ) func (t Topic) prefix() string { @@ -161,6 +171,8 @@ func (t Topic) prefix() string { return "AM" case OptionsLaunchpadValue: return "LV" + case ForexSecAggs: + return "CAS" case ForexMinAggs: return "CA" case ForexQuotes: @@ -169,6 +181,8 @@ func (t Topic) prefix() string { return "AM" case ForexLaunchpadValue: return "LV" + case CryptoSecAggs: + return "XAS" case CryptoMinAggs: return "XA" case CryptoTrades: @@ -185,6 +199,8 @@ func (t Topic) prefix() string { return "AM" case IndexValue: return "V" + case BusinuessFairMarketValue: + return "FMV" } return "" } diff --git a/websocket/models/models.go b/websocket/models/models.go index f42ed76d..eecc1a94 100644 --- a/websocket/models/models.go +++ b/websocket/models/models.go @@ -389,3 +389,17 @@ type LaunchpadValue struct { // The Timestamp in nanoseconds. Timestamp int64 `json:"t,omitempty"` } + +type FairMarketValue struct { + // The event type. + EventType + + // The value. + FMV float64 `json:"fmv"` + + // The ticker symbol for the given security. + Ticker string `json:"sym"` + + // The Timestamp in nanoseconds. + Timestamp int64 `json:"t,omitempty"` +} From d8b17d1cabfc7a9e9b1374290544a8872f5e0e79 Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:00:40 -0400 Subject: [PATCH 02/13] include fmv in test cases to get better coverage --- rest/snapshot_test.go | 44 +++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/rest/snapshot_test.go b/rest/snapshot_test.go index c7b5c90d..9bcea3ad 100644 --- a/rest/snapshot_test.go +++ b/rest/snapshot_test.go @@ -62,7 +62,8 @@ var snapshot1 = `{ "ticker": "BCAT", "todaysChange": -0.124, "todaysChangePerc": -0.601, - "updated": 1605192894630916600 + "updated": 1605192894630916600, + "fmv": 20.506 }` var snapshot2 = `{ @@ -110,7 +111,8 @@ var snapshot2 = `{ "ticker": "MSFT", "todaysChange": 3.71, "todaysChangePerc": 1.199, - "updated": 1649083047682204000 + "updated": 1649083047682204000, + "fmv": 313.1296 }` func TestListSnapshotAllTickers(t *testing.T) { @@ -260,7 +262,8 @@ func TestGetOptionContractSnapshot(t *testing.T) { "price": 147.951, "ticker": "AAPL", "timeframe": "REAL-TIME" - } + }, + "fmv": 21.075 } }` @@ -332,7 +335,8 @@ func TestListOptionsChainSnapshot(t *testing.T) { "price": 124.94, "ticker": "AAPL", "timeframe": "DELAYED" - } + }, + "fmv": 75.06 }` chain2 := `{ "break_even_price": 162.375, @@ -383,7 +387,8 @@ func TestListOptionsChainSnapshot(t *testing.T) { "price": 124.94, "ticker": "AAPL", "timeframe": "DELAYED" - } + }, + "fmv": 75.06 }` chain3 := `{ "break_even_price": 162.375, @@ -434,7 +439,8 @@ func TestListOptionsChainSnapshot(t *testing.T) { "price": 124.94, "ticker": "AAPL", "timeframe": "DELAYED" - } + }, + "fmv": 75.06 }` expectedResponse := `{ @@ -901,6 +907,7 @@ var optionsSnapshotsTestData = []string{ "ticker": "AAPL", "timeframe": "REAL-TIME" }, + "fmv": 123.1, "error": "", "message": "" }`, @@ -935,6 +942,7 @@ var optionsSnapshotsTestData = []string{ "ticker": "META", "timeframe": "REAL-TIME" }, + "fmv": 200.2, "error": "", "message": "" }`, @@ -968,7 +976,8 @@ var optionsSnapshotsTestData = []string{ "price": 11.93, "ticker": "F", "timeframe": "REAL-TIME" - } + }, + "fmv": 6.97 }`, } @@ -998,7 +1007,8 @@ var cryptoSnapshotsTestData = []string{ "conditions": [ 1 ] - } + }, + "fmv": 27220.3 }`, `{ "market_status": "open", @@ -1025,7 +1035,8 @@ var cryptoSnapshotsTestData = []string{ "conditions": [ 1 ] - } + }, + "fmv": 1816.31 }`, `{ "market_status": "open", @@ -1052,7 +1063,8 @@ var cryptoSnapshotsTestData = []string{ "conditions": [ 1 ] - } + }, + "fmv": 0.784 }`, } @@ -1078,7 +1090,8 @@ var forexSnapshotTestData = []string{ "ask": 1.35191, "bid": 1.35185, "exchange": 48 - } + }, + "fmv": 1.35185 }`, `{ "market_status": "open", @@ -1101,7 +1114,8 @@ var forexSnapshotTestData = []string{ "ask": 0.92883, "bid": 0.92877, "exchange": 48 - } + }, + "fmv": 0.92877 }`, `{ "market_status": "open", @@ -1124,7 +1138,8 @@ var forexSnapshotTestData = []string{ "ask": 1.51297, "bid": 1.51281, "exchange": 48 - } + }, + "fmv": 1.51281 }`, } @@ -1223,7 +1238,8 @@ var partialSuccessWithStocksTestData = []string{ "timeframe": "REAL-TIME" }, "ticker": "AAPL", - "type": "stocks" + "type": "stocks", + "fmv": 173.5 }`, `{ "error": "NOT_ENTITLED", From a313e93abf49f56182aa8c992a4f68f8157db20b Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 18 Oct 2023 15:32:08 +0000 Subject: [PATCH 03/13] chore: Updated coverage badge. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 777ce510..db17575c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Polygon Go Client -![Coverage](https://img.shields.io/badge/Coverage-77.0%25-brightgreen) +![Coverage](https://img.shields.io/badge/Coverage-76.8%25-brightgreen) From d831d854ffbda92dd43a864260e767fc0bc76d9a Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Wed, 18 Oct 2023 17:21:54 -0400 Subject: [PATCH 04/13] update CryptoBook snapshot --- rest/models/snapshot.go | 15 ++++++++------- rest/snapshot_test.go | 3 ++- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/rest/models/snapshot.go b/rest/models/snapshot.go index 7418e17c..1f66582d 100644 --- a/rest/models/snapshot.go +++ b/rest/models/snapshot.go @@ -370,13 +370,14 @@ type UnderlyingAsset struct { // FullBookSnapshot is the level 2 book of a single crypto ticker. type FullBookSnapshot struct { - AskCount float64 `json:"askCount,omitempty"` - Asks []OrderBookQuote `json:"asks,omitempty"` - BidCount float64 `json:"bidCount,omitempty"` - Bids []OrderBookQuote `json:"bids,omitempty"` - Spread float64 `json:"spread,omitempty"` - Ticker string `json:"ticker,omitempty"` - Updated Nanos `json:"updated,omitempty"` + AskCount float64 `json:"askCount,omitempty"` + Asks []OrderBookQuote `json:"asks,omitempty"` + BidCount float64 `json:"bidCount,omitempty"` + Bids []OrderBookQuote `json:"bids,omitempty"` + Spread float64 `json:"spread,omitempty"` + Ticker string `json:"ticker,omitempty"` + FairMarketValue float64 `json:"fmv,omitempty"` + Updated Nanos `json:"updated,omitempty"` } // OrderBookQuote contains quote information for a crypto ticker. diff --git a/rest/snapshot_test.go b/rest/snapshot_test.go index 9bcea3ad..a48ac7f1 100644 --- a/rest/snapshot_test.go +++ b/rest/snapshot_test.go @@ -534,7 +534,8 @@ func TestGetCryptoFullBookSnapshot(t *testing.T) { ], "spread": -4849.17, "ticker": "X:BTCUSD", - "updated": 1605295074162 + "updated": 1605295074162, + "fmv": 16001.56 } }` From 37c8a557824ca58fc0588b48be9e1119ad4b4240 Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Wed, 18 Oct 2023 21:25:45 -0400 Subject: [PATCH 05/13] remove FMV from full book response --- rest/models/snapshot.go | 15 +++++++-------- rest/snapshot_test.go | 3 +-- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/rest/models/snapshot.go b/rest/models/snapshot.go index 1f66582d..7418e17c 100644 --- a/rest/models/snapshot.go +++ b/rest/models/snapshot.go @@ -370,14 +370,13 @@ type UnderlyingAsset struct { // FullBookSnapshot is the level 2 book of a single crypto ticker. type FullBookSnapshot struct { - AskCount float64 `json:"askCount,omitempty"` - Asks []OrderBookQuote `json:"asks,omitempty"` - BidCount float64 `json:"bidCount,omitempty"` - Bids []OrderBookQuote `json:"bids,omitempty"` - Spread float64 `json:"spread,omitempty"` - Ticker string `json:"ticker,omitempty"` - FairMarketValue float64 `json:"fmv,omitempty"` - Updated Nanos `json:"updated,omitempty"` + AskCount float64 `json:"askCount,omitempty"` + Asks []OrderBookQuote `json:"asks,omitempty"` + BidCount float64 `json:"bidCount,omitempty"` + Bids []OrderBookQuote `json:"bids,omitempty"` + Spread float64 `json:"spread,omitempty"` + Ticker string `json:"ticker,omitempty"` + Updated Nanos `json:"updated,omitempty"` } // OrderBookQuote contains quote information for a crypto ticker. diff --git a/rest/snapshot_test.go b/rest/snapshot_test.go index a48ac7f1..9bcea3ad 100644 --- a/rest/snapshot_test.go +++ b/rest/snapshot_test.go @@ -534,8 +534,7 @@ func TestGetCryptoFullBookSnapshot(t *testing.T) { ], "spread": -4849.17, "ticker": "X:BTCUSD", - "updated": 1605295074162, - "fmv": 16001.56 + "updated": 1605295074162 } }` From 2cd89c2be3791b9e6335cd9c5fd7102c48c68bae Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:27:40 -0400 Subject: [PATCH 06/13] spelling --- websocket/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/websocket/config.go b/websocket/config.go index 278b5925..906a0e96 100644 --- a/websocket/config.go +++ b/websocket/config.go @@ -138,7 +138,7 @@ const ( IndexMinAggs Topic = 90 IndexValue Topic = 91 - BusinuessFairMarketValue Topic = 100 + BusinessFairMarketValue Topic = 100 ) func (t Topic) prefix() string { @@ -199,7 +199,7 @@ func (t Topic) prefix() string { return "AM" case IndexValue: return "V" - case BusinuessFairMarketValue: + case BusinessFairMarketValue: return "FMV" } return "" From 02c91007e496cbc86d74ca9d2eb2ac04040fc7fb Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:13:14 -0400 Subject: [PATCH 07/13] update feeds --- websocket/config.go | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/websocket/config.go b/websocket/config.go index 906a0e96..be67e244 100644 --- a/websocket/config.go +++ b/websocket/config.go @@ -51,19 +51,23 @@ func (c *Config) validate() error { type Feed string const ( - Delayed Feed = "wss://delayed.polygon.io" - RealTime Feed = "wss://socket.polygon.io" - Nasdaq Feed = "wss://nasdaqfeed.polygon.io" - PolyFeed Feed = "wss://polyfeed.polygon.io" - PolyFeedPlus Feed = "wss://polyfeedplus.polygon.io" - StarterFeed Feed = "wss://starterfeed.polygon.io" - LaunchpadFeed Feed = "wss://launchpad.polygon.io" - BusinessFeed Feed = "wss://business.polygon.io" - EdgxBusinessFeed Feed = "wss://edgx-business.polygon.io" - DelayedBusinessFeed Feed = "wss://delayed-business.polygon.io" - FullMarketBusinessFeed Feed = "wss://fullmarket-business.polygon.io" - NasdaqfeedLastSaleBusinessFeed Feed = "wss://nasdaqfeed-last-sale-business.polygon.io" - NasdaqfeedBasicBusinessFeed Feed = "wss://nasdaqfeed-basic-business.polygon.io" + Delayed Feed = "wss://delayed.polygon.io" + RealTime Feed = "wss://socket.polygon.io" + Nasdaq Feed = "wss://nasdaqfeed.polygon.io" + PolyFeed Feed = "wss://polyfeed.polygon.io" + PolyFeedPlus Feed = "wss://polyfeedplus.polygon.io" + StarterFeed Feed = "wss://starterfeed.polygon.io" + LaunchpadFeed Feed = "wss://launchpad.polygon.io" + BusinessFeed Feed = "wss://business.polygon.io" + EdgxBusinessFeed Feed = "wss://edgx-business.polygon.io" + DelayedBusinessFeed Feed = "wss://delayed-business.polygon.io" + DelayedEdgxBusinessFeed Feed = "wss://delayed-edgx-business.polygon.io" + DelayedNasdaqLastSaleBusinessFeed Feed = "wss://delayed-nasdaq-last-sale-business.polygon.io" + DelayedNasdaqBasicFeed Feed = "wss://delayed-nasdaq-basic-business.polygon.io" + DelayedFullMarketBusinessFeed Feed = "wss://delayed-fullmarket-business.polygon.io" + FullMarketBusinessFeed Feed = "wss://fullmarket-business.polygon.io" + NasdaqfeedLastSaleBusinessFeed Feed = "wss://nasdaq-last-sale-business.polygon.io" + NasdaqfeedBasicBusinessFeed Feed = "wss://nasdaq-basic-business.polygon.io" ) // Market is the type of market (e.g. Stocks, Crypto) used to connect to the server. From ebaa9ad601fa2d60c27edb7ed881034a2c291ef4 Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:30:31 -0400 Subject: [PATCH 08/13] update names --- websocket/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/websocket/config.go b/websocket/config.go index be67e244..22758a64 100644 --- a/websocket/config.go +++ b/websocket/config.go @@ -66,8 +66,8 @@ const ( DelayedNasdaqBasicFeed Feed = "wss://delayed-nasdaq-basic-business.polygon.io" DelayedFullMarketBusinessFeed Feed = "wss://delayed-fullmarket-business.polygon.io" FullMarketBusinessFeed Feed = "wss://fullmarket-business.polygon.io" - NasdaqfeedLastSaleBusinessFeed Feed = "wss://nasdaq-last-sale-business.polygon.io" - NasdaqfeedBasicBusinessFeed Feed = "wss://nasdaq-basic-business.polygon.io" + NasdaqLastSaleBusinessFeed Feed = "wss://nasdaq-last-sale-business.polygon.io" + NasdaqBasicBusinessFeed Feed = "wss://nasdaq-basic-business.polygon.io" ) // Market is the type of market (e.g. Stocks, Crypto) used to connect to the server. From af8b909d7a9b6c49849e0f5558055060f9ca5413 Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Fri, 20 Oct 2023 12:45:14 -0400 Subject: [PATCH 09/13] add fmv case --- websocket/polygon.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/websocket/polygon.go b/websocket/polygon.go index 0564ef67..6ee030da 100644 --- a/websocket/polygon.go +++ b/websocket/polygon.go @@ -545,6 +545,12 @@ func (c *Client) handleData(eventType string, msg json.RawMessage) { return } c.output <- out + case "FMV": + var out models.FairMarketValue + if err := json.Unmarshal(msg, &out); err != nil { + c.log.Errorf("failed to unmarshal message: %v", err) + } + default: c.log.Infof("unknown message type '%s'", sanitize(eventType)) } From 3af0bf6b38d8676a3523730b75424688823500cc Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 25 Oct 2023 15:53:33 +0000 Subject: [PATCH 10/13] chore: Updated coverage badge. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index db17575c..37ce468f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Polygon Go Client -![Coverage](https://img.shields.io/badge/Coverage-76.8%25-brightgreen) +![Coverage](https://img.shields.io/badge/Coverage-76.5%25-brightgreen) From 4079cb0552dfa1f5c94920990b6e276050d3103e Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:57:44 -0400 Subject: [PATCH 11/13] increment version --- rest/client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest/client/client.go b/rest/client/client.go index fca7fe5b..bdb8a8c9 100644 --- a/rest/client/client.go +++ b/rest/client/client.go @@ -11,7 +11,7 @@ import ( "github.com/polygon-io/client-go/rest/models" ) -const clientVersion = "v1.14.1" +const clientVersion = "v1.15.0" const ( APIURL = "https://api.polygon.io" From 32e2d43f1e18dd1f1b25a4eac81e3c31da8a8018 Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Wed, 25 Oct 2023 12:19:17 -0400 Subject: [PATCH 12/13] update specs --- .polygon/rest.json | 136 ++++++++++++++-- .polygon/websocket.json | 333 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 453 insertions(+), 16 deletions(-) diff --git a/.polygon/rest.json b/.polygon/rest.json index 5382b1b9..13dc3c1f 100644 --- a/.polygon/rest.json +++ b/.polygon/rest.json @@ -911,6 +911,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastTrade": { "allOf": [ { @@ -1224,6 +1229,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastTrade": { "allOf": [ { @@ -1987,6 +1997,11 @@ ], "type": "object" }, + "Fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "ForexConversion": { "properties": { "converted": { @@ -2393,6 +2408,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastQuote": { "description": "The most recent quote for this ticker.", "properties": { @@ -2583,6 +2603,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastQuote": { "description": "The most recent quote for this ticker.", "properties": { @@ -3879,6 +3904,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastQuote": { "description": "The most recent quote for this ticker. This is only returned if your current plan includes quotes.", "properties": { @@ -4144,6 +4174,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastQuote": { "description": "The most recent quote for this ticker. This is only returned if your current plan includes quotes.", "properties": { @@ -5195,7 +5230,9 @@ "exchange": 48, "timestamp": 1605555313000 }, + "request_id": "a73a29dbcab4613eeaf48583d3baacf0", "status": "success", + "symbol": "AUD/USD", "to": "USD" }, "schema": { @@ -17771,7 +17808,8 @@ "r": 202, "s": 25, "t": 1617901342969834000, - "x": 312 + "x": 312, + "y": 1617901342969834000 }, "status": "OK" }, @@ -18622,6 +18660,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastTrade": { "allOf": [ { @@ -18983,6 +19026,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastTrade": { "allOf": [ { @@ -19516,6 +19564,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastTrade": { "allOf": [ { @@ -19856,6 +19909,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastQuote": { "description": "The most recent quote for this ticker.", "properties": { @@ -20173,6 +20231,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastQuote": { "description": "The most recent quote for this ticker.", "properties": { @@ -20481,6 +20544,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastQuote": { "description": "The most recent quote for this ticker.", "properties": { @@ -20828,6 +20896,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastQuote": { "description": "The most recent quote for this ticker. This is only returned if your current plan includes quotes.", "properties": { @@ -21234,6 +21307,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastQuote": { "description": "The most recent quote for this ticker. This is only returned if your current plan includes quotes.", "properties": { @@ -21639,6 +21717,11 @@ ], "type": "object" }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "format": "double", + "type": "number" + }, "lastQuote": { "description": "The most recent quote for this ticker. This is only returned if your current plan includes quotes.", "properties": { @@ -22637,17 +22720,17 @@ "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", "results": [ { - "ask_exchange": "48,", - "ask_price": "1.18565,", - "bid_exchange": "48,", - "bid_price": "1.18558,", + "ask_exchange": 48, + "ask_price": 1.18565, + "bid_exchange": 48, + "bid_price": 1.18558, "participant_timestamp": 1625097600000000000 }, { - "ask_exchange": "48,", - "ask_price": "1.18565,", - "bid_exchange": "48,", - "bid_price": "1.18559,", + "ask_exchange": 48, + "ask_price": 1.18565, + "bid_exchange": 48, + "bid_price": 1.18559, "participant_timestamp": 1625097600000000000 } ], @@ -26642,6 +26725,7 @@ "strike_price": 5, "underlying_ticker": "NCLH" }, + "fmv": 0.05, "greeks": { "delta": 0.5520187372272933, "gamma": 0.00706756515659829, @@ -26698,6 +26782,7 @@ } }, { + "fmv": 0.05, "last_quote": { "ask": 21.25, "ask_exchange": 300, @@ -26816,8 +26901,12 @@ "description": "The error while looking for this ticker.", "type": "string" }, + "fmv": { + "description": "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.\nFor more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "type": "number" + }, "greeks": { - "description": "The greeks for this contract. \nThere are certain circumstances where greeks will not be returned, such as options contracts that are deep in the money.\nSee this \u003ca href=\"https://polygon.io/blog/greeks-and-implied-volatility/#testing\"\nalt=\"link\"\u003earticle\u003c/a\u003e for more information.", + "description": "The greeks for this contract.\nThere are certain circumstances where greeks will not be returned, such as options contracts that are deep in the money.\nSee this \u003ca href=\"https://polygon.io/blog/greeks-and-implied-volatility/#testing\"\nalt=\"link\"\u003earticle\u003c/a\u003e for more information.", "properties": { "delta": { "description": "The change in the option's price per $0.01 increment in the price of the underlying asset.", @@ -27713,6 +27802,7 @@ "strike_price": 150, "ticker": "O:AAPL211022C000150000" }, + "fmv": 0.05, "greeks": { "delta": 1, "gamma": 0, @@ -27900,8 +27990,12 @@ "name": "Details" } }, + "fmv": { + "description": "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.\nFor more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "type": "number" + }, "greeks": { - "description": "The greeks for this contract. \nThere are certain circumstances where greeks will not be returned, such as options contracts that are deep in the money.\nSee this \u003ca href=\"https://polygon.io/blog/greeks-and-implied-volatility/#testing\"\nalt=\"link\"\u003earticle\u003c/a\u003e for more information.", + "description": "The greeks for this contract.\nThere are certain circumstances where greeks will not be returned, such as options contracts that are deep in the money.\nSee this \u003ca href=\"https://polygon.io/blog/greeks-and-implied-volatility/#testing\"\nalt=\"link\"\u003earticle\u003c/a\u003e for more information.", "properties": { "delta": { "description": "The change in the option's price per $0.01 increment in the price of the underlying asset.", @@ -28243,6 +28337,7 @@ "strike_price": 150, "ticker": "O:AAPL230616C00150000" }, + "fmv": 0.05, "greeks": { "delta": 0.5520187372272933, "gamma": 0.00706756515659829, @@ -28431,8 +28526,12 @@ "name": "Details" } }, + "fmv": { + "description": "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.\nFor more information, \u003ca rel=\"nofollow\" target=\"_blank\" href=\"https://polygon.io/contact\"\u003econtact us\u003c/a\u003e.", + "type": "number" + }, "greeks": { - "description": "The greeks for this contract. \nThere are certain circumstances where greeks will not be returned, such as options contracts that are deep in the money.\nSee this \u003ca href=\"https://polygon.io/blog/greeks-and-implied-volatility/#testing\"\nalt=\"link\"\u003earticle\u003c/a\u003e for more information.", + "description": "The greeks for this contract.\nThere are certain circumstances where greeks will not be returned, such as options contracts that are deep in the money.\nSee this \u003ca href=\"https://polygon.io/blog/greeks-and-implied-volatility/#testing\"\nalt=\"link\"\u003earticle\u003c/a\u003e for more information.", "properties": { "delta": { "description": "The change in the option's price per $0.01 increment in the price of the underlying asset.", @@ -30030,7 +30129,7 @@ "financials": { "properties": { "balance_sheet": { - "description": "Balance sheet.\nNote that the keys in this object can be any of the balance sheet concepts defined in \u003ca rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"http://www.xbrlsite.com/2016/fac/v3/Documentation/FundamentalAccountingConceptsList.html\"\u003ethis table of fundamental accounting concepts\u003c/a\u003e but converted to `snake_case`.", + "description": "Balance sheet.\nThe keys in this object can be any of the fields listed in the Balance Sheet section of the \u003ca target=\"_blank\" href=\"https://polygon.io/blog/financials-api-glossary-of-fields\"\u003efinancials API glossary of terms\u003c/a\u003e.", "properties": { "*": { "description": "An individual financial data point.", @@ -30082,15 +30181,15 @@ "type": "object" }, "cash_flow_statement": { - "description": "Cash flow statement.\nNote that the keys in this object can be any of the cash flow statement concepts defined in \u003ca rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"http://www.xbrlsite.com/2016/fac/v3/Documentation/FundamentalAccountingConceptsList.html\"\u003ethis table of fundamental accounting concepts\u003c/a\u003e but converted to `snake_case`.\nSee the attributes of the objects within `balance_sheet` for more details.", + "description": "Cash flow statement.\nThe keys in this object can be any of the fields listed in the Cash Flow Statement section of the \u003ca target=\"_blank\" href=\"https://polygon.io/blog/financials-api-glossary-of-fields\"\u003efinancials API glossary of terms\u003c/a\u003e.\nSee the attributes of the objects within `balance_sheet` for more details.", "type": "object" }, "comprehensive_income": { - "description": "Comprehensive income.\nNote that the keys in this object can be any of the comprehensive income statement concepts defined in \u003ca rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"http://www.xbrlsite.com/2016/fac/v3/Documentation/FundamentalAccountingConceptsList.html\"\u003ethis table of fundamental accounting concepts\u003c/a\u003e but converted to `snake_case`.\nSee the attributes of the objects within `balance_sheet` for more details.", + "description": "Comprehensive income.\nThe keys in this object can be any of the fields listed in the Comprehensive Income section of the \u003ca target=\"_blank\" href=\"https://polygon.io/blog/financials-api-glossary-of-fields\"\u003efinancials API glossary of terms\u003c/a\u003e.\nSee the attributes of the objects within `balance_sheet` for more details.", "type": "object" }, "income_statement": { - "description": "Income statement.\nNote that the keys in this object can be any of the income statement concepts defined in \u003ca rel=\"noopener noreferrer nofollow\" target=\"_blank\" href=\"http://www.xbrlsite.com/2016/fac/v3/Documentation/FundamentalAccountingConceptsList.html\"\u003ethis table of fundamental accounting concepts\u003c/a\u003e but converted to `snake_case`.\nSee the attributes of the objects within `balance_sheet` for more details.", + "description": "Income statement.\nThe keys in this object can be any of the fields listed in the Income Statement section of the \u003ca target=\"_blank\" href=\"https://polygon.io/blog/financials-api-glossary-of-fields\"\u003efinancials API glossary of terms\u003c/a\u003e.\nSee the attributes of the objects within `balance_sheet` for more details.", "type": "object" } }, @@ -30877,6 +30976,11 @@ "/v3/reference/tickers/types" ] }, + { + "paths": [ + "/vX/reference/tickers/taxonomies" + ] + }, { "paths": [ "/v1/marketstatus/upcoming" diff --git a/.polygon/websocket.json b/.polygon/websocket.json index 267b522d..0738b167 100644 --- a/.polygon/websocket.json +++ b/.polygon/websocket.json @@ -48,6 +48,11 @@ "/stocks/LULD" ] }, + { + "paths": [ + "/business/stocks/FMV" + ] + }, { "paths": [ "/launchpad/stocks/AM" @@ -84,6 +89,11 @@ "/options/Q" ] }, + { + "paths": [ + "/business/options/FMV" + ] + }, { "paths": [ "/launchpad/options/AM" @@ -110,6 +120,11 @@ "/forex/C" ] }, + { + "paths": [ + "/business/forex/FMV" + ] + }, { "paths": [ "/launchpad/forex/AM" @@ -146,6 +161,11 @@ "/crypto/XL2" ] }, + { + "paths": [ + "/business/crypto/FMV" + ] + }, { "paths": [ "/launchpad/crypto/AM" @@ -915,6 +935,79 @@ ] } }, + "/business/stocks/FMV": { + "get": { + "summary": "Fair Market Value", + "description": "Real-time fair market value for a given stock ticker symbol.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a stock ticker or use * to subscribe to all stock tickers.\nYou can also use a comma separated list to subscribe to multiple stock tickers.\nYou can retrieve available stock tickers from our [Stock Tickers API](https://polygon.io/docs/stocks/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^([a-zA-Z]+)$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a fair market value event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "FMV" + ], + "description": "The event type." + }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us.\n" + }, + "sym": { + "description": "The ticker symbol for the given security." + }, + "t": { + "description": "The nanosecond timestamp." + } + } + }, + "example": { + "ev": "FMV", + "val": 189.22, + "sym": "AAPL", + "t": 1678220098130 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "indicative-price", + "description": "Indicative Price" + }, + "x-polygon-entitlement-market-type": { + "name": "stocks", + "description": "Stocks data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "delayed", + "description": "15 minute delayed data" + }, + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, "/launchpad/stocks/AM": { "get": { "summary": "Aggregates (Per Minute)", @@ -1608,6 +1701,79 @@ ] } }, + "/business/options/FMV": { + "get": { + "summary": "Fair Market Value", + "description": "Real-time fair market value for a given options ticker symbol.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify an option contract. You're only allowed to subscribe to 1,000 option contracts per connection.\nYou can also use a comma separated list to subscribe to multiple option contracts.\nYou can retrieve active options contracts from our [Options Contracts API](https://polygon.io/docs/options/get_v3_reference_options_contracts).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(([a-zA-Z]+|[0-9])+)$/" + }, + "example": "O:SPY241220P00720000" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a fair market value event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "FMV" + ], + "description": "The event type." + }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us.\n" + }, + "sym": { + "description": "The ticker symbol for the given security." + }, + "t": { + "description": "The nanosecond timestamp." + } + } + }, + "example": { + "ev": "FMV", + "val": 7.2, + "sym": "O:TSLA210903C00700000", + "t": 1401715883806000000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "indicative-price", + "description": "Indicative Price" + }, + "x-polygon-entitlement-market-type": { + "name": "options", + "description": "Options data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "delayed", + "description": "15 minute delayed data" + }, + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, "/launchpad/options/AM": { "get": { "summary": "Aggregates (Per Minute)", @@ -2005,6 +2171,79 @@ ] } }, + "/business/forex/FMV": { + "get": { + "summary": "Fair Market Value", + "description": "Real-time fair market value for a given forex ticker symbol.\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 fair market value event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "FMV" + ], + "description": "The event type." + }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us.\n" + }, + "sym": { + "description": "The ticker symbol for the given security." + }, + "t": { + "description": "The nanosecond timestamp." + } + } + }, + "example": { + "ev": "FMV", + "val": 1.0631, + "sym": "C:EURUSD", + "t": 1678220098130 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "indicative-price", + "description": "Indicative Price" + }, + "x-polygon-entitlement-market-type": { + "name": "fx", + "description": "Forex data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "delayed", + "description": "15 minute delayed data" + }, + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, "/launchpad/forex/AM": { "get": { "summary": "Aggregates (Per Minute)", @@ -2646,6 +2885,79 @@ ] } }, + "/business/crypto/FMV": { + "get": { + "summary": "Fair Market Value", + "description": "Real-time fair market value for a given crypto ticker symbol.\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 fair market value event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "FMV" + ], + "description": "The event type." + }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us.\n" + }, + "sym": { + "description": "The ticker symbol for the given security." + }, + "t": { + "description": "The nanosecond timestamp." + } + } + }, + "example": { + "ev": "FMV", + "val": 33021.9, + "sym": "X:BTC-USD", + "t": 1610462007425 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "indicative-price", + "description": "Indicative Price" + }, + "x-polygon-entitlement-market-type": { + "name": "crypto", + "description": "Crypto data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "delayed", + "description": "15 minute delayed data" + }, + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, "/launchpad/crypto/AM": { "get": { "summary": "Aggregates (Per Minute)", @@ -4621,6 +4933,27 @@ "description": "The nanosecond timestamp." } } + }, + "BusinessWebsocketFairMarketValue": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "FMV" + ], + "description": "The event type." + }, + "fmv": { + "description": "Fair market value is only available on Business plans. It is our proprietary algorithm to generate a real-time, accurate, fair market value of a tradable security. For more information, contact us.\n" + }, + "sym": { + "description": "The ticker symbol for the given security." + }, + "t": { + "description": "The nanosecond timestamp." + } + } } }, "parameters": { From 94042c661fa24b7771c1492d7d48c8faa464cdb9 Mon Sep 17 00:00:00 2001 From: aitzkovitz <19159499+aitzkovitz@users.noreply.github.com> Date: Wed, 25 Oct 2023 12:44:10 -0400 Subject: [PATCH 13/13] trigger action