diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 178de444..00000000 --- a/.drone.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -kind: pipeline -type: docker -name: release - -platform: - os: linux - arch: amd64 - -steps: - - name: build - image: python:3.7.5-alpine - commands: - - python setup.py sdist bdist_wheel - environment: - VERSION: ${DRONE_TAG##v} - - - name: release - image: python:3.7.5 - commands: - - pip install --user --upgrade twine - - ./upload - environment: - PASSWORD: - from_secret: pypi_token - USERNAME: __token__ - -trigger: - event: - - tag - ref: - - refs/tags/v* - ---- -kind: signature -hmac: c5572884fdd2183d7c63100530974a649f4607ee18c813570741d7a63f31cfae - -... diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..d7105d15 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @justinpolygon @penelopus @davidwf-polygonio diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..d9320547 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,37 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** + + +**To Reproduce** + + +**Expected behavior** + + +**Screenshots** + + +**Additional context** + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..8d22d026 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,28 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: enhancement +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** + + +**Describe the solution you'd like** + + +**Describe alternatives you've considered** + + +**Additional context** + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..6a7695c0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..f0767d70 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,33 @@ +name: codeql +on: + push: + branches: + - master + pull_request: + branches: + - master + schedule: + - cron: "33 12 * * 3" +jobs: + analyze: + name: analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + language: ["python"] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..f524111b --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,33 @@ +name: lint +on: + push: + tags: + - v* + branches: + - v1 + pull_request: +permissions: + contents: read +jobs: + lint: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ['3.10'] + name: Lint ${{ matrix.python-version }} + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Setup Poetry + uses: abatilo/actions-poetry@v2 + - name: Install pypi deps + run: poetry install + - name: Style lint + run: make style + - name: Static lint + run: make static + if: always() diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..c906b0d3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: release +on: + push: + tags: + - v* +permissions: + contents: read +jobs: + test: + runs-on: ubuntu-latest + name: Release to PyPi + steps: + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.10" + - name: Setup Poetry + uses: abatilo/actions-poetry@v2 + - name: Configure Poetry + run: poetry config pypi-token.pypi ${{ secrets.POETRY_HTTP_BASIC_PYPI_PASSWORD }} + - name: Install pypi deps + run: poetry install + - name: Get tag + id: tag + uses: dawidd6/action-get-tag@v1 + - name: Version according to tag + run: poetry version ${{ steps.tag.outputs.tag }} + - name: Build + run: poetry build + - name: Publish to PyPi + run: poetry publish diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..f87d2e29 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: unittest +on: + push: + tags: + - v* + branches: + - v1 + pull_request: +permissions: + contents: read +jobs: + test: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + python-version: ['3.8', '3.9', '3.10'] + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} Unit test ${{ matrix.python-version }} + steps: + - name: Windows hack + run: git config --system core.longpaths true + if: ${{ matrix.os == 'windows-latest' }} + - uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Setup Poetry + uses: abatilo/actions-poetry@v2 + - name: Install pypi deps + run: poetry install + - name: Unit tests + run: make test diff --git a/.gitignore b/.gitignore index a655050c..300a17c1 100644 --- a/.gitignore +++ b/.gitignore @@ -55,7 +55,7 @@ venv/ *.log # Sphinx documentation -docs/_build/ +docs/build/ # PyBuilder target/ diff --git a/.polygon/rest.json b/.polygon/rest.json new file mode 100644 index 00000000..425d2c2d --- /dev/null +++ b/.polygon/rest.json @@ -0,0 +1,31831 @@ +{ + "components": { + "parameters": { + "AggregateAdjusted": { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + }, + "AggregateDate": { + "description": "The beginning date for the aggregate window.", + "example": "2023-01-09", + "in": "path", + "name": "date", + "required": true, + "schema": { + "type": "string" + } + }, + "AggregateLimitMax50000": { + "description": "Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000.\nRead more about how limit is used to calculate aggregate results in our article on\nAggregate Data API Improvements.\n", + "example": 120, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + "AggregateMultiplier": { + "description": "The size of the timespan multiplier.", + "example": 1, + "in": "path", + "name": "multiplier", + "required": true, + "schema": { + "type": "integer" + } + }, + "AggregateSort": { + "description": "Sort the results by timestamp.\n`asc` will return results in ascending order (oldest at the top),\n`desc` will return results in descending order (newest at the top).\n", + "example": "asc", + "in": "query", + "name": "sort", + "schema": { + "enum": [ + "asc", + "desc" + ] + } + }, + "AggregateTimeFrom": { + "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-01-09", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + "AggregateTimeTo": { + "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-02-10", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + "AggregateTimespan": { + "description": "The size of the time window.", + "example": "day", + "in": "path", + "name": "timespan", + "required": true, + "schema": { + "enum": [ + "second", + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + "CryptoTickerPathParam": { + "description": "The ticker symbol of the currency pair.", + "example": "X:BTCUSD", + "in": "path", + "name": "cryptoTicker", + "required": true, + "schema": { + "type": "string" + } + }, + "CryptoTickersQueryParam": { + "description": "A case-sensitive comma separated list of tickers to get snapshots for. For example, X:BTCUSD, X:ETHBTC, and X:BOBAUSD. Empty string defaults to querying all tickers.", + "in": "query", + "name": "tickers", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "ForexTickerPathParam": { + "description": "The ticker symbol of the currency pair.", + "example": "C:EURUSD", + "in": "path", + "name": "forexTicker", + "required": true, + "schema": { + "type": "string" + } + }, + "ForexTickersQueryParam": { + "description": "A case-sensitive comma separated list of tickers to get snapshots for. For example, C:EURUSD, C:GBPCAD, and C:AUDINR. Empty string defaults to querying all tickers.", + "in": "query", + "name": "tickers", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "GeneralTickerPathParam": { + "description": "The ticker symbol of the asset.", + "example": "AAPL", + "in": "path", + "name": "ticker", + "required": true, + "schema": { + "type": "string" + } + }, + "IncludeOTC": { + "description": "Include OTC securities in the response. Default is false (don't include OTC securities).\n", + "in": "query", + "name": "include_otc", + "schema": { + "type": "boolean" + } + }, + "IndicesAggregateTimeFrom": { + "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-03-13", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + "IndicesAggregateTimeTo": { + "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-03-24", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + "IndicesTickerPathParam": { + "description": "The ticker symbol of Index.", + "example": "I:NDX", + "in": "path", + "name": "indicesTicker", + "required": true, + "schema": { + "type": "string" + } + }, + "LimitMax10000": { + "description": "Limit the size of the response, max 10000.", + "example": 100, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + "LimitMax50000": { + "description": "Limit the size of the response, max 50000 and default 5000.", + "example": 10, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + "LimitNoMax": { + "description": "Limit the number of results.\n", + "example": 5, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + "OptionsTickerPathParam": { + "description": "The ticker symbol of the options contract.", + "example": "O:SPY251219C00650000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + } + }, + "ReverseOrder": { + "description": "Reverse the order of the results.\n", + "example": true, + "in": "query", + "name": "reverse", + "schema": { + "type": "boolean" + } + }, + "SnapshotDirection": { + "description": "The direction of the snapshot results to return.\n", + "example": "gainers", + "in": "path", + "name": "direction", + "required": true, + "schema": { + "enum": [ + "gainers", + "losers" + ], + "type": "string" + } + }, + "StocksTickerPathParam": { + "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.", + "example": "AAPL", + "in": "path", + "name": "stocksTicker", + "required": true, + "schema": { + "type": "string" + } + }, + "TickersQueryParam": { + "description": "A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers.", + "in": "query", + "name": "tickers", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + } + }, + "responses": { + "Conflict": { + "description": "Parameter is invalid or incorrect." + }, + "DefaultError": { + "description": "Unexpected error" + }, + "NotFound": { + "description": "The specified resource was not found" + }, + "Unauthorized": { + "description": "Unauthorized - Check our API Key and account status" + } + }, + "schemas": { + "Adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "AskExchangeId": { + "allOf": [ + { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + { + "description": "Ask Exchange Id" + } + ] + }, + "AskPrice": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "AskSize": { + "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.", + "type": "integer" + }, + "BidExchangeId": { + "allOf": [ + { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + { + "description": "Bid Exchange Id" + } + ] + }, + "BidPrice": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "BidSize": { + "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.", + "type": "integer" + }, + "Close": { + "description": "The close price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "CloseIndices": { + "description": "The close value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "Company": { + "properties": { + "active": { + "description": "Indicates if the security is actively listed. If false, this means the company is no longer listed and cannot be traded.", + "type": "boolean" + }, + "bloomberg": { + "description": "The Bloomberg guid for the symbol.", + "type": "string" + }, + "ceo": { + "description": "The name of the company's current CEO.", + "type": "string" + }, + "cik": { + "description": "The official CIK guid used for SEC database/filings.", + "type": "string" + }, + "country": { + "description": "The country in which the company is registered.", + "type": "string" + }, + "description": { + "description": "A description of the company and what they do/offer.", + "type": "string" + }, + "employees": { + "description": "The approximate number of employees for the company.", + "type": "integer" + }, + "exchange": { + "description": "The symbol's primary exchange.", + "type": "string" + }, + "exchangeSymbol": { + "description": "The exchange code (id) of the symbol's primary exchange.", + "type": "string" + }, + "figi": { + "description": "The OpenFigi project guid for the symbol. (https://openfigi.com/)", + "type": "string" + }, + "hq_address": { + "description": "The street address for the company's headquarters.", + "type": "string" + }, + "hq_country": { + "description": "The country in which the company's headquarters is located.", + "type": "string" + }, + "hq_state": { + "description": "The state in which the company's headquarters is located.", + "type": "string" + }, + "industry": { + "description": "The industry in which the company operates.", + "type": "string" + }, + "lei": { + "description": "The Legal Entity Identifier (LEI) guid for the symbol. (https://en.wikipedia.org/wiki/Legal_Entity_Identifier)", + "type": "string" + }, + "listdate": { + "description": "The date that the symbol was listed on the exchange.", + "format": "date", + "type": "string" + }, + "logo": { + "description": "The URL of the entity's logo.", + "type": "string" + }, + "marketcap": { + "description": "The current market cap for the company.", + "type": "integer" + }, + "name": { + "description": "The name of the company/entity.", + "type": "string" + }, + "phone": { + "description": "The phone number for the company. This is usually a corporate contact number.", + "type": "string" + }, + "sector": { + "description": "The sector of the indsutry in which the symbol operates.", + "type": "string" + }, + "sic": { + "description": "Standard Industrial Classification (SIC) id for the symbol. (https://en.wikipedia.org/wiki/Legal_Entity_Identifier)", + "type": "integer" + }, + "similar": { + "description": "A list of ticker symbols for similar companies.", + "items": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "type": "array" + }, + "symbol": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "tags": { + "items": { + "description": "A list of words related to the company.", + "type": "string" + }, + "type": "array" + }, + "type": { + "description": "The type or class of the security. (Full List of Ticker Types)", + "type": "string" + }, + "updated": { + "description": "The last time this company record was updated.", + "format": "date", + "type": "string" + }, + "url": { + "description": "The URL of the company's website", + "type": "string" + } + }, + "type": "object" + }, + "ConditionTypeMap": { + "properties": { + "condition": { + "description": "Polygon.io's mapping for condition codes. For more information, see our Trade Conditions Glossary.\n", + "type": "string" + } + }, + "type": "object" + }, + "Conditions": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "Count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "CryptoExchange": { + "items": { + "properties": { + "id": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "market": { + "description": "Market data type this exchange contains ( crypto only currently )", + "type": "string" + }, + "name": { + "description": "Name of the exchange", + "type": "string" + }, + "type": { + "description": "Type of exchange feed", + "type": "string" + }, + "url": { + "description": "URL of this exchange", + "type": "string" + } + }, + "required": [ + "id", + "type", + "market", + "name", + "url" + ], + "type": "object" + }, + "type": "array" + }, + "CryptoGroupedResults": { + "properties": { + "results": { + "items": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t", + "T" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "CryptoHistoricTrades": { + "properties": { + "day": { + "description": "The date that was evaluated from the request.", + "format": "date", + "type": "string" + }, + "map": { + "description": "A map for shortened result keys.", + "type": "object" + }, + "msLatency": { + "description": "The milliseconds of latency for the query results.", + "type": "integer" + }, + "symbol": { + "description": "The symbol pair that was evaluated from the request.", + "type": "string" + }, + "ticks": { + "items": { + "properties": { + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "x", + "c", + "t", + "i" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "day", + "map", + "msLatency", + "symbol", + "ticks" + ], + "type": "object" + }, + "CryptoLastTrade": { + "properties": { + "last": { + "properties": { + "conditions": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "exchange": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + }, + "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.\n", + "format": "double", + "type": "number" + }, + "size": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "timestamp": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + } + }, + "required": [ + "conditions", + "exchange", + "price", + "size", + "timestamp" + ], + "type": "object" + }, + "symbol": { + "description": "The symbol pair that was evaluated from the request.", + "type": "string" + } + }, + "required": [ + "symbol" + ], + "type": "object" + }, + "CryptoOpenClose": { + "properties": { + "close": { + "description": "The close price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "closingTrades": { + "items": { + "properties": { + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "x", + "c", + "t", + "i" + ], + "type": "object" + }, + "type": "array" + }, + "day": { + "description": "The date requested.", + "format": "date", + "type": "string" + }, + "isUTC": { + "description": "Whether or not the timestamps are in UTC timezone.", + "type": "boolean" + }, + "open": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "openTrades": { + "items": { + "properties": { + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "x", + "c", + "t", + "i" + ], + "type": "object" + }, + "type": "array" + }, + "symbol": { + "description": "The symbol pair that was evaluated from the request.", + "type": "string" + } + }, + "required": [ + "symbol", + "isUTC", + "day", + "open", + "close", + "openTrades", + "closingTrades" + ], + "type": "object" + }, + "CryptoSnapshotMinute": { + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "CryptoSnapshotTicker": { + "properties": { + "ticker": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "lastTrade": { + "allOf": [ + { + "description": "The most recent trade for this ticker." + }, + { + "properties": { + "c": { + "description": "The trade conditions.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size (volume) of the trade.", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp. This is the timestamp of when the trade was generated at the exchange.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "t", + "x" + ], + "type": "object" + } + ] + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "day", + "lastTrade", + "min", + "prevDay", + "ticker", + "todaysChange", + "todaysChangePerc", + "updated" + ], + "type": "object" + } + }, + "type": "object" + }, + "CryptoSnapshotTickerFullBook": { + "properties": { + "data": { + "properties": { + "askCount": { + "description": "The combined total number of asks in the book.", + "format": "double", + "type": "number" + }, + "asks": { + "items": { + "properties": { + "p": { + "description": "The price of this book level.", + "format": "double", + "type": "number" + }, + "x": { + "description": "A map of the exchange ID to number of shares at this price level.\n
\n
\n**Example:**\n
\n`{\n \"p\": 16302.94,\n \"x\": {\n \"1\": 0.02859424,\n \"6\": 0.023455\n }\n}`\n
\n
\nIn this example, exchange ID 1 has 0.02859424 shares available at $16,302.94,\nand exchange ID 6 has 0.023455 shares at the same price level.\n", + "type": "object" + } + }, + "required": [ + "p", + "x" + ], + "type": "object" + }, + "type": "array" + }, + "bidCount": { + "description": "The combined total number of bids in the book.", + "format": "double", + "type": "number" + }, + "bids": { + "items": { + "properties": { + "p": { + "description": "The price of this book level.", + "format": "double", + "type": "number" + }, + "x": { + "description": "A map of the exchange ID to number of shares at this price level.\n
\n
\n**Example:**\n
\n`{\n \"p\": 16302.94,\n \"x\": {\n \"1\": 0.02859424,\n \"6\": 0.023455\n }\n}`\n
\n
\nIn this example, exchange ID 1 has 0.02859424 shares available at $16,302.94,\nand exchange ID 6 has 0.023455 shares at the same price level.\n", + "type": "object" + } + }, + "required": [ + "p", + "x" + ], + "type": "object" + }, + "type": "array" + }, + "spread": { + "description": "The difference between the best bid and the best ask price across exchanges.", + "format": "double", + "type": "number" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "ticker", + "bids", + "asks", + "bidCount", + "askCount", + "spread", + "updated" + ], + "type": "object" + } + }, + "type": "object" + }, + "CryptoSnapshotTickers": { + "properties": { + "tickers": { + "items": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "lastTrade": { + "allOf": [ + { + "description": "The most recent trade for this ticker." + }, + { + "properties": { + "c": { + "description": "The trade conditions.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size (volume) of the trade.", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp. This is the timestamp of when the trade was generated at the exchange.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "t", + "x" + ], + "type": "object" + } + ] + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "day", + "lastTrade", + "min", + "prevDay", + "ticker", + "todaysChange", + "todaysChangePerc", + "updated" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "CryptoTick": { + "properties": { + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "x", + "c", + "t", + "i" + ], + "type": "object" + }, + "CryptoTradeExchange": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + }, + "Date": { + "oneOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "format": "date", + "type": "string" + } + ] + }, + "Exchange": { + "items": { + "properties": { + "code": { + "description": "A unique identifier for the exchange internal to Polygon.io. This is not an industry code or ISO standard.", + "type": "string" + }, + "id": { + "description": "The ID of the exchange.", + "type": "number" + }, + "market": { + "description": "The market data type that this exchange contains.", + "type": "string" + }, + "mic": { + "description": "The Market Identification Code or MIC as defined in ISO 10383 (https://en.wikipedia.org/wiki/Market_Identifier_Code).", + "type": "string" + }, + "name": { + "description": "The name of the exchange.", + "type": "string" + }, + "tape": { + "description": "The tape id of the exchange.", + "type": "string" + }, + "type": { + "description": "The type of exchange.\n- TRF = Trade Reporting Facility\n- exchange = Reporting exchange on the tape\n", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "ExchangeId": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "Financial": { + "properties": { + "cashChange": { + "example": 7202000000, + "type": "integer" + }, + "cashFlow": { + "example": 28293000000, + "type": "integer" + }, + "costOfRevenue": { + "example": 54381000000, + "type": "integer" + }, + "currentAssets": { + "example": 143810000000, + "type": "integer" + }, + "currentCash": { + "example": 27491000000, + "type": "integer" + }, + "currentDebt": { + "example": 18478000000, + "type": "integer" + }, + "grossProfit": { + "example": 33912000000, + "type": "integer" + }, + "netIncome": { + "example": 20065000000, + "type": "integer" + }, + "operatingExpense": { + "example": 7638000000, + "type": "integer" + }, + "operatingGainsLosses": { + "type": "number" + }, + "operatingIncome": { + "example": 26274000000, + "type": "integer" + }, + "operatingRevenue": { + "example": 88293000000, + "type": "integer" + }, + "reportDate": { + "description": "Report Date", + "example": "2017-12-31T00:00:00.000Z", + "format": "date-time", + "type": "string" + }, + "reportDateStr": { + "description": "Report date as non date format", + "example": "2017-12-31", + "type": "string" + }, + "researchAndDevelopment": { + "example": 3407000000, + "type": "integer" + }, + "shareholderEquity": { + "example": 140199000000, + "type": "integer" + }, + "symbol": { + "description": "Stock Symbol", + "example": "AAPL", + "type": "string" + }, + "totalAssets": { + "example": 406794000000, + "type": "integer" + }, + "totalCash": { + "example": 77153000000, + "type": "integer" + }, + "totalDebt": { + "example": 122400000000, + "type": "integer" + }, + "totalLiabilities": { + "example": 266595000000, + "type": "integer" + }, + "totalRevenue": { + "example": 88293000000, + "type": "integer" + } + }, + "required": [ + "symbol", + "reportDate", + "reportDateStr" + ], + "type": "object" + }, + "Financials": { + "description": "Financials", + "properties": { + "EBITDAMargin": { + "format": "double", + "type": "number" + }, + "accumulatedOtherComprehensiveIncome": { + "type": "integer" + }, + "accumulatedRetainedEarningsDeficit": { + "type": "integer" + }, + "assetTurnover": { + "type": "integer" + }, + "assets": { + "type": "integer" + }, + "assetsAverage": { + "type": "integer" + }, + "assetsCurrent": { + "type": "integer" + }, + "assetsNonCurrent": { + "type": "integer" + }, + "averageEquity": { + "type": "integer" + }, + "bookValuePerShare": { + "format": "double", + "type": "number" + }, + "calendarDate": { + "example": "2019-03-31", + "format": "date-time", + "type": "string" + }, + "capitalExpenditure": { + "type": "integer" + }, + "cashAndEquivalents": { + "type": "integer" + }, + "cashAndEquivalentsUSD": { + "type": "integer" + }, + "consolidatedIncome": { + "type": "integer" + }, + "costOfRevenue": { + "type": "integer" + }, + "currentLiabilities": { + "type": "integer" + }, + "currentRatio": { + "format": "double", + "type": "number" + }, + "debt": { + "type": "integer" + }, + "debtCurrent": { + "type": "integer" + }, + "debtNonCurrent": { + "type": "integer" + }, + "debtToEquityRatio": { + "format": "double", + "type": "number" + }, + "debtUSD": { + "type": "integer" + }, + "deferredRevenue": { + "type": "integer" + }, + "deposits": { + "type": "integer" + }, + "depreciationAmortizationAndAccretion": { + "type": "integer" + }, + "dividendYield": { + "type": "integer" + }, + "dividendsPerBasicCommonShare": { + "type": "integer" + }, + "earningBeforeInterestTaxes": { + "type": "integer" + }, + "earningBeforeInterestTaxesUSD": { + "type": "integer" + }, + "earningsBeforeInterestTaxesDepreciationAmortization": { + "type": "integer" + }, + "earningsBeforeInterestTaxesDepreciationAmortizationUSD": { + "type": "integer" + }, + "earningsBeforeTax": { + "type": "integer" + }, + "earningsPerBasicShare": { + "format": "double", + "type": "number" + }, + "earningsPerBasicShareUSD": { + "format": "double", + "type": "number" + }, + "earningsPerDilutedShare": { + "format": "double", + "type": "number" + }, + "effectOfExchangeRateChangesOnCash": { + "type": "integer" + }, + "enterpriseValue": { + "type": "integer" + }, + "enterpriseValueOverEBIT": { + "type": "integer" + }, + "enterpriseValueOverEBITDA": { + "format": "double", + "type": "number" + }, + "foreignCurrencyUSDExchangeRate": { + "type": "integer" + }, + "freeCashFlow": { + "type": "integer" + }, + "freeCashFlowPerShare": { + "format": "double", + "type": "number" + }, + "goodwillAndIntangibleAssets": { + "type": "integer" + }, + "grossMargin": { + "format": "double", + "type": "number" + }, + "grossProfit": { + "type": "integer" + }, + "incomeTaxExpense": { + "type": "integer" + }, + "interestExpense": { + "type": "integer" + }, + "inventory": { + "type": "integer" + }, + "investedCapital": { + "type": "integer" + }, + "investedCapitalAverage": { + "type": "integer" + }, + "investments": { + "type": "integer" + }, + "investmentsCurrent": { + "type": "integer" + }, + "investmentsNonCurrent": { + "type": "integer" + }, + "issuanceDebtSecurities": { + "type": "integer" + }, + "issuanceEquityShares": { + "type": "integer" + }, + "liabilitiesNonCurrent": { + "type": "integer" + }, + "marketCapitalization": { + "type": "integer" + }, + "netCashFlow": { + "type": "integer" + }, + "netCashFlowBusinessAcquisitionsDisposals": { + "type": "integer" + }, + "netCashFlowFromFinancing": { + "type": "integer" + }, + "netCashFlowFromInvesting": { + "type": "integer" + }, + "netCashFlowFromOperations": { + "type": "integer" + }, + "netCashFlowInvestmentAcquisitionsDisposals": { + "type": "integer" + }, + "netIncome": { + "type": "integer" + }, + "netIncomeCommonStock": { + "type": "integer" + }, + "netIncomeCommonStockUSD": { + "type": "integer" + }, + "netIncomeToNonControllingInterests": { + "type": "integer" + }, + "netLossIncomeFromDiscontinuedOperations": { + "type": "integer" + }, + "operatingExpenses": { + "type": "integer" + }, + "operatingIncome": { + "type": "integer" + }, + "paymentDividendsOtherCashDistributions": { + "type": "integer" + }, + "payoutRatio": { + "type": "integer" + }, + "period": { + "description": "Reporting period.", + "enum": [ + "Q", + "T", + "QA", + "TA", + "Y", + "YA" + ], + "example": "Q", + "type": "string" + }, + "preferredDividendsIncomeStatementImpact": { + "type": "integer" + }, + "priceEarnings": { + "format": "double", + "type": "number" + }, + "priceSales": { + "format": "double", + "type": "number" + }, + "priceToBookValue": { + "format": "double", + "type": "number" + }, + "priceToEarningsRatio": { + "format": "double", + "type": "number" + }, + "priceToSalesRatio": { + "format": "double", + "type": "number" + }, + "profitMargin": { + "format": "double", + "type": "number" + }, + "propertyPlantEquipmentNet": { + "type": "integer" + }, + "reportPeriod": { + "example": "2019-03-31", + "format": "date-time", + "type": "string" + }, + "researchAndDevelopmentExpense": { + "type": "integer" + }, + "returnOnAverageAssets": { + "type": "integer" + }, + "returnOnAverageEquity": { + "type": "integer" + }, + "returnOnInvestedCapital": { + "type": "integer" + }, + "returnOnSales": { + "format": "double", + "type": "number" + }, + "revenues": { + "type": "integer" + }, + "revenuesUSD": { + "type": "integer" + }, + "salesPerShare": { + "format": "double", + "type": "number" + }, + "sellingGeneralAndAdministrativeExpense": { + "type": "integer" + }, + "shareBasedCompensation": { + "type": "integer" + }, + "shareFactor": { + "type": "integer" + }, + "sharePriceAdjustedClose": { + "format": "double", + "type": "number" + }, + "shareholdersEquity": { + "type": "integer" + }, + "shareholdersEquityUSD": { + "type": "integer" + }, + "shares": { + "type": "integer" + }, + "tangibleAssetValue": { + "type": "integer" + }, + "tangibleAssetsBookValuePerShare": { + "format": "double", + "type": "number" + }, + "taxAssets": { + "type": "integer" + }, + "taxLiabilities": { + "type": "integer" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "totalLiabilities": { + "type": "integer" + }, + "tradeAndNonTradePayables": { + "type": "integer" + }, + "tradeAndNonTradeReceivables": { + "type": "integer" + }, + "updated": { + "example": "1999-03-28", + "format": "date-time", + "type": "string" + }, + "weightedAverageShares": { + "type": "integer" + }, + "weightedAverageSharesDiluted": { + "type": "integer" + }, + "workingCapital": { + "type": "integer" + } + }, + "required": [ + "ticker", + "exDate", + "paymentDate", + "ratio", + "tofactor", + "forfactor" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "ForexConversion": { + "properties": { + "converted": { + "description": "The result of the conversion.", + "format": "double", + "type": "number" + }, + "from": { + "description": "The \"from\" currency symbol.", + "type": "string" + }, + "initialAmount": { + "description": "The amount to convert.", + "format": "double", + "type": "number" + }, + "last": { + "properties": { + "ask": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "bid": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "exchange": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "timestamp": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + } + }, + "required": [ + "ask", + "bid", + "exchange", + "timestamp" + ], + "type": "object" + }, + "to": { + "description": "The \"to\" currency symbol.", + "type": "string" + } + }, + "required": [ + "from", + "to", + "initialAmount", + "converted" + ], + "type": "object" + }, + "ForexExchangeId": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "ForexGroupedResults": { + "properties": { + "results": { + "items": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t", + "T" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "ForexHistoricTrades": { + "properties": { + "day": { + "description": "The date that was evaluated from the request.", + "format": "date", + "type": "string" + }, + "map": { + "description": "A map for shortened result keys.", + "type": "object" + }, + "msLatency": { + "description": "The milliseconds of latency for the query results.", + "type": "integer" + }, + "pair": { + "description": "The currency pair that was evaluated from the request.", + "type": "string" + }, + "ticks": { + "items": { + "properties": { + "a": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "b": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + } + }, + "required": [ + "a", + "b", + "x", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "day", + "map", + "msLatency", + "pair", + "ticks" + ], + "type": "object" + }, + "ForexPairLastQuote": { + "properties": { + "last": { + "properties": { + "ask": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "bid": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "exchange": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "timestamp": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + } + }, + "required": [ + "ask", + "bid", + "exchange", + "timestamp" + ], + "type": "object" + }, + "symbol": { + "description": "The symbol pair that was evaluated from the request.", + "type": "string" + } + }, + "required": [ + "symbol" + ], + "type": "object" + }, + "ForexPreviousClose": { + "properties": { + "results": { + "items": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "T", + "v", + "o", + "c", + "h", + "l", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "ForexSnapshotLastQuote": { + "properties": { + "a": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "b": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp of the quote.", + "type": "integer" + }, + "x": { + "description": "The exchange ID on which this quote happened.", + "type": "integer" + } + }, + "required": [ + "a", + "b", + "t", + "x" + ], + "type": "object" + }, + "ForexSnapshotPrevDay": { + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ForexSnapshotTicker": { + "properties": { + "ticker": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "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" + }, + "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.", + "format": "double", + "type": "number" + }, + "lastQuote": { + "description": "The most recent quote for this ticker.", + "properties": { + "a": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "b": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp of the quote.", + "type": "integer" + }, + "x": { + "description": "The exchange ID on which this quote happened.", + "type": "integer" + } + }, + "required": [ + "a", + "b", + "t", + "x" + ], + "type": "object" + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "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" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "day", + "lastQuote", + "min", + "prevDay", + "ticker", + "todaysChange", + "todaysChangePerc", + "updated" + ], + "type": "object" + } + }, + "type": "object" + }, + "ForexSnapshotTickers": { + "properties": { + "tickers": { + "items": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "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" + }, + "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.", + "format": "double", + "type": "number" + }, + "lastQuote": { + "description": "The most recent quote for this ticker.", + "properties": { + "a": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "b": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp of the quote.", + "type": "integer" + }, + "x": { + "description": "The exchange ID on which this quote happened.", + "type": "integer" + } + }, + "required": [ + "a", + "b", + "t", + "x" + ], + "type": "object" + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "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" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "day", + "lastQuote", + "min", + "prevDay", + "ticker", + "todaysChange", + "todaysChangePerc", + "updated" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "ForexTickerResults": { + "properties": { + "results": { + "items": { + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "High": { + "description": "The highest price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "HighIndices": { + "description": "The highest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "IndexAggsBase": { + "properties": { + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + "Indicators": { + "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n", + "items": { + "description": "The indicator code.\n", + "type": "integer" + }, + "type": "array" + }, + "IndicesGroupedResults": { + "properties": { + "results": { + "items": { + "properties": { + "c": { + "description": "The close value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "h": { + "description": "The highest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "l": { + "description": "The lowest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "o": { + "description": "The open value 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" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "IndicesOpenClose": { + "properties": { + "afterHours": { + "description": "The close value of the ticker symbol in after hours trading.", + "format": "double", + "type": "number" + }, + "close": { + "description": "The close value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "from": { + "description": "The requested date.", + "format": "date", + "type": "string" + }, + "high": { + "description": "The highest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "low": { + "description": "The lowest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "open": { + "description": "The open value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "preMarket": { + "description": "The open value of the ticker symbol in pre-market trading.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + }, + "symbol": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "status", + "from", + "symbol", + "open", + "high", + "low", + "close" + ], + "type": "object" + }, + "IndicesTickerResults": { + "properties": { + "results": { + "items": { + "properties": { + "c": { + "description": "The close value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "h": { + "description": "The highest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "l": { + "description": "The lowest value 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 value 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" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "Locales": { + "properties": { + "results": { + "items": { + "properties": { + "locale": { + "description": "An abbreviated country name.", + "type": "string" + }, + "name": { + "description": "The name of the country.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "Low": { + "description": "The lowest price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "LowIndices": { + "description": "The lowest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "Map": { + "description": "A mapping of the keys returned in the results to their descriptive name and data types.", + "properties": { + "key": { + "description": "A dynamic key from the results set", + "properties": { + "name": { + "description": "The descriptive name of this results key", + "type": "string" + }, + "type": { + "description": "The data type of this results key", + "enum": [ + "string", + "int", + "int64", + "float64" + ], + "type": "string" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "MarketHoliday": { + "items": { + "properties": { + "close": { + "description": "The market close time on the holiday (if it's not closed).", + "format": "date-time", + "type": "string" + }, + "date": { + "description": "The date of the holiday.", + "format": "date", + "type": "string" + }, + "exchange": { + "description": "Which market the record is for.", + "type": "string" + }, + "name": { + "description": "The name of the holiday.", + "type": "string" + }, + "open": { + "description": "The market open time on the holiday (if it's not closed).", + "format": "date-time", + "type": "string" + }, + "status": { + "description": "The status of the market on the holiday.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "MarketStatus": { + "properties": { + "afterHours": { + "description": "Whether or not the market is in post-market hours.", + "type": "boolean" + }, + "currencies": { + "properties": { + "crypto": { + "description": "The status of the crypto market.", + "type": "string" + }, + "fx": { + "description": "The status of the forex market.", + "type": "string" + } + }, + "type": "object" + }, + "earlyHours": { + "description": "Whether or not the market is in pre-market hours.", + "type": "boolean" + }, + "exchanges": { + "properties": { + "nasdaq": { + "description": "The status of the Nasdaq market.", + "type": "string" + }, + "nyse": { + "description": "The status of the NYSE market.", + "type": "string" + }, + "otc": { + "description": "The status of the OTC market.", + "type": "string" + } + }, + "type": "object" + }, + "market": { + "description": "The status of the market as a whole.", + "type": "string" + }, + "serverTime": { + "description": "The current time of the server.", + "format": "date-time", + "type": "string" + } + }, + "type": "object" + }, + "Markets": { + "properties": { + "results": { + "description": "A list of supported markets.", + "items": { + "properties": { + "desc": { + "description": "A description of the market.", + "type": "string" + }, + "market": { + "description": "The name of the market.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "MsLatency": { + "description": "The milliseconds of latency for the query results.", + "type": "integer" + }, + "News": { + "items": { + "properties": { + "image": { + "description": "A URL of the image for the news article, if found.", + "type": "string" + }, + "keywords": { + "description": "A list of common keywords related to the news article.", + "items": { + "description": "Common keywords of the news article.", + "type": "string" + }, + "type": "array" + }, + "source": { + "description": "The publication source of the article.", + "type": "string" + }, + "summary": { + "description": "A summary of the news article.", + "type": "string" + }, + "symbols": { + "description": "A list of ticker symbols relating to the article.", + "items": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "type": "array" + }, + "timestamp": { + "description": "The timestamp of the news article.", + "format": "date-time", + "type": "string" + }, + "title": { + "description": "The title of the news article.", + "type": "string" + }, + "url": { + "description": "A direct link to the news article from its source publication.", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "NumberOfItems": { + "description": "The number of transactions in the aggregate window.", + "type": "integer" + }, + "OTC": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "Open": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "OpenIndices": { + "description": "The open value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "PaginationHooksBase": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + } + }, + "type": "object" + }, + "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.\n", + "format": "double", + "type": "number" + }, + "QueryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "RatingSection": { + "properties": { + "current": { + "description": "Analyst Rating at current month", + "example": 0, + "type": "number" + }, + "month1": { + "description": "Analyst Ratings at 1 month in the future", + "example": 1, + "type": "number" + }, + "month2": { + "description": "Analyst Ratings at 2 month in the future", + "example": 3, + "type": "number" + }, + "month3": { + "description": "Analyst Ratings at 3 month in the future", + "example": 4, + "type": "number" + }, + "month4": { + "description": "Analyst Ratings at 4 month in the future", + "example": 3, + "type": "number" + }, + "month5": { + "description": "Analyst Ratings at 5 month in the future", + "example": 2, + "type": "number" + } + }, + "required": [ + "month1", + "month2", + "month3", + "current" + ], + "type": "object" + }, + "RequestID": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "RequestIdBase": { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + } + }, + "required": [ + "request_id" + ], + "type": "object" + }, + "SequenceNumber": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n", + "format": "int64", + "type": "integer" + }, + "Size": { + "description": "The size of a trade (also known as volume).\n", + "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": { + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "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" + }, + "SnapshotOHLCVVW": { + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "SnapshotOHLCVVWOtc": { + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "StandardBase": { + "allOf": [ + { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + } + }, + "required": [ + "request_id" + ], + "type": "object" + }, + { + "properties": { + "count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + ] + }, + "Status": { + "description": "The status of this request's response.", + "type": "string" + }, + "StatusBase": { + "properties": { + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + "StatusCountBase": { + "properties": { + "count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + "StockSymbol": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "StocksGroupedResults": { + "properties": { + "results": { + "items": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "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" + }, + "otc": { + "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 end of the aggregate window.", + "type": "integer" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "t", + "v", + "T" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "StocksOpenClose": { + "properties": { + "afterHours": { + "description": "The close price of the ticker symbol in after hours trading.", + "format": "double", + "type": "number" + }, + "close": { + "description": "The close price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "from": { + "description": "The requested date.", + "format": "date", + "type": "string" + }, + "high": { + "description": "The highest price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "low": { + "description": "The lowest price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "open": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "preMarket": { + "description": "The open price of the ticker symbol in pre-market trading.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + }, + "symbol": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "volume": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + } + }, + "required": [ + "status", + "from", + "symbol", + "open", + "high", + "low", + "close", + "volume" + ], + "type": "object" + }, + "StocksSnapshotLastQuote": { + "properties": { + "P": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "S": { + "description": "The ask size in lots.", + "type": "integer" + }, + "p": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "s": { + "description": "The bid size in lots.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "P", + "S", + "t" + ], + "type": "object" + }, + "StocksSnapshotMinute": { + "properties": { + "av": { + "description": "The accumulated volume.", + "type": "integer" + }, + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "av", + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "StocksSnapshotMinuteOTC": { + "properties": { + "av": { + "description": "The accumulated volume.", + "type": "integer" + }, + "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" + }, + "otc": { + "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", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "av", + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "StocksSnapshotTicker": { + "properties": { + "ticker": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "lastQuote": { + "description": "The most recent quote for this ticker. This is only returned if your current plan includes quotes.", + "properties": { + "P": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "S": { + "description": "The ask size in lots.", + "type": "integer" + }, + "p": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "s": { + "description": "The bid size in lots.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "P", + "S", + "t" + ], + "type": "object" + }, + "lastTrade": { + "description": "The most recent trade for this ticker. This is only returned if your current plan includes trades.", + "properties": { + "c": { + "description": "The trade conditions.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size (volume) of the trade.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "t", + "x" + ], + "type": "object" + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "properties": { + "av": { + "description": "The accumulated volume.", + "type": "integer" + }, + "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" + }, + "otc": { + "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", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "av", + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + }, + "StocksSnapshotTickers": { + "properties": { + "tickers": { + "items": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "lastQuote": { + "description": "The most recent quote for this ticker. This is only returned if your current plan includes quotes.", + "properties": { + "P": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "S": { + "description": "The ask size in lots.", + "type": "integer" + }, + "p": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "s": { + "description": "The bid size in lots.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "P", + "S", + "t" + ], + "type": "object" + }, + "lastTrade": { + "description": "The most recent trade for this ticker. This is only returned if your current plan includes trades.", + "properties": { + "c": { + "description": "The trade conditions.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size (volume) of the trade.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "t", + "x" + ], + "type": "object" + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "properties": { + "av": { + "description": "The accumulated volume.", + "type": "integer" + }, + "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" + }, + "otc": { + "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", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "av", + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "StocksTickerResultsOTC": { + "properties": { + "results": { + "items": { + "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" + }, + "otc": { + "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", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "StocksV2Base": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "f": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "q": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n", + "format": "int64", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "y": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + } + }, + "required": [ + "T", + "t", + "y", + "f", + "q" + ], + "type": "object" + }, + "StocksV2NBBO": { + "allOf": [ + { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "f": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "q": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n", + "format": "int64", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "y": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + } + }, + "required": [ + "T", + "t", + "y", + "f", + "q" + ], + "type": "object" + }, + { + "properties": { + "P": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "S": { + "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.", + "type": "integer" + }, + "X": { + "allOf": [ + { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + { + "description": "Ask Exchange Id" + } + ] + }, + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n", + "items": { + "description": "The indicator code.\n", + "type": "integer" + }, + "type": "array" + }, + "p": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "s": { + "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.", + "type": "integer" + }, + "x": { + "allOf": [ + { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + { + "description": "Bid Exchange Id" + } + ] + }, + "z": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "x", + "P", + "S", + "X", + "z" + ], + "type": "object" + } + ] + }, + "StocksV2NBBOs": { + "properties": { + "results": { + "items": { + "allOf": [ + { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "f": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "q": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n", + "format": "int64", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "y": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + } + }, + "required": [ + "T", + "t", + "y", + "f", + "q" + ], + "type": "object" + }, + { + "properties": { + "P": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "S": { + "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.", + "type": "integer" + }, + "X": { + "allOf": [ + { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + { + "description": "Ask Exchange Id" + } + ] + }, + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n", + "items": { + "description": "The indicator code.\n", + "type": "integer" + }, + "type": "array" + }, + "p": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "s": { + "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.", + "type": "integer" + }, + "x": { + "allOf": [ + { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + { + "description": "Bid Exchange Id" + } + ] + }, + "z": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "x", + "P", + "S", + "X", + "z" + ], + "type": "object" + } + ] + }, + "type": "array" + } + }, + "type": "object" + }, + "StocksV2Trade": { + "allOf": [ + { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "f": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "q": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n", + "format": "int64", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "y": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + } + }, + "required": [ + "T", + "t", + "y", + "f", + "q" + ], + "type": "object" + }, + { + "properties": { + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "e": { + "description": "The trade correction indicator.\n", + "type": "integer" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "r": { + "description": "The ID for the Trade Reporting Facility where the trade took place.\n", + "type": "integer" + }, + "s": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "z": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "e", + "x", + "r", + "z" + ], + "type": "object" + } + ] + }, + "StocksV2Trades": { + "properties": { + "results": { + "items": { + "allOf": [ + { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "f": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "q": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n", + "format": "int64", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "y": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + } + }, + "required": [ + "T", + "t", + "y", + "f", + "q" + ], + "type": "object" + }, + { + "properties": { + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "e": { + "description": "The trade correction indicator.\n", + "type": "integer" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "r": { + "description": "The ID for the Trade Reporting Facility where the trade took place.\n", + "type": "integer" + }, + "s": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "z": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "e", + "x", + "r", + "z" + ], + "type": "object" + } + ] + }, + "type": "array" + } + }, + "type": "object" + }, + "SymbolPair": { + "description": "The symbol pair that was evaluated from the request.", + "type": "string" + }, + "Tape": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n", + "type": "integer" + }, + "TickerBase": { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + "TickerResults": { + "properties": { + "results": { + "items": { + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "TickerSymbol": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "Timestamp": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "TimestampExchange": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + }, + "TimestampSIP": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "TimestampTRF": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "TodaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "TodaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "TradeDetailsMapItem": { + "properties": { + "name": { + "description": "Name of the trade detail item", + "type": "string" + }, + "type": { + "description": "Actual type of the trade detail item", + "type": "string" + } + }, + "type": "object" + }, + "TradeExchange": { + "description": "The exchange that this trade happened on.", + "type": "integer" + }, + "TradeId": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "Updated": { + "description": "The last updated timestamp.", + "type": "integer" + }, + "V1LastBase": { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + }, + "symbol": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "symbol", + "status", + "request_id" + ], + "type": "object" + }, + "V2AggsBase": { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + "V2LastBase": { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + }, + "V2TicksBase": { + "properties": { + "db_latency": { + "description": "Latency in milliseconds for the query results from the database.", + "type": "integer" + }, + "results_count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "success": { + "description": "Whether or not this query was executed successfully.", + "type": "boolean" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "type": "object" + }, + "Volume": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "VolumeWeight": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "securitySchemes": { + "apiKey": { + "in": "query", + "name": "apiKey", + "type": "apiKey" + } + } + }, + "info": { + "description": "The future of fintech.", + "title": "Polygon API", + "version": "1.0.0" + }, + "openapi": "3.0.3", + "paths": { + "/v1/conversion/{from}/{to}": { + "get": { + "description": "Get currency conversions using the latest market conversion rates. Note than you can convert in both directions. For example USD to CAD or CAD to USD.", + "operationId": "RealTimeCurrencyConversion", + "parameters": [ + { + "description": "The \"from\" symbol of the pair.", + "example": "AUD", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The \"to\" symbol of the pair.", + "example": "USD", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The amount to convert, with a decimal.", + "example": 100, + "in": "query", + "name": "amount", + "schema": { + "default": 1, + "type": "number" + } + }, + { + "description": "The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy.", + "example": 2, + "in": "query", + "name": "precision", + "schema": { + "default": 2, + "enum": [ + 0, + 1, + 2, + 3, + 4 + ], + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "converted": 73.14, + "from": "AUD", + "initialAmount": 100, + "last": { + "ask": 1.3673344, + "bid": 1.3672596, + "exchange": 48, + "timestamp": 1605555313000 + }, + "request_id": "a73a29dbcab4613eeaf48583d3baacf0", + "status": "success", + "symbol": "AUD/USD", + "to": "USD" + }, + "schema": { + "properties": { + "converted": { + "description": "The result of the conversion.", + "format": "double", + "type": "number" + }, + "from": { + "description": "The \"from\" currency symbol.", + "type": "string" + }, + "initialAmount": { + "description": "The amount to convert.", + "format": "double", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "last": { + "properties": { + "ask": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "bid": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "exchange": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "timestamp": { + "description": "The Unix millisecond timestamp.", + "type": "integer", + "x-polygon-go-type": { + "name": "IMilliseconds", + "path": "github.com/polygon-io/ptime" + } + } + }, + "required": [ + "exchange", + "timestamp", + "ask", + "bid" + ], + "type": "object", + "x-polygon-go-type": { + "name": "LastQuoteCurrencies" + } + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + }, + "symbol": { + "description": "The symbol pair that was evaluated from the request.", + "type": "string" + }, + "to": { + "description": "The \"to\" currency symbol.", + "type": "string" + } + }, + "required": [ + "status", + "request_id", + "from", + "to", + "symbol", + "initialAmount", + "converted" + ], + "type": "object" + } + }, + "text/csv": { + "example": "ask,bid,exchange,timestamp\n1.3673344,1.3672596,48,1605555313000\n", + "schema": { + "type": "string" + } + } + }, + "description": "The last tick for this currency pair, plus the converted amount for the requested amount." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Real-time Currency Conversion", + "tags": [ + "fx:conversion" + ], + "x-polygon-entitlement-data-type": { + "description": "NBBO data", + "name": "nbbo" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + } + }, + "/v1/historic/crypto/{from}/{to}/{date}": { + "get": { + "description": "Get historic trade ticks for a cryptocurrency pair.\n", + "parameters": [ + { + "description": "The \"from\" symbol of the crypto pair.", + "example": "BTC", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The \"to\" symbol of the crypto pair.", + "example": "USD", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The date/day of the historic ticks to retrieve.", + "example": "2020-10-14", + "in": "path", + "name": "date", + "required": true, + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results.\n", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "description": "Limit the size of the response, max 10000.", + "example": 100, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "day": "2020-10-14T00:00:00.000Z", + "map": { + "c": "conditions", + "p": "price", + "s": "size", + "t": "timestamp", + "x": "exchange" + }, + "msLatency": 1, + "status": "success", + "symbol": "BTC-USD", + "ticks": [ + { + "c": [ + 2 + ], + "p": 15482.89, + "s": 0.00188217, + "t": 1604880000067, + "x": 1 + }, + { + "c": [ + 2 + ], + "p": 15482.11, + "s": 0.00161739, + "t": 1604880000167, + "x": 1 + } + ], + "type": "crypto" + }, + "schema": { + "allOf": [ + { + "description": "The status of this request's response.", + "type": "string" + }, + { + "properties": { + "day": { + "description": "The date that was evaluated from the request.", + "format": "date", + "type": "string" + }, + "map": { + "description": "A map for shortened result keys.", + "type": "object" + }, + "msLatency": { + "description": "The milliseconds of latency for the query results.", + "type": "integer" + }, + "symbol": { + "description": "The symbol pair that was evaluated from the request.", + "type": "string" + }, + "ticks": { + "items": { + "properties": { + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "x", + "c", + "t", + "i" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "day", + "map", + "msLatency", + "symbol", + "ticks" + ], + "type": "object" + } + ] + } + } + }, + "description": "An array of crypto trade ticks." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Historic Crypto Trades", + "tags": [ + "crypto:trades" + ], + "x-polygon-deprecation": { + "date": 1654056060000, + "replaces": { + "name": "Trades v3", + "path": "get_v3_trades__cryptoticker" + } + }, + "x-polygon-entitlement-data-type": { + "description": "Trade data", + "name": "trades" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + } + }, + "/v1/historic/forex/{from}/{to}/{date}": { + "get": { + "description": "Get historic ticks for a forex currency pair.\n", + "parameters": [ + { + "description": "The \"from\" symbol of the currency pair.\n\nExample: For **USD/JPY** the `from` would be **USD**.\n", + "example": "AUD", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The \"to\" symbol of the currency pair.\n\nExample: For **USD/JPY** the `to` would be **JPY**.\n", + "example": "USD", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The date/day of the historic ticks to retrieve.", + "example": "2020-10-14", + "in": "path", + "name": "date", + "required": true, + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results.\n", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "description": "Limit the size of the response, max 10000.", + "example": 100, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "day": "2020-10-14", + "map": { + "ap": "ask", + "bp": "bid", + "t": "timestamp" + }, + "msLatency": "0", + "pair": "AUD/USD", + "status": "success", + "ticks": [ + { + "ap": 0.71703, + "bp": 0.71701, + "t": 1602633600000, + "x": 48 + }, + { + "ap": 0.71703, + "bp": 0.717, + "t": 1602633600000, + "x": 48 + }, + { + "ap": 0.71702, + "bp": 0.717, + "t": 1602633600000, + "x": 48 + } + ], + "type": "forex" + }, + "schema": { + "allOf": [ + { + "properties": { + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + { + "properties": { + "day": { + "description": "The date that was evaluated from the request.", + "format": "date", + "type": "string" + }, + "map": { + "description": "A map for shortened result keys.", + "type": "object" + }, + "msLatency": { + "description": "The milliseconds of latency for the query results.", + "type": "integer" + }, + "pair": { + "description": "The currency pair that was evaluated from the request.", + "type": "string" + }, + "ticks": { + "items": { + "properties": { + "a": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "b": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + } + }, + "required": [ + "a", + "b", + "x", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "day", + "map", + "msLatency", + "pair", + "ticks" + ], + "type": "object" + } + ] + } + } + }, + "description": "An array of forex ticks" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Historic Forex Ticks", + "tags": [ + "fx:trades" + ], + "x-polygon-deprecation": { + "date": 1654056060000, + "replaces": { + "name": "Quotes (BBO) v3", + "path": "get_v3_quotes__fxticker" + } + }, + "x-polygon-entitlement-data-type": { + "description": "NBBO data", + "name": "nbbo" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + } + }, + "/v1/indicators/ema/{cryptoTicker}": { + "get": { + "description": "Get the exponential moving average (EMA) for a ticker symbol over a given time range.", + "operationId": "CryptoEMA", + "parameters": [ + { + "description": "The ticker symbol for which to get exponential moving average (EMA) data.", + "example": "X:BTCUSD", + "in": "path", + "name": "cryptoTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 50, + "in": "query", + "name": "window", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to \ncalculate the exponential moving average (EMA).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/ema/X:BTCUSD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 140.139 + } + ] + }, + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "EMAResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nX:BTCUSD,55188.33773657,18970.3019,0,18816.66899332,19165.98,19333,18690,1664164800000,297389,,0,,0,0,0,0,0,false,1664164800000,19846.01135387188\nX:BTCUSD,4798.38258637,18914.0766,0,18928,18784.41,19184.3,18636,1664078400000,78936,,0,,0,0,0,0,0,false,1664078400000,19902.65703099573\nX:BTCUSD,4798.38258637,18914.0766,0,18928,18784.41,19184.3,18636,1664064000000,78936,,0,,0,0,0,0,0,false,1664064000000,19948.29976695474\nX:BTCUSD,15457.24362826,19317.486,0,19529.04,19475.84,19651.2772302,18846.67,1664409600000,191936,,0,,0,0,0,0,0,false,1664409600000,19751.714760699124\nX:BTCUSD,23180.93663313,19103.9189,0,19090,19416.20352522,19791,18461,1664337600000,225076,,0,,0,0,0,0,0,false,1664337600000,19762.974955013375\nX:BTCUSD,17479.00092209,19776.6697,0,19228.2,19141.78,20372.17374536,18821.55,1664251200000,183075,,0,,0,0,0,0,0,false,1664251200000,19791.86053850303\nX:BTCUSD,2868.09828007,19069.8521,0,19210.31,18925.87,19400,18805.1,1663992000000,58721,,0,,0,0,0,0,0,false,1663992000000,19995.805471728403\nX:BTCUSD,23180.93663313,19103.9189,0,19090,19416.20352522,19791,18461,1664323200000,225076,,0,,0,0,0,0,0,false,1664323200000,19777.128890923308\nX:BTCUSD,17479.00092209,19776.6697,0,19228.2,19141.78,20372.17374536,18821.55,1664236800000,183075,,0,,0,0,0,0,0,false,1664236800000,19818.394438033767\nX:BTCUSD,55188.33773657,18970.3019,0,18816.66899332,19165.98,19333,18690,1664150400000,297389,,0,,0,0,0,0,0,false,1664150400000,19873.767735662568\n", + "schema": { + "type": "string" + } + } + }, + "description": "Exponential Moving Average (EMA) data for each period." + } + }, + "summary": "Exponential Moving Average (EMA)", + "tags": [ + "crypto:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/ema/{fxTicker}": { + "get": { + "description": "Get the exponential moving average (EMA) for a ticker symbol over a given time range.", + "operationId": "ForexEMA", + "parameters": [ + { + "description": "The ticker symbol for which to get exponential moving average (EMA) data.", + "example": "C:EURUSD", + "in": "path", + "name": "fxTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 50, + "in": "query", + "name": "window", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to \ncalculate the exponential moving average (EMA).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/ema/C:USDAUD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/C:USDAUD/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 140.139 + } + ] + }, + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "EMAResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nC:USDAUD,685,1.5537,0,1.5539533,1.5371372,1.5705737,1.5316281,1664323200000,685,,0,,0,0,0,0,0,false,1664323200000,1.4915199239999994\nC:USDAUD,550,1.5405,0,1.5298,1.54531,1.5526263,1.5298,1664164800000,550,,0,,0,0,0,0,0,false,1664164800000,1.4863299679999997\nC:USDAUD,10,1.5312,0,1.5324261,1.53107,1.5326375,1.5301,1664078400000,10,,0,,0,0,0,0,0,false,1664078400000,1.4826388699999997\nC:USDAUD,686,1.5442,0,1.53763,1.5404,1.5526022,1.537279,1664409600000,686,,0,,0,0,0,0,0,false,1664409600000,1.4942168479999998\nC:USDAUD,536,1.5459,0,1.5446162,1.5550165,1.5587,1.5364287,1664251200000,536,,0,,0,0,0,0,0,false,1664251200000,1.4900704799999993\nC:USDAUD,536,1.5459,0,1.5446162,1.5550165,1.5587,1.5364287,1664236800000,536,,0,,0,0,0,0,0,false,1664236800000,1.4882634499999994\nC:USDAUD,550,1.5405,0,1.5298,1.54531,1.5526263,1.5298,1664150400000,550,,0,,0,0,0,0,0,false,1664150400000,1.4845906159999998\nC:USDAUD,10,1.5312,0,1.5324261,1.53107,1.5326375,1.5301,1664064000000,10,,0,,0,0,0,0,0,false,1664064000000,1.4809719239999999\nC:USDAUD,1,1.5314,0,1.5313936,1.5313936,1.5313936,1.5313936,1663977600000,1,,0,,0,0,0,0,0,false,1663977600000,1.4794745239999998\nC:USDAUD,685,1.5537,0,1.5539533,1.5371372,1.5705737,1.5316281,1664337600000,685,,0,,0,0,0,0,0,false,1664337600000,1.4928357579999996\n", + "schema": { + "type": "string" + } + } + }, + "description": "Exponential Moving Average (EMA) data for each period." + } + }, + "summary": "Exponential Moving Average (EMA)", + "tags": [ + "fx:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/ema/{indicesTicker}": { + "get": { + "description": "Get the exponential moving average (EMA) for a ticker symbol over a given time range.", + "operationId": "IndicesEMA", + "parameters": [ + { + "description": "The ticker symbol for which to get exponential moving average (EMA) data.", + "example": "I:NDX", + "in": "path", + "name": "indicesTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 50, + "in": "query", + "name": "window", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "The value in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close values to \ncalculate the exponential moving average (EMA).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/ema/I:NDX?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTE1MDg0Ljk5OTM4OTgyMDAzJTJDJTIyaCUyMiUzQTAlMkMlMjJsJTIyJTNBMCUyQyUyMnQlMjIlM0ExNjg3MjE5MjAwMDAwJTdEJmFzPSZleHBhbmRfdW5kZXJseWluZz1mYWxzZSZsaW1pdD0xJm9yZGVyPWRlc2Mmc2VyaWVzX3R5cGU9Y2xvc2UmdGltZXNwYW49ZGF5JnRpbWVzdGFtcC5sdD0xNjg3MjM3MjAwMDAwJndpbmRvdz01MA", + "request_id": "b9201816341441eed663a90443c0623a", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366449650?limit=226&sort=desc" + }, + "values": [ + { + "timestamp": 1687237200000, + "value": 14452.002555459003 + } + ] + }, + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "EMAResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Exponential Moving Average (EMA) data for each period." + } + }, + "summary": "Exponential Moving Average (EMA)", + "tags": [ + "indices:aggregates" + ], + "x-polygon-entitlement-allowed-limited-tickers": true, + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Indices data", + "name": "indices" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/ema/{optionsTicker}": { + "get": { + "description": "Get the exponential moving average (EMA) for a ticker symbol over a given time range.", + "operationId": "OptionsEMA", + "parameters": [ + { + "description": "The ticker symbol for which to get exponential moving average (EMA) data.", + "example": "O:SPY241220P00720000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 50, + "in": "query", + "name": "window", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to \ncalculate the exponential moving average (EMA).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/ema/O:SPY241220P00720000?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/O:SPY241220P00720000/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 140.139 + } + ] + }, + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "EMAResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value O:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649217600000,1,,0,,0,0,0,0,0,false,1649217600000,286.1730473491824 O:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649131200000,1,,0,,0,0,0,0,0,false,1649131200000,285.60990642465924 O:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649044800000,1,,0,,0,0,0,0,0,false,1649044800000,285.023780156278 O:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648785600000,1,,0,,0,0,0,0,0,false,1648785600000,284.4137303667383 O:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648526400000,1,,0,,0,0,0,0,0,false,1648526400000,282.43007426223943 O:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649304000000,1,,0,,0,0,0,0,0,false,1649304000000,286.7141043158811 O:SPY241220P00720000,2,270.49,0,270.49,270.49,270.49,270.49,1649390400000,1,,0,,0,0,0,0,0,false,1649390400000,286.0778649309446 O:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648699200000,1,,0,,0,0,0,0,0,false,1648699200000,283.77878058578887 O:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648612800000,1,,0,,0,0,0,0,0,false,1648612800000,283.11791448724966 O:SPY241220P00720000,3,277.8267,0,277.82,277.83,277.83,277.82,1649649600000,2,,0,,0,0,0,0,0,false,1649649600000,285.7544192473781", + "schema": { + "type": "string" + } + } + }, + "description": "Exponential Moving Average (EMA) data for each period." + } + }, + "summary": "Exponential Moving Average (EMA)", + "tags": [ + "options:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/ema/{stockTicker}": { + "get": { + "description": "Get the exponential moving average (EMA) for a ticker symbol over a given time range.", + "operationId": "EMA", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol for which to get exponential moving average (EMA) data. For example, AAPL represents Apple Inc.", + "example": "AAPL", + "in": "path", + "name": "stockTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the exponential moving average are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the exponential moving average (EMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 50, + "in": "query", + "name": "window", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the exponential moving average. i.e. 'close' will result in using close prices to \ncalculate the exponential moving average (EMA).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/ema/AAPL?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 140.139 + } + ] + }, + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "EMAResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nAAPL,8.1599225E+07,152.5505,0,149.31,154.48,154.56,149.1,1663560000000,671961,,0,,0,0,0,0,0,false,1663560000000,163.17972071441582\nAAPL,8.4461761E+07,152.1354,0,152.74,151.76,154.72,149.945,1664251200000,683781,,0,,0,0,0,0,0,false,1664251200000,160.92194334973746\nAAPL,9.3308449E+07,156.1877,0,157.34,153.72,158.61,153.6,1663732800000,712645,,0,,0,0,0,0,0,false,1663732800000,162.5721451116157\nAAPL,1.07691097E+08,156.1317,0,153.4,156.9,158.08,153.08,1663646400000,792177,,0,,0,0,0,0,0,false,1663646400000,162.93345715698777\nAAPL,9.6031641E+07,150.0222,0,151.19,150.43,151.47,148.56,1663905600000,766888,,0,,0,0,0,0,0,false,1663905600000,161.72552880161066\nAAPL,8.6651514E+07,152.5709,0,152.38,152.74,154.47,150.91,1663819200000,686866,,0,,0,0,0,0,0,false,1663819200000,162.18657079351314\nAAPL,1.64879031E+08,150.2387,0,151.21,150.7,151.35,148.37,1663300800000,850358,,0,,0,0,0,0,0,false,1663300800000,163.53481135582055\nAAPL,1.27842348E+08,142.9013,0,146.1,142.48,146.72,140.68,1664424000000,1061605,,0,,0,0,0,0,0,false,1664424000000,159.78118646009983\nAAPL,1.46755122E+08,147.599,0,147.64,149.84,150.6414,144.84,1664337600000,1140818,,0,,0,0,0,0,0,false,1664337600000,160.48735733602226\nAAPL,9.3339409E+07,151.5222,0,149.66,150.77,153.7701,149.64,1664164800000,747666,,0,,0,0,0,0,0,false,1664164800000,161.29590022115534\n", + "schema": { + "type": "string" + } + } + }, + "description": "Exponential Moving Average (EMA) data for each period." + } + }, + "summary": "Exponential Moving Average (EMA)", + "tags": [ + "stocks:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v1/indicators/macd/{cryptoTicker}": { + "get": { + "description": "Get moving average convergence/divergence (MACD) data for a ticker symbol over a given time range.", + "operationId": "CryptoMACD", + "parameters": [ + { + "description": "The ticker symbol for which to get MACD data.", + "example": "X:BTCUSD", + "in": "path", + "name": "cryptoTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "The short window size used to calculate MACD data.", + "example": 12, + "in": "query", + "name": "short_window", + "schema": { + "default": 12, + "type": "integer" + } + }, + { + "description": "The long window size used to calculate MACD data.", + "example": 26, + "in": "query", + "name": "long_window", + "schema": { + "default": 26, + "type": "integer" + } + }, + { + "description": "The window size used to calculate the MACD signal line.", + "example": 9, + "in": "query", + "name": "signal_window", + "schema": { + "default": 9, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate MACD data. i.e. 'close' will result in using close prices to \ncalculate the MACD.", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/macd/X:BTCUSD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "histogram": 38.3801666667, + "signal": 106.9811666667, + "timestamp": 1517562000016, + "value": 145.3613333333 + }, + { + "histogram": 41.098859136, + "signal": 102.7386283473, + "timestamp": 1517562001016, + "value": 143.8374874833 + } + ] + }, + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "histogram": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "signal": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "MACDResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value,signal,histogram\nX:BTCUSD,23180.93663313,19103.9189,0,19090,19416.20352522,19791,18461,1664323200000,225076,,0,,0,0,0,0,0,false,1664323200000,-200.79662915774315,-281.5009533935604,80.70432423581724\nX:BTCUSD,17479.00092209,19776.6697,0,19228.2,19141.78,20372.17374536,18821.55,1664236800000,183075,,0,,0,0,0,0,0,false,1664236800000,-264.55324270273195,-316.4388906203941,51.88564791766214\nX:BTCUSD,55188.33773657,18970.3019,0,18816.66899332,19165.98,19333,18690,1664150400000,297389,,0,,0,0,0,0,0,false,1664150400000,-317.75700272815084,-339.5909474061525,21.83394467800167\nX:BTCUSD,4798.38258637,18914.0766,0,18928,18784.41,19184.3,18636,1664078400000,78936,,0,,0,0,0,0,0,false,1664078400000,-350.23805379084297,-345.0494335756529,-5.188620215190042\nX:BTCUSD,4798.38258637,18914.0766,0,18928,18784.41,19184.3,18636,1664064000000,78936,,0,,0,0,0,0,0,false,1664064000000,-347.75055091027025,-343.7522785218554,-3.9982723884148754\nX:BTCUSD,2868.09828007,19069.8521,0,19210.31,18925.87,19400,18805.1,1663992000000,58721,,0,,0,0,0,0,0,false,1663992000000,-339.51740285673077,-342.7527104247516,3.2353075680208576\nX:BTCUSD,11337.77105153,19346.509,0,19527.23,19487.24,19640,18846.95,1664409600000,142239,,0,,0,0,0,0,0,false,1664409600000,-130.70646519456568,-232.81921860513586,102.11275341057018\nX:BTCUSD,23180.93663313,19103.9189,0,19090,19416.20352522,19791,18461,1664337600000,225076,,0,,0,0,0,0,0,false,1664337600000,-165.73322121465026,-258.3474069577784,92.61418574312813\nX:BTCUSD,17479.00092209,19776.6697,0,19228.2,19141.78,20372.17374536,18821.55,1664251200000,183075,,0,,0,0,0,0,0,false,1664251200000,-242.62960978099727,-301.6770344525147,59.04742467151743\nX:BTCUSD,55188.33773657,18970.3019,0,18816.66899332,19165.98,19333,18690,1664164800000,297389,,0,,0,0,0,0,0,false,1664164800000,-288.68772337443806,-329.4103025998096,40.72257922537153\n", + "schema": { + "type": "string" + } + } + }, + "description": "Moving Average Convergence/Divergence (MACD) data for each period." + } + }, + "summary": "Moving Average Convergence/Divergence (MACD)", + "tags": [ + "crypto:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/macd/{fxTicker}": { + "get": { + "description": "Get moving average convergence/divergence (MACD) data for a ticker symbol over a given time range.", + "operationId": "ForexMACD", + "parameters": [ + { + "description": "The ticker symbol for which to get MACD data.", + "example": "C:EURUSD", + "in": "path", + "name": "fxTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The short window size used to calculate MACD data.", + "example": 12, + "in": "query", + "name": "short_window", + "schema": { + "default": 12, + "type": "integer" + } + }, + { + "description": "The long window size used to calculate MACD data.", + "example": 26, + "in": "query", + "name": "long_window", + "schema": { + "default": 26, + "type": "integer" + } + }, + { + "description": "The window size used to calculate the MACD signal line.", + "example": 9, + "in": "query", + "name": "signal_window", + "schema": { + "default": 9, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to \ncalculate the MACD.", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/macd/C:USDAUD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/C:USDAUD/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "histogram": 38.3801666667, + "signal": 106.9811666667, + "timestamp": 1517562000016, + "value": 145.3613333333 + }, + { + "histogram": 41.098859136, + "signal": 102.7386283473, + "timestamp": 1517562001016, + "value": 143.8374874833 + } + ] + }, + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "histogram": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "signal": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "MACDResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value,signal,histogram\nC:USDAUD,687,1.5442,0,1.53763,1.5386983,1.5526022,1.537279,1664409600000,687,,0,,0,0,0,0,0,false,1664409600000,0.0160095063995076,0.016240853664654657,-0.0002313472651470569\nC:USDAUD,536,1.5459,0,1.5446162,1.5550165,1.5587,1.5364287,1664251200000,536,,0,,0,0,0,0,0,false,1664251200000,0.019060448457087098,0.015690709670065223,0.0033697387870218753\nC:USDAUD,550,1.5405,0,1.5298,1.54531,1.5526263,1.5298,1664164800000,550,,0,,0,0,0,0,0,false,1664164800000,0.017190795754692623,0.013971241529748895,0.003219554224943728\nC:USDAUD,1,1.5314,0,1.5313936,1.5313936,1.5313936,1.5313936,1663977600000,1,,0,,0,0,0,0,0,false,1663977600000,0.014349509127189686,0.010792069356789809,0.0035574397703998766\nC:USDAUD,685,1.5537,0,1.5539533,1.5371372,1.5705737,1.5316281,1664337600000,685,,0,,0,0,0,0,0,false,1664337600000,0.0169083298713677,0.016298690480941423,0.0006096393904262767\nC:USDAUD,685,1.5537,0,1.5539533,1.5371372,1.5705737,1.5316281,1664323200000,685,,0,,0,0,0,0,0,false,1664323200000,0.017968564486413374,0.016146280633334852,0.001822283853078522\nC:USDAUD,536,1.5459,0,1.5446162,1.5550165,1.5587,1.5364287,1664236800000,536,,0,,0,0,0,0,0,false,1664236800000,0.018356408747553177,0.014848274973309752,0.0035081337742434247\nC:USDAUD,550,1.5405,0,1.5298,1.54531,1.5526263,1.5298,1664150400000,550,,0,,0,0,0,0,0,false,1664150400000,0.016441299960100686,0.01316635297351296,0.0032749469865877255\nC:USDAUD,10,1.5312,0,1.5324261,1.53107,1.5326375,1.5301,1664078400000,10,,0,,0,0,0,0,0,false,1664078400000,0.015245524601038118,0.012347616226866026,0.002897908374172092\nC:USDAUD,10,1.5312,0,1.5324261,1.53107,1.5326375,1.5301,1664064000000,10,,0,,0,0,0,0,0,false,1664064000000,0.014947418239455779,0.011623139133323003,0.0033242791061327756\n", + "schema": { + "type": "string" + } + } + }, + "description": "Moving Average Convergence/Divergence (MACD) data for each period." + } + }, + "summary": "Moving Average Convergence/Divergence (MACD)", + "tags": [ + "fx:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/macd/{indicesTicker}": { + "get": { + "description": "Get moving average convergence/divergence (MACD) for a ticker symbol over a given time range.", + "operationId": "IndicesMACD", + "parameters": [ + { + "description": "The ticker symbol for which to get MACD data.", + "example": "I:NDX", + "in": "path", + "name": "indicesTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The short window size used to calculate MACD data.", + "example": 12, + "in": "query", + "name": "short_window", + "schema": { + "default": 12, + "type": "integer" + } + }, + { + "description": "The long window size used to calculate MACD data.", + "example": 26, + "in": "query", + "name": "long_window", + "schema": { + "default": 26, + "type": "integer" + } + }, + { + "description": "The window size used to calculate the MACD signal line.", + "example": 9, + "in": "query", + "name": "signal_window", + "schema": { + "default": 9, + "type": "integer" + } + }, + { + "description": "The value in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close values to \ncalculate the MACD.", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/macd/I:NDX?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTE1MDg0Ljk5OTM4OTgyMDAzJTJDJTIyaCUyMiUzQTAlMkMlMjJsJTIyJTNBMCUyQyUyMnQlMjIlM0ExNjg3MTUwODAwMDAwJTdEJmFzPSZleHBhbmRfdW5kZXJseWluZz1mYWxzZSZsaW1pdD0yJmxvbmdfd2luZG93PTI2Jm9yZGVyPWRlc2Mmc2VyaWVzX3R5cGU9Y2xvc2Umc2hvcnRfd2luZG93PTEyJnNpZ25hbF93aW5kb3c9OSZ0aW1lc3Bhbj1kYXkmdGltZXN0YW1wLmx0PTE2ODcyMTkyMDAwMDA", + "request_id": "2eeda0be57e83cbc64cc8d1a74e84dbd", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366537196?limit=121&sort=desc" + }, + "values": [ + { + "histogram": -4.7646219788108795, + "signal": 220.7596784587801, + "timestamp": 1687237200000, + "value": 215.9950564799692 + }, + { + "histogram": 3.4518937661882205, + "signal": 221.9508339534828, + "timestamp": 1687219200000, + "value": 225.40272771967102 + } + ] + }, + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "histogram": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "signal": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "MACDResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Moving Average Convergence/Divergence (MACD) data for each period." + } + }, + "summary": "Moving Average Convergence/Divergence (MACD)", + "tags": [ + "indices:aggregates" + ], + "x-polygon-entitlement-allowed-limited-tickers": true, + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Indices data", + "name": "indices" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/macd/{optionsTicker}": { + "get": { + "description": "Get moving average convergence/divergence (MACD) for a ticker symbol over a given time range.", + "operationId": "OptionsMACD", + "parameters": [ + { + "description": "The ticker symbol for which to get MACD data.", + "example": "O:SPY241220P00720000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The short window size used to calculate MACD data.", + "example": 12, + "in": "query", + "name": "short_window", + "schema": { + "default": 12, + "type": "integer" + } + }, + { + "description": "The long window size used to calculate MACD data.", + "example": 26, + "in": "query", + "name": "long_window", + "schema": { + "default": 26, + "type": "integer" + } + }, + { + "description": "The window size used to calculate the MACD signal line.", + "example": 9, + "in": "query", + "name": "signal_window", + "schema": { + "default": 9, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to \ncalculate the MACD.", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/macd/O:SPY241220P00720000?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/O:SPY241220P00720000/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "histogram": 38.3801666667, + "signal": 106.9811666667, + "timestamp": 1517562000016, + "value": 145.3613333333 + }, + { + "histogram": 41.098859136, + "signal": 102.7386283473, + "timestamp": 1517562001016, + "value": 143.8374874833 + } + ] + }, + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "histogram": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "signal": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "MACDResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value,signal,histogram\nO:SPY241220P00720000,3,277.8267,0,277.82,277.83,277.83,277.82,1649649600000,2,,0,,0,0,0,0,0,false,1649649600000,-0.05105556065990413,3.5771695836806834,-3.6282251443405875\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649304000000,1,,0,,0,0,0,0,0,false,1649304000000,4.047960862047148,5.247666286053219,-1.199705424006071\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648785600000,1,,0,,0,0,0,0,0,false,1648785600000,5.255380647906861,6.466477305754766,-1.2110966578479045\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648699200000,1,,0,,0,0,0,0,0,false,1648699200000,5.591072756938104,6.769251470216741,-1.178178713278637\nO:SPY241220P00720000,2,270.49,0,270.49,270.49,270.49,270.49,1649390400000,1,,0,,0,0,0,0,0,false,1649390400000,1.4304642046162712,4.48422586976583,-3.053761665149559\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649217600000,1,,0,,0,0,0,0,0,false,1649217600000,4.32835898317461,5.547592642054737,-1.2192336588801274\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649131200000,1,,0,,0,0,0,0,0,false,1649131200000,4.623290999840208,5.852401056774768,-1.2291100569345605\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649044800000,1,,0,,0,0,0,0,0,false,1649044800000,4.932483632022979,6.159678571008409,-1.2271949389854298\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648612800000,1,,0,,0,0,0,0,0,false,1648612800000,5.93821326327344,7.063796148536399,-1.1255828852629595\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648526400000,1,,0,,0,0,0,0,0,false,1648526400000,6.294916771166584,7.345191869852139,-1.050275098685555\n", + "schema": { + "type": "string" + } + } + }, + "description": "Moving Average Convergence/Divergence (MACD) data for each period." + } + }, + "summary": "Moving Average Convergence/Divergence (MACD)", + "tags": [ + "options:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/macd/{stockTicker}": { + "get": { + "description": "Get moving average convergence/divergence (MACD) data for a ticker symbol over a given time range.", + "operationId": "MACD", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol for which to get moving average convergence/divergence (MACD) data. For example, AAPL represents Apple Inc.", + "example": "AAPL", + "in": "path", + "name": "stockTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the MACD are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The short window size used to calculate MACD data.", + "example": 12, + "in": "query", + "name": "short_window", + "schema": { + "default": 12, + "type": "integer" + } + }, + { + "description": "The long window size used to calculate MACD data.", + "example": 26, + "in": "query", + "name": "long_window", + "schema": { + "default": 26, + "type": "integer" + } + }, + { + "description": "The window size used to calculate the MACD signal line.", + "example": 9, + "in": "query", + "name": "signal_window", + "schema": { + "default": 9, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the MACD. i.e. 'close' will result in using close prices to \ncalculate the MACD.", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/macd/AAPL?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "histogram": 38.3801666667, + "signal": 106.9811666667, + "timestamp": 1517562000016, + "value": 145.3613333333 + }, + { + "histogram": 41.098859136, + "signal": 102.7386283473, + "timestamp": 1517562001016, + "value": 143.8374874833 + } + ] + }, + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "histogram": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "signal": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + }, + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "MACDResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value,signal,histogram\nAAPL,1.27842348E+08,142.9013,0,146.1,142.48,146.72,140.68,1664424000000,1061605,,0,,0,0,0,0,0,false,1664424000000,-5.413804946923619,-3.8291158739479005,-1.5846890729757188\nAAPL,8.4461761E+07,152.1354,0,152.74,151.76,154.72,149.945,1664251200000,683781,,0,,0,0,0,0,0,false,1664251200000,-4.63165683097526,-3.098305244715017,-1.5333515862602427\nAAPL,9.3339409E+07,151.5222,0,149.66,150.77,153.7701,149.64,1664164800000,747666,,0,,0,0,0,0,0,false,1664164800000,-4.581291216131007,-2.7149673481499565,-1.86632386798105\nAAPL,9.3308449E+07,156.1877,0,157.34,153.72,158.61,153.6,1663732800000,712645,,0,,0,0,0,0,0,false,1663732800000,-3.6311474313744156,-1.1648824074663984,-2.4662650239080173\nAAPL,1.64879031E+08,150.2387,0,151.21,150.7,151.35,148.37,1663300800000,850358,,0,,0,0,0,0,0,false,1663300800000,-2.533545758578896,0.9308104167079131,-3.464356175286809\nAAPL,1.46755122E+08,147.599,0,147.64,149.84,150.6414,144.84,1664337600000,1140818,,0,,0,0,0,0,0,false,1664337600000,-4.771497049659786,-3.432943605703971,-1.3385534439558149\nAAPL,9.6031641E+07,150.0222,0,151.19,150.43,151.47,148.56,1663905600000,766888,,0,,0,0,0,0,0,false,1663905600000,-4.349569413677017,-2.2483863811546936,-2.1011830325223233\nAAPL,8.6651514E+07,152.5709,0,152.38,152.74,154.47,150.91,1663819200000,686866,,0,,0,0,0,0,0,false,1663819200000,-3.9559234852549707,-1.7230906230241128,-2.232832862230858\nAAPL,1.07691097E+08,156.1317,0,153.4,156.9,158.08,153.08,1663646400000,792177,,0,,0,0,0,0,0,false,1663646400000,-3.2635802145105117,-0.548316151489394,-2.7152640630211176\nAAPL,8.1599225E+07,152.5505,0,149.31,154.48,154.56,149.1,1663560000000,671961,,0,,0,0,0,0,0,false,1663560000000,-3.070742345502225,0.13049986426588545,-3.2012422097681106\n", + "schema": { + "type": "string" + } + } + }, + "description": "Moving Average Convergence/Divergence (MACD) data for each period." + } + }, + "summary": "Moving Average Convergence/Divergence (MACD)", + "tags": [ + "stocks:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v1/indicators/rsi/{cryptoTicker}": { + "get": { + "description": "Get the relative strength index (RSI) for a ticker symbol over a given time range.", + "operationId": "CryptoRSI", + "parameters": [ + { + "description": "The ticker symbol for which to get relative strength index (RSI) data.", + "example": "X:BTCUSD", + "in": "path", + "name": "cryptoTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "The window size used to calculate the relative strength index (RSI). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 14, + "in": "query", + "name": "window", + "schema": { + "default": 14, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to \ncalculate the relative strength index (RSI).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/rsi/X:BTCUSD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 82.19 + } + ] + }, + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "RSIResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nX:BTCUSD,15457.24362826,19317.486,0,19529.04,19475.84,19651.2772302,18846.67,1664409600000,191936,,0,,0,0,0,0,0,false,1664409600000,52.040915721136884\nX:BTCUSD,17479.00092209,19776.6697,0,19228.2,19141.78,20372.17374536,18821.55,1664251200000,183075,,0,,0,0,0,0,0,false,1664251200000,44.813590401722564\nX:BTCUSD,17479.00092209,19776.6697,0,19228.2,19141.78,20372.17374536,18821.55,1664236800000,183075,,0,,0,0,0,0,0,false,1664236800000,44.813590401722564\nX:BTCUSD,55188.33773657,18970.3019,0,18816.66899332,19165.98,19333,18690,1664164800000,297389,,0,,0,0,0,0,0,false,1664164800000,45.22751170711286\nX:BTCUSD,55188.33773657,18970.3019,0,18816.66899332,19165.98,19333,18690,1664150400000,297389,,0,,0,0,0,0,0,false,1664150400000,45.22751170711286\nX:BTCUSD,4798.38258637,18914.0766,0,18928,18784.41,19184.3,18636,1664078400000,78936,,0,,0,0,0,0,0,false,1664078400000,37.361825384231004\nX:BTCUSD,4798.38258637,18914.0766,0,18928,18784.41,19184.3,18636,1664064000000,78936,,0,,0,0,0,0,0,false,1664064000000,37.361825384231004\nX:BTCUSD,23180.93663313,19103.9189,0,19090,19416.20352522,19791,18461,1664337600000,225076,,0,,0,0,0,0,0,false,1664337600000,50.74235333598462\nX:BTCUSD,23180.93663313,19103.9189,0,19090,19416.20352522,19791,18461,1664323200000,225076,,0,,0,0,0,0,0,false,1664323200000,50.74235333598462\nX:BTCUSD,2868.09828007,19069.8521,0,19210.31,18925.87,19400,18805.1,1663992000000,58721,,0,,0,0,0,0,0,false,1663992000000,39.159457782344376\n", + "schema": { + "type": "string" + } + } + }, + "description": "Relative strength index data for each period." + } + }, + "summary": "Relative Strength Index (RSI)", + "tags": [ + "crypto:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/rsi/{fxTicker}": { + "get": { + "description": "Get the relative strength index (RSI) for a ticker symbol over a given time range.", + "operationId": "ForexRSI", + "parameters": [ + { + "description": "The ticker symbol for which to get relative strength index (RSI) data.", + "example": "C:EURUSD", + "in": "path", + "name": "fxTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the relative strength index (RSI).", + "example": 14, + "in": "query", + "name": "window", + "schema": { + "default": 14, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to \ncalculate the relative strength index (RSI).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/rsi/C:USDAUD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/C:USDAUD/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 82.19 + } + ] + }, + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "RSIResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nC:USDAUD,686,1.5442,0,1.53763,1.5404,1.5526022,1.537279,1664409600000,686,,0,,0,0,0,0,0,false,1664409600000,65.97230488287764\nC:USDAUD,550,1.5405,0,1.5298,1.54531,1.5526263,1.5298,1664164800000,550,,0,,0,0,0,0,0,false,1664164800000,79.3273623194404\nC:USDAUD,550,1.5405,0,1.5298,1.54531,1.5526263,1.5298,1664150400000,550,,0,,0,0,0,0,0,false,1664150400000,79.32736231944038\nC:USDAUD,10,1.5312,0,1.5324261,1.53107,1.5326375,1.5301,1664064000000,10,,0,,0,0,0,0,0,false,1664064000000,74.64770184023104\nC:USDAUD,685,1.5537,0,1.5539533,1.5371372,1.5705737,1.5316281,1664337600000,685,,0,,0,0,0,0,0,false,1664337600000,64.43214811875563\nC:USDAUD,685,1.5537,0,1.5539533,1.5371372,1.5705737,1.5316281,1664323200000,685,,0,,0,0,0,0,0,false,1664323200000,64.43214811875563\nC:USDAUD,536,1.5459,0,1.5446162,1.5550165,1.5587,1.5364287,1664251200000,536,,0,,0,0,0,0,0,false,1664251200000,81.95981214984681\nC:USDAUD,536,1.5459,0,1.5446162,1.5550165,1.5587,1.5364287,1664236800000,536,,0,,0,0,0,0,0,false,1664236800000,81.95981214984683\nC:USDAUD,10,1.5312,0,1.5324261,1.53107,1.5326375,1.5301,1664078400000,10,,0,,0,0,0,0,0,false,1664078400000,74.64770184023104\nC:USDAUD,1,1.5314,0,1.5313936,1.5313936,1.5313936,1.5313936,1663977600000,1,,0,,0,0,0,0,0,false,1663977600000,74.98028072374902\n", + "schema": { + "type": "string" + } + } + }, + "description": "Relative strength index data for each period." + } + }, + "summary": "Relative Strength Index (RSI)", + "tags": [ + "fx:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/rsi/{indicesTicker}": { + "get": { + "description": "Get the relative strength index (RSI) for a ticker symbol over a given time range.", + "operationId": "IndicesRSI", + "parameters": [ + { + "description": "The ticker symbol for which to get relative strength index (RSI) data.", + "example": "I:NDX", + "in": "path", + "name": "indicesTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the relative strength index (RSI).", + "example": 14, + "in": "query", + "name": "window", + "schema": { + "default": 14, + "type": "integer" + } + }, + { + "description": "The value in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close values to \ncalculate the relative strength index (RSI).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/rsi/I:NDX?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTE1MDg0Ljk5OTM4OTgyMDAzJTJDJTIyaCUyMiUzQTAlMkMlMjJsJTIyJTNBMCUyQyUyMnQlMjIlM0ExNjg3MjE5MjAwMDAwJTdEJmFzPSZleHBhbmRfdW5kZXJseWluZz1mYWxzZSZsaW1pdD0xJm9yZGVyPWRlc2Mmc2VyaWVzX3R5cGU9Y2xvc2UmdGltZXNwYW49ZGF5JnRpbWVzdGFtcC5sdD0xNjg3MjM3MjAwMDAwJndpbmRvdz0xNA", + "request_id": "28a8417f521f98e1d08f6ed7d1fbcad3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366658253?limit=66&sort=desc" + }, + "values": [ + { + "timestamp": 1687237200000, + "value": 73.98019439047955 + } + ] + }, + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "RSIResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Relative Strength Index (RSI) data for each period." + } + }, + "summary": "Relative Strength Index (RSI)", + "tags": [ + "indices:aggregates" + ], + "x-polygon-entitlement-allowed-limited-tickers": true, + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Indices data", + "name": "indices" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/rsi/{optionsTicker}": { + "get": { + "description": "Get the relative strength index (RSI) for a ticker symbol over a given time range.", + "operationId": "OptionsRSI", + "parameters": [ + { + "description": "The ticker symbol for which to get relative strength index (RSI) data.", + "example": "O:SPY241220P00720000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the relative strength index (RSI).", + "example": 14, + "in": "query", + "name": "window", + "schema": { + "default": 14, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to \ncalculate the relative strength index (RSI).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/rsi/O:SPY241220P00720000?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/O:SPY241220P00720000/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 82.19 + } + ] + }, + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "RSIResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nO:SPY241220P00720000,3,277.8267,0,277.82,277.83,277.83,277.82,1649649600000,2,,0,,0,0,0,0,0,false,1649649600000,30.837887188419387\nO:SPY241220P00720000,2,270.49,0,270.49,270.49,270.49,270.49,1649390400000,1,,0,,0,0,0,0,0,false,1649390400000,15.546598157051605\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648785600000,1,,0,,0,0,0,0,0,false,1648785600000,88.61520575036505\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648699200000,1,,0,,0,0,0,0,0,false,1648699200000,88.61520575036505\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648612800000,1,,0,,0,0,0,0,0,false,1648612800000,88.61520575036505\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648526400000,1,,0,,0,0,0,0,0,false,1648526400000,88.61520575036505\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649304000000,1,,0,,0,0,0,0,0,false,1649304000000,88.61520575036505\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649217600000,1,,0,,0,0,0,0,0,false,1649217600000,88.61520575036505\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649131200000,1,,0,,0,0,0,0,0,false,1649131200000,88.61520575036505\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649044800000,1,,0,,0,0,0,0,0,false,1649044800000,88.61520575036505\n", + "schema": { + "type": "string" + } + } + }, + "description": "Relative Strength Index (RSI) data for each period." + } + }, + "summary": "Relative Strength Index (RSI)", + "tags": [ + "options:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/rsi/{stockTicker}": { + "get": { + "description": "Get the relative strength index (RSI) for a ticker symbol over a given time range.", + "operationId": "RSI", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol for which to get relative strength index (RSI) data. For example, AAPL represents Apple Inc.", + "example": "AAPL", + "in": "path", + "name": "stockTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the relative strength index are adjusted for splits. By default, aggregates are adjusted. Set this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the relative strength index (RSI).", + "example": 14, + "in": "query", + "name": "window", + "schema": { + "default": 14, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the relative strength index. i.e. 'close' will result in using close prices to \ncalculate the relative strength index (RSI).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/rsi/AAPL?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 82.19 + } + ] + }, + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "RSIResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nAAPL,1.27849501E+08,142.9012,0,146.1,142.48,146.72,140.68,1664424000000,1061692,,0,,0,0,0,0,0,false,1664424000000,23.065352237561996\nAAPL,1.46755122E+08,147.599,0,147.64,149.84,150.6414,144.84,1664337600000,1140818,,0,,0,0,0,0,0,false,1664337600000,29.877761913419718\nAAPL,9.3339409E+07,151.5222,0,149.66,150.77,153.7701,149.64,1664164800000,747666,,0,,0,0,0,0,0,false,1664164800000,29.58201330468151\nAAPL,8.1599225E+07,152.5505,0,149.31,154.48,154.56,149.1,1663560000000,671961,,0,,0,0,0,0,0,false,1663560000000,30.233508748331047\nAAPL,1.64879031E+08,150.2387,0,151.21,150.7,151.35,148.37,1663300800000,850358,,0,,0,0,0,0,0,false,1663300800000,19.857312489527956\nAAPL,8.4461761E+07,152.1354,0,152.74,151.76,154.72,149.945,1664251200000,683781,,0,,0,0,0,0,0,false,1664251200000,32.18008680069761\nAAPL,9.6031641E+07,150.0222,0,151.19,150.43,151.47,148.56,1663905600000,766888,,0,,0,0,0,0,0,false,1663905600000,28.71109953239781\nAAPL,8.6651514E+07,152.5709,0,152.38,152.74,154.47,150.91,1663819200000,686866,,0,,0,0,0,0,0,false,1663819200000,31.140902927103383\nAAPL,9.3308449E+07,156.1877,0,157.34,153.72,158.61,153.6,1663732800000,712645,,0,,0,0,0,0,0,false,1663732800000,32.21491128713248\nAAPL,1.07691097E+08,156.1317,0,153.4,156.9,158.08,153.08,1663646400000,792177,,0,,0,0,0,0,0,false,1663646400000,35.950871523070575\n", + "schema": { + "type": "string" + } + } + }, + "description": "Relative strength Index data for each period." + } + }, + "summary": "Relative Strength Index (RSI)", + "tags": [ + "stocks:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v1/indicators/sma/{cryptoTicker}": { + "get": { + "description": "Get the simple moving average (SMA) for a ticker symbol over a given time range.", + "operationId": "CryptoSMA", + "parameters": [ + { + "description": "The ticker symbol for which to get simple moving average (SMA) data.", + "example": "X:BTCUSD", + "in": "path", + "name": "cryptoTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 50, + "in": "query", + "name": "window", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to \ncalculate the simple moving average (SMA).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/sma/X:BTCUSD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "aggregates": [ + { + "c": 75.0875, + "h": 75.15, + "l": 73.7975, + "n": 1, + "o": 74.06, + "t": 1577941200000, + "v": 135647456, + "vw": 74.6099 + }, + { + "c": 74.3575, + "h": 75.145, + "l": 74.125, + "n": 1, + "o": 74.2875, + "t": 1578027600000, + "v": 146535512, + "vw": 74.7026 + } + ], + "url": "https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 140.139 + } + ] + }, + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "SMAResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nX:BTCUSD,55188.33773657,18970.3019,0,18816.66899332,19165.98,19333,18690,1664164800000,297389,,0,,0,0,0,0,0,false,1664164800000,19846.01135387188\nX:BTCUSD,4798.38258637,18914.0766,0,18928,18784.41,19184.3,18636,1664078400000,78936,,0,,0,0,0,0,0,false,1664078400000,19902.65703099573\nX:BTCUSD,4798.38258637,18914.0766,0,18928,18784.41,19184.3,18636,1664064000000,78936,,0,,0,0,0,0,0,false,1664064000000,19948.29976695474\nX:BTCUSD,15457.24362826,19317.486,0,19529.04,19475.84,19651.2772302,18846.67,1664409600000,191936,,0,,0,0,0,0,0,false,1664409600000,19751.714760699124\nX:BTCUSD,23180.93663313,19103.9189,0,19090,19416.20352522,19791,18461,1664337600000,225076,,0,,0,0,0,0,0,false,1664337600000,19762.974955013375\nX:BTCUSD,17479.00092209,19776.6697,0,19228.2,19141.78,20372.17374536,18821.55,1664251200000,183075,,0,,0,0,0,0,0,false,1664251200000,19791.86053850303\nX:BTCUSD,2868.09828007,19069.8521,0,19210.31,18925.87,19400,18805.1,1663992000000,58721,,0,,0,0,0,0,0,false,1663992000000,19995.805471728403\nX:BTCUSD,23180.93663313,19103.9189,0,19090,19416.20352522,19791,18461,1664323200000,225076,,0,,0,0,0,0,0,false,1664323200000,19777.128890923308\nX:BTCUSD,17479.00092209,19776.6697,0,19228.2,19141.78,20372.17374536,18821.55,1664236800000,183075,,0,,0,0,0,0,0,false,1664236800000,19818.394438033767\nX:BTCUSD,55188.33773657,18970.3019,0,18816.66899332,19165.98,19333,18690,1664150400000,297389,,0,,0,0,0,0,0,false,1664150400000,19873.767735662568\n", + "schema": { + "type": "string" + } + } + }, + "description": "Simple Moving Average (SMA) data for each period." + } + }, + "summary": "Simple Moving Average (SMA)", + "tags": [ + "crypto:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/sma/{fxTicker}": { + "get": { + "description": "Get the simple moving average (SMA) for a ticker symbol over a given time range.", + "operationId": "ForexSMA", + "parameters": [ + { + "description": "The ticker symbol for which to get simple moving average (SMA) data.", + "example": "C:EURUSD", + "in": "path", + "name": "fxTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 50, + "in": "query", + "name": "window", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to \ncalculate the simple moving average (SMA).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/sma/C:USDAUD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "aggregates": [ + { + "c": 75.0875, + "h": 75.15, + "l": 73.7975, + "n": 1, + "o": 74.06, + "t": 1577941200000, + "v": 135647456, + "vw": 74.6099 + }, + { + "c": 74.3575, + "h": 75.145, + "l": 74.125, + "n": 1, + "o": 74.2875, + "t": 1578027600000, + "v": 146535512, + "vw": 74.7026 + } + ], + "url": "https://api.polygon.io/v2/aggs/ticker/C:USDAUD/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 140.139 + } + ] + }, + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "SMAResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nC:USDAUD,685,1.5537,0,1.5539533,1.5371372,1.5705737,1.5316281,1664323200000,685,,0,,0,0,0,0,0,false,1664323200000,1.4915199239999994\nC:USDAUD,550,1.5405,0,1.5298,1.54531,1.5526263,1.5298,1664164800000,550,,0,,0,0,0,0,0,false,1664164800000,1.4863299679999997\nC:USDAUD,10,1.5312,0,1.5324261,1.53107,1.5326375,1.5301,1664078400000,10,,0,,0,0,0,0,0,false,1664078400000,1.4826388699999997\nC:USDAUD,686,1.5442,0,1.53763,1.5404,1.5526022,1.537279,1664409600000,686,,0,,0,0,0,0,0,false,1664409600000,1.4942168479999998\nC:USDAUD,536,1.5459,0,1.5446162,1.5550165,1.5587,1.5364287,1664251200000,536,,0,,0,0,0,0,0,false,1664251200000,1.4900704799999993\nC:USDAUD,536,1.5459,0,1.5446162,1.5550165,1.5587,1.5364287,1664236800000,536,,0,,0,0,0,0,0,false,1664236800000,1.4882634499999994\nC:USDAUD,550,1.5405,0,1.5298,1.54531,1.5526263,1.5298,1664150400000,550,,0,,0,0,0,0,0,false,1664150400000,1.4845906159999998\nC:USDAUD,10,1.5312,0,1.5324261,1.53107,1.5326375,1.5301,1664064000000,10,,0,,0,0,0,0,0,false,1664064000000,1.4809719239999999\nC:USDAUD,1,1.5314,0,1.5313936,1.5313936,1.5313936,1.5313936,1663977600000,1,,0,,0,0,0,0,0,false,1663977600000,1.4794745239999998\nC:USDAUD,685,1.5537,0,1.5539533,1.5371372,1.5705737,1.5316281,1664337600000,685,,0,,0,0,0,0,0,false,1664337600000,1.4928357579999996\n", + "schema": { + "type": "string" + } + } + }, + "description": "Simple Moving Average (SMA) data for each period." + } + }, + "summary": "Simple Moving Average (SMA)", + "tags": [ + "fx:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/sma/{indicesTicker}": { + "get": { + "description": "Get the simple moving average (SMA) for a ticker symbol over a given time range.", + "operationId": "IndicesSMA", + "parameters": [ + { + "description": "The ticker symbol for which to get simple moving average (SMA) data.", + "example": "I:NDX", + "in": "path", + "name": "indicesTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 50, + "in": "query", + "name": "window", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "The value in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close values to \ncalculate the simple moving average (SMA).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/sma/I:NDX?cursor=YWRqdXN0ZWQ9dHJ1ZSZhcD0lN0IlMjJ2JTIyJTNBMCUyQyUyMm8lMjIlM0EwJTJDJTIyYyUyMiUzQTE1MDg0Ljk5OTM4OTgyMDAzJTJDJTIyaCUyMiUzQTAlMkMlMjJsJTIyJTNBMCUyQyUyMnQlMjIlM0ExNjg3MjE5MjAwMDAwJTdEJmFzPSZleHBhbmRfdW5kZXJseWluZz1mYWxzZSZsaW1pdD0xJm9yZGVyPWRlc2Mmc2VyaWVzX3R5cGU9Y2xvc2UmdGltZXNwYW49ZGF5JnRpbWVzdGFtcC5sdD0xNjg3MjM3MjAwMDAwJndpbmRvdz01Mw", + "request_id": "4cae270008cb3f947e3f92c206e3888a", + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/1678338000000/1687366378997?limit=240&sort=desc" + }, + "values": [ + { + "timestamp": 1687237200000, + "value": 14362.676417589264 + } + ] + }, + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "SMAResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Simple Moving Average (SMA) data for each period." + } + }, + "summary": "Simple Moving Average (SMA)", + "tags": [ + "indices:aggregates" + ], + "x-polygon-entitlement-allowed-limited-tickers": true, + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Indices data", + "name": "indices" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/sma/{optionsTicker}": { + "get": { + "description": "Get the simple moving average (SMA) for a ticker symbol over a given time range.", + "operationId": "OptionsSMA", + "parameters": [ + { + "description": "The ticker symbol for which to get simple moving average (SMA) data.", + "example": "O:SPY241220P00720000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 50, + "in": "query", + "name": "window", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to \ncalculate the simple moving average (SMA).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/sma/O:SPY241220P00720000?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "aggregates": [ + { + "c": 75.0875, + "h": 75.15, + "l": 73.7975, + "n": 1, + "o": 74.06, + "t": 1577941200000, + "v": 135647456, + "vw": 74.6099 + }, + { + "c": 74.3575, + "h": 75.145, + "l": 74.125, + "n": 1, + "o": 74.2875, + "t": 1578027600000, + "v": 146535512, + "vw": 74.7026 + } + ], + "url": "https://api.polygon.io/v2/aggs/ticker/O:SPY241220P00720000/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 140.139 + } + ] + }, + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "SMAResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649304000000,1,,0,,0,0,0,0,0,false,1649304000000,286.0121999999996\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649131200000,1,,0,,0,0,0,0,0,false,1649131200000,284.61099999999965\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648699200000,1,,0,,0,0,0,0,0,false,1648699200000,282.50919999999974\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648612800000,1,,0,,0,0,0,0,0,false,1648612800000,281.80859999999973\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648526400000,1,,0,,0,0,0,0,0,false,1648526400000,281.1079999999998\nO:SPY241220P00720000,3,277.8267,0,277.82,277.83,277.83,277.82,1649649600000,2,,0,,0,0,0,0,0,false,1649649600000,285.4949999999996\nO:SPY241220P00720000,2,270.49,0,270.49,270.49,270.49,270.49,1649390400000,1,,0,,0,0,0,0,0,false,1649390400000,285.6801999999996\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649217600000,1,,0,,0,0,0,0,0,false,1649217600000,285.31159999999966\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1649044800000,1,,0,,0,0,0,0,0,false,1649044800000,283.9103999999997\nO:SPY241220P00720000,1,299.97,0,299.97,299.97,299.97,299.97,1648785600000,1,,0,,0,0,0,0,0,false,1648785600000,283.2097999999997\n", + "schema": { + "type": "string" + } + } + }, + "description": "Simple Moving Average (SMA) data for each period." + } + }, + "summary": "Simple Moving Average (SMA)", + "tags": [ + "options:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + } + }, + "x-polygon-ignore": true + }, + "/v1/indicators/sma/{stockTicker}": { + "get": { + "description": "Get the simple moving average (SMA) for a ticker symbol over a given time range.", + "operationId": "SMA", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol for which to get simple moving average (SMA) data. For example, AAPL represents Apple Inc.", + "example": "AAPL", + "in": "path", + "name": "stockTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The size of the aggregate time window.", + "example": "day", + "in": "query", + "name": "timespan", + "schema": { + "default": "day", + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "Whether or not the aggregates used to calculate the simple moving average are adjusted for splits. By default, aggregates are adjusted.\nSet this to false to get results that are NOT adjusted for splits.", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "default": true, + "type": "boolean" + } + }, + { + "description": "The window size used to calculate the simple moving average (SMA). i.e. a window size of 10 with daily aggregates would result in a 10 day moving average.", + "example": 50, + "in": "query", + "name": "window", + "schema": { + "default": 50, + "type": "integer" + } + }, + { + "description": "The price in the aggregate which will be used to calculate the simple moving average. i.e. 'close' will result in using close prices to \ncalculate the simple moving average (SMA).", + "example": "close", + "in": "query", + "name": "series_type", + "schema": { + "default": "close", + "enum": [ + "open", + "high", + "low", + "close" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the aggregates used to calculate this indicator in the response.", + "in": "query", + "name": "expand_underlying", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "The order in which to return the results, ordered by timestamp.", + "example": "desc", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 5000", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 5000, + "type": "integer" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v1/indicators/sma/AAPL?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": { + "underlying": { + "aggregates": [ + { + "c": 75.0875, + "h": 75.15, + "l": 73.7975, + "n": 1, + "o": 74.06, + "t": 1577941200000, + "v": 135647456, + "vw": 74.6099 + }, + { + "c": 74.3575, + "h": 75.145, + "l": 74.125, + "n": 1, + "o": 74.2875, + "t": 1578027600000, + "v": 146535512, + "vw": 74.7026 + } + ], + "url": "https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2003-01-01/2022-07-25" + }, + "values": [ + { + "timestamp": 1517562000016, + "value": 140.139 + } + ] + }, + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "underlying": { + "properties": { + "aggregates": { + "items": { + "properties": { + "c": { + "description": "The close price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "h": { + "description": "The highest price for the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "l": { + "description": "The lowest price for the symbol in the given time period.", + "format": "float", + "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": "float", + "type": "number" + }, + "otc": { + "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.", + "format": "float", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "float", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "float", + "type": "number" + } + }, + "required": [ + "v", + "vw", + "o", + "c", + "h", + "l", + "t", + "n" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Aggregate", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "url": { + "description": "The URL which can be used to request the underlying aggregates used in this request.", + "type": "string" + } + }, + "type": "object" + }, + "values": { + "items": { + "properties": { + "timestamp": { + "description": "The Unix Msec timestamp from the last aggregate used in this calculation.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "IMicroseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "value": { + "description": "The indicator value for this period.", + "format": "float", + "type": "number", + "x-polygon-go-type": { + "name": "*float64" + } + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "SMAResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "aggregate_T,aggregate_v,aggregate_vw,aggregate_a,aggregate_o,aggregate_c,aggregate_h,aggregate_l,aggregate_t,aggregate_n,aggregate_m,aggregate_x,aggregate_g,aggregate_op,aggregate_z,aggregate_av,aggregate_s,aggregate_e,aggregate_otc,timestamp,value\nAAPL,1.27849501E+08,142.9012,0,146.1,142.48,146.72,140.68,1664424000000,1061692,,0,,0,0,0,0,0,false,1664424000000,164.19240000000005\nAAPL,1.46755122E+08,147.599,0,147.64,149.84,150.6414,144.84,1664337600000,1140818,,0,,0,0,0,0,0,false,1664337600000,164.40360000000007\nAAPL,8.4461761E+07,152.1354,0,152.74,151.76,154.72,149.945,1664251200000,683781,,0,,0,0,0,0,0,false,1664251200000,164.42680000000007\nAAPL,9.3339409E+07,151.5222,0,149.66,150.77,153.7701,149.64,1664164800000,747666,,0,,0,0,0,0,0,false,1664164800000,164.33300000000006\nAAPL,9.3308449E+07,156.1877,0,157.34,153.72,158.61,153.6,1663732800000,712645,,0,,0,0,0,0,0,false,1663732800000,164.13680000000005\nAAPL,9.6031641E+07,150.0222,0,151.19,150.43,151.47,148.56,1663905600000,766888,,0,,0,0,0,0,0,false,1663905600000,164.32100000000005\nAAPL,8.6651514E+07,152.5709,0,152.38,152.74,154.47,150.91,1663819200000,686866,,0,,0,0,0,0,0,false,1663819200000,164.28180000000003\nAAPL,1.07691097E+08,156.1317,0,153.4,156.9,158.08,153.08,1663646400000,792177,,0,,0,0,0,0,0,false,1663646400000,163.97960000000006\nAAPL,8.1599225E+07,152.5505,0,149.31,154.48,154.56,149.1,1663560000000,671961,,0,,0,0,0,0,0,false,1663560000000,163.73900000000006\nAAPL,1.64879031E+08,150.2387,0,151.21,150.7,151.35,148.37,1663300800000,850358,,0,,0,0,0,0,0,false,1663300800000,163.59020000000007\n", + "schema": { + "type": "string" + } + } + }, + "description": "Simple Moving Average (SMA) data for each period." + } + }, + "summary": "Simple Moving Average (SMA)", + "tags": [ + "stocks:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v1/last/crypto/{from}/{to}": { + "get": { + "description": "Get the last trade tick for a cryptocurrency pair.", + "operationId": "LastTradeCrypto", + "parameters": [ + { + "description": "The \"from\" symbol of the pair.", + "example": "BTC", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The \"to\" symbol of the pair.", + "example": "USD", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "last": { + "conditions": [ + 1 + ], + "exchange": 4, + "price": 16835.42, + "size": 0.006909, + "timestamp": 1605560885027 + }, + "request_id": "d2d779df015fe2b7fbb8e58366610ef7", + "status": "success", + "symbol": "BTC-USD" + }, + "schema": { + "properties": { + "last": { + "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", + "x-polygon-go-type": { + "name": "Int32Array" + } + }, + "exchange": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.", + "type": "integer" + }, + "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" + }, + "size": { + "description": "The size of a trade (also known as volume).", + "format": "double", + "type": "number" + }, + "timestamp": { + "description": "The Unix millisecond timestamp.", + "type": "integer", + "x-polygon-go-type": { + "name": "IMilliseconds", + "path": "github.com/polygon-io/ptime" + } + } + }, + "required": [ + "exchange", + "price", + "size", + "timestamp" + ], + "type": "object", + "x-polygon-go-type": { + "name": "LastTradeCrypto" + } + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + }, + "symbol": { + "description": "The symbol pair that was evaluated from the request.", + "type": "string" + } + }, + "required": [ + "status", + "request_id", + "symbol" + ], + "type": "object" + } + }, + "text/csv": { + "example": "conditions,exchange,price,size,timestamp\n1,4,16835.42,0.006909,1605560885027\n", + "schema": { + "type": "string" + } + } + }, + "description": "The last tick for this currency pair." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Last Trade for a Crypto Pair", + "tags": [ + "crypto:last:trade" + ], + "x-polygon-entitlement-data-type": { + "description": "Trade data", + "name": "trades" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + } + }, + "/v1/last_quote/currencies/{from}/{to}": { + "get": { + "description": "Get the last quote tick for a forex currency pair.", + "operationId": "LastQuoteCurrencies", + "parameters": [ + { + "description": "The \"from\" symbol of the pair.", + "example": "AUD", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The \"to\" symbol of the pair.", + "example": "USD", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "last": { + "ask": 0.73124, + "bid": 0.73122, + "exchange": 48, + "timestamp": 1605557756000 + }, + "request_id": "a73a29dbcab4613eeaf48583d3baacf0", + "status": "success", + "symbol": "AUD/USD" + }, + "schema": { + "properties": { + "last": { + "properties": { + "ask": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "bid": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "exchange": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "timestamp": { + "description": "The Unix millisecond timestamp.", + "type": "integer", + "x-polygon-go-type": { + "name": "IMilliseconds", + "path": "github.com/polygon-io/ptime" + } + } + }, + "required": [ + "ask", + "bid", + "exchange", + "timestamp" + ], + "type": "object", + "x-polygon-go-type": { + "name": "LastQuoteCurrencies" + } + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + }, + "symbol": { + "description": "The symbol pair that was evaluated from the request.", + "type": "string" + } + }, + "required": [ + "status", + "request_id", + "symbol" + ], + "type": "object" + } + }, + "text/csv": { + "example": "ask,bid,exchange,timestamp\n0.73124,0.73122,48,1605557756000\n", + "schema": { + "type": "string" + } + } + }, + "description": "The last quote tick for this currency pair." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Last Quote for a Currency Pair", + "tags": [ + "fx:last:quote" + ], + "x-polygon-entitlement-data-type": { + "description": "NBBO data", + "name": "nbbo" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + } + }, + "/v1/marketstatus/now": { + "get": { + "description": "Get the current trading status of the exchanges and overall financial markets.", + "operationId": "GetMarketStatus", + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "afterHours": true, + "currencies": { + "crypto": "open", + "fx": "open" + }, + "earlyHours": false, + "exchanges": { + "nasdaq": "extended-hours", + "nyse": "extended-hours", + "otc": "closed" + }, + "market": "extended-hours", + "serverTime": "2020-11-10T17:37:37-05:00" + }, + "schema": { + "properties": { + "afterHours": { + "description": "Whether or not the market is in post-market hours.", + "type": "boolean", + "x-polygon-go-type": { + "name": "*bool" + } + }, + "currencies": { + "properties": { + "crypto": { + "description": "The status of the crypto market.", + "type": "string" + }, + "fx": { + "description": "The status of the forex market.", + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "Currencies" + } + }, + "earlyHours": { + "description": "Whether or not the market is in pre-market hours.", + "type": "boolean", + "x-polygon-go-type": { + "name": "*bool" + } + }, + "exchanges": { + "properties": { + "nasdaq": { + "description": "The status of the Nasdaq market.", + "type": "string" + }, + "nyse": { + "description": "The status of the NYSE market.", + "type": "string" + }, + "otc": { + "description": "The status of the OTC market.", + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "Exchanges" + } + }, + "indicesGroups": { + "properties": { + "cccy": { + "description": "The status of Cboe Streaming Market Indices Cryptocurrency (\"CCCY\") indices trading hours.", + "type": "string" + }, + "cgi": { + "description": "The status of Cboe Global Indices (\"CGI\") trading hours.", + "type": "string" + }, + "dow_jones": { + "description": "The status of Dow Jones indices trading hours", + "type": "string" + }, + "ftse_russell": { + "description": "The status of Financial Times Stock Exchange Group (\"FTSE\") Russell indices trading hours.", + "type": "string" + }, + "msci": { + "description": "The status of Morgan Stanley Capital International (\"MSCI\") indices trading hours.", + "type": "string" + }, + "mstar": { + "description": "The status of Morningstar (\"MSTAR\") indices trading hours.", + "type": "string" + }, + "mstarc": { + "description": "The status of Morningstar Customer (\"MSTARC\") indices trading hours." + }, + "nasdaq": { + "description": "The status of National Association of Securities Dealers Automated Quotations (\"Nasdaq\") indices trading hours.", + "type": "string" + }, + "s_and_p": { + "description": "The status of Standard & Poors's (\"S&P\") indices trading hours.", + "type": "string" + }, + "societe_generale": { + "description": "The status of Societe Generale indices trading hours.", + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "IndicesGroups" + } + }, + "market": { + "description": "The status of the market as a whole.", + "type": "string" + }, + "serverTime": { + "description": "The current time of the server, returned as a date-time in RFC3339 format.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "OK" + } + }, + "summary": "Market Status", + "tags": [ + "reference:stocks:market" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + } + } + }, + "/v1/marketstatus/upcoming": { + "get": { + "description": "Get upcoming market holidays and their open/close times.", + "operationId": "GetMarketHolidays", + "responses": { + "200": { + "content": { + "application/json": { + "example": [ + { + "date": "2020-11-26", + "exchange": "NYSE", + "name": "Thanksgiving", + "status": "closed" + }, + { + "date": "2020-11-26", + "exchange": "NASDAQ", + "name": "Thanksgiving", + "status": "closed" + }, + { + "date": "2020-11-26", + "exchange": "OTC", + "name": "Thanksgiving", + "status": "closed" + }, + { + "close": "2020-11-27T18:00:00.000Z", + "date": "2020-11-27", + "exchange": "NASDAQ", + "name": "Thanksgiving", + "open": "2020-11-27T14:30:00.000Z", + "status": "early-close" + }, + { + "close": "2020-11-27T18:00:00.000Z", + "date": "2020-11-27", + "exchange": "NYSE", + "name": "Thanksgiving", + "open": "2020-11-27T14:30:00.000Z", + "status": "early-close" + } + ], + "schema": { + "items": { + "properties": { + "close": { + "description": "The market close time on the holiday (if it's not closed).", + "type": "string" + }, + "date": { + "description": "The date of the holiday.", + "type": "string" + }, + "exchange": { + "description": "Which market the record is for.", + "type": "string" + }, + "name": { + "description": "The name of the holiday.", + "type": "string" + }, + "open": { + "description": "The market open time on the holiday (if it's not closed).", + "type": "string" + }, + "status": { + "description": "The status of the market on the holiday.", + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "MarketHoliday" + } + }, + "type": "array" + } + } + }, + "description": "OK" + } + }, + "summary": "Market Holidays", + "tags": [ + "reference:stocks:market" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + } + } + }, + "/v1/open-close/crypto/{from}/{to}/{date}": { + "get": { + "description": "Get the open, close prices of a cryptocurrency symbol on a certain day.\n", + "parameters": [ + { + "description": "The \"from\" symbol of the pair.", + "example": "BTC", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The \"to\" symbol of the pair.", + "example": "USD", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The date of the requested open/close in the format YYYY-MM-DD.", + "example": "2023-01-09", + "in": "path", + "name": "date", + "required": true, + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "close": 11050.64, + "closingTrades": [ + { + "c": [ + 2 + ], + "i": "973323250", + "p": 11050.64, + "s": 0.006128, + "t": 1602287999795, + "x": 4 + }, + { + "c": [ + 1 + ], + "i": "105717893", + "p": 11049.4, + "s": 0.014, + "t": 1602287999659, + "x": 17 + } + ], + "day": "2020-10-09T00:00:00.000Z", + "isUTC": true, + "open": 10932.44, + "openTrades": [ + { + "c": [ + 2 + ], + "i": "511235746", + "p": 10932.44, + "s": 0.002, + "t": 1602201600056, + "x": 1 + }, + { + "c": [ + 2 + ], + "i": "511235751", + "p": 10923.76, + "s": 0.02, + "t": 1602201600141, + "x": 4 + } + ], + "symbol": "BTC-USD" + }, + "schema": { + "properties": { + "close": { + "description": "The close price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "closingTrades": { + "items": { + "properties": { + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "x", + "c", + "t", + "i" + ], + "type": "object" + }, + "type": "array" + }, + "day": { + "description": "The date requested.", + "format": "date", + "type": "string" + }, + "isUTC": { + "description": "Whether or not the timestamps are in UTC timezone.", + "type": "boolean" + }, + "open": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "openTrades": { + "items": { + "properties": { + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "t": { + "description": "The Unix Msec timestamp for the start of the aggregate window.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "x", + "c", + "t", + "i" + ], + "type": "object" + }, + "type": "array" + }, + "symbol": { + "description": "The symbol pair that was evaluated from the request.", + "type": "string" + } + }, + "required": [ + "symbol", + "isUTC", + "day", + "open", + "close", + "openTrades", + "closingTrades" + ], + "type": "object" + } + }, + "text/csv": { + "example": "isUTC,day,open,close,openTrades,closingTrades\ntrue,2020-10-09,10932.44,11050.64,\"[{\\\"s\\\":0.002,\\\"p\\\":10932.44,\\\"x\\\":1,\\\"t\\\":1602201600056,\\\"c\\\":[2],\\\"i\\\":\\\"511235746\\\"},{\\\"s\\\":0.02,\\\"p\\\":10923.76,\\\"x\\\":4,\\\"t\\\":1602201600141,\\\"c\\\":[2],\\\"i\\\":\\\"511235751\\\"}]\",\"[{\\\"s\\\":0.006128,\\\"p\\\":11050.64,\\\"x\\\":4,\\\"t\\\":1602287999795,\\\"c\\\":[2],\\\"i\\\":\\\"973323250\\\"},{\\\"s\\\":0.014,\\\"p\\\":11049.4,\\\"x\\\":17,\\\"t\\\":1602287999659,\\\"c\\\":[1],\\\"i\\\":\\\"105717893\\\"}]\"\n", + "schema": { + "type": "string" + } + } + }, + "description": "The open/close of this symbol." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Daily Open/Close", + "tags": [ + "crypto:open-close" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + } + }, + "/v1/open-close/{indicesTicker}/{date}": { + "get": { + "description": "Get the open, close and afterhours values of a index symbol on a certain date.\n", + "parameters": [ + { + "description": "The ticker symbol of Index.", + "example": "I:NDX", + "in": "path", + "name": "indicesTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The date of the requested open/close in the format YYYY-MM-DD.", + "example": "2023-03-10", + "in": "path", + "name": "date", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "afterHours": 11830.43006295237, + "close": 11830.28178808306, + "from": "2023-03-10T00:00:00.000Z", + "high": 12069.62262033557, + "low": 11789.85923449393, + "open": 12001.69552583921, + "preMarket": 12001.69552583921, + "status": "OK", + "symbol": "I:NDX" + }, + "schema": { + "properties": { + "afterHours": { + "description": "The close value of the ticker symbol in after hours trading.", + "format": "double", + "type": "number" + }, + "close": { + "description": "The close value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "from": { + "description": "The requested date.", + "format": "date", + "type": "string" + }, + "high": { + "description": "The highest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "low": { + "description": "The lowest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "open": { + "description": "The open value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "preMarket": { + "description": "The open value of the ticker symbol in pre-market trading.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + }, + "symbol": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "status", + "from", + "symbol", + "open", + "high", + "low", + "close" + ], + "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." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Daily Open/Close", + "tags": [ + "stocks:open-close" + ], + "x-polygon-entitlement-allowed-limited-tickers": true, + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Indices data", + "name": "indices" + } + } + }, + "/v1/open-close/{optionsTicker}/{date}": { + "get": { + "description": "Get the open, close and afterhours prices of an options contract on a certain date.\n", + "parameters": [ + { + "description": "The ticker symbol of the options contract.", + "example": "O:SPY251219C00650000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The date of the requested open/close in the format YYYY-MM-DD.", + "example": "2023-01-09", + "in": "path", + "name": "date", + "required": true, + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "afterHours": 26.35, + "close": 26.35, + "from": "2023-01-09", + "high": 26.35, + "low": 25, + "open": 25, + "preMarket": 25, + "status": "OK", + "symbol": "O:TSLA210903C00700000", + "volume": 2 + }, + "schema": { + "properties": { + "afterHours": { + "description": "The close price of the ticker symbol in after hours trading.", + "format": "double", + "type": "number" + }, + "close": { + "description": "The close price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "from": { + "description": "The requested date.", + "format": "date", + "type": "string" + }, + "high": { + "description": "The highest price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "low": { + "description": "The lowest price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "open": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "preMarket": { + "description": "The open price of the ticker symbol in pre-market trading.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + }, + "symbol": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "volume": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + } + }, + "required": [ + "status", + "from", + "symbol", + "open", + "high", + "low", + "close", + "volume" + ], + "type": "object" + } + }, + "text/csv": { + "example": "from,open,high,low,close,volume,afterHours,preMarket\n2023-01-09,25,26.35,25,26.35,2,26.35,25\n", + "schema": { + "type": "string" + } + } + }, + "description": "The open/close of this stock symbol." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Daily Open/Close", + "tags": [ + "options:open-close" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + } + } + }, + "/v1/open-close/{stocksTicker}/{date}": { + "get": { + "description": "Get the open, close and afterhours prices of a stock symbol on a certain date.\n", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.", + "example": "AAPL", + "in": "path", + "name": "stocksTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The date of the requested open/close in the format YYYY-MM-DD.", + "example": "2023-01-09", + "in": "path", + "name": "date", + "required": true, + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "afterHours": 322.1, + "close": 325.12, + "from": "2023-01-09", + "high": 326.2, + "low": 322.3, + "open": 324.66, + "preMarket": 324.5, + "status": "OK", + "symbol": "AAPL", + "volume": 26122646 + }, + "schema": { + "properties": { + "afterHours": { + "description": "The close price of the ticker symbol in after hours trading.", + "format": "double", + "type": "number" + }, + "close": { + "description": "The close price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "from": { + "description": "The requested date.", + "format": "date", + "type": "string" + }, + "high": { + "description": "The highest price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "low": { + "description": "The lowest price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "open": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "preMarket": { + "description": "The open price of the ticker symbol in pre-market trading.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + }, + "symbol": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "volume": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + } + }, + "required": [ + "status", + "from", + "symbol", + "open", + "high", + "low", + "close", + "volume" + ], + "type": "object" + } + }, + "text/csv": { + "example": "from,open,high,low,close,volume,afterHours,preMarket\n2023-01-09,324.66,326.2,322.3,325.12,26122646,322.1,324.5\n", + "schema": { + "type": "string" + } + } + }, + "description": "The open/close of this stock symbol." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Daily Open/Close", + "tags": [ + "stocks:open-close" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v1/reference/sec/filings": { + "get": { + "description": "List filings", + "operationId": "ListFilings", + "parameters": [ + { + "description": "Query by filing type.", + "in": "query", + "name": "type", + "schema": { + "description": "Filing Type", + "enum": [ + "10-K", + "10-Q" + ], + "type": "string" + } + }, + { + "description": "Query by filing date.", + "in": "query", + "name": "filing_date", + "schema": { + "description": "The date when the filing was filed in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Query by period of report.", + "in": "query", + "name": "period_of_report_date", + "schema": { + "description": "The period of report for the filing in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "If true, query only for filings with an XBRL instance file.\nIf false, query for filings without an XBRL instance file.\nIf this parameter is not provided, query for filings with or without XBRL instance files.", + "in": "query", + "name": "has_xbrl", + "schema": { + "nullable": true, + "type": "boolean" + }, + "x-polygon-go-id": "HasXBRL" + }, + { + "description": "Query by entity company name.", + "in": "query", + "name": "entities.company_data.name", + "schema": { + "example": "Facebook Inc", + "type": "string" + }, + "x-polygon-filter-field": { + "search": true + } + }, + { + "description": "Query by entity company CIK.", + "in": "query", + "name": "entities.company_data.cik", + "schema": { + "description": "Central Index Key (CIK) Number", + "type": "string" + } + }, + { + "description": "Query by entity company ticker.", + "in": "query", + "name": "entities.company_data.ticker", + "schema": { + "description": "Ticker", + "type": "string" + } + }, + { + "description": "Query by entity company SIC.", + "in": "query", + "name": "entities.company_data.sic", + "schema": { + "description": "Standard Industrial Classification (SIC)", + "type": "string" + } + }, + { + "description": "Search by filing_date.", + "in": "query", + "name": "filing_date.gte", + "schema": { + "description": "The date when the filing was filed in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + } + }, + { + "description": "Search by filing_date.", + "in": "query", + "name": "filing_date.gt", + "schema": { + "description": "The date when the filing was filed in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + } + }, + { + "description": "Search by filing_date.", + "in": "query", + "name": "filing_date.lte", + "schema": { + "description": "The date when the filing was filed in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + } + }, + { + "description": "Search by filing_date.", + "in": "query", + "name": "filing_date.lt", + "schema": { + "description": "The date when the filing was filed in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + } + }, + { + "description": "Search by period_of_report_date.", + "in": "query", + "name": "period_of_report_date.gte", + "schema": { + "description": "The period of report for the filing in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + } + }, + { + "description": "Search by period_of_report_date.", + "in": "query", + "name": "period_of_report_date.gt", + "schema": { + "description": "The period of report for the filing in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + } + }, + { + "description": "Search by period_of_report_date.", + "in": "query", + "name": "period_of_report_date.lte", + "schema": { + "description": "The period of report for the filing in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + } + }, + { + "description": "Search by period_of_report_date.", + "in": "query", + "name": "period_of_report_date.lt", + "schema": { + "description": "The period of report for the filing in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + } + }, + { + "description": "Search by entities.company_data.name.", + "in": "query", + "name": "entities.company_data.name.search", + "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 1000.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "filing_date", + "enum": [ + "filing_date", + "period_of_report_date" + ], + "example": "filing_date", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "description": "FIXME", + "example": {}, + "schema": { + "properties": { + "count": { + "type": "integer" + }, + "next_url": { + "type": "string" + }, + "request_id": { + "type": "string" + }, + "results": { + "items": { + "properties": { + "acceptance_datetime": { + "description": "The datetime when the filing was accepted by EDGAR in EST (format: YYYYMMDDHHMMSS)", + "type": "string" + }, + "accession_number": { + "description": "Filing Accession Number", + "type": "string" + }, + "entities": { + "description": "Entities related to the filing (e.g. the document filers).", + "items": { + "description": "A filing entity (e.g. the document filer).", + "properties": { + "company_data": { + "properties": { + "cik": { + "description": "Central Index Key (CIK) Number", + "type": "string" + }, + "name": { + "example": "Facebook Inc", + "type": "string" + }, + "sic": { + "description": "Standard Industrial Classification (SIC)", + "type": "string" + }, + "ticker": { + "description": "Ticker", + "type": "string" + } + }, + "required": [ + "name", + "cik", + "sic" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SECCompanyData", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "relation": { + "description": "Relationship of this entity to the filing.", + "enum": [ + "filer" + ], + "type": "string" + } + }, + "required": [ + "relation" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SECFilingEntity", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "files_count": { + "description": "The number of files associated with the filing.", + "format": "int64", + "type": "integer" + }, + "filing_date": { + "description": "The date when the filing was filed in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + }, + "id": { + "description": "Unique identifier for the filing.", + "type": "string" + }, + "period_of_report_date": { + "description": "The period of report for the filing in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + }, + "source_url": { + "description": "The source URL is a link back to the upstream source for this filing\ndocument.", + "example": "https://www.sec.gov/Archives/edgar/data/0001326801/000132680119000037/0001326801-19-000037-index.html", + "format": "uri", + "type": "string" + }, + "type": { + "description": "Filing Type", + "enum": [ + "10-K", + "10-Q" + ], + "type": "string" + } + }, + "required": [ + "id", + "accession_number", + "type", + "filing_date", + "period_of_report_date", + "files_count", + "source_url", + "download_url", + "entities" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SECFiling", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "status": { + "type": "string" + } + }, + "required": [ + "status", + "request_id", + "count", + "results" + ], + "type": "object" + } + } + }, + "description": "FIXME" + } + }, + "summary": "SEC Filings", + "tags": [ + "reference:sec:filings" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-paginate": { + "sort": { + "default": "filing_date", + "enum": [ + "filing_date", + "period_of_report_date" + ] + } + } + }, + "x-polygon-draft": true + }, + "/v1/reference/sec/filings/{filing_id}": { + "get": { + "description": "Get filing", + "operationId": "GetFiling", + "parameters": [ + { + "description": "Select by filing id.", + "in": "path", + "name": "filing_id", + "schema": { + "description": "Unique identifier for the filing.", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "description": "FIXME", + "example": {}, + "schema": { + "properties": { + "results": { + "properties": { + "acceptance_datetime": { + "description": "The datetime when the filing was accepted by EDGAR in EST (format: YYYYMMDDHHMMSS)", + "type": "string" + }, + "accession_number": { + "description": "Filing Accession Number", + "type": "string" + }, + "entities": { + "description": "Entities related to the filing (e.g. the document filers).", + "items": { + "description": "A filing entity (e.g. the document filer).", + "properties": { + "company_data": { + "properties": { + "cik": { + "description": "Central Index Key (CIK) Number", + "type": "string" + }, + "name": { + "example": "Facebook Inc", + "type": "string" + }, + "sic": { + "description": "Standard Industrial Classification (SIC)", + "type": "string" + }, + "ticker": { + "description": "Ticker", + "type": "string" + } + }, + "required": [ + "name", + "cik", + "sic" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SECCompanyData", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "relation": { + "description": "Relationship of this entity to the filing.", + "enum": [ + "filer" + ], + "type": "string" + } + }, + "required": [ + "relation" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SECFilingEntity", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "files_count": { + "description": "The number of files associated with the filing.", + "format": "int64", + "type": "integer" + }, + "filing_date": { + "description": "The date when the filing was filed in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + }, + "id": { + "description": "Unique identifier for the filing.", + "type": "string" + }, + "period_of_report_date": { + "description": "The period of report for the filing in YYYYMMDD format.", + "example": "20210101", + "pattern": "^[0-9]{8}$", + "type": "string" + }, + "source_url": { + "description": "The source URL is a link back to the upstream source for this filing\ndocument.", + "example": "https://www.sec.gov/Archives/edgar/data/0001326801/000132680119000037/0001326801-19-000037-index.html", + "format": "uri", + "type": "string" + }, + "type": { + "description": "Filing Type", + "enum": [ + "10-K", + "10-Q" + ], + "type": "string" + } + }, + "required": [ + "id", + "accession_number", + "type", + "filing_date", + "period_of_report_date", + "files_count", + "source_url", + "download_url", + "entities" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SECFiling", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + } + }, + "type": "object" + } + } + }, + "description": "FIXME" + } + }, + "summary": "SEC Filing", + "tags": [ + "reference:sec:filing" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + } + }, + "x-polygon-draft": true + }, + "/v1/reference/sec/filings/{filing_id}/files": { + "get": { + "description": "List filing files", + "operationId": "ListFilingFiles", + "parameters": [ + { + "description": "Select by filing id.", + "in": "path", + "name": "filing_id", + "schema": { + "description": "Unique identifier for the filing.", + "type": "string" + } + }, + { + "description": "Query by file sequence number.", + "in": "query", + "name": "sequence", + "schema": { + "description": "File Sequence Number", + "format": "int64", + "max": 999, + "min": 1, + "type": "integer" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Query by file name.", + "in": "query", + "name": "filename", + "schema": { + "description": "The name for the file.", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Search by sequence.", + "in": "query", + "name": "sequence.gte", + "schema": { + "description": "File Sequence Number", + "format": "int64", + "max": 999, + "min": 1, + "type": "integer" + } + }, + { + "description": "Search by sequence.", + "in": "query", + "name": "sequence.gt", + "schema": { + "description": "File Sequence Number", + "format": "int64", + "max": 999, + "min": 1, + "type": "integer" + } + }, + { + "description": "Search by sequence.", + "in": "query", + "name": "sequence.lte", + "schema": { + "description": "File Sequence Number", + "format": "int64", + "max": 999, + "min": 1, + "type": "integer" + } + }, + { + "description": "Search by sequence.", + "in": "query", + "name": "sequence.lt", + "schema": { + "description": "File Sequence Number", + "format": "int64", + "max": 999, + "min": 1, + "type": "integer" + } + }, + { + "description": "Search by filename.", + "in": "query", + "name": "filename.gte", + "schema": { + "description": "The name for the file.", + "type": "string" + } + }, + { + "description": "Search by filename.", + "in": "query", + "name": "filename.gt", + "schema": { + "description": "The name for the file.", + "type": "string" + } + }, + { + "description": "Search by filename.", + "in": "query", + "name": "filename.lte", + "schema": { + "description": "The name for the file.", + "type": "string" + } + }, + { + "description": "Search by filename.", + "in": "query", + "name": "filename.lt", + "schema": { + "description": "The name for the file.", + "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 1000.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "sequence", + "enum": [ + "sequence", + "filename" + ], + "example": "sequence", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "description": "FIXME", + "example": {}, + "schema": { + "properties": { + "count": { + "type": "integer" + }, + "next_url": { + "type": "string" + }, + "request_id": { + "type": "string" + }, + "results": { + "items": { + "description": "File associated with the filing.\n\nThis provides information to uniquly identify the additional data and a URL\nwhere the file may be downloaded.", + "properties": { + "description": { + "description": "A description for the contents of the file.", + "type": "string" + }, + "filename": { + "description": "The name for the file.", + "type": "string" + }, + "id": { + "description": "An identifier unique to the filing for this data entry.", + "example": "1", + "type": "string" + }, + "sequence": { + "description": "File Sequence Number", + "format": "int64", + "max": 999, + "min": 1, + "type": "integer" + }, + "size_bytes": { + "description": "The size of the file in bytes.", + "format": "int64", + "type": "integer" + }, + "source_url": { + "description": "The source URL is a link back to the upstream source for this file.", + "format": "uri", + "type": "string" + }, + "type": { + "description": "The type of document contained in the file.", + "type": "string" + } + }, + "required": [ + "id", + "file", + "description", + "type", + "size_bytes", + "sequence", + "source_url" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SECFilingFile", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array" + }, + "status": { + "type": "string" + } + }, + "required": [ + "status", + "request_id", + "count", + "results" + ], + "type": "object" + } + } + }, + "description": "FIXME" + } + }, + "summary": "SEC Filing Files", + "tags": [ + "reference:sec:filing:files" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-paginate": { + "sort": { + "default": "sequence", + "enum": [ + "sequence", + "filename" + ] + } + } + }, + "x-polygon-draft": true + }, + "/v1/reference/sec/filings/{filing_id}/files/{file_id}": { + "get": { + "description": "Get filing file", + "operationId": "GetFilingFile", + "parameters": [ + { + "description": "Select by filing id.", + "in": "path", + "name": "filing_id", + "schema": { + "description": "Unique identifier for the filing.", + "type": "string" + } + }, + { + "description": "Select by file id.", + "in": "path", + "name": "file_id", + "schema": { + "description": "An identifier unique to the filing for this data entry.", + "example": "1", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "File associated with the filing.\n\nThis provides information to uniquly identify the additional data and a URL\nwhere the file may be downloaded.", + "properties": { + "description": { + "description": "A description for the contents of the file.", + "type": "string" + }, + "filename": { + "description": "The name for the file.", + "type": "string" + }, + "id": { + "description": "An identifier unique to the filing for this data entry.", + "example": "1", + "type": "string" + }, + "sequence": { + "description": "File Sequence Number", + "format": "int64", + "max": 999, + "min": 1, + "type": "integer" + }, + "size_bytes": { + "description": "The size of the file in bytes.", + "format": "int64", + "type": "integer" + }, + "source_url": { + "description": "The source URL is a link back to the upstream source for this file.", + "format": "uri", + "type": "string" + }, + "type": { + "description": "The type of document contained in the file.", + "type": "string" + } + }, + "required": [ + "id", + "file", + "description", + "type", + "size_bytes", + "sequence", + "source_url" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SECFilingFile", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + } + } + }, + "description": "The file data." + } + }, + "summary": "SEC Filing File", + "tags": [ + "reference:sec:filing:file" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + } + }, + "x-polygon-draft": true + }, + "/v1/related-companies/{ticker}": { + "get": { + "description": "Get a list of tickers related to the queried ticker based on News and Returns data.", + "operationId": "GetRelatedCompanies", + "parameters": [ + { + "description": "The ticker symbol to search.", + "example": "AAPL", + "in": "path", + "name": "ticker", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "31d59dda-80e5-4721-8496-d0d32a654afe", + "results": [ + { + "ticker": "MSFT" + }, + { + "ticker": "GOOGL" + }, + { + "ticker": "AMZN" + }, + { + "ticker": "FB" + }, + { + "ticker": "TSLA" + }, + { + "ticker": "NVDA" + }, + { + "ticker": "INTC" + }, + { + "ticker": "ADBE" + }, + { + "ticker": "NFLX" + }, + { + "ticker": "PYPL" + } + ], + "status": "OK", + "stock_symbol": "AAPL" + }, + "schema": { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "items": { + "description": "The tickers related to the requested ticker.", + "properties": { + "ticker": { + "description": "A ticker related to the requested ticker.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + }, + "ticker": { + "description": "The ticker being queried.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Related Companies." + }, + "401": { + "description": "Unauthorized - Check our API Key and account status" + } + }, + "summary": "Related Companies", + "tags": [ + "reference:related:companies" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + } + } + }, + "/v1/summaries": { + "get": { + "description": "Get everything needed to visualize the tick-by-tick movement of a list of tickers.", + "operationId": "SnapshotSummary", + "parameters": [ + { + "description": "Comma separated list of tickers. This API currently supports Stocks/Equities, Crypto, Options, and Forex. See the tickers endpoint for more details on supported tickers. If no tickers are passed then no results will be returned.\n\nWarning: The maximum number of characters allowed in a URL are subject to your technology stack.", + "example": "NCLH,O:SPY250321C00380000,C:EURUSD,X:BTCUSD", + "in": "query", + "name": "ticker.any_of", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "abc123", + "results": [ + { + "branding": { + "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, + "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": "NCLH", + "type": "stocks" + }, + { + "last_updated": 1679597116344223500, + "market_status": "closed", + "name": "NCLH $5 Call", + "options": { + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-10-14", + "shares_per_contract": 100, + "strike_price": 5, + "underlying_ticker": "NCLH" + }, + "price": 6.6, + "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" + }, + { + "last_updated": 1679597116344223500, + "market_status": "open", + "name": "Euro - United States Dollar", + "price": 0.97989, + "session": { + "change": -0.0001, + "change_percent": -0.67, + "close": 0.97989, + "high": 0.98999, + "low": 0.96689, + "open": 0.97889, + "previous_close": 0.98001 + }, + "ticker": "C:EURUSD", + "type": "fx" + }, + { + "branding": { + "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, + "session": { + "change": -201.23, + "change_percent": -0.77, + "close": 32154.68, + "high": 33124.28, + "low": 28182.88, + "open": 31129.32, + "previous_close": 33362.18 + }, + "ticker": "X:BTCUSD", + "type": "crypto" + }, + { + "error": "NOT_FOUND", + "message": "Ticker not found.", + "ticker": "APx" + } + ], + "status": "OK" + }, + "schema": { + "properties": { + "request_id": { + "type": "string" + }, + "results": { + "items": { + "properties": { + "branding": { + "properties": { + "icon_url": { + "description": "A link to this ticker's company's icon. Icon's are generally smaller, square images that represent the company at a glance.\nNote that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more details.", + "type": "string" + }, + "logo_url": { + "description": "A link to this ticker's company's logo.\nNote that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more details.", + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "Branding" + } + }, + "error": { + "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" + }, + "message": { + "description": "The error message while looking for this ticker.", + "type": "string" + }, + "name": { + "description": "Name of ticker, forex, or crypto asset.", + "type": "string" + }, + "options": { + "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 this link 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.", + "format": "double", + "type": "number" + }, + "strike_price": { + "description": "The strike price of the option contract.", + "format": "double", + "type": "number" + }, + "underlying_ticker": { + "description": "The ticker for the option contract.", + "type": "string" + } + }, + "required": [ + "contract_type", + "expiration_date", + "exercise_style", + "shares_per_contract", + "strike_price", + "underlying_ticker" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Options" + } + }, + "price": { + "description": "The most up to date ticker price.", + "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" + }, + "regular_trading_change": { + "description": "Today's change in regular trading hours, difference between current price and previous trading day's close, otherwise difference between today's close and previous day's close.", + "format": "double", + "type": "number" + }, + "regular_trading_change_percent": { + "description": "Today's regular trading change as a percentage.", + "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": "Ticker of asset queried.", + "type": "string" + }, + "type": { + "description": "The market for this ticker of stock, crypto, fx, option.", + "enum": [ + "stocks", + "crypto", + "options", + "fx" + ], + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object", + "x-polygon-go-type": { + "name": "SummaryResult" + } + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + } + }, + "description": "Snapshot Summary for ticker list" + } + }, + "summary": "Summaries", + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v2/aggs/grouped/locale/global/market/crypto/{date}": { + "get": { + "description": "Get the daily open, high, low, and close (OHLC) for the entire cryptocurrency markets.\n", + "parameters": [ + { + "description": "The beginning date for the aggregate window.", + "example": "2023-01-09", + "in": "path", + "name": "date", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "queryCount": 3, + "results": [ + { + "T": "X:ARDRUSD", + "c": 0.0550762, + "h": 0.0550762, + "l": 0.0550762, + "n": 18388, + "o": 0.0550762, + "t": 1580676480000, + "v": 2, + "vw": 0.0551 + }, + { + "T": "X:NGCUSD", + "c": 0.0272983, + "h": 0.0273733, + "l": 0.0272983, + "n": 18, + "o": 0.0273733, + "t": 1580674080000, + "v": 4734, + "vw": 0.0273 + }, + { + "T": "X:ZSCUSD", + "c": 0.00028531, + "h": 0.00028531, + "l": 0.00028531, + "n": 151, + "o": 0.00028531, + "t": 1580671080000, + "v": 390, + "vw": 0.0003 + } + ], + "resultsCount": 3, + "status": "OK" + }, + "schema": { + "allOf": [ + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t", + "T" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "T,c,h,l,n,o,t,v,vw\nX:ARDRUSD,0.0550762,0.0550762,0.0550762,18388,0.0550762,1580676480000,2,0.0551\nX:NGCUSD,0.0272983,0.0273733,0.0272983,18,0.0273733,1580674080000,4734,0.0273\nX:ZSCUSD,0.00028531,0.00028531,0.00028531,151,0.00028531,1580671080000,390,0.0003\n", + "schema": { + "type": "string" + } + } + }, + "description": "The previous day OHLC for the ticker." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Grouped Daily (Bars)", + "tags": [ + "crypto:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + } + }, + "/v2/aggs/grouped/locale/global/market/fx/{date}": { + "get": { + "description": "Get the daily open, high, low, and close (OHLC) for the entire forex markets.\n", + "parameters": [ + { + "description": "The beginning date for the aggregate window.", + "example": "2023-01-09", + "in": "path", + "name": "date", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "queryCount": 3, + "results": [ + { + "T": "C:ILSCHF", + "c": 0.2704, + "h": 0.2706, + "l": 0.2693, + "n": 689, + "o": 0.2698, + "t": 1602719999999, + "v": 689, + "vw": 0.2702 + }, + { + "T": "C:GBPCAD", + "c": 1.71103, + "h": 1.71642, + "l": 1.69064, + "n": 407324, + "o": 1.69955, + "t": 1602719999999, + "v": 407324, + "vw": 1.7062 + }, + { + "T": "C:DKKAUD", + "c": 0.2214, + "h": 0.2214, + "l": 0.2195, + "n": 10639, + "o": 0.22, + "t": 1602719999999, + "v": 10639, + "vw": 0.2202 + } + ], + "resultsCount": 3, + "status": "OK" + }, + "schema": { + "allOf": [ + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t", + "T" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "T,c,h,l,n,o,t,v,vw\nC:ILSCHF,0.2704,0.2706,0.2693,689,0.2698,1602719999999,689,0.2702\nC:GBPCAD,1.71103,1.71642,1.69064,407324,1.69955,1602719999999,407324,1.7062\nC:DKKAUD,0.2214,0.2214,0.2195,10639,0.22,1602719999999,10639,0.2202\n", + "schema": { + "type": "string" + } + } + }, + "description": "Previous day OHLC for ticker" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Grouped Daily (Bars)", + "tags": [ + "fx:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + } + }, + "/v2/aggs/grouped/locale/us/market/stocks/{date}": { + "get": { + "description": "Get the daily open, high, low, and close (OHLC) for the entire stocks/equities markets.\n", + "parameters": [ + { + "description": "The beginning date for the aggregate window.", + "example": "2023-01-09", + "in": "path", + "name": "date", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + }, + { + "description": "Include OTC securities in the response. Default is false (don't include OTC securities).\n", + "in": "query", + "name": "include_otc", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "queryCount": 3, + "results": [ + { + "T": "KIMpL", + "c": 25.9102, + "h": 26.25, + "l": 25.91, + "n": 74, + "o": 26.07, + "t": 1602705600000, + "v": 4369, + "vw": 26.0407 + }, + { + "T": "TANH", + "c": 23.4, + "h": 24.763, + "l": 22.65, + "n": 1096, + "o": 24.5, + "t": 1602705600000, + "v": 25933.6, + "vw": 23.493 + }, + { + "T": "VSAT", + "c": 34.24, + "h": 35.47, + "l": 34.21, + "n": 4966, + "o": 34.9, + "t": 1602705600000, + "v": 312583, + "vw": 34.4736 + } + ], + "resultsCount": 3, + "status": "OK" + }, + "schema": { + "allOf": [ + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "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" + }, + "otc": { + "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 end of the aggregate window.", + "type": "integer" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "t", + "v", + "T" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "T,c,h,l,n,o,t,v,vw\nKIMpL,25.9102,26.25,25.91,74,26.07,1602705600000,4369,26.0407\nTANH,23.4,24.763,22.65,1096,24.5,1602705600000,25933.6,23.493\nVSAT,34.24,35.47,34.21,4966,34.9,1602705600000,312583,34.4736\n", + "schema": { + "type": "string" + } + } + }, + "description": "Previous day OHLC for ticker" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Grouped Daily (Bars)", + "tags": [ + "stocks:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v2/aggs/ticker/{cryptoTicker}/prev": { + "get": { + "description": "Get the previous day's open, high, low, and close (OHLC) for the specified cryptocurrency pair.\n", + "parameters": [ + { + "description": "The ticker symbol of the currency pair.", + "example": "X:BTCUSD", + "in": "path", + "name": "cryptoTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "queryCount": 1, + "request_id": "b2170df985474b6d21a6eeccfb6bee67", + "results": [ + { + "T": "X:BTCUSD", + "c": 16035.9, + "h": 16180, + "l": 15639.2, + "o": 15937.1, + "t": 1605416400000, + "v": 95045.16897951, + "vw": 15954.2111 + } + ], + "resultsCount": 1, + "status": "OK", + "ticker": "X:BTCUSD" + }, + "schema": { + "allOf": [ + { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t", + "T" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "T,c,h,l,o,t,v,vw\nX:BTCUSD,16035.9,16180,15639.2,15937.1,1605416400000,95045.16897951,15954.2111\n", + "schema": { + "type": "string" + } + } + }, + "description": "The previous day OHLC for a ticker." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Previous Close", + "tags": [ + "crypto:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + } + }, + "/v2/aggs/ticker/{cryptoTicker}/range/{multiplier}/{timespan}/{from}/{to}": { + "get": { + "description": "Get aggregate bars for a cryptocurrency pair over a given date range in custom time window sizes.\n
\n
\nFor example, if timespan = \u2018minute\u2019 and multiplier = \u20185\u2019 then 5-minute bars will be returned.\n", + "parameters": [ + { + "description": "The ticker symbol of the currency pair.", + "example": "X:BTCUSD", + "in": "path", + "name": "cryptoTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The size of the timespan multiplier.", + "example": 1, + "in": "path", + "name": "multiplier", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "The size of the time window.", + "example": "day", + "in": "path", + "name": "timespan", + "required": true, + "schema": { + "enum": [ + "second", + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-01-09", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-02-10", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + }, + { + "description": "Sort the results by timestamp.\n`asc` will return results in ascending order (oldest at the top),\n`desc` will return results in descending order (newest at the top).\n", + "example": "asc", + "in": "query", + "name": "sort", + "schema": { + "enum": [ + "asc", + "desc" + ] + } + }, + { + "description": "Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000.\nRead more about how limit is used to calculate aggregate results in our article on\nAggregate Data API Improvements.\n", + "example": 120, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "queryCount": 2, + "request_id": "0cf72b6da685bcd386548ffe2895904a", + "results": [ + { + "c": 10094.75, + "h": 10429.26, + "l": 9490, + "n": 1, + "o": 9557.9, + "t": 1590984000000, + "v": 303067.6562332156, + "vw": 9874.5529 + }, + { + "c": 9492.62, + "h": 10222.72, + "l": 9135.68, + "n": 1, + "o": 10096.87, + "t": 1591070400000, + "v": 323339.6922892879, + "vw": 9729.5701 + } + ], + "resultsCount": 2, + "status": "OK", + "ticker": "X:BTCUSD" + }, + "schema": { + "allOf": [ + { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "c,h,l,n,o,t,v,vw\n10094.75,10429.26,9490,1,9557.9,1590984000000,303067.6562332156,9874.5529\n9492.62,10222.72,9135.68,1,10096.87,1591070400000,323339.6922892879,9729.5701\n", + "schema": { + "type": "string" + } + } + }, + "description": "Cryptocurrency Aggregates." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Aggregates (Bars)", + "tags": [ + "crypto:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + } + }, + "/v2/aggs/ticker/{forexTicker}/prev": { + "get": { + "description": "Get the previous day's open, high, low, and close (OHLC) for the specified forex pair.\n", + "parameters": [ + { + "description": "The ticker symbol of the currency pair.", + "example": "C:EURUSD", + "in": "path", + "name": "forexTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "queryCount": 1, + "request_id": "08ec061fb85115678d68452c0a609cb7", + "results": [ + { + "T": "C:EURUSD", + "c": 1.06206, + "h": 1.0631, + "l": 1.0505, + "n": 180300, + "o": 1.05252, + "t": 1651708799999, + "v": 180300, + "vw": 1.055 + } + ], + "resultsCount": 1, + "status": "OK", + "ticker": "C:EURUSD" + }, + "schema": { + "allOf": [ + { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "T", + "v", + "o", + "c", + "h", + "l", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "T,c,h,l,n,o,t,v,vw\nC:EURUSD,1.06206,1.0631,1.0505,180300,1.05252,1651708799999,180300,1.055\n", + "schema": { + "type": "string" + } + } + }, + "description": "The previous day OHLC for the ticker." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Previous Close", + "tags": [ + "fx:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + } + }, + "/v2/aggs/ticker/{forexTicker}/range/{multiplier}/{timespan}/{from}/{to}": { + "get": { + "description": "Get aggregate bars for a forex pair over a given date range in custom time window sizes.\n
\n
\nFor example, if timespan = \u2018minute\u2019 and multiplier = \u20185\u2019 then 5-minute bars will be returned.\n", + "parameters": [ + { + "description": "The ticker symbol of the currency pair.", + "example": "C:EURUSD", + "in": "path", + "name": "forexTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The size of the timespan multiplier.", + "example": 1, + "in": "path", + "name": "multiplier", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "The size of the time window.", + "example": "day", + "in": "path", + "name": "timespan", + "required": true, + "schema": { + "enum": [ + "second", + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-01-09", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-02-10", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + }, + { + "description": "Sort the results by timestamp.\n`asc` will return results in ascending order (oldest at the top),\n`desc` will return results in descending order (newest at the top).\n", + "example": "asc", + "in": "query", + "name": "sort", + "schema": { + "enum": [ + "asc", + "desc" + ] + } + }, + { + "description": "Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000.\nRead more about how limit is used to calculate aggregate results in our article on\nAggregate Data API Improvements.\n", + "example": 120, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "queryCount": 1, + "request_id": "79c061995d8b627b736170bc9653f15d", + "results": [ + { + "c": 1.17721, + "h": 1.18305, + "l": 1.1756, + "n": 125329, + "o": 1.17921, + "t": 1626912000000, + "v": 125329, + "vw": 1.1789 + } + ], + "resultsCount": 1, + "status": "OK", + "ticker": "C:EURUSD" + }, + "schema": { + "allOf": [ + { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "c,h,l,n,o,t,v,vw\n1.17721,1.18305,1.1756,125329,1.17921,1626912000000,125329,1.1789\n", + "schema": { + "type": "string" + } + } + }, + "description": "Forex Aggregates." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Aggregates (Bars)", + "tags": [ + "fx:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + } + }, + "/v2/aggs/ticker/{indicesTicker}/prev": { + "get": { + "description": "Get the previous day's open, high, low, and close (OHLC) for the specified index.\n", + "parameters": [ + { + "description": "The ticker symbol of Index.", + "example": "I:NDX", + "in": "path", + "name": "indicesTicker", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "queryCount": 1, + "request_id": "b2170df985474b6d21a6eeccfb6bee67", + "results": [ + { + "T": "I:NDX", + "c": 15070.14948566977, + "h": 15127.4195807999, + "l": 14946.7243781848, + "o": 15036.48391066877, + "t": 1687291200000 + } + ], + "resultsCount": 1, + "status": "OK", + "ticker": "I:NDX" + }, + "schema": { + "allOf": [ + { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + { + "properties": { + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "properties": { + "c": { + "description": "The close value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "h": { + "description": "The highest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "l": { + "description": "The lowest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "o": { + "description": "The open value 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" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "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." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Previous Close", + "tags": [ + "indices:aggregates" + ], + "x-polygon-entitlement-allowed-limited-tickers": true, + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Indices data", + "name": "indices" + } + } + }, + "/v2/aggs/ticker/{indicesTicker}/range/{multiplier}/{timespan}/{from}/{to}": { + "get": { + "description": "Get aggregate bars for an index over a given date range in custom time window sizes.\n
\n
\nFor example, if timespan = \u2018minute\u2019 and multiplier = \u20185\u2019 then 5-minute bars will be returned.\n", + "parameters": [ + { + "description": "The ticker symbol of Index.", + "example": "I:NDX", + "in": "path", + "name": "indicesTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The size of the timespan multiplier.", + "example": 1, + "in": "path", + "name": "multiplier", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "The size of the time window.", + "example": "day", + "in": "path", + "name": "timespan", + "required": true, + "schema": { + "enum": [ + "second", + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-03-13", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-03-24", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Sort the results by timestamp.\n`asc` will return results in ascending order (oldest at the top),\n`desc` will return results in descending order (newest at the top).\n", + "example": "asc", + "in": "query", + "name": "sort", + "schema": { + "enum": [ + "asc", + "desc" + ] + } + }, + { + "description": "Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000.\nRead more about how limit is used to calculate aggregate results in our article on\nAggregate Data API Improvements.\n", + "example": 120, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "count": 2, + "queryCount": 2, + "request_id": "0cf72b6da685bcd386548ffe2895904a", + "results": [ + { + "c": 11995.88235998666, + "h": 12340.44936267155, + "l": 11970.34221717375, + "o": 12230.83658266843, + "t": 1678341600000 + }, + { + "c": 11830.28178808306, + "h": 12069.62262033557, + "l": 11789.85923449393, + "o": 12001.69552583921, + "t": 1678428000000 + } + ], + "status": "OK", + "ticker": "I:NDX" + }, + "schema": { + "allOf": [ + { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + { + "properties": { + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "properties": { + "c": { + "description": "The close value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "h": { + "description": "The highest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "l": { + "description": "The lowest value for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "o": { + "description": "The open value 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" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "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." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Aggregates (Bars)", + "tags": [ + "indices:aggregates" + ], + "x-polygon-entitlement-allowed-limited-tickers": true, + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Indices data", + "name": "indices" + } + } + }, + "/v2/aggs/ticker/{optionsTicker}/prev": { + "get": { + "description": "Get the previous day's open, high, low, and close (OHLC) for the specified option contract.\n", + "parameters": [ + { + "description": "The ticker symbol of the options contract.", + "example": "O:SPY251219C00650000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "queryCount": 1, + "request_id": "6a7e466379af0a71039d60cc78e72282", + "results": [ + { + "T": "O:TSLA210903C00700000", + "c": 115.97, + "h": 117.59, + "l": 114.13, + "n": 2, + "o": 115.55, + "t": 1605042000000, + "v": 131704427, + "vw": 116.3058 + } + ], + "resultsCount": 1, + "status": "OK", + "ticker": "O:TSLA210903C00700000" + }, + "schema": { + "allOf": [ + { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "T,c,h,l,n,o,t,v,vw\nO:TSLA210903C00700000,115.97,117.59,114.13,2,115.55,1605042000000,131704427.0,116.3058\n", + "schema": { + "type": "string" + } + } + }, + "description": "The previous day OHLC for the options contract." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Previous Close", + "tags": [ + "options:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + } + } + }, + "/v2/aggs/ticker/{optionsTicker}/range/{multiplier}/{timespan}/{from}/{to}": { + "get": { + "description": "Get aggregate bars for an option contract over a given date range in custom time window sizes.\n
\n
\nFor example, if timespan = \u2018minute\u2019 and multiplier = \u20185\u2019 then 5-minute bars will be returned.\n", + "parameters": [ + { + "description": "The ticker symbol of the options contract.", + "example": "O:SPY251219C00650000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The size of the timespan multiplier.", + "example": 1, + "in": "path", + "name": "multiplier", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "The size of the time window.", + "example": "day", + "in": "path", + "name": "timespan", + "required": true, + "schema": { + "enum": [ + "second", + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-01-09", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-02-10", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + }, + { + "description": "Sort the results by timestamp.\n`asc` will return results in ascending order (oldest at the top),\n`desc` will return results in descending order (newest at the top).\n", + "example": "asc", + "in": "query", + "name": "sort", + "schema": { + "enum": [ + "asc", + "desc" + ] + } + }, + { + "description": "Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000.\nRead more about how limit is used to calculate aggregate results in our article on\nAggregate Data API Improvements.\n", + "example": 120, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "count": 2, + "queryCount": 2, + "request_id": "5585acde-5085-42d6-95b2-2e388a28370a", + "results": [ + { + "c": 26.2, + "h": 26.2, + "l": 26.2, + "n": 1, + "o": 26.2, + "t": 1632369600000, + "v": 2, + "vw": 26.2 + }, + { + "c": 28.3, + "h": 28.3, + "l": 28.3, + "n": 1, + "o": 28.3, + "t": 1632456000000, + "v": 2, + "vw": 28.3 + } + ], + "resultsCount": 2, + "status": "OK", + "ticker": "O:RDFN211119C00025000" + }, + "schema": { + "allOf": [ + { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "c,h,l,n,o,t,v,vw\n26.2,26.2,26.2,1,26.2,1632369600000,2,26.2\n28.3,28.3,28.3,1,28.3,1632456000000,2,28.3\n", + "schema": { + "type": "string" + } + } + }, + "description": "Options Aggregates." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Aggregates (Bars)", + "tags": [ + "options:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + } + } + }, + "/v2/aggs/ticker/{stocksTicker}/prev": { + "get": { + "description": "Get the previous day's open, high, low, and close (OHLC) for the specified stock ticker.\n", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.", + "example": "AAPL", + "in": "path", + "name": "stocksTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "queryCount": 1, + "request_id": "6a7e466379af0a71039d60cc78e72282", + "results": [ + { + "T": "AAPL", + "c": 115.97, + "h": 117.59, + "l": 114.13, + "o": 115.55, + "t": 1605042000000, + "v": 131704427, + "vw": 116.3058 + } + ], + "resultsCount": 1, + "status": "OK", + "ticker": "AAPL" + }, + "schema": { + "allOf": [ + { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "T,c,h,l,o,t,v,vw\nAAPL,115.97,117.59,114.13,115.55,1605042000000,131704427.0,116.3058\n", + "schema": { + "type": "string" + } + } + }, + "description": "The previous day OHLC for the ticker." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Previous Close", + "tags": [ + "stocks:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v2/aggs/ticker/{stocksTicker}/range/{multiplier}/{timespan}/{from}/{to}": { + "get": { + "description": "Get aggregate bars for a stock over a given date range in custom time window sizes.\n
\n
\nFor example, if timespan = \u2018minute\u2019 and multiplier = \u20185\u2019 then 5-minute bars will be returned.\n", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.", + "example": "AAPL", + "in": "path", + "name": "stocksTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The size of the timespan multiplier.", + "example": 1, + "in": "path", + "name": "multiplier", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "The size of the time window.", + "example": "day", + "in": "path", + "name": "timespan", + "required": true, + "schema": { + "enum": [ + "second", + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string" + } + }, + { + "description": "The start of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-01-09", + "in": "path", + "name": "from", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The end of the aggregate time window. Either a date with the format YYYY-MM-DD or a millisecond timestamp.", + "example": "2023-02-10", + "in": "path", + "name": "to", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Whether or not the results are adjusted for splits. By default, results are adjusted.\nSet this to false to get results that are NOT adjusted for splits.\n", + "example": true, + "in": "query", + "name": "adjusted", + "schema": { + "type": "boolean" + } + }, + { + "description": "Sort the results by timestamp.\n`asc` will return results in ascending order (oldest at the top),\n`desc` will return results in descending order (newest at the top).\n", + "example": "asc", + "in": "query", + "name": "sort", + "schema": { + "enum": [ + "asc", + "desc" + ] + } + }, + { + "description": "Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000.\nRead more about how limit is used to calculate aggregate results in our article on\nAggregate Data API Improvements.\n", + "example": 120, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "adjusted": true, + "next_url": "https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/1578114000000/2020-01-10?cursor=bGltaXQ9MiZzb3J0PWFzYw", + "queryCount": 2, + "request_id": "6a7e466379af0a71039d60cc78e72282", + "results": [ + { + "c": 75.0875, + "h": 75.15, + "l": 73.7975, + "n": 1, + "o": 74.06, + "t": 1577941200000, + "v": 135647456, + "vw": 74.6099 + }, + { + "c": 74.3575, + "h": 75.145, + "l": 74.125, + "n": 1, + "o": 74.2875, + "t": 1578027600000, + "v": 146535512, + "vw": 74.7026 + } + ], + "resultsCount": 2, + "status": "OK", + "ticker": "AAPL" + }, + "schema": { + "allOf": [ + { + "properties": { + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "required": [ + "ticker" + ], + "type": "object" + }, + { + "properties": { + "adjusted": { + "description": "Whether or not this response was adjusted for splits.", + "type": "boolean" + }, + "queryCount": { + "description": "The number of aggregates (minute or day) used to generate the response.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "resultsCount": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "adjusted", + "queryCount", + "resultsCount", + "request_id" + ], + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "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" + }, + "otc": { + "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", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "t" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "c,h,l,n,o,t,v,vw\n75.0875,75.15,73.7975,1,74.06,1577941200000,135647456.0,74.6099\n74.3575,75.145,74.125,1,74.2875,1578027600000,146535512.0,74.7026\n", + "schema": { + "type": "string" + } + } + }, + "description": "Stock Aggregates." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Aggregates (Bars)", + "tags": [ + "stocks:aggregates" + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v2/last/nbbo/{stocksTicker}": { + "get": { + "description": "Get the most recent NBBO (Quote) tick for a given stock.", + "operationId": "LastQuote", + "parameters": [ + { + "description": "The ticker symbol of the stock/equity.", + "example": "AAPL", + "in": "path", + "name": "stocksTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "b84e24636301f19f88e0dfbf9a45ed5c", + "results": { + "P": 127.98, + "S": 7, + "T": "AAPL", + "X": 19, + "p": 127.96, + "q": 83480742, + "s": 1, + "t": 1617827221349730300, + "x": 11, + "y": 1617827221349366000, + "z": 3 + }, + "status": "OK" + }, + "schema": { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "P": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "S": { + "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.", + "type": "integer" + }, + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "X": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "c": { + "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", + "x-polygon-go-type": { + "name": "Int32Array" + } + }, + "f": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "i": { + "description": "A list of indicator codes.", + "items": { + "description": "The indicator codes. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).", + "format": "int32", + "type": "integer" + }, + "type": "array", + "x-polygon-go-type": { + "name": "Int32Array" + } + }, + "p": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "q": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).", + "format": "int64", + "type": "integer" + }, + "s": { + "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.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "y": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + }, + "z": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ", + "type": "integer" + } + }, + "required": [ + "T", + "t", + "y", + "q" + ], + "type": "object", + "x-polygon-go-type": { + "name": "LastQuoteResult" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + }, + "text/csv": { + "example": "P,S,T,X,p,q,s,t,x,y,z\n127.98,7,AAPL,19,127.96,83480742,1,1617827221349730300,11,1617827221349366000,3\n", + "schema": { + "type": "string" + } + } + }, + "description": "The last NBBO tick for this stock." + }, + "401": { + "description": "Unauthorized - Check our API Key and account status" + }, + "404": { + "description": "The specified resource was not found" + } + }, + "summary": "Last Quote", + "tags": [ + "stocks:last:quote" + ], + "x-polygon-entitlement-allowed-timeframes": [ + { + "description": "Real Time Data", + "name": "realtime" + }, + { + "description": "15 minute delayed data", + "name": "delayed" + } + ], + "x-polygon-entitlement-data-type": { + "description": "NBBO data", + "name": "nbbo" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v2/last/trade/{optionsTicker}": { + "get": { + "description": "Get the most recent trade for a given options contract.", + "operationId": "LastTradeOptions", + "parameters": [ + { + "description": "The ticker symbol of the options contract.", + "example": "O:TSLA210903C00700000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "f05562305bd26ced64b98ed68b3c5d96", + "results": { + "T": "O:TSLA210903C00700000", + "c": [ + 227 + ], + "f": 1617901342969796400, + "i": "", + "p": 115.55, + "q": 1325541950, + "r": 202, + "s": 25, + "t": 1617901342969834000, + "x": 312, + "y": 1617901342969834000 + }, + "status": "OK" + }, + "schema": { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "c": { + "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", + "x-polygon-go-type": { + "name": "Int32Array" + } + }, + "e": { + "description": "The trade correction indicator.", + "type": "integer" + }, + "f": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.", + "type": "string" + }, + "p": { + "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" + }, + "q": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).", + "format": "int64", + "type": "integer" + }, + "r": { + "description": "The ID for the Trade Reporting Facility where the trade took place.", + "type": "integer" + }, + "s": { + "description": "The size of a trade (also known as volume).", + "format": "double", + "type": "number" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "y": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + }, + "z": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ", + "type": "integer" + } + }, + "required": [ + "T", + "t", + "y", + "q", + "i", + "p", + "x" + ], + "type": "object", + "x-polygon-go-type": { + "name": "LastTradeResult" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + }, + "text/csv": { + "example": "T,c,f,i,p,q,r,s,t,x\nO:TSLA210903C00700000,227,1617901342969796400,,115.55,1325541950,202,25,1617901342969834000,312\n", + "schema": { + "type": "string" + } + } + }, + "description": "The last trade for this options contract." + }, + "401": { + "description": "Unauthorized - Check our API Key and account status" + }, + "404": { + "description": "The specified resource was not found" + } + }, + "summary": "Last Trade", + "tags": [ + "options:last:trade" + ], + "x-polygon-entitlement-allowed-timeframes": [ + { + "description": "Real Time Data", + "name": "realtime" + }, + { + "description": "15 minute delayed data", + "name": "delayed" + } + ], + "x-polygon-entitlement-data-type": { + "description": "Trade data", + "name": "trades" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + } + }, + "x-polygon-ignore": true + }, + "/v2/last/trade/{stocksTicker}": { + "get": { + "description": "Get the most recent trade for a given stock.", + "operationId": "LastTrade", + "parameters": [ + { + "description": "The ticker symbol of the stock/equity.", + "example": "AAPL", + "in": "path", + "name": "stocksTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "f05562305bd26ced64b98ed68b3c5d96", + "results": { + "T": "AAPL", + "c": [ + 37 + ], + "f": 1617901342969796400, + "i": "118749", + "p": 129.8473, + "q": 3135876, + "r": 202, + "s": 25, + "t": 1617901342969834000, + "x": 4, + "y": 1617901342968000000, + "z": 3 + }, + "status": "OK" + }, + "schema": { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "c": { + "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", + "x-polygon-go-type": { + "name": "Int32Array" + } + }, + "e": { + "description": "The trade correction indicator.", + "type": "integer" + }, + "f": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.", + "type": "string" + }, + "p": { + "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" + }, + "q": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).", + "format": "int64", + "type": "integer" + }, + "r": { + "description": "The ID for the Trade Reporting Facility where the trade took place.", + "type": "integer" + }, + "s": { + "description": "The size of a trade (also known as volume).", + "format": "double", + "type": "number" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "y": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + }, + "z": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ", + "type": "integer" + } + }, + "required": [ + "T", + "t", + "y", + "q", + "i", + "p", + "x" + ], + "type": "object", + "x-polygon-go-type": { + "name": "LastTradeResult" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + }, + "text/csv": { + "example": "T,c,f,i,p,q,r,s,t,x,y,z\nAAPL,37,1617901342969796400,118749,129.8473,3135876,202,25,1617901342969834000,4,1617901342968000000,3\n", + "schema": { + "type": "string" + } + } + }, + "description": "The last trade for this stock." + }, + "401": { + "description": "Unauthorized - Check our API Key and account status" + }, + "404": { + "description": "The specified resource was not found" + } + }, + "summary": "Last Trade", + "tags": [ + "stocks:last:trade" + ], + "x-polygon-entitlement-allowed-timeframes": [ + { + "description": "Real Time Data", + "name": "realtime" + }, + { + "description": "15 minute delayed data", + "name": "delayed" + } + ], + "x-polygon-entitlement-data-type": { + "description": "Trade data", + "name": "trades" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v2/reference/news": { + "get": { + "description": "Get the most recent news articles relating to a stock ticker symbol, including a summary of the article and a link to the original source.", + "operationId": "ListNews", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.", + "in": "query", + "name": "ticker", + "schema": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Return results published on, before, or after this date.", + "in": "query", + "name": "published_utc", + "schema": { + "oneOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "format": "date", + "type": "string" + } + ] + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Search by ticker.", + "in": "query", + "name": "ticker.gte", + "schema": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + { + "description": "Search by ticker.", + "in": "query", + "name": "ticker.gt", + "schema": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + { + "description": "Search by ticker.", + "in": "query", + "name": "ticker.lte", + "schema": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + { + "description": "Search by ticker.", + "in": "query", + "name": "ticker.lt", + "schema": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + { + "description": "Search by published_utc.", + "in": "query", + "name": "published_utc.gte", + "schema": { + "oneOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "format": "date", + "type": "string" + } + ] + } + }, + { + "description": "Search by published_utc.", + "in": "query", + "name": "published_utc.gt", + "schema": { + "oneOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "format": "date", + "type": "string" + } + ] + } + }, + { + "description": "Search by published_utc.", + "in": "query", + "name": "published_utc.lte", + "schema": { + "oneOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "format": "date", + "type": "string" + } + ] + } + }, + { + "description": "Search by published_utc.", + "in": "query", + "name": "published_utc.lt", + "schema": { + "oneOf": [ + { + "format": "date-time", + "type": "string" + }, + { + "format": "date", + "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 1000.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "published_utc", + "enum": [ + "published_utc" + ], + "example": "published_utc", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "count": 1, + "next_url": "https://api.polygon.io:443/v2/reference/news?cursor=eyJsaW1pdCI6MSwic29ydCI6InB1Ymxpc2hlZF91dGMiLCJvcmRlciI6ImFzY2VuZGluZyIsInRpY2tlciI6e30sInB1Ymxpc2hlZF91dGMiOnsiZ3RlIjoiMjAyMS0wNC0yNiJ9LCJzZWFyY2hfYWZ0ZXIiOlsxNjE5NDA0Mzk3MDAwLG51bGxdfQ", + "request_id": "831afdb0b8078549fed053476984947a", + "results": [ + { + "amp_url": "https://m.uk.investing.com/news/stock-market-news/markets-are-underestimating-fed-cuts-ubs-3559968?ampMode=1", + "article_url": "https://uk.investing.com/news/stock-market-news/markets-are-underestimating-fed-cuts-ubs-3559968", + "author": "Sam Boughedda", + "description": "UBS analysts warn that markets are underestimating the extent of future interest rate cuts by the Federal Reserve, as the weakening economy is likely to justify more cuts than currently anticipated.", + "id": "8ec638777ca03b553ae516761c2a22ba2fdd2f37befae3ab6fdab74e9e5193eb", + "image_url": "https://i-invdn-com.investing.com/news/LYNXNPEC4I0AL_L.jpg", + "insights": [ + { + "sentiment": "positive", + "sentiment_reasoning": "UBS analysts are providing a bullish outlook on the extent of future Federal Reserve rate cuts, suggesting that markets are underestimating the number of cuts that will occur.", + "ticker": "UBS" + } + ], + "keywords": [ + "Federal Reserve", + "interest rates", + "economic data" + ], + "published_utc": "2024-06-24T18:33:53Z", + "publisher": { + "favicon_url": "https://s3.polygon.io/public/assets/news/favicons/investing.ico", + "homepage_url": "https://www.investing.com/", + "logo_url": "https://s3.polygon.io/public/assets/news/logos/investing.png", + "name": "Investing.com" + }, + "tickers": [ + "UBS" + ], + "title": "Markets are underestimating Fed cuts: UBS By Investing.com - Investing.com UK" + } + ], + "status": "OK" + }, + "schema": { + "properties": { + "count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "items": { + "properties": { + "amp_url": { + "description": "The mobile friendly Accelerated Mobile Page (AMP) URL.", + "type": "string" + }, + "article_url": { + "description": "A link to the news article.", + "type": "string" + }, + "author": { + "description": "The article's author.", + "type": "string" + }, + "description": { + "description": "A description of the article.", + "type": "string" + }, + "id": { + "description": "Unique identifier for the article.", + "type": "string" + }, + "image_url": { + "description": "The article's image URL.", + "type": "string" + }, + "insights": { + "description": "The insights related to the article.", + "items": { + "properties": { + "sentiment": { + "description": "The sentiment of the insight.", + "enum": [ + "positive", + "neutral", + "negative" + ], + "type": "string" + }, + "sentiment_reasoning": { + "description": "The reasoning behind the sentiment.", + "type": "string" + }, + "ticker": { + "description": "The ticker symbol associated with the insight.", + "type": "string" + } + }, + "required": [ + "ticker", + "sentiment", + "sentiment_reasoning" + ], + "type": "object" + }, + "type": "array" + }, + "keywords": { + "description": "The keywords associated with the article (which will vary depending on\nthe publishing source).", + "items": { + "type": "string" + }, + "type": "array" + }, + "published_utc": { + "description": "The date the article was published on.", + "format": "date-time", + "type": "string" + }, + "publisher": { + "properties": { + "favicon_url": { + "description": "The publisher's homepage favicon URL.", + "type": "string" + }, + "homepage_url": { + "description": "The publisher's homepage URL.", + "type": "string" + }, + "logo_url": { + "description": "The publisher's logo URL.", + "type": "string" + }, + "name": { + "description": "The publisher's name.", + "type": "string" + } + }, + "required": [ + "name", + "logo_url", + "homepage_url" + ], + "type": "object" + }, + "tickers": { + "description": "The ticker symbols associated with the article.", + "items": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "type": "array" + }, + "title": { + "description": "The title of the news article.", + "type": "string" + } + }, + "required": [ + "id", + "publisher", + "title", + "author", + "published_utc", + "article_url", + "tickers" + ], + "type": "object", + "x-polygon-go-type": { + "name": "NewsArticleMetadata", + "path": "github.com/polygon-io/go-lib-models/v2/globals" + } + }, + "type": "array", + "x-polygon-go-type": { + "name": "ListNewsArticlesResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "id,publisher_name,publisher_homepage_url,publisher_logo_url,publisher_favicon_url,title,author,published_utc,article_url,ticker,amp_url,image_url,description,keywords,sentiment,sentiment_reasoning\n8ec638777ca03b553ae516761c2a22ba2fdd2f37befae3ab6fdab74e9e5193eb,Investing.com,https://www.investing.com/,https://s3.polygon.io/public/assets/news/logos/investing.png,https://s3.polygon.io/public/assets/news/favicons/investing.ico,Markets are underestimating Fed cuts: UBS By Investing.com - Investing.com UK,Sam Boughedda,1719254033000000000,https://uk.investing.com/news/stock-market-news/markets-are-underestimating-fed-cuts-ubs-3559968,UBS,https://m.uk.investing.com/news/stock-market-news/markets-are-underestimating-fed-cuts-ubs-3559968?ampMode=1,https://i-invdn-com.investing.com/news/LYNXNPEC4I0AL_L.jpg,\"UBS analysts warn that markets are underestimating the extent of future interest rate cuts by the Federal Reserve, as the weakening economy is likely to justify more cuts than currently anticipated.\",\"Federal Reserve,interest rates,economic data\",positive,\"UBS analysts are providing a bullish outlook on the extent of future Federal Reserve rate cuts, suggesting that markets are underestimating the number of cuts that will occur.\"\n", + "schema": { + "type": "string" + } + } + }, + "description": "An array of news articles." + }, + "401": { + "description": "Unauthorized - Check our API Key and account status" + }, + "404": { + "description": "The specified resource was not found" + } + }, + "summary": "Ticker News", + "tags": [ + "reference:news" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-paginate": { + "sort": { + "default": "published_utc", + "enum": [ + "published_utc" + ], + "limit": { + "default": 10, + "maximum": 1000, + "minimum": 1 + } + } + } + } + }, + "/v2/snapshot/locale/global/markets/crypto/tickers": { + "get": { + "description": "Get the current minute, day, and previous day\u2019s aggregate, as well as the last trade and quote for all traded cryptocurrency symbols.\n
\n
\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n", + "parameters": [ + { + "description": "A case-sensitive comma separated list of tickers to get snapshots for. For example, X:BTCUSD, X:ETHBTC, and X:BOBAUSD. Empty string defaults to querying all tickers.", + "in": "query", + "name": "tickers", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "status": "OK", + "tickers": [ + { + "day": { + "c": 0.296, + "h": 0.59714, + "l": 0.23706, + "o": 0.28, + "v": 4097699.5691991993, + "vw": 0 + }, + "lastTrade": { + "c": [ + 1 + ], + "i": 413131, + "p": 0.293, + "s": 13.6191, + "t": 1605292686010, + "x": 17 + }, + "min": { + "c": 0.296, + "h": 0.296, + "l": 0.294, + "n": 2, + "o": 0.296, + "t": 1684427880000, + "v": 123.4866, + "vw": 0 + }, + "prevDay": { + "c": 0.281, + "h": 0.59714, + "l": 0.23706, + "o": 0.27, + "v": 6070178.786154971, + "vw": 0.4076 + }, + "ticker": "X:FSNUSD", + "todaysChange": 0.012, + "todaysChangePerc": 4.270463, + "updated": 1605330008999 + } + ] + }, + "schema": { + "allOf": [ + { + "properties": { + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + { + "properties": { + "tickers": { + "items": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "lastTrade": { + "allOf": [ + { + "description": "The most recent trade for this ticker." + }, + { + "properties": { + "c": { + "description": "The trade conditions.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size (volume) of the trade.", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp. This is the timestamp of when the trade was generated at the exchange.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "t", + "x" + ], + "type": "object" + } + ] + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "day", + "lastTrade", + "min", + "prevDay", + "ticker", + "todaysChange", + "todaysChangePerc", + "updated" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "day_c,day_h,day_l,day_o,day_v,lastTrade_c,lastTrade_i,lastTrade_p,lastTrade_s,lastTrade_t,lastTrade_x,min_c,min_h,min_l,min_o,min_v,prevDay_c,prevDay_h,prevDay_l,prevDay_o,prevDay_v,prevDay_vw\n16260.85,16428.4,15830.4,16418.07,105008.84231068,0,\"[2]\",464569520,16242.31,0.001933,1605294230780,4,16235.1,16264.29,16129.3,16257.51,19.30791925,0,16399.24,16418.07,16399.24,16418.07,0.99167108,16402.6893\n", + "schema": { + "type": "string" + } + } + }, + "description": "Get current state for all tickers" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "All Tickers", + "tags": [ + "crypto: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + } + }, + "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}": { + "get": { + "description": "Get the current minute, day, and previous day\u2019s aggregate, as well as the last trade and quote for a single traded cryptocurrency symbol.\n
\n
\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n", + "parameters": [ + { + "description": "Ticker of the snapshot", + "example": "X:BTCUSD", + "in": "path", + "name": "ticker", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "ad92e92ce183112c593717f00dfebd2c", + "status": "OK", + "ticker": { + "day": { + "c": 16260.85, + "h": 16428.4, + "l": 15830.4, + "o": 16418.07, + "v": 105008.84231068, + "vw": 0 + }, + "lastTrade": { + "c": [ + 2 + ], + "i": "464569520", + "p": 16242.31, + "s": 0.001933, + "t": 1605294230780, + "x": 4 + }, + "min": { + "c": 16235.1, + "h": 16264.29, + "l": 16129.3, + "n": 558, + "o": 16257.51, + "t": 1684428960000, + "v": 19.30791925, + "vw": 0 + }, + "prevDay": { + "c": 16399.24, + "h": 16418.07, + "l": 16399.24, + "o": 16418.07, + "v": 0.99167108, + "vw": 16402.6893 + }, + "ticker": "X:BTCUSD", + "todaysChange": -156.93, + "todaysChangePerc": -0.956935, + "updated": 1605330008999 + } + }, + "schema": { + "allOf": [ + { + "properties": { + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + } + }, + "required": [ + "request_id" + ], + "type": "object" + }, + { + "properties": { + "ticker": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "lastTrade": { + "allOf": [ + { + "description": "The most recent trade for this ticker." + }, + { + "properties": { + "c": { + "description": "The trade conditions.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size (volume) of the trade.", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp. This is the timestamp of when the trade was generated at the exchange.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "t", + "x" + ], + "type": "object" + } + ] + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "day", + "lastTrade", + "min", + "prevDay", + "ticker", + "todaysChange", + "todaysChangePerc", + "updated" + ], + "type": "object" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "day_c,day_h,day_l,day_o,day_v,lastTrade_c,lastTrade_i,lastTrade_p,lastTrade_s,lastTrade_t,lastTrade_x,min_c,min_h,min_l,min_o,min_v,prevDay_c,prevDay_h,prevDay_l,prevDay_o,prevDay_v,prevDay_vw\n16260.85,16428.4,15830.4,16418.07,105008.84231068,0,\"[2]\",464569520,16242.31,0.001933,1605294230780,4,16235.1,16264.29,16129.3,16257.51,19.30791925,0,16399.24,16418.07,16399.24,16418.07,0.99167108,16402.6893\n", + "schema": { + "type": "string" + } + } + }, + "description": "Get current state for a ticker" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Ticker", + "tags": [ + "crypto: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + } + }, + "/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book": { + "get": { + "description": "Get the current level 2 book of a single ticker. This is the combined book from all of the exchanges.\n
\n
\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n", + "parameters": [ + { + "description": "The cryptocurrency ticker.", + "example": "X:BTCUSD", + "in": "path", + "name": "ticker", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "data": { + "askCount": 593.1412981600005, + "asks": [ + { + "p": 11454, + "x": { + "2": 1 + } + }, + { + "p": 11455, + "x": { + "2": 1 + } + } + ], + "bidCount": 694.951789670001, + "bids": [ + { + "p": 16303.17, + "x": { + "1": 2 + } + }, + { + "p": 16302.94, + "x": { + "1": 0.02859424, + "6": 0.023455 + } + } + ], + "spread": -4849.17, + "ticker": "X:BTCUSD", + "updated": 1605295074162 + }, + "status": "OK" + }, + "schema": { + "allOf": [ + { + "description": "The status of this request's response.", + "type": "string" + }, + { + "properties": { + "data": { + "properties": { + "askCount": { + "description": "The combined total number of asks in the book.", + "format": "double", + "type": "number" + }, + "asks": { + "items": { + "properties": { + "p": { + "description": "The price of this book level.", + "format": "double", + "type": "number" + }, + "x": { + "description": "A map of the exchange ID to number of shares at this price level.\n
\n
\n**Example:**\n
\n`{\n \"p\": 16302.94,\n \"x\": {\n \"1\": 0.02859424,\n \"6\": 0.023455\n }\n}`\n
\n
\nIn this example, exchange ID 1 has 0.02859424 shares available at $16,302.94,\nand exchange ID 6 has 0.023455 shares at the same price level.\n", + "type": "object" + } + }, + "required": [ + "p", + "x" + ], + "type": "object" + }, + "type": "array" + }, + "bidCount": { + "description": "The combined total number of bids in the book.", + "format": "double", + "type": "number" + }, + "bids": { + "items": { + "properties": { + "p": { + "description": "The price of this book level.", + "format": "double", + "type": "number" + }, + "x": { + "description": "A map of the exchange ID to number of shares at this price level.\n
\n
\n**Example:**\n
\n`{\n \"p\": 16302.94,\n \"x\": {\n \"1\": 0.02859424,\n \"6\": 0.023455\n }\n}`\n
\n
\nIn this example, exchange ID 1 has 0.02859424 shares available at $16,302.94,\nand exchange ID 6 has 0.023455 shares at the same price level.\n", + "type": "object" + } + }, + "required": [ + "p", + "x" + ], + "type": "object" + }, + "type": "array" + }, + "spread": { + "description": "The difference between the best bid and the best ask price across exchanges.", + "format": "double", + "type": "number" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "ticker", + "bids", + "asks", + "bidCount", + "askCount", + "spread", + "updated" + ], + "type": "object" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "side,price,size,exchange\nbid,20292.97,0.01501,1\nbid,20291.93,0.00218483,1\nask,18445.61,0.22,1\nask,18463.07,0.00234104,1\nask,18464.83,0.04159475,1\n", + "schema": { + "type": "string" + } + } + }, + "description": "Get current level 2 book for a ticker" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Ticker Full Book (L2)", + "tags": [ + "crypto:snapshot" + ], + "x-polygon-deprecation": { + "date": 1719838800000 + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "description": "Real Time Data", + "name": "realtime" + }, + { + "description": "15 minute delayed data", + "name": "delayed" + } + ], + "x-polygon-entitlement-data-type": { + "description": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + } + }, + "/v2/snapshot/locale/global/markets/crypto/{direction}": { + "get": { + "description": "Get the current top 20 gainers or losers of the day in cryptocurrency markets.\n
\n
\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n
\n
\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n", + "parameters": [ + { + "description": "The direction of the snapshot results to return.\n", + "example": "gainers", + "in": "path", + "name": "direction", + "required": true, + "schema": { + "enum": [ + "gainers", + "losers" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "status": "OK", + "tickers": [ + { + "day": { + "c": 0.0374, + "h": 0.062377, + "l": 0.01162, + "o": 0.044834, + "v": 27313165.159427017, + "vw": 0 + }, + "lastTrade": { + "c": [ + 2 + ], + "i": "517478762", + "p": 0.0374, + "s": 499, + "t": 1604409649544, + "x": 2 + }, + "min": { + "c": 0.062377, + "h": 0.062377, + "l": 0.062377, + "n": 2, + "o": 0.062377, + "t": 1684426740000, + "v": 35420, + "vw": 0 + }, + "prevDay": { + "c": 0.01162, + "h": 0.044834, + "l": 0.01162, + "o": 0.044834, + "v": 53616273.36827199, + "vw": 0.0296 + }, + "ticker": "X:DRNUSD", + "todaysChange": 0.02578, + "todaysChangePerc": 221.858864, + "updated": 1605330008999 + } + ] + }, + "schema": { + "allOf": [ + { + "description": "The status of this request's response.", + "type": "string" + }, + { + "properties": { + "tickers": { + "items": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "lastTrade": { + "allOf": [ + { + "description": "The most recent trade for this ticker." + }, + { + "properties": { + "c": { + "description": "The trade conditions.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size (volume) of the trade.", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp. This is the timestamp of when the trade was generated at the exchange.", + "type": "integer" + }, + "x": { + "description": "The exchange that this crypto trade happened on. \nSee Exchanges for a mapping of exchanges to IDs.\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "t", + "x" + ], + "type": "object" + } + ] + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "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" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "day", + "lastTrade", + "min", + "prevDay", + "ticker", + "todaysChange", + "todaysChangePerc", + "updated" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "day_c,day_h,day_l,day_o,day_v,day_vw,lastTrade_c,lastTrade_i,lastTrade_p,lastTrade_s,lastTrade_t,lastTrade_x,day_c,day_h,day_l,day_o,day_v,day_vw,prevDay_c,prevDay_h,prevDay_l,prevDay_o,prevDay_v,prevDay_vw\n0.0374,0.062377,0.01162,0.044834,27313165.159427017,0,\"[2]\",517478762,0.0374,499,1604409649544,2,0.062377,0.062377,0.062377,0.062377,35420,0,0.01162,0.044834,0.01162,0.044834,53616273.36827199,0.0296\n", + "schema": { + "type": "string" + } + } + }, + "description": "Get the current gainers / losers of the day" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Gainers/Losers", + "tags": [ + "crypto: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + } + } + }, + "/v2/snapshot/locale/global/markets/forex/tickers": { + "get": { + "description": "Get the current minute, day, and previous day\u2019s aggregate, as well as the last trade and quote for all traded forex symbols.\n
\n
\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n", + "parameters": [ + { + "description": "A case-sensitive comma separated list of tickers to get snapshots for. For example, C:EURUSD, C:GBPCAD, and C:AUDINR. Empty string defaults to querying all tickers.", + "in": "query", + "name": "tickers", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "status": "OK", + "tickers": [ + { + "day": { + "c": 0.11778221, + "h": 0.11812263, + "l": 0.11766631, + "o": 0.11797149, + "v": 77794 + }, + "lastQuote": { + "a": 0.11780678, + "b": 0.11777952, + "t": 1605280919000, + "x": 48 + }, + "min": { + "c": 0.117769, + "h": 0.11779633, + "l": 0.11773698, + "n": 1, + "o": 0.11778, + "t": 1684422000000, + "v": 202 + }, + "prevDay": { + "c": 0.11797258, + "h": 0.11797258, + "l": 0.11797149, + "o": 0.11797149, + "v": 2, + "vw": 0 + }, + "ticker": "C:HKDCHF", + "todaysChange": -0.00019306, + "todaysChangePerc": -0.1636482, + "updated": 1605280919000 + } + ] + }, + "schema": { + "allOf": [ + { + "properties": { + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + { + "properties": { + "tickers": { + "items": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "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" + }, + "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.", + "format": "double", + "type": "number" + }, + "lastQuote": { + "description": "The most recent quote for this ticker.", + "properties": { + "a": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "b": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp of the quote.", + "type": "integer" + }, + "x": { + "description": "The exchange ID on which this quote happened.", + "type": "integer" + } + }, + "required": [ + "a", + "b", + "t", + "x" + ], + "type": "object" + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "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" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "day", + "lastQuote", + "min", + "prevDay", + "ticker", + "todaysChange", + "todaysChangePerc", + "updated" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "day_c,day_h,day_l,day_o,day_v,lastQuote_a,lastQuote_b,lastQuote_i,lastQuote_t,lastQuote_x,min_c,min_h,min_l,min_o,min_v,prevDay_c,prevDay_h,prevDay_l,prevDay_o,prevDay_v,prevDay_vw\n1.18403,1.1906,1.18001,1.18725,83578,1.18403,1.18398,0,1606163759000,48,1.18396,1.18423,1.1838,1.18404,41,1.18724,1.18727,1.18725,1.18725,5,0\n", + "schema": { + "type": "string" + } + } + }, + "description": "Get current state for all tickers" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "All Tickers", + "tags": [ + "fx: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + } + }, + "/v2/snapshot/locale/global/markets/forex/tickers/{ticker}": { + "get": { + "description": "Get the current minute, day, and previous day\u2019s aggregate, as well as the last trade and quote for a single traded currency symbol.\n
\n
\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n", + "parameters": [ + { + "description": "The forex ticker.", + "example": "C:EURUSD", + "in": "path", + "name": "ticker", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "ad76e76ce183002c5937a7f02dfebde4", + "status": "OK", + "ticker": { + "day": { + "c": 1.18403, + "h": 1.1906, + "l": 1.18001, + "o": 1.18725, + "v": 83578 + }, + "lastQuote": { + "a": 1.18403, + "b": 1.18398, + "i": 0, + "t": 1606163759000, + "x": 48 + }, + "min": { + "c": 1.18396, + "h": 1.18423, + "l": 1.1838, + "n": 85, + "o": 1.18404, + "t": 1684422000000, + "v": 41 + }, + "prevDay": { + "c": 1.18724, + "h": 1.18727, + "l": 1.18725, + "o": 1.18725, + "v": 5, + "vw": 0 + }, + "ticker": "C:EURUSD", + "todaysChange": -0.00316, + "todaysChangePerc": -0.27458312, + "updated": 1606163759000 + } + }, + "schema": { + "allOf": [ + { + "properties": { + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + } + }, + "required": [ + "request_id" + ], + "type": "object" + }, + { + "properties": { + "ticker": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "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" + }, + "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.", + "format": "double", + "type": "number" + }, + "lastQuote": { + "description": "The most recent quote for this ticker.", + "properties": { + "a": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "b": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp of the quote.", + "type": "integer" + }, + "x": { + "description": "The exchange ID on which this quote happened.", + "type": "integer" + } + }, + "required": [ + "a", + "b", + "t", + "x" + ], + "type": "object" + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "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" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "day", + "lastQuote", + "min", + "prevDay", + "ticker", + "todaysChange", + "todaysChangePerc", + "updated" + ], + "type": "object" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "day_c,day_h,day_l,day_o,day_v,lastQuote_a,lastQuote_b,lastQuote_i,lastQuote_t,lastQuote_x,min_c,min_h,min_l,min_o,min_v,prevDay_c,prevDay_h,prevDay_l,prevDay_o,prevDay_v,prevDay_vw\n1.18403,1.1906,1.18001,1.18725,83578,1.18403,1.18398,0,1606163759000,48,1.18396,1.18423,1.1838,1.18404,41,1.18724,1.18727,1.18725,1.18725,5,0\n", + "schema": { + "type": "string" + } + } + }, + "description": "Get current state for a ticker" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Ticker", + "tags": [ + "fx: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + } + }, + "/v2/snapshot/locale/global/markets/forex/{direction}": { + "get": { + "description": "Get the current top 20 gainers or losers of the day in forex markets.\n
\n
\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\n
\n
\nNote: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges.\n", + "parameters": [ + { + "description": "The direction of the snapshot results to return.\n", + "example": "gainers", + "in": "path", + "name": "direction", + "required": true, + "schema": { + "enum": [ + "gainers", + "losers" + ], + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "status": "OK", + "tickers": [ + { + "day": { + "c": 0.886156, + "h": 0.887111, + "l": 0.8825327, + "o": 0.8844732, + "v": 1041 + }, + "lastQuote": { + "a": 0.8879606, + "b": 0.886156, + "t": 1605283204000, + "x": 48 + }, + "min": { + "c": 0.886156, + "h": 0.886156, + "l": 0.886156, + "n": 1, + "o": 0.886156, + "t": 1684422000000, + "v": 1 + }, + "prevDay": { + "c": 0.8428527, + "h": 0.889773, + "l": 0.8428527, + "o": 0.8848539, + "v": 1078, + "vw": 0 + }, + "ticker": "C:PLNILS", + "todaysChange": 0.0433033, + "todaysChangePerc": 5.13770674, + "updated": 1605330008999 + } + ] + }, + "schema": { + "allOf": [ + { + "properties": { + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + { + "properties": { + "tickers": { + "items": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "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" + }, + "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.", + "format": "double", + "type": "number" + }, + "lastQuote": { + "description": "The most recent quote for this ticker.", + "properties": { + "a": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "b": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "t": { + "description": "The millisecond accuracy timestamp of the quote.", + "type": "integer" + }, + "x": { + "description": "The exchange ID on which this quote happened.", + "type": "integer" + } + }, + "required": [ + "a", + "b", + "t", + "x" + ], + "type": "object" + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "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" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "required": [ + "day", + "lastQuote", + "min", + "prevDay", + "ticker", + "todaysChange", + "todaysChangePerc", + "updated" + ], + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": { + "tickers": "day_c,day_h,day_l,day_o,day_v,lastQuote_a,lastQuote_b,lastQuote_t,lastQuote_x,min_c,min_h,min_l,min_o,min_v,prevDay_c,prevDay_h,prevDay_l,prevDay_o,prevDay_v,prevDay_vw\n0.886156,0.887111,0.8825327,0.8844732,1041,0.8879606,0.886156,1605283204000,48,0.886156,0.886156,0.886156,0.886156,1,0.8428527,0.889773,0.8428527,0.8848539,1078,0\n" + }, + "schema": { + "type": "string" + } + } + }, + "description": "Get the current gainers / losers of the day" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Gainers/Losers", + "tags": [ + "fx: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + } + } + }, + "/v2/snapshot/locale/us/markets/stocks/tickers": { + "get": { + "description": "Get the most up-to-date market data for all traded stock symbols.\n
\n
\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n", + "parameters": [ + { + "description": "A case-sensitive comma separated list of tickers to get snapshots for. For example, AAPL,TSLA,GOOG. Empty string defaults to querying all tickers.", + "in": "query", + "name": "tickers", + "schema": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + { + "description": "Include OTC securities in the response. Default is false (don't include OTC securities).\n", + "in": "query", + "name": "include_otc", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "count": 1, + "status": "OK", + "tickers": [ + { + "day": { + "c": 20.506, + "h": 20.64, + "l": 20.506, + "o": 20.64, + "v": 37216, + "vw": 20.616 + }, + "lastQuote": { + "P": 20.6, + "S": 22, + "p": 20.5, + "s": 13, + "t": 1605192959994246100 + }, + "lastTrade": { + "c": [ + 14, + 41 + ], + "i": "71675577320245", + "p": 20.506, + "s": 2416, + "t": 1605192894630916600, + "x": 4 + }, + "min": { + "av": 37216, + "c": 20.506, + "h": 20.506, + "l": 20.506, + "n": 1, + "o": 20.506, + "t": 1684428600000, + "v": 5000, + "vw": 20.5105 + }, + "prevDay": { + "c": 20.63, + "h": 21, + "l": 20.5, + "o": 20.79, + "v": 292738, + "vw": 20.6939 + }, + "ticker": "BCAT", + "todaysChange": -0.124, + "todaysChangePerc": -0.601, + "updated": 1605192894630916600 + } + ] + }, + "schema": { + "allOf": [ + { + "properties": { + "count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + { + "properties": { + "tickers": { + "items": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "lastQuote": { + "description": "The most recent quote for this ticker. This is only returned if your current plan includes quotes.", + "properties": { + "P": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "S": { + "description": "The ask size in lots.", + "type": "integer" + }, + "p": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "s": { + "description": "The bid size in lots.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "P", + "S", + "t" + ], + "type": "object" + }, + "lastTrade": { + "description": "The most recent trade for this ticker. This is only returned if your current plan includes trades.", + "properties": { + "c": { + "description": "The trade conditions.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size (volume) of the trade.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "t", + "x" + ], + "type": "object" + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "properties": { + "av": { + "description": "The accumulated volume.", + "type": "integer" + }, + "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" + }, + "otc": { + "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", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "av", + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "day_c,day_h,day_l,day_o,day_v,lastQuote_a,lastQuote_b,lastQuote_i,lastQuote_t,lastQuote_x,lastTrade_c,lastTrade_i,lastTrade_p,lastTrade_s,lastTrade_t,lastTrade_x,min_c,min_h,min_l,min_o,min_v,prevDay_c,prevDay_h,prevDay_l,prevDay_o,prevDay_v,prevDay_vw\n120.4229,120.53,118.81,119.62,28727868,119.725,120.47,4,120.46,8,1605195918507251817,\"[14,41]\",4046,120.47,236,1605195918306274031,10,28724441,120.4201,120.468,120.37,120.435,270796,120.4129,119.49,119.63,116.44,117.19,110597265,118.4998\n", + "schema": { + "type": "string" + } + } + }, + "description": "Get current state for all tickers" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "All Tickers", + "tags": [ + "stocks: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}": { + "get": { + "description": "Get the most up-to-date market data for a single traded stock ticker.\n
\n
\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST.\n", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.", + "example": "AAPL", + "in": "path", + "name": "stocksTicker", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "657e430f1ae768891f018e08e03598d8", + "status": "OK", + "ticker": { + "day": { + "c": 120.4229, + "h": 120.53, + "l": 118.81, + "o": 119.62, + "v": 28727868, + "vw": 119.725 + }, + "lastQuote": { + "P": 120.47, + "S": 4, + "p": 120.46, + "s": 8, + "t": 1605195918507251700 + }, + "lastTrade": { + "c": [ + 14, + 41 + ], + "i": "4046", + "p": 120.47, + "s": 236, + "t": 1605195918306274000, + "x": 10 + }, + "min": { + "av": 28724441, + "c": 120.4201, + "h": 120.468, + "l": 120.37, + "n": 762, + "o": 120.435, + "t": 1684428720000, + "v": 270796, + "vw": 120.4129 + }, + "prevDay": { + "c": 119.49, + "h": 119.63, + "l": 116.44, + "o": 117.19, + "v": 110597265, + "vw": 118.4998 + }, + "ticker": "AAPL", + "todaysChange": 0.98, + "todaysChangePerc": 0.82, + "updated": 1605195918306274000 + } + }, + "schema": { + "allOf": [ + { + "properties": { + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + } + }, + "required": [ + "request_id" + ], + "type": "object" + }, + { + "properties": { + "ticker": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "lastQuote": { + "description": "The most recent quote for this ticker. This is only returned if your current plan includes quotes.", + "properties": { + "P": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "S": { + "description": "The ask size in lots.", + "type": "integer" + }, + "p": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "s": { + "description": "The bid size in lots.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "P", + "S", + "t" + ], + "type": "object" + }, + "lastTrade": { + "description": "The most recent trade for this ticker. This is only returned if your current plan includes trades.", + "properties": { + "c": { + "description": "The trade conditions.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size (volume) of the trade.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "t", + "x" + ], + "type": "object" + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "properties": { + "av": { + "description": "The accumulated volume.", + "type": "integer" + }, + "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" + }, + "otc": { + "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", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "av", + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "type": "object" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "day_c,day_h,day_l,day_o,day_v,lastQuote_a,lastQuote_b,lastQuote_i,lastQuote_t,lastQuote_x,lastTrade_c,lastTrade_i,lastTrade_p,lastTrade_s,lastTrade_t,lastTrade_x,min_c,min_h,min_l,min_o,min_v,prevDay_c,prevDay_h,prevDay_l,prevDay_o,prevDay_v,prevDay_vw\n120.4229,120.53,118.81,119.62,28727868,119.725,120.47,4,120.46,8,1605195918507251817,\"[14,41]\",4046,120.47,236,1605195918306274031,10,28724441,120.4201,120.468,120.37,120.435,270796,120.4129,119.49,119.63,116.44,117.19,110597265,118.4998\n", + "schema": { + "type": "string" + } + } + }, + "description": "Get current state for a ticker" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Ticker", + "tags": [ + "stocks: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v2/snapshot/locale/us/markets/stocks/{direction}": { + "get": { + "description": "Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets.\n
\n
\nTop gainers are those tickers whose price has increased by the highest percentage since the previous day's close.\nTop losers are those tickers whose price has decreased by the highest percentage since the previous day's close.\nThis output will only include tickers with a trading volume of 10,000 or more.\n
\n
\nNote: Snapshot data is cleared at 3:30am EST and gets populated as data is received from the exchanges.\n", + "parameters": [ + { + "description": "The direction of the snapshot results to return.\n", + "example": "gainers", + "in": "path", + "name": "direction", + "required": true, + "schema": { + "enum": [ + "gainers", + "losers" + ], + "type": "string" + } + }, + { + "description": "Include OTC securities in the response. Default is false (don't include OTC securities).\n", + "in": "query", + "name": "include_otc", + "schema": { + "type": "boolean" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "status": "OK", + "tickers": [ + { + "day": { + "c": 14.2284, + "h": 15.09, + "l": 14.2, + "o": 14.33, + "v": 133963, + "vw": 14.5311 + }, + "lastQuote": { + "P": 14.44, + "S": 11, + "p": 14.2, + "s": 25, + "t": 1605195929997325600 + }, + "lastTrade": { + "c": [ + 63 + ], + "i": "79372124707124", + "p": 14.2284, + "s": 536, + "t": 1605195848258266000, + "x": 4 + }, + "min": { + "av": 133963, + "c": 14.2284, + "h": 14.325, + "l": 14.2, + "n": 5, + "o": 14.28, + "t": 1684428600000, + "v": 6108, + "vw": 14.2426 + }, + "prevDay": { + "c": 0.73, + "h": 0.799, + "l": 0.73, + "o": 0.75, + "v": 1568097, + "vw": 0.7721 + }, + "ticker": "PDS", + "todaysChange": 13.498, + "todaysChangePerc": 1849.096, + "updated": 1605195848258266000 + } + ] + }, + "schema": { + "allOf": [ + { + "properties": { + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + }, + { + "properties": { + "tickers": { + "items": { + "properties": { + "day": { + "description": "The most recent daily bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "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, contact us.", + "format": "double", + "type": "number" + }, + "lastQuote": { + "description": "The most recent quote for this ticker. This is only returned if your current plan includes quotes.", + "properties": { + "P": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "S": { + "description": "The ask size in lots.", + "type": "integer" + }, + "p": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "s": { + "description": "The bid size in lots.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + } + }, + "required": [ + "p", + "s", + "P", + "S", + "t" + ], + "type": "object" + }, + "lastTrade": { + "description": "The most recent trade for this ticker. This is only returned if your current plan includes trades.", + "properties": { + "c": { + "description": "The trade conditions.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "s": { + "description": "The size (volume) of the trade.", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "t", + "x" + ], + "type": "object" + }, + "min": { + "description": "The most recent minute bar for this ticker.", + "properties": { + "av": { + "description": "The accumulated volume.", + "type": "integer" + }, + "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" + }, + "otc": { + "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", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "av", + "o", + "h", + "l", + "c", + "v", + "vw", + "t", + "n" + ], + "type": "object" + }, + "prevDay": { + "description": "The previous day's bar for this ticker.", + "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" + }, + "o": { + "description": "The open price for the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "otc": { + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false.", + "type": "boolean" + }, + "v": { + "description": "The trading volume of the symbol in the given time period.", + "format": "double", + "type": "number" + }, + "vw": { + "description": "The volume weighted average price.", + "format": "double", + "type": "number" + } + }, + "required": [ + "o", + "h", + "l", + "c", + "v", + "vw" + ], + "type": "object" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "todaysChange": { + "description": "The value of the change from the previous day.", + "format": "double", + "type": "number" + }, + "todaysChangePerc": { + "description": "The percentage change since the previous day.", + "format": "double", + "type": "number" + }, + "updated": { + "description": "The last updated timestamp.", + "type": "integer" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + }, + "text/csv": { + "example": "day_c,day_h,day_l,day_o,day_v,day_vw,lastQuote_P,lastQuote_S,lastQuote_p,lastQuote_s,lastQuote_t,lastTrade_c,lastTrade_i,lastTrade_p,lastTrade_s,lastTrade_t,lastTrade_x,min_av,min_c,min_h,min_l,min_o,min_v,min_vw,prevDay_c,prevDay_h,prevDay_l,prevDay_o,prevDay_v,prevDay_vw\n14.2284,15.09,14.2,14.33,133963,14.5311,14.44,11,14.2,25,1605195929997325568,\"[63]\",79372124707124,14.2284,536,1605195848258266112,4,133963,14.2284,14.325,14.2,14.28,6108,14.2426,0.73,0.799,0.73,0.75,1568097,0.7721\n", + "schema": { + "type": "string" + } + } + }, + "description": "Get the current tickers of the day" + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Gainers/Losers", + "tags": [ + "stocks: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v2/ticks/stocks/nbbo/{ticker}/{date}": { + "get": { + "description": "Get NBBO quotes for a given ticker symbol on a specified date.\n", + "parameters": [ + { + "description": "The ticker symbol we want quotes for.", + "example": "AAPL", + "in": "path", + "name": "ticker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The date/day of the quotes to retrieve in the format YYYY-MM-DD.", + "example": "2020-10-14", + "in": "path", + "name": "date", + "required": true, + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results.\n", + "in": "query", + "name": "timestamp", + "schema": { + "type": "integer" + } + }, + { + "description": "The maximum timestamp allowed in the results.\n", + "in": "query", + "name": "timestampLimit", + "schema": { + "type": "integer" + } + }, + { + "description": "Reverse the order of the results.\n", + "example": true, + "in": "query", + "name": "reverse", + "schema": { + "type": "boolean" + } + }, + { + "description": "Limit the size of the response, max 50000 and default 5000.", + "example": 10, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "db_latency": 43, + "map": { + "P": { + "name": "ask_price", + "type": "float64" + }, + "S": { + "name": "ask_size", + "type": "int" + }, + "X": { + "name": "ask_exchange", + "type": "int" + }, + "c": { + "name": "conditions", + "type": "int" + }, + "f": { + "name": "trf_timestamp", + "type": "int64" + }, + "i": { + "name": "indicators", + "type": "int" + }, + "p": { + "name": "bid_price", + "type": "float64" + }, + "q": { + "name": "sequence_number", + "type": "int" + }, + "s": { + "name": "bid_size", + "type": "int" + }, + "t": { + "name": "sip_timestamp", + "type": "int64" + }, + "x": { + "name": "bid_exchange", + "type": "int" + }, + "y": { + "name": "participant_timestamp", + "type": "int64" + }, + "z": { + "name": "tape", + "type": "int" + } + }, + "results": [ + { + "P": 0, + "S": 0, + "X": 0, + "c": [ + 1 + ], + "p": 102.7, + "q": 2060, + "s": 60, + "t": 1517562000065700400, + "x": 11, + "y": 1517562000065321200, + "z": 3 + }, + { + "P": 0, + "S": 0, + "X": 0, + "c": [ + 1 + ], + "p": 170, + "q": 2061, + "s": 2, + "t": 1517562000065791500, + "x": 11, + "y": 1517562000065408300, + "z": 3 + } + ], + "results_count": 2, + "success": true, + "ticker": "AAPL" + }, + "schema": { + "allOf": [ + { + "properties": { + "db_latency": { + "description": "Latency in milliseconds for the query results from the database.", + "type": "integer" + }, + "results_count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "success": { + "description": "Whether or not this query was executed successfully.", + "type": "boolean" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "allOf": [ + { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "f": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "q": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n", + "format": "int64", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "y": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + } + }, + "required": [ + "T", + "t", + "y", + "f", + "q" + ], + "type": "object" + }, + { + "properties": { + "P": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "S": { + "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.", + "type": "integer" + }, + "X": { + "allOf": [ + { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + { + "description": "Ask Exchange Id" + } + ] + }, + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "i": { + "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n", + "items": { + "description": "The indicator code.\n", + "type": "integer" + }, + "type": "array" + }, + "p": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "s": { + "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.", + "type": "integer" + }, + "x": { + "allOf": [ + { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + { + "description": "Bid Exchange Id" + } + ] + }, + "z": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "x", + "P", + "S", + "X", + "z" + ], + "type": "object" + } + ] + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + } + }, + "description": "A list of quotes." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Quotes (NBBO)", + "tags": [ + "stocks:quotes" + ], + "x-polygon-deprecation": { + "date": 1654056060000, + "replaces": { + "name": "Quotes (NBBO) v3", + "path": "get_v3_quotes__stockticker" + } + }, + "x-polygon-entitlement-data-type": { + "description": "NBBO data", + "name": "nbbo" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v2/ticks/stocks/trades/{ticker}/{date}": { + "get": { + "description": "Get trades for a given ticker symbol on a specified date.\n", + "parameters": [ + { + "description": "The ticker symbol we want trades for.", + "example": "AAPL", + "in": "path", + "name": "ticker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The date/day of the trades to retrieve in the format YYYY-MM-DD.", + "example": "2020-10-14", + "in": "path", + "name": "date", + "required": true, + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "The timestamp offset, used for pagination. This is the offset at which to start the results. Using the `timestamp` of the last result as the offset will give you the next page of results.\n", + "in": "query", + "name": "timestamp", + "schema": { + "type": "integer" + } + }, + { + "description": "The maximum timestamp allowed in the results.\n", + "in": "query", + "name": "timestampLimit", + "schema": { + "type": "integer" + } + }, + { + "description": "Reverse the order of the results.\n", + "example": true, + "in": "query", + "name": "reverse", + "schema": { + "type": "boolean" + } + }, + { + "description": "Limit the size of the response, max 50000 and default 5000.", + "example": 10, + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "db_latency": 11, + "map": { + "I": { + "name": "orig_id", + "type": "string" + }, + "c": { + "name": "conditions", + "type": "int" + }, + "e": { + "name": "correction", + "type": "int" + }, + "f": { + "name": "trf_timestamp", + "type": "int64" + }, + "i": { + "name": "id", + "type": "string" + }, + "p": { + "name": "price", + "type": "float64" + }, + "q": { + "name": "sequence_number", + "type": "int64" + }, + "r": { + "name": "trf_id", + "type": "int" + }, + "s": { + "name": "size", + "type": "int" + }, + "t": { + "name": "sip_timestamp", + "type": "int64" + }, + "x": { + "name": "exchange", + "type": "int" + }, + "y": { + "name": "participant_timestamp", + "type": "int64" + }, + "z": { + "name": "tape", + "type": "int" + } + }, + "results": [ + { + "c": [ + 12, + 41 + ], + "i": "1", + "p": 171.55, + "q": 1063, + "s": 100, + "t": 1517562000016036600, + "x": 11, + "y": 1517562000015577000, + "z": 3 + }, + { + "c": [ + 12, + 41 + ], + "i": "2", + "p": 171.55, + "q": 1064, + "s": 100, + "t": 1517562000016038100, + "x": 11, + "y": 1517562000015577600, + "z": 3 + } + ], + "results_count": 2, + "success": true, + "ticker": "AAPL" + }, + "schema": { + "allOf": [ + { + "properties": { + "db_latency": { + "description": "Latency in milliseconds for the query results from the database.", + "type": "integer" + }, + "results_count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "success": { + "description": "Whether or not this query was executed successfully.", + "type": "boolean" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + } + }, + "type": "object" + }, + { + "properties": { + "results": { + "items": { + "allOf": [ + { + "properties": { + "T": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "f": { + "description": "The nanosecond accuracy TRF(Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this message.", + "type": "integer" + }, + "q": { + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n", + "format": "int64", + "type": "integer" + }, + "t": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this message from the exchange which produced it.", + "type": "integer" + }, + "y": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "type": "integer" + } + }, + "required": [ + "T", + "t", + "y", + "f", + "q" + ], + "type": "object" + }, + { + "properties": { + "c": { + "description": "A list of condition codes.\n", + "items": { + "description": "The condition code. These are the conditions of this message. See\n[Condition Mappings](https://polygon.io/docs/get_v3_reference_conditions)\nfor a mapping to exchange conditions.\n", + "type": "integer" + }, + "type": "array" + }, + "e": { + "description": "The trade correction indicator.\n", + "type": "integer" + }, + "i": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.\n", + "type": "string" + }, + "p": { + "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.\n", + "format": "double", + "type": "number" + }, + "r": { + "description": "The ID for the Trade Reporting Facility where the trade took place.\n", + "type": "integer" + }, + "s": { + "description": "The size of a trade (also known as volume).\n", + "format": "double", + "type": "number" + }, + "x": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "z": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ\n", + "type": "integer" + } + }, + "required": [ + "c", + "i", + "p", + "s", + "e", + "x", + "r", + "z" + ], + "type": "object" + } + ] + }, + "type": "array" + } + }, + "type": "object" + } + ] + } + } + }, + "description": "A list of trades." + }, + "default": { + "description": "Unexpected error" + } + }, + "summary": "Trades", + "tags": [ + "stocks:trades" + ], + "x-polygon-deprecation": { + "date": 1654056060000, + "replaces": { + "name": "Trades v3", + "path": "get_v3_trades__stockticker" + } + }, + "x-polygon-entitlement-data-type": { + "description": "Trade data", + "name": "trades" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + } + } + }, + "/v3/quotes/{fxTicker}": { + "get": { + "description": "Get BBO quotes for a ticker symbol in a given time range.", + "operationId": "QuotesFx", + "parameters": [ + { + "description": "The ticker symbol to get quotes for.", + "example": "C:EUR-USD", + "in": "path", + "name": "fxTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + }, + { + "description": "Order results based on the `sort` field.", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "example": "asc", + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 1000 and max is 50000.", + "in": "query", + "name": "limit", + "schema": { + "default": 1000, + "example": 10, + "maximum": 50000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "timestamp", + "enum": [ + "timestamp" + ], + "example": "timestamp", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v3/quotes/C:EUR-USD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": [ + { + "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, + "participant_timestamp": 1625097600000000000 + } + ], + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "results": { + "items": { + "properties": { + "ask_exchange": { + "description": "The ask exchange ID", + "type": "integer" + }, + "ask_price": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "bid_exchange": { + "description": "The bid exchange ID", + "type": "integer" + }, + "bid_price": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "participant_timestamp": { + "description": "The nanosecond Exchange Unix Timestamp. This is the timestamp of when the quote was generated at the exchange.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + } + }, + "required": [ + "participant_timestamp" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + }, + "text/csv": { + "example": "ask_exchange,ask_price,bid_exchange,bid_price,participant_timestamp\n48,,1.18565,,48,,1.18558,,1625097600000000000\n48,,1.18565,,48,,1.18559,,1625097600000000000\n", + "schema": { + "type": "string" + } + } + }, + "description": "A list of quotes." + } + }, + "summary": "Quotes (BBO)", + "tags": [ + "fx:quotes" + ], + "x-polygon-entitlement-data-type": { + "description": "NBBO data", + "name": "nbbo" + }, + "x-polygon-entitlement-market-type": { + "description": "Forex data", + "name": "fx" + }, + "x-polygon-paginate": { + "limit": { + "default": 1000, + "example": 10, + "max": 50000 + }, + "order": { + "default": "desc" + }, + "sort": { + "default": "timestamp", + "enum": [ + "timestamp" + ] + } + }, + "x-polygon-replaces": { + "date": 1654056060000, + "replaces": { + "name": "Historic Forex Ticks", + "path": "get_v1_historic_forex__from___to___date" + } + } + }, + "x-polygon-ignore": true + }, + "/v3/quotes/{optionsTicker}": { + "get": { + "description": "Get quotes for an options ticker symbol in a given time range.", + "operationId": "QuotesOptions", + "parameters": [ + { + "description": "The ticker symbol to get quotes for.", + "example": "O:SPY241220P00720000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + }, + { + "description": "Order results based on the `sort` field.", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "example": "asc", + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 1000 and max is 50000.", + "in": "query", + "name": "limit", + "schema": { + "default": 1000, + "example": 10, + "maximum": 50000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "timestamp", + "enum": [ + "timestamp" + ], + "example": "timestamp", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v3/quotes/O:SPY241220P00720000?cursor=YXA9NzY5Nzg0NzAxJmFzPSZsaW1pdD0xMCZvcmRlcj1kZXNjJnNvcnQ9dGltZXN0YW1wJnRpbWVzdGFtcC5sdGU9MjAyMi0wMi0xN1QxNyUzQTI1JTNBMTMuMDA5MzU2MDMyWg", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": [ + { + "ask_exchange": 323, + "ask_price": 282, + "ask_size": 10, + "bid_exchange": 316, + "bid_price": 277.5, + "bid_size": 1, + "sequence_number": 789539218, + "sip_timestamp": 1645119125346243600 + }, + { + "ask_exchange": 301, + "ask_price": 282, + "ask_size": 1, + "bid_exchange": 323, + "bid_price": 277.5, + "bid_size": 10, + "sequence_number": 788994206, + "sip_timestamp": 1645119118474271000 + } + ], + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "results": { + "items": { + "properties": { + "ask_exchange": { + "description": "The ask exchange ID", + "type": "integer" + }, + "ask_price": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "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_exchange": { + "description": "The bid exchange ID", + "type": "integer" + }, + "bid_price": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "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" + }, + "sequence_number": { + "description": "The sequence number represents the sequence in which quote events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).", + "format": "int64", + "type": "integer" + }, + "sip_timestamp": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this quote from the exchange which produced it.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + } + }, + "required": [ + "sip_timestamp", + "sequence_number" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + }, + "text/csv": { + "example": "ask_exchange,ask_price,ask_size,bid_exchange,bid_price,bid_size,sequence_number,sip_timestamp\n323,282,10,316,277.5,1,789539218,1645119125346243600\n301,282,1,323,277.5,10,788994206,1645119118474271000\n", + "schema": { + "type": "string" + } + } + }, + "description": "A list of quotes." + } + }, + "summary": "Quotes", + "tags": [ + "options:quotes" + ], + "x-polygon-entitlement-data-type": { + "description": "NBBO data", + "name": "nbbo" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + }, + "x-polygon-paginate": { + "limit": { + "default": 1000, + "example": 10, + "max": 50000 + }, + "order": { + "default": "desc" + }, + "sort": { + "default": "timestamp", + "enum": [ + "timestamp" + ] + } + } + }, + "x-polygon-ignore": true + }, + "/v3/quotes/{stockTicker}": { + "get": { + "description": "Get NBBO quotes for a ticker symbol in a given time range.", + "operationId": "Quotes", + "parameters": [ + { + "description": "The ticker symbol to get quotes for.", + "example": "AAPL", + "in": "path", + "name": "stockTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + }, + { + "description": "Order results based on the `sort` field.", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "example": "asc", + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 1000 and max is 50000.", + "in": "query", + "name": "limit", + "schema": { + "default": 1000, + "example": 10, + "maximum": 50000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "timestamp", + "enum": [ + "timestamp" + ], + "example": "timestamp", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v3/quotes/AAPL?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": [ + { + "ask_exchange": 0, + "ask_price": 0, + "ask_size": 0, + "bid_exchange": 11, + "bid_price": 102.7, + "bid_size": 60, + "conditions": [ + 1 + ], + "participant_timestamp": 1517562000065321200, + "sequence_number": 2060, + "sip_timestamp": 1517562000065700400, + "tape": 3 + }, + { + "ask_exchange": 0, + "ask_price": 0, + "ask_size": 0, + "bid_exchange": 11, + "bid_price": 170, + "bid_size": 2, + "conditions": [ + 1 + ], + "participant_timestamp": 1517562000065408300, + "sequence_number": 2061, + "sip_timestamp": 1517562000065791500, + "tape": 3 + } + ], + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "results": { + "items": { + "properties": { + "ask_exchange": { + "description": "The ask exchange ID", + "type": "integer" + }, + "ask_price": { + "description": "The ask price.", + "format": "double", + "type": "number" + }, + "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_exchange": { + "description": "The bid exchange ID", + "type": "integer" + }, + "bid_price": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "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" + }, + "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", + "x-polygon-go-type": { + "name": "Int32Array" + } + }, + "indicators": { + "description": "A list of indicator codes.", + "items": { + "description": "The indicator codes. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).", + "format": "int32", + "type": "integer" + }, + "type": "array", + "x-polygon-go-type": { + "name": "Int32Array" + } + }, + "participant_timestamp": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the quote was actually generated at the exchange.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "sequence_number": { + "description": "The sequence number represents the sequence in which quote events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11). Values reset after each trading session/day.", + "format": "int64", + "type": "integer" + }, + "sip_timestamp": { + "description": "The nanosecond accuracy SIP Unix Timestamp. This is the timestamp of when the SIP received this quote from the exchange which produced it.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "tape": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ", + "format": "int32", + "type": "integer" + }, + "trf_timestamp": { + "description": "The nanosecond accuracy TRF (Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this quote.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + } + }, + "required": [ + "participant_timestamp", + "sequence_number", + "sip_timestamp" + ], + "type": "object", + "x-polygon-go-type": { + "name": "CommonQuote" + } + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + }, + "text/csv": { + "example": "ask_exchange,ask_price,ask_size,bid_exchange,bid_price,bid_size,conditions,participant_timestamp,sequence_number,sip_timestamp,tape\n0,0,0,11,102.7,60,1,1517562000065321216,2060,1517562000065700260,3\n0,0,0,11,170,2,1,1517562000065408256,2061,1517562000065791515,3\n", + "schema": { + "type": "string" + } + } + }, + "description": "A list of quotes." + } + }, + "summary": "Quotes (NBBO)", + "tags": [ + "stocks:quotes" + ], + "x-polygon-entitlement-data-type": { + "description": "NBBO data", + "name": "nbbo" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + }, + "x-polygon-paginate": { + "limit": { + "default": 1000, + "example": 10, + "max": 50000 + }, + "order": { + "default": "desc" + }, + "sort": { + "default": "timestamp", + "enum": [ + "timestamp" + ] + } + }, + "x-polygon-replaces": { + "date": 1654056060000, + "replaces": { + "name": "Quotes (NBBO)", + "path": "get_v2_ticks_stocks_nbbo__ticker___date" + } + } + } + }, + "/v3/reference/conditions": { + "get": { + "description": "List all conditions that Polygon.io uses.", + "operationId": "ListConditions", + "parameters": [ + { + "description": "Filter for conditions within a given 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 data type.", + "in": "query", + "name": "data_type", + "schema": { + "description": "The type of financial data represented by a data model.", + "enum": [ + "trade", + "bbo", + "nbbo" + ], + "example": "trade", + "type": "string" + } + }, + { + "description": "Filter for conditions with a given ID.", + "in": "query", + "name": "id", + "schema": { + "description": "An identifier used by Polygon.io for this condition. Unique per data type.", + "example": 1, + "type": "integer" + } + }, + { + "description": "Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned.", + "in": "query", + "name": "sip", + "schema": { + "description": "One of the SIPs.", + "enum": [ + "CTA", + "UTP", + "OPRA" + ], + "example": "CTA", + "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 1000.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "asset_class", + "enum": [ + "asset_class", + "id", + "type", + "name", + "data_types", + "legacy" + ], + "example": "asset_class", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "example": { + "count": 1, + "request_id": "31d59dda-80e5-4721-8496-d0d32a654afe", + "results": [ + { + "asset_class": "stocks", + "data_types": [ + "trade" + ], + "id": 2, + "name": "Average Price Trade", + "sip_mapping": { + "CTA": "B", + "UTP": "W" + }, + "type": "condition", + "update_rules": { + "consolidated": { + "updates_high_low": false, + "updates_open_close": false, + "updates_volume": true + }, + "market_center": { + "updates_high_low": false, + "updates_open_close": false, + "updates_volume": true + } + } + } + ], + "status": "OK" + }, + "properties": { + "count": { + "description": "The total number of results for this request.", + "example": 1, + "type": "integer" + }, + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request ID assigned by the server.", + "example": "31d59dda-80e5-4721-8496-d0d32a654afe", + "type": "string" + }, + "results": { + "description": "An array of conditions that match your query.", + "items": { + "description": "A condition generally refers to any extra information passed in a trade or a quote. These conditions\nmay or may not affect the behavior of aggregates.", + "properties": { + "abbreviation": { + "description": "A commonly-used abbreviation for this condition.", + "type": "string" + }, + "asset_class": { + "description": "An identifier for a group of similar financial instruments.", + "enum": [ + "stocks", + "options", + "crypto", + "fx" + ], + "example": "stocks", + "type": "string" + }, + "data_types": { + "description": "Data types that this condition applies to.", + "items": { + "description": "The type of financial data represented by a data model.", + "enum": [ + "trade", + "bbo", + "nbbo" + ], + "example": "trade", + "type": "string" + }, + "type": "array" + }, + "description": { + "description": "A short description of the semantics of this condition.", + "type": "string" + }, + "exchange": { + "description": "If present, mapping this condition from a Polygon.io code to a SIP symbol depends on this attribute.\nIn other words, data with this condition attached comes exclusively from the given exchange.", + "type": "integer" + }, + "id": { + "description": "An identifier used by Polygon.io for this condition. Unique per data type.", + "example": 1, + "type": "integer" + }, + "legacy": { + "description": "If true, this condition is from an old version of the SIPs' specs and no longer is used.\nOther conditions may or may not reuse the same symbol as this one.", + "type": "boolean" + }, + "name": { + "description": "The name of this condition.", + "example": "Acquisition", + "type": "string" + }, + "sip_mapping": { + "description": "A mapping to a symbol for each SIP that has this condition.", + "properties": { + "CTA": { + "type": "string" + }, + "OPRA": { + "type": "string" + }, + "UTP": { + "type": "string" + } + }, + "type": "object" + }, + "type": { + "description": "An identifier for a collection of related conditions.", + "enum": [ + "sale_condition", + "quote_condition", + "sip_generated_flag", + "financial_status_indicator", + "short_sale_restriction_indicator", + "settlement_condition", + "market_condition", + "trade_thru_exempt" + ], + "type": "string" + }, + "update_rules": { + "description": "A list of aggregation rules.", + "properties": { + "consolidated": { + "description": "Describes aggregation rules on a consolidated (all exchanges) basis.", + "properties": { + "updates_high_low": { + "description": "Whether or not trades with this condition update the high/low.", + "type": "boolean" + }, + "updates_open_close": { + "description": "Whether or not trades with this condition update the open/close.", + "type": "boolean" + }, + "updates_volume": { + "description": "Whether or not trades with this condition update the volume.", + "type": "boolean" + } + }, + "required": [ + "updates_high_low", + "updates_open_close", + "updates_volume" + ], + "type": "object" + }, + "market_center": { + "description": "Describes aggregation rules on a per-market-center basis.", + "properties": { + "updates_high_low": { + "description": "Whether or not trades with this condition update the high/low.", + "type": "boolean" + }, + "updates_open_close": { + "description": "Whether or not trades with this condition update the open/close.", + "type": "boolean" + }, + "updates_volume": { + "description": "Whether or not trades with this condition update the volume.", + "type": "boolean" + } + }, + "required": [ + "updates_high_low", + "updates_open_close", + "updates_volume" + ], + "type": "object" + } + }, + "required": [ + "consolidated", + "market_center" + ], + "type": "object" + } + }, + "required": [ + "id", + "type", + "name", + "asset_class", + "sip_mapping", + "data_types" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "example": "OK", + "type": "string" + } + }, + "required": [ + "status", + "request_id", + "count", + "results" + ], + "type": "object" + } + }, + "text/csv": { + "example": "id,type,abbreviation,name,description,asset_class,sip_mapping,exchange,consolidated_updates_high_low,consolidated_updates_open_close,consolidated_updates_volume,market_center_updates_high_low,market_center_updates_open_close,market_center_updates_volume,data_types,legacy\n0,regular,,Regular Trade,,crypto,null,0,,,,,,,trade,false\n1,buy_or_sell_side,,Sell Side,The asset was sold at the prevailing best bid price on an exchange.,crypto,null,0,,,,,,,trade,false\n2,buy_or_sell_side,,Buy Side,The asset was bought at the prevailing best ask price on an exchange.,crypto,null,0,,,,,,,trade,false\n", + "schema": { + "type": "string" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The total number of results for this request.", + "example": 1, + "type": "integer" + }, + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request ID assigned by the server.", + "example": "31d59dda-80e5-4721-8496-d0d32a654afe", + "type": "string" + }, + "results": { + "description": "An array of conditions that match your query.", + "items": { + "description": "A condition generally refers to any extra information passed in a trade or a quote. These conditions\nmay or may not affect the behavior of aggregates.", + "properties": { + "abbreviation": { + "description": "A commonly-used abbreviation for this condition.", + "type": "string" + }, + "asset_class": { + "description": "An identifier for a group of similar financial instruments.", + "enum": [ + "stocks", + "options", + "crypto", + "fx" + ], + "example": "stocks", + "type": "string" + }, + "data_types": { + "description": "Data types that this condition applies to.", + "items": { + "description": "The type of financial data represented by a data model.", + "enum": [ + "trade", + "bbo", + "nbbo" + ], + "example": "trade", + "type": "string" + }, + "type": "array" + }, + "description": { + "description": "A short description of the semantics of this condition.", + "type": "string" + }, + "exchange": { + "description": "If present, mapping this condition from a Polygon.io code to a SIP symbol depends on this attribute.\nIn other words, data with this condition attached comes exclusively from the given exchange.", + "type": "integer" + }, + "id": { + "description": "An identifier used by Polygon.io for this condition. Unique per data type.", + "example": 1, + "type": "integer" + }, + "legacy": { + "description": "If true, this condition is from an old version of the SIPs' specs and no longer is used.\nOther conditions may or may not reuse the same symbol as this one.", + "type": "boolean" + }, + "name": { + "description": "The name of this condition.", + "example": "Acquisition", + "type": "string" + }, + "sip_mapping": { + "description": "A mapping to a symbol for each SIP that has this condition.", + "properties": { + "CTA": { + "type": "string" + }, + "OPRA": { + "type": "string" + }, + "UTP": { + "type": "string" + } + }, + "type": "object" + }, + "type": { + "description": "An identifier for a collection of related conditions.", + "enum": [ + "sale_condition", + "quote_condition", + "sip_generated_flag", + "financial_status_indicator", + "short_sale_restriction_indicator", + "settlement_condition", + "market_condition", + "trade_thru_exempt" + ], + "type": "string" + }, + "update_rules": { + "description": "A list of aggregation rules.", + "properties": { + "consolidated": { + "description": "Describes aggregation rules on a consolidated (all exchanges) basis.", + "properties": { + "updates_high_low": { + "description": "Whether or not trades with this condition update the high/low.", + "type": "boolean" + }, + "updates_open_close": { + "description": "Whether or not trades with this condition update the open/close.", + "type": "boolean" + }, + "updates_volume": { + "description": "Whether or not trades with this condition update the volume.", + "type": "boolean" + } + }, + "required": [ + "updates_high_low", + "updates_open_close", + "updates_volume" + ], + "type": "object" + }, + "market_center": { + "description": "Describes aggregation rules on a per-market-center basis.", + "properties": { + "updates_high_low": { + "description": "Whether or not trades with this condition update the high/low.", + "type": "boolean" + }, + "updates_open_close": { + "description": "Whether or not trades with this condition update the open/close.", + "type": "boolean" + }, + "updates_volume": { + "description": "Whether or not trades with this condition update the volume.", + "type": "boolean" + } + }, + "required": [ + "updates_high_low", + "updates_open_close", + "updates_volume" + ], + "type": "object" + } + }, + "required": [ + "consolidated", + "market_center" + ], + "type": "object" + } + }, + "required": [ + "id", + "type", + "name", + "asset_class", + "sip_mapping", + "data_types" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "example": "OK", + "type": "string" + } + }, + "required": [ + "status", + "request_id", + "count", + "results" + ], + "type": "object" + } + } + }, + "description": "a query parameter was malformed" + }, + "default": { + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The total number of results for this request.", + "example": 1, + "type": "integer" + }, + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request ID assigned by the server.", + "example": "31d59dda-80e5-4721-8496-d0d32a654afe", + "type": "string" + }, + "results": { + "description": "An array of conditions that match your query.", + "items": { + "description": "A condition generally refers to any extra information passed in a trade or a quote. These conditions\nmay or may not affect the behavior of aggregates.", + "properties": { + "abbreviation": { + "description": "A commonly-used abbreviation for this condition.", + "type": "string" + }, + "asset_class": { + "description": "An identifier for a group of similar financial instruments.", + "enum": [ + "stocks", + "options", + "crypto", + "fx" + ], + "example": "stocks", + "type": "string" + }, + "data_types": { + "description": "Data types that this condition applies to.", + "items": { + "description": "The type of financial data represented by a data model.", + "enum": [ + "trade", + "bbo", + "nbbo" + ], + "example": "trade", + "type": "string" + }, + "type": "array" + }, + "description": { + "description": "A short description of the semantics of this condition.", + "type": "string" + }, + "exchange": { + "description": "If present, mapping this condition from a Polygon.io code to a SIP symbol depends on this attribute.\nIn other words, data with this condition attached comes exclusively from the given exchange.", + "type": "integer" + }, + "id": { + "description": "An identifier used by Polygon.io for this condition. Unique per data type.", + "example": 1, + "type": "integer" + }, + "legacy": { + "description": "If true, this condition is from an old version of the SIPs' specs and no longer is used.\nOther conditions may or may not reuse the same symbol as this one.", + "type": "boolean" + }, + "name": { + "description": "The name of this condition.", + "example": "Acquisition", + "type": "string" + }, + "sip_mapping": { + "description": "A mapping to a symbol for each SIP that has this condition.", + "properties": { + "CTA": { + "type": "string" + }, + "OPRA": { + "type": "string" + }, + "UTP": { + "type": "string" + } + }, + "type": "object" + }, + "type": { + "description": "An identifier for a collection of related conditions.", + "enum": [ + "sale_condition", + "quote_condition", + "sip_generated_flag", + "financial_status_indicator", + "short_sale_restriction_indicator", + "settlement_condition", + "market_condition", + "trade_thru_exempt" + ], + "type": "string" + }, + "update_rules": { + "description": "A list of aggregation rules.", + "properties": { + "consolidated": { + "description": "Describes aggregation rules on a consolidated (all exchanges) basis.", + "properties": { + "updates_high_low": { + "description": "Whether or not trades with this condition update the high/low.", + "type": "boolean" + }, + "updates_open_close": { + "description": "Whether or not trades with this condition update the open/close.", + "type": "boolean" + }, + "updates_volume": { + "description": "Whether or not trades with this condition update the volume.", + "type": "boolean" + } + }, + "required": [ + "updates_high_low", + "updates_open_close", + "updates_volume" + ], + "type": "object" + }, + "market_center": { + "description": "Describes aggregation rules on a per-market-center basis.", + "properties": { + "updates_high_low": { + "description": "Whether or not trades with this condition update the high/low.", + "type": "boolean" + }, + "updates_open_close": { + "description": "Whether or not trades with this condition update the open/close.", + "type": "boolean" + }, + "updates_volume": { + "description": "Whether or not trades with this condition update the volume.", + "type": "boolean" + } + }, + "required": [ + "updates_high_low", + "updates_open_close", + "updates_volume" + ], + "type": "object" + } + }, + "required": [ + "consolidated", + "market_center" + ], + "type": "object" + } + }, + "required": [ + "id", + "type", + "name", + "asset_class", + "sip_mapping", + "data_types" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "example": "OK", + "type": "string" + } + }, + "required": [ + "status", + "request_id", + "count", + "results" + ], + "type": "object" + } + } + }, + "description": "an unknown error occurred" + } + }, + "summary": "Conditions", + "tags": [ + "reference:conditions" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-paginate": { + "limit": { + "default": 10, + "max": 1000 + }, + "sort": { + "default": "asset_class", + "enum": [ + "asset_class", + "id", + "type", + "name", + "data_types", + "legacy" + ] + } + } + } + }, + "/v3/reference/dividends": { + "get": { + "description": "Get a list of historical cash dividends, including the ticker symbol,\ndeclaration date, ex-dividend date, record date, pay date, frequency,\nand amount.", + "operationId": "ListDividends", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.", + "in": "query", + "name": "ticker", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true, + "type": "string" + } + }, + { + "description": "Query by ex-dividend date with the format YYYY-MM-DD.", + "in": "query", + "name": "ex_dividend_date", + "schema": { + "format": "date", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true, + "type": "string" + } + }, + { + "description": "Query by record date with the format YYYY-MM-DD.", + "in": "query", + "name": "record_date", + "schema": { + "format": "date", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true, + "type": "string" + } + }, + { + "description": "Query by declaration date with the format YYYY-MM-DD.", + "in": "query", + "name": "declaration_date", + "schema": { + "format": "date", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true, + "type": "string" + } + }, + { + "description": "Query by pay date with the format YYYY-MM-DD.", + "in": "query", + "name": "pay_date", + "schema": { + "format": "date", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true, + "type": "string" + } + }, + { + "description": "Query by 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).", + "in": "query", + "name": "frequency", + "schema": { + "enum": [ + 0, + 1, + 2, + 4, + 12 + ], + "type": "integer" + } + }, + { + "description": "Query by the cash amount of the dividend.", + "in": "query", + "name": "cash_amount", + "schema": { + "type": "number" + }, + "x-polygon-filter-field": { + "range": true, + "type": "number" + } + }, + { + "description": "Query by 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.", + "in": "query", + "name": "dividend_type", + "schema": { + "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" + } + ] + } + } + }, + { + "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": "Range by ex_dividend_date.", + "in": "query", + "name": "ex_dividend_date.gte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by ex_dividend_date.", + "in": "query", + "name": "ex_dividend_date.gt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by ex_dividend_date.", + "in": "query", + "name": "ex_dividend_date.lte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by ex_dividend_date.", + "in": "query", + "name": "ex_dividend_date.lt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by record_date.", + "in": "query", + "name": "record_date.gte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by record_date.", + "in": "query", + "name": "record_date.gt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by record_date.", + "in": "query", + "name": "record_date.lte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by record_date.", + "in": "query", + "name": "record_date.lt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by declaration_date.", + "in": "query", + "name": "declaration_date.gte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by declaration_date.", + "in": "query", + "name": "declaration_date.gt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by declaration_date.", + "in": "query", + "name": "declaration_date.lte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by declaration_date.", + "in": "query", + "name": "declaration_date.lt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by pay_date.", + "in": "query", + "name": "pay_date.gte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by pay_date.", + "in": "query", + "name": "pay_date.gt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by pay_date.", + "in": "query", + "name": "pay_date.lte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by pay_date.", + "in": "query", + "name": "pay_date.lt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by cash_amount.", + "in": "query", + "name": "cash_amount.gte", + "schema": { + "type": "number" + } + }, + { + "description": "Range by cash_amount.", + "in": "query", + "name": "cash_amount.gt", + "schema": { + "type": "number" + } + }, + { + "description": "Range by cash_amount.", + "in": "query", + "name": "cash_amount.lte", + "schema": { + "type": "number" + } + }, + { + "description": "Range by cash_amount.", + "in": "query", + "name": "cash_amount.lt", + "schema": { + "type": "number" + } + }, + { + "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 1000.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "ex_dividend_date", + "enum": [ + "ex_dividend_date", + "pay_date", + "declaration_date", + "record_date", + "cash_amount", + "ticker" + ], + "example": "ex_dividend_date", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "description": "A list of dividends.", + "example": { + "next_url": "https://api.polygon.io/v3/reference/dividends/AAPL?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "results": [ + { + "cash_amount": 0.22, + "declaration_date": "2021-10-28", + "dividend_type": "CD", + "ex_dividend_date": "2021-11-05", + "frequency": 4, + "id": "E8e3c4f794613e9205e2f178a36c53fcc57cdabb55e1988c87b33f9e52e221444", + "pay_date": "2021-11-11", + "record_date": "2021-11-08", + "ticker": "AAPL" + }, + { + "cash_amount": 0.22, + "declaration_date": "2021-07-27", + "dividend_type": "CD", + "ex_dividend_date": "2021-08-06", + "frequency": 4, + "id": "E6436c5475706773f03490acf0b63fdb90b2c72bfeed329a6eb4afc080acd80ae", + "pay_date": "2021-08-12", + "record_date": "2021-08-09", + "ticker": "AAPL" + } + ], + "status": "OK" + }, + "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": { + "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" + } + ] + } + }, + "id": { + "description": "The unique identifier of the dividend.", + "type": "string" + }, + "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", + "id" + ], + "type": "object", + "x-polygon-go-struct-tags": { + "tags": [ + "db" + ] + } + }, + "type": "array" + }, + "status": { + "type": "string" + } + }, + "required": [ + "request_id" + ], + "type": "object" + } + }, + "text/csv": { + "schema": { + "example": "ticker,declaration_date,ex_dividend_date,record_date,pay_date,frequency,cash_amount,dividend_type\nAAPL,2021-10-28,2021-11-05,2021-11-08,2021-11-11,4,0.22,CD\nAAPL,2021-07-27,2021-08-06,2021-08-09,2021-08-12,4,0.22,CD\n", + "type": "string" + } + } + }, + "description": "OK" + } + }, + "summary": "Dividends v3", + "tags": [ + "reference:dividends" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-paginate": { + "limit": { + "default": 10, + "max": 1000 + }, + "sort": { + "default": "ex_dividend_date", + "enum": [ + "ex_dividend_date", + "pay_date", + "declaration_date", + "record_date", + "cash_amount", + "ticker" + ] + } + } + } + }, + "/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 Identifier 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": [ + "id", + "type", + "asset_class", + "locale", + "name" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "example": "OK", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + }, + "text/csv": { + "example": "id,type,asset_class,locale,name,acronym,mic,operating_mic,participant_id,url\n1,exchange,stocks,us,\"NYSE American, LLC\",AMEX,XASE,XNYS,65,https://www.nyse.com/markets/nyse-american\n2,exchange,stocks,us,\"Nasdaq OMX BX, Inc.\",,XBOS,XNAS,66,https://www.nasdaq.com/solutions/nasdaq-bx-stock-market\n3,exchange,stocks,us,\"NYSE National, Inc.\",NSX,XCIS,XNYS,67,https://www.nyse.com/markets/nyse-national\n", + "schema": { + "type": "string" + } + } + }, + "description": "OK" + }, + "400": { + "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" + }, + "status": { + "description": "The status of this request's response.", + "example": "OK", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + } + }, + "description": "a query parameter was malformed" + }, + "default": { + "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" + }, + "status": { + "description": "The status of this request's response.", + "example": "OK", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + } + }, + "description": "an unknown error occurred" + } + }, + "summary": "Exchanges", + "tags": [ + "reference:exchanges" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + } + } + }, + "/v3/reference/options/contracts": { + "get": { + "description": "Query for historical options contracts. This provides both active and expired options contracts.", + "operationId": "ListOptionsContracts", + "parameters": [ + { + "description": "This parameter has been deprecated. To search by specific options ticker, use the Options Contract endpoint [here](https://polygon.io/docs/options/get_v3_reference_options_contracts__options_ticker).", + "in": "query", + "name": "ticker", + "schema": { + "type": "string" + } + }, + { + "description": "Query for contracts relating to an underlying stock ticker.", + "in": "query", + "name": "underlying_ticker", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true, + "type": "string" + } + }, + { + "description": "Query by the type of contract.", + "in": "query", + "name": "contract_type", + "schema": { + "enum": [ + "call", + "put" + ], + "type": "string" + } + }, + { + "description": "Query by contract expiration with date format YYYY-MM-DD.", + "in": "query", + "name": "expiration_date", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Specify a point in time for contracts as of this date with format YYYY-MM-DD. Defaults to today's date.", + "in": "query", + "name": "as_of", + "schema": { + "type": "string" + } + }, + { + "description": "Query by strike price of a contract.", + "in": "query", + "name": "strike_price", + "schema": { + "type": "number" + }, + "x-polygon-filter-field": { + "range": true, + "type": "number" + } + }, + { + "description": "Query for expired contracts. Default is false.", + "in": "query", + "name": "expired", + "schema": { + "type": "boolean" + } + }, + { + "description": "Range by underlying_ticker.", + "in": "query", + "name": "underlying_ticker.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by underlying_ticker.", + "in": "query", + "name": "underlying_ticker.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by underlying_ticker.", + "in": "query", + "name": "underlying_ticker.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by underlying_ticker.", + "in": "query", + "name": "underlying_ticker.lt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by expiration_date.", + "in": "query", + "name": "expiration_date.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by expiration_date.", + "in": "query", + "name": "expiration_date.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by expiration_date.", + "in": "query", + "name": "expiration_date.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by expiration_date.", + "in": "query", + "name": "expiration_date.lt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by strike_price.", + "in": "query", + "name": "strike_price.gte", + "schema": { + "type": "number" + } + }, + { + "description": "Range by strike_price.", + "in": "query", + "name": "strike_price.gt", + "schema": { + "type": "number" + } + }, + { + "description": "Range by strike_price.", + "in": "query", + "name": "strike_price.lte", + "schema": { + "type": "number" + } + }, + { + "description": "Range by strike_price.", + "in": "query", + "name": "strike_price.lt", + "schema": { + "type": "number" + } + }, + { + "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 1000.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "ticker", + "enum": [ + "ticker", + "underlying_ticker", + "expiration_date", + "strike_price" + ], + "example": "ticker", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "603902c0-a5a5-406f-bd08-f030f92418fa", + "results": [ + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2021-11-19", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 85, + "ticker": "O:AAPL211119C00085000", + "underlying_ticker": "AAPL" + }, + { + "additional_underlyings": [ + { + "amount": 44, + "type": "equity", + "underlying": "VMW" + }, + { + "amount": 6.53, + "type": "currency", + "underlying": "USD" + } + ], + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2021-11-19", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 90, + "ticker": "O:AAPL211119C00090000", + "underlying_ticker": "AAPL" + } + ], + "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": { + "additional_underlyings": { + "description": "If an option contract has additional underlyings or deliverables associated with it, they will appear here.\nSee here for some examples of what might cause a contract to have additional underlyings.", + "items": { + "properties": { + "amount": { + "description": "The number of shares per contract of the additional underlying, or the cash-in-lieu amount of the currency.", + "type": "number" + }, + "type": { + "description": "The type of the additional underlying asset, either equity or currency.", + "type": "string" + }, + "underlying": { + "description": "The name of the additional underlying asset.", + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "AdditionalUnderlying" + } + }, + "type": "array", + "x-polygon-go-type": { + "name": "AdditionalUnderlyings" + } + }, + "cfi": { + "description": "The 6 letter CFI code of the contract (defined in ISO 10962)", + "type": "string" + }, + "contract_type": { + "description": "The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\".", + "type": "string" + }, + "correction": { + "description": "The correction number for this option contract.", + "type": "integer" + }, + "exercise_style": { + "description": "The exercise style of this contract. See this link 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.", + "type": "string", + "x-polygon-go-type": { + "name": "IDaysPolygonDateString", + "path": "github.com/polygon-io/ptime" + } + }, + "primary_exchange": { + "description": "The MIC code of the primary exchange that this contract is listed on.", + "type": "string" + }, + "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.", + "type": "number" + }, + "ticker": { + "description": "The ticker for the option contract.", + "type": "string" + }, + "underlying_ticker": { + "description": "The underlying ticker that the option contract relates to.", + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "OptionsContract" + } + }, + "type": "array" + }, + "status": { + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "schema": { + "example": "cfi,contract_type,exercise_style,expiration_date,primary_exchange,shares_per_contract,strike_price,ticker,underlying_ticker,additional_underlyings_json\nOCASPS,call,american,2021-11-19,BATO,100,85,O:AAPL211119C00085000,AAPL,\nOCASPS,call,american,2021-11-19,BATO,100,90,O:AAPL211119C00090000,AAPL,\"[{'type': 'equity', 'underlying': 'VMW', 'amount': 44}, {'type': 'currency', 'underlying': 'USD', 'amount': 6.53}]\"\n", + "type": "string" + } + } + }, + "description": "A list of options contracts" + } + }, + "summary": "Options Contracts", + "tags": [ + "reference:options:contracts:list" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-paginate": { + "limit": { + "default": 10, + "max": 1000 + }, + "sort": { + "default": "ticker", + "enum": [ + "ticker", + "underlying_ticker", + "expiration_date", + "strike_price" + ] + } + } + } + }, + "/v3/reference/options/contracts/{options_ticker}": { + "get": { + "description": "Get an options contract", + "operationId": "GetOptionsContract", + "parameters": [ + { + "description": "Query for a contract by options ticker. You can learn more about the structure of options tickers [here](https://polygon.io/blog/how-to-read-a-stock-options-ticker/).", + "example": "O:SPY251219C00650000", + "in": "path", + "name": "options_ticker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Specify a point in time for the contract as of this date with format YYYY-MM-DD. Defaults to today's date.", + "in": "query", + "name": "as_of", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "603902c0-a5a5-406f-bd08-f030f92418fa", + "results": { + "additional_underlyings": [ + { + "amount": 44, + "type": "equity", + "underlying": "VMW" + }, + { + "amount": 6.53, + "type": "currency", + "underlying": "USD" + } + ], + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2021-11-19", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 85, + "ticker": "O:AAPL211119C00085000", + "underlying_ticker": "AAPL" + }, + "status": "OK" + }, + "schema": { + "properties": { + "request_id": { + "type": "string" + }, + "results": { + "properties": { + "additional_underlyings": { + "description": "If an option contract has additional underlyings or deliverables associated with it, they will appear here.\nSee here for some examples of what might cause a contract to have additional underlyings.", + "items": { + "properties": { + "amount": { + "description": "The number of shares per contract of the additional underlying, or the cash-in-lieu amount of the currency.", + "type": "number" + }, + "type": { + "description": "The type of the additional underlying asset, either equity or currency.", + "type": "string" + }, + "underlying": { + "description": "The name of the additional underlying asset.", + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "AdditionalUnderlying" + } + }, + "type": "array", + "x-polygon-go-type": { + "name": "AdditionalUnderlyings" + } + }, + "cfi": { + "description": "The 6 letter CFI code of the contract (defined in ISO 10962)", + "type": "string" + }, + "contract_type": { + "description": "The type of contract. Can be \"put\", \"call\", or in some rare cases, \"other\".", + "type": "string" + }, + "correction": { + "description": "The correction number for this option contract.", + "type": "integer" + }, + "exercise_style": { + "description": "The exercise style of this contract. See this link 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.", + "type": "string", + "x-polygon-go-type": { + "name": "IDaysPolygonDateString", + "path": "github.com/polygon-io/ptime" + } + }, + "primary_exchange": { + "description": "The MIC code of the primary exchange that this contract is listed on.", + "type": "string" + }, + "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.", + "type": "number" + }, + "ticker": { + "description": "The ticker for the option contract.", + "type": "string" + }, + "underlying_ticker": { + "description": "The underlying ticker that the option contract relates to.", + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "OptionsContract" + } + }, + "status": { + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "schema": { + "example": "cfi,contract_type,exercise_style,expiration_date,primary_exchange,shares_per_contract,strike_price,ticker,underlying_ticker,additional_underlyings_json\nOCASPS,call,american,2021-11-19,BATO,100,90,O:AAPL211119C00090000,AAPL,\"[{'type': 'equity', 'underlying': 'VMW', 'amount': 44}, {'type': 'currency', 'underlying': 'USD', 'amount': 6.53}]\"\n", + "type": "string" + } + } + }, + "description": "A specific options contract" + } + }, + "summary": "Options Contract", + "tags": [ + "reference:options:contract" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + } + } + }, + "/v3/reference/splits": { + "get": { + "description": "Get a list of historical stock splits, including the ticker symbol, the execution date, and the factors of the split ratio.", + "operationId": "ListStockSplits", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.", + "in": "query", + "name": "ticker", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true, + "type": "string" + } + }, + { + "description": "Query by execution date with the format YYYY-MM-DD.", + "in": "query", + "name": "execution_date", + "schema": { + "format": "date", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true, + "type": "string" + } + }, + { + "description": "Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse split. By default this filter is not used.", + "in": "query", + "name": "reverse_split", + "schema": { + "nullable": true, + "type": "boolean" + } + }, + { + "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": "Range by execution_date.", + "in": "query", + "name": "execution_date.gte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by execution_date.", + "in": "query", + "name": "execution_date.gt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by execution_date.", + "in": "query", + "name": "execution_date.lte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by execution_date.", + "in": "query", + "name": "execution_date.lt", + "schema": { + "format": "date", + "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 1000.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "execution_date", + "enum": [ + "execution_date", + "ticker" + ], + "example": "execution_date", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v3/splits/AAPL?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "results": [ + { + "execution_date": "2020-08-31", + "id": "E36416cce743c3964c5da63e1ef1626c0aece30fb47302eea5a49c0055c04e8d0", + "split_from": 1, + "split_to": 4, + "ticker": "AAPL" + }, + { + "execution_date": "2005-02-28", + "id": "E90a77bdf742661741ed7c8fc086415f0457c2816c45899d73aaa88bdc8ff6025", + "split_from": 1, + "split_to": 2, + "ticker": "AAPL" + } + ], + "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": { + "execution_date": { + "description": "The execution date of the stock split. On this date the stock split was applied.", + "type": "string" + }, + "id": { + "description": "The unique identifier for this stock split.", + "type": "string" + }, + "split_from": { + "description": "The second number in the split ratio.\n\nFor example: In a 2-for-1 split, split_from would be 1.", + "format": "float", + "type": "number" + }, + "split_to": { + "description": "The first number in the split ratio.\n\nFor example: In a 2-for-1 split, split_to would be 2.", + "format": "float", + "type": "number" + }, + "ticker": { + "description": "The ticker symbol of the stock split.", + "type": "string" + } + }, + "required": [ + "split_from", + "split_to", + "id", + "ticker", + "execution_date" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "ticker,execution_date,split_from,split_to\nAAPL,2020-08-31,1.0,4.0\nAAPL,2005-02-28,1.0,2.0\n", + "schema": { + "type": "string" + } + } + }, + "description": "A list of stock splits." + } + }, + "summary": "Stock Splits v3", + "tags": [ + "reference:stocks" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-paginate": { + "limit": { + "default": 10, + "max": 1000 + }, + "sort": { + "default": "execution_date", + "enum": [ + "execution_date", + "ticker" + ] + } + } + } + }, + "/v3/reference/tickers": { + "get": { + "description": "Query all ticker symbols which are supported by Polygon.io. This API currently includes Stocks/Equities, Indices, Forex, and Crypto.", + "operationId": "ListTickers", + "parameters": [ + { + "description": "Specify a ticker symbol.\nDefaults to empty string which queries all tickers.", + "in": "query", + "name": "ticker", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Specify the type of the tickers. Find the types that we support via our [Ticker Types API](https://polygon.io/docs/stocks/get_v3_reference_tickers_types).\nDefaults to empty string which queries all types.", + "in": "query", + "name": "type", + "schema": { + "enum": [ + "CS", + "ADRC", + "ADRP", + "ADRR", + "UNIT", + "RIGHT", + "PFD", + "FUND", + "SP", + "WARRANT", + "INDEX", + "ETF", + "ETN", + "OS", + "GDR", + "OTHER", + "NYRS", + "AGEN", + "EQLK", + "BOND", + "ADRW", + "BASKET", + "LT" + ], + "type": "string" + } + }, + { + "description": "Filter by market type. By default all markets are included.", + "in": "query", + "name": "market", + "schema": { + "enum": [ + "stocks", + "crypto", + "fx", + "otc", + "indices" + ], + "type": "string" + } + }, + { + "description": "Specify the primary exchange of the asset in the ISO code format. Find more information about the ISO codes [at the ISO org website](https://www.iso20022.org/market-identifier-codes).\nDefaults to empty string which queries all exchanges.", + "in": "query", + "name": "exchange", + "schema": { + "type": "string" + } + }, + { + "description": "Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes [at their website](https://www.cusip.com/identifiers.html#/CUSIP).\nDefaults to empty string which queries all CUSIPs.\n\nNote: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response.", + "in": "query", + "name": "cusip", + "schema": { + "type": "string" + } + }, + { + "description": "Specify the CIK of the asset you want to search for. Find more information about CIK codes [at their website](https://www.sec.gov/edgar/searchedgar/cik.htm).\nDefaults to empty string which queries all CIKs.", + "in": "query", + "name": "cik", + "schema": { + "type": "string" + } + }, + { + "description": "Specify a point in time to retrieve tickers available on that date.\nDefaults to the most recent available date.", + "in": "query", + "name": "date", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Search for terms within the ticker and/or company name.", + "in": "query", + "name": "search", + "schema": { + "type": "string" + } + }, + { + "description": "Specify if the tickers returned should be actively traded on the queried date. Default is true.", + "example": true, + "in": "query", + "name": "active", + "schema": { + "type": "boolean" + } + }, + { + "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 100 and max is 1000.", + "in": "query", + "name": "limit", + "schema": { + "default": 100, + "example": 100, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "ticker", + "enum": [ + "ticker", + "name", + "market", + "locale", + "primary_exchange", + "type", + "currency_symbol", + "currency_name", + "base_currency_symbol", + "base_currency_name", + "cik", + "composite_figi", + "share_class_figi", + "last_updated_utc", + "delisted_utc" + ], + "example": "ticker", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "count": 1, + "next_url": "https://api.polygon.io/v3/reference/tickers?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "e70013d92930de90e089dc8fa098888e", + "results": [ + { + "active": true, + "cik": "0001090872", + "composite_figi": "BBG000BWQYZ5", + "currency_name": "usd", + "last_updated_utc": "2021-04-25T00:00:00Z", + "locale": "us", + "market": "stocks", + "name": "Agilent Technologies Inc.", + "primary_exchange": "XNYS", + "share_class_figi": "BBG001SCTQY4", + "ticker": "A", + "type": "CS" + } + ], + "status": "OK" + }, + "schema": { + "properties": { + "count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "description": "An array of tickers that match your query.\n\nNote: Although you can query by CUSIP, due to legal reasons we do not return the CUSIP in the response.", + "items": { + "properties": { + "active": { + "description": "Whether or not the asset is actively traded. False means the asset has been delisted.", + "type": "boolean" + }, + "cik": { + "description": "The CIK number for this ticker. Find more information [here](https://en.wikipedia.org/wiki/Central_Index_Key).", + "type": "string" + }, + "composite_figi": { + "description": "The composite OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi)", + "type": "string" + }, + "currency_name": { + "description": "The name of the currency that this asset is traded with.", + "type": "string" + }, + "delisted_utc": { + "description": "The last date that the asset was traded.", + "format": "date-time", + "type": "string" + }, + "last_updated_utc": { + "description": "The information is accurate up to this time.", + "format": "date-time", + "type": "string" + }, + "locale": { + "description": "The locale of the asset.", + "enum": [ + "us", + "global" + ], + "type": "string" + }, + "market": { + "description": "The market type of the asset.", + "enum": [ + "stocks", + "crypto", + "fx", + "otc", + "indices" + ], + "type": "string" + }, + "name": { + "description": "The name of the asset. For stocks/equities this will be the companies registered name. For crypto/fx this will be the name of the currency or coin pair.", + "type": "string" + }, + "primary_exchange": { + "description": "The ISO code of the primary listing exchange for this asset.", + "type": "string" + }, + "share_class_figi": { + "description": "The share Class OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi)", + "type": "string" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "type": { + "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" + } + }, + "required": [ + "ticker", + "name", + "market", + "locale" + ], + "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" + } + }, + "type": "object" + } + }, + "text/csv": { + "example": "ticker,name,market,locale,primary_exchange,type,active,currency_name,cik,composite_figi,share_class_figi,last_updated_utc\nA,Agilent Technologies Inc.,stocks,us,XNYS,CS,true,usd,0001090872,BBG000BWQYZ5,BBG001SCTQY4,2021-04-25T00:00:00Z\n", + "schema": { + "type": "string" + } + } + }, + "description": "Reference Tickers." + }, + "401": { + "description": "Unauthorized - Check our API Key and account status" + } + }, + "summary": "Tickers", + "tags": [ + "reference:tickers:list" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-paginate": { + "limit": { + "default": 100, + "max": 1000 + }, + "sort": { + "default": "ticker", + "enum": [ + "ticker", + "name", + "market", + "locale", + "primary_exchange", + "type", + "currency_symbol", + "currency_name", + "base_currency_symbol", + "base_currency_name", + "cik", + "composite_figi", + "share_class_figi", + "last_updated_utc", + "delisted_utc" + ] + } + } + } + }, + "/v3/reference/tickers/types": { + "get": { + "description": "List all ticker types that Polygon.io has.", + "operationId": "ListTickerTypes", + "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", + "indices" + ], + "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": "Describes the type of financial instrument represented by a ticker.", + "properties": { + "asset_class": { + "description": "An identifier for a group of similar financial instruments.", + "enum": [ + "stocks", + "options", + "crypto", + "fx", + "indices" + ], + "example": "stocks", + "type": "string" + }, + "code": { + "description": "A code used by Polygon.io to refer to this ticker type.", + "example": "CS", + "type": "string" + }, + "description": { + "description": "A short description of this ticker type.", + "example": "Common Stock", + "type": "string" + }, + "locale": { + "description": "An identifier for a geographical location.", + "enum": [ + "us", + "global" + ], + "example": "us", + "type": "string" + } + }, + "required": [ + "code", + "description", + "asset_class", + "locale" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "example": "OK", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + }, + "text/csv": { + "example": "code,description,asset_class,locale\nCS,Common Stock,stocks,us\nPFD,Preferred Stock,stocks,us\n", + "schema": { + "type": "string" + } + } + }, + "description": "OK" + }, + "400": { + "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" + }, + "status": { + "description": "The status of this request's response.", + "example": "OK", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + } + }, + "description": "a query parameter was malformed" + }, + "default": { + "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" + }, + "status": { + "description": "The status of this request's response.", + "example": "OK", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + } + }, + "description": "an unknown error occurred" + } + }, + "summary": "Ticker Types", + "tags": [ + "reference:tickers:types" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + } + } + }, + "/v3/reference/tickers/{ticker}": { + "get": { + "description": "Get a single ticker supported by Polygon.io. This response will have detailed information about the ticker and the company behind it.", + "operationId": "GetTicker", + "parameters": [ + { + "description": "The ticker symbol of the asset.", + "example": "AAPL", + "in": "path", + "name": "ticker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Specify a point in time to get information about the ticker available on that date.\nWhen retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing.\n\nFor example, consider an SEC filing submitted by AAPL on 2019-07-31, with a period of report date ending on 2019-06-29.\nThat means that the filing was submitted on 2019-07-31, but the filing was created based on information from 2019-06-29.\nIf you were to query for AAPL details on 2019-06-29, the ticker details would include information from the SEC filing.\n\nDefaults to the most recent available date.", + "in": "query", + "name": "date", + "schema": { + "format": "date", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "31d59dda-80e5-4721-8496-d0d32a654afe", + "results": { + "active": true, + "address": { + "address1": "One Apple Park Way", + "city": "Cupertino", + "postal_code": "95014", + "state": "CA" + }, + "branding": { + "icon_url": "https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-01-10_icon.png", + "logo_url": "https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-01-10_logo.svg" + }, + "cik": "0000320193", + "composite_figi": "BBG000B9XRY4", + "currency_name": "usd", + "description": "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.", + "homepage_url": "https://www.apple.com", + "list_date": "1980-12-12", + "locale": "us", + "market": "stocks", + "market_cap": 2771126040150, + "name": "Apple Inc.", + "phone_number": "(408) 996-1010", + "primary_exchange": "XNAS", + "round_lot": 100, + "share_class_figi": "BBG001S5N8V8", + "share_class_shares_outstanding": 16406400000, + "sic_code": "3571", + "sic_description": "ELECTRONIC COMPUTERS", + "ticker": "AAPL", + "ticker_root": "AAPL", + "total_employees": 154000, + "type": "CS", + "weighted_shares_outstanding": 16334371000 + }, + "status": "OK" + }, + "schema": { + "properties": { + "count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "description": "Ticker with details.", + "properties": { + "active": { + "description": "Whether or not the asset is actively traded. False means the asset has been delisted.", + "type": "boolean" + }, + "address": { + "properties": { + "address1": { + "description": "The first line of the company's headquarters address.", + "type": "string" + }, + "address2": { + "description": "The second line of the company's headquarters address, if applicable.", + "type": "string" + }, + "city": { + "description": "The city of the company's headquarters address.", + "type": "string" + }, + "postal_code": { + "description": "The postal code of the company's headquarters address.", + "type": "string" + }, + "state": { + "description": "The state of the company's headquarters address.", + "type": "string" + } + }, + "type": "object" + }, + "branding": { + "properties": { + "icon_url": { + "description": "A link to this ticker's company's icon. Icon's are generally smaller, square images that represent the company at a glance.\nNote that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more details.", + "type": "string" + }, + "logo_url": { + "description": "A link to this ticker's company's logo.\nNote that you must provide an API key when accessing this URL. See the \"Authentication\" section at the top of this page for more details.", + "type": "string" + } + }, + "type": "object" + }, + "cik": { + "description": "The CIK number for this ticker. Find more information [here](https://en.wikipedia.org/wiki/Central_Index_Key).", + "type": "string" + }, + "composite_figi": { + "description": "The composite OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi)", + "type": "string" + }, + "currency_name": { + "description": "The name of the currency that this asset is traded with.", + "type": "string" + }, + "delisted_utc": { + "description": "The last date that the asset was traded.", + "format": "date-time", + "type": "string" + }, + "description": { + "description": "A description of the company and what they do/offer.", + "type": "string" + }, + "homepage_url": { + "description": "The URL of the company's website homepage.", + "type": "string" + }, + "list_date": { + "description": "The date that the symbol was first publicly listed in the format YYYY-MM-DD.", + "type": "string" + }, + "locale": { + "description": "The locale of the asset.", + "enum": [ + "us", + "global" + ], + "type": "string" + }, + "market": { + "description": "The market type of the asset.", + "enum": [ + "stocks", + "crypto", + "fx", + "otc", + "indices" + ], + "type": "string" + }, + "market_cap": { + "description": "The most recent close price of the ticker multiplied by weighted outstanding shares.", + "format": "double", + "type": "number" + }, + "name": { + "description": "The name of the asset. For stocks/equities this will be the companies registered name. For crypto/fx this will be the name of the currency or coin pair.", + "type": "string" + }, + "phone_number": { + "description": "The phone number for the company behind this ticker.", + "type": "string" + }, + "primary_exchange": { + "description": "The ISO code of the primary listing exchange for this asset.", + "type": "string" + }, + "round_lot": { + "description": "Round lot size of this security.", + "format": "double", + "type": "number" + }, + "share_class_figi": { + "description": "The share Class OpenFIGI number for this ticker. Find more information [here](https://www.openfigi.com/about/figi)", + "type": "string" + }, + "share_class_shares_outstanding": { + "description": "The recorded number of outstanding shares for this particular share class.", + "format": "double", + "type": "number" + }, + "sic_code": { + "description": "The standard industrial classification code for this ticker. For a list of SIC Codes, see the SEC's SIC Code List.", + "type": "string" + }, + "sic_description": { + "description": "A description of this ticker's SIC code.", + "type": "string" + }, + "ticker": { + "description": "The exchange symbol that this item is traded under.", + "type": "string" + }, + "ticker_root": { + "description": "The root of a specified ticker. For example, the root of BRK.A is BRK.", + "type": "string" + }, + "ticker_suffix": { + "description": "The suffix of a specified ticker. For example, the suffix of BRK.A is A.", + "type": "string" + }, + "total_employees": { + "description": "The approximate number of employees for the company.", + "type": "number" + }, + "type": { + "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" + } + }, + "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,address2,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" + }, + "fmv": 0.05, + "greeks": { + "delta": 0.5520187372272933, + "gamma": 0.00706756515659829, + "theta": -0.018532772783847958, + "vega": 0.7274811132998142 + }, + "implied_volatility": 0.3048997097864957, + "last_quote": { + "ask": 21.25, + "ask_exchange": 12, + "ask_size": 110, + "bid": 20.9, + "bid_exchange": 10, + "bid_size": 172, + "last_updated": 1636573458756383500, + "midpoint": 21.075, + "timeframe": "REAL-TIME" + }, + "last_trade": { + "conditions": [ + 209 + ], + "exchange": 316, + "price": 0.05, + "sip_timestamp": 1675280958783136800, + "size": 2, + "timeframe": "REAL-TIME" + }, + "market_status": "closed", + "name": "NCLH $5 Call", + "open_interest": 8921, + "session": { + "change": -0.05, + "change_percent": -1.07, + "close": 6.65, + "early_trading_change": -0.01, + "early_trading_change_percent": -0.03, + "high": 7.01, + "late_trading_change": -0.4, + "late_trading_change_percent": -0.02, + "low": 5.42, + "open": 6.7, + "previous_close": 6.71, + "volume": 67 + }, + "ticker": "O:NCLH221014C00005000", + "type": "options", + "underlying_asset": { + "change_to_break_even": 23.123999999999995, + "last_updated": 1636573459862384600, + "price": 147.951, + "ticker": "AAPL", + "timeframe": "REAL-TIME" + } + }, + { + "fmv": 0.05, + "last_quote": { + "ask": 21.25, + "ask_exchange": 300, + "ask_size": 110, + "bid": 20.9, + "bid_exchange": 323, + "bid_size": 172, + "last_updated": 1636573458756383500, + "timeframe": "REAL-TIME" + }, + "last_trade": { + "conditions": [ + 209 + ], + "exchange": 316, + "id": "4064", + "last_updated": 1675280958783136800, + "price": 0.05, + "size": 2, + "timeframe": "REAL-TIME" + }, + "market_status": "closed", + "name": "Apple Inc.", + "session": { + "change": -1.05, + "change_percent": -4.67, + "close": 21.4, + "early_trading_change": -0.39, + "early_trading_change_percent": -0.07, + "high": 22.49, + "late_trading_change": 1.2, + "late_trading_change_percent": 3.92, + "low": 21.35, + "open": 22.49, + "previous_close": 22.45, + "volume": 37 + }, + "ticker": "AAPL", + "type": "stocks" + }, + { + "error": "NOT_FOUND", + "message": "Ticker not found.", + "ticker": "TSLAAPL" + } + ], + "status": "OK" + }, + "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 this link 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" + }, + "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, contact us.", + "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 article 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 Exchanges 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 Exchanges 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": [ + "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 trades.", + "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 Exchanges 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": [ + "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" + }, + "regular_trading_change": { + "description": "Today's change in regular trading hours, difference between current price and previous trading day's close, otherwise difference between today's close and previous day's close.", + "format": "double", + "type": "number" + }, + "regular_trading_change_percent": { + "description": "Today's regular trading change as a percentage.", + "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", + "indices" + ], + "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": [ + "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" + } + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + } + }, + "description": "Snapshots for the ticker list" + } + }, + "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": "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" + ] + } + } + } + }, + "/v3/snapshot/indices": { + "get": { + "description": "Get a Snapshot of indices data for said tickers", + "operationId": "IndicesSnapshot", + "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: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": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "6a7e466379af0a71039d60cc78e72282", + "results": [ + { + "last_updated": 1679597116344223500, + "market_status": "closed", + "name": "Dow Jones Industrial Average", + "session": { + "change": -50.01, + "change_percent": -1.45, + "close": 3822.39, + "high": 3834.41, + "low": 38217.11, + "open": 3827.38, + "previous_close": 3812.19 + }, + "ticker": "I:DJI", + "timeframe": "REAL-TIME", + "type": "indices", + "value": 3822.39 + }, + { + "error": "NOT_FOUND", + "message": "Ticker not found.", + "ticker": "APx" + }, + { + "error": "NOT_ENTITLED", + "message": "Not entitled to this ticker.", + "ticker": "APy" + } + ], + "status": "OK" + }, + "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": { + "error": { + "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" + }, + "message": { + "description": "The error message while looking for this ticker.", + "type": "string" + }, + "name": { + "description": "Name of Index.", + "type": "string" + }, + "session": { + "properties": { + "change": { + "description": "The value of the change for the index from the previous trading day.", + "format": "double", + "type": "number" + }, + "change_percent": { + "description": "The percent of the change for the index from the previous trading day.", + "format": "double", + "type": "number" + }, + "close": { + "description": "The closing value for the index of the day.", + "format": "double", + "type": "number" + }, + "high": { + "description": "The highest value for the index of the day.", + "format": "double", + "type": "number" + }, + "low": { + "description": "The lowest value for the index of the day.", + "format": "double", + "type": "number" + }, + "open": { + "description": "The open value for the index of the day.", + "format": "double", + "type": "number" + }, + "previous_close": { + "description": "The closing value for the index of previous trading day.", + "format": "double", + "type": "number" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "IndicesSession" + } + }, + "ticker": { + "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": [ + "indices" + ], + "type": "string" + }, + "value": { + "description": "Value of Index.", + "type": "number" + } + }, + "required": [ + "ticker" + ], + "type": "object", + "x-polygon-go-type": { + "name": "IndicesResult" + } + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + } + }, + "description": "Snapshots for indices data of the underlying ticker" + } + }, + "summary": "Indices Snapshot", + "tags": [ + "indices: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Indices data", + "name": "indices" + }, + "x-polygon-paginate": { + "limit": { + "default": 10, + "max": 250 + }, + "sort": { + "default": "ticker", + "enum": [ + "ticker" + ] + } + } + } + }, + "/v3/snapshot/options/{underlyingAsset}": { + "get": { + "description": "Get the snapshot of all options contracts for an underlying ticker.", + "operationId": "OptionsChain", + "parameters": [ + { + "description": "The underlying ticker symbol of the option contract.", + "example": "EVRI", + "in": "path", + "name": "underlyingAsset", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Query by strike price of a contract.", + "in": "query", + "name": "strike_price", + "schema": { + "type": "number" + }, + "x-polygon-filter-field": { + "range": true, + "type": "number" + } + }, + { + "description": "Query by contract expiration with date format YYYY-MM-DD.", + "in": "query", + "name": "expiration_date", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Query by the type of contract.", + "in": "query", + "name": "contract_type", + "schema": { + "enum": [ + "call", + "put" + ], + "type": "string" + } + }, + { + "description": "Range by strike_price.", + "in": "query", + "name": "strike_price.gte", + "schema": { + "type": "number" + } + }, + { + "description": "Range by strike_price.", + "in": "query", + "name": "strike_price.gt", + "schema": { + "type": "number" + } + }, + { + "description": "Range by strike_price.", + "in": "query", + "name": "strike_price.lte", + "schema": { + "type": "number" + } + }, + { + "description": "Range by strike_price.", + "in": "query", + "name": "strike_price.lt", + "schema": { + "type": "number" + } + }, + { + "description": "Range by expiration_date.", + "in": "query", + "name": "expiration_date.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by expiration_date.", + "in": "query", + "name": "expiration_date.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by expiration_date.", + "in": "query", + "name": "expiration_date.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by expiration_date.", + "in": "query", + "name": "expiration_date.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", + "expiration_date", + "strike_price" + ], + "example": "ticker", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "6a7e466379af0a71039d60cc78e72282", + "results": [ + { + "break_even_price": 151.2, + "day": { + "change": 4.5, + "change_percent": 6.76, + "close": 120.73, + "high": 120.81, + "last_updated": 1605195918507251700, + "low": 118.9, + "open": 119.32, + "previous_close": 119.12, + "volume": 868, + "vwap": 119.31 + }, + "details": { + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-01-21", + "shares_per_contract": 100, + "strike_price": 150, + "ticker": "O:AAPL211022C000150000" + }, + "fmv": 0.05, + "greeks": { + "delta": 1, + "gamma": 0, + "theta": 0.00229, + "vega": 0 + }, + "implied_volatility": 5, + "last_quote": { + "ask": 120.3, + "ask_size": 4, + "bid": 120.28, + "bid_size": 8, + "last_updated": 1605195918507251700, + "midpoint": 120.29, + "timeframe": "REAL-TIME" + }, + "last_trade": { + "conditions": [ + 209 + ], + "exchange": 316, + "price": 0.05, + "sip_timestamp": 1675280958783136800, + "size": 2, + "timeframe": "REAL-TIME" + }, + "open_interest": 1543, + "underlying_asset": { + "change_to_break_even": 4.2, + "last_updated": 1605195918507251700, + "price": 147, + "ticker": "AAPL", + "timeframe": "DELAYED" + } + } + ], + "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" + }, + "day": { + "description": "The most recent daily bar for this contract.", + "properties": { + "change": { + "description": "The value of the price change for the contract from the previous trading day.", + "format": "double", + "type": "number" + }, + "change_percent": { + "description": "The percent of the price change for the contract from the previous trading day.", + "format": "double", + "type": "number" + }, + "close": { + "description": "The closing price for the contract of the day.", + "format": "double", + "type": "number" + }, + "high": { + "description": "The highest price for the contract of the day.", + "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" + } + }, + "low": { + "description": "The lowest price for the contract of the day.", + "format": "double", + "type": "number" + }, + "open": { + "description": "The open price for the contract of the day.", + "format": "double", + "type": "number" + }, + "previous_close": { + "description": "The closing price for the contract of previous trading day.", + "format": "double", + "type": "number" + }, + "volume": { + "description": "The trading volume for the contract of the day.", + "format": "double", + "type": "number" + }, + "vwap": { + "description": "The trading volume weighted average price for the contract of the day.", + "format": "double", + "type": "number", + "x-polygon-go-id": "VWAP" + } + }, + "required": [ + "open", + "high", + "low", + "close", + "previous_close", + "volume", + "vwap", + "change_percent", + "change" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Day" + } + }, + "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 this link 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" + }, + "ticker": { + "description": "The ticker symbol for the asset.", + "type": "string" + } + }, + "required": [ + "ticker", + "contract_type", + "exercise_style", + "expiration_date", + "shares_per_contract", + "strike_price" + ], + "type": "object", + "x-polygon-go-type": { + "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, contact us.", + "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 article 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 Exchanges for Polygon.io's mapping of exchange IDs.", + "format": "int32", + "type": "number" + }, + "ask_size": { + "description": "The ask size.", + "format": "double", + "type": "number" + }, + "bid": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "bid_exchange": { + "description": "The bid side exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "format": "int32", + "type": "number" + }, + "bid_size": { + "description": "The bid size.", + "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": [ + "ask", + "ask_size", + "bid_size", + "bid", + "midpoint" + ], + "type": "object", + "x-polygon-go-type": { + "name": "LastQuote" + } + }, + "last_trade": { + "description": "The most recent trade for this contract. This is only returned if your current plan includes trades.", + "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/options/get_v3_reference_conditions)\nfor a mapping to exchange conditions.", + "format": "int32", + "type": "integer" + }, + "type": "array" + }, + "exchange": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "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": [ + "exchange", + "price", + "sip_timestamp", + "size" + ], + "type": "object", + "x-polygon-go-type": { + "name": "OptionsLastTrade" + } + }, + "open_interest": { + "description": "The quantity of this contract held at the end of the last trading day.", + "format": "double", + "type": "number" + }, + "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": [ + "ticker", + "change_to_break_even" + ], + "type": "object", + "x-polygon-go-type": { + "name": "UnderlyingAsset" + } + } + }, + "required": [ + "day", + "last_quote", + "underlying_asset", + "details", + "break_even_price", + "open_interest" + ], + "type": "object", + "x-polygon-go-type": { + "name": "OptionSnapshotResult" + } + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + } + }, + "description": "Snapshots for options contracts of the underlying ticker" + } + }, + "summary": "Options Chain", + "tags": [ + "options: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + }, + "x-polygon-paginate": { + "limit": { + "default": 10, + "max": 250 + }, + "sort": { + "default": "ticker", + "enum": [ + "ticker", + "expiration_date", + "strike_price" + ] + } + } + } + }, + "/v3/snapshot/options/{underlyingAsset}/{optionContract}": { + "get": { + "description": "Get the snapshot of an option contract for a stock equity.", + "operationId": "OptionContract", + "parameters": [ + { + "description": "The underlying ticker symbol of the option contract.", + "example": "EVRI", + "in": "path", + "name": "underlyingAsset", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "The option contract identifier.", + "example": "O:EVRI240920P00012500", + "in": "path", + "name": "optionContract", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "d9ff18dac69f55c218f69e4753706acd", + "results": { + "break_even_price": 171.075, + "day": { + "change": -1.05, + "change_percent": -4.67, + "close": 21.4, + "high": 22.49, + "last_updated": 1636520400000000000, + "low": 21.35, + "open": 22.49, + "previous_close": 22.45, + "volume": 37, + "vwap": 21.6741 + }, + "details": { + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2023-06-16", + "shares_per_contract": 100, + "strike_price": 150, + "ticker": "O:AAPL230616C00150000" + }, + "fmv": 0.05, + "greeks": { + "delta": 0.5520187372272933, + "gamma": 0.00706756515659829, + "theta": -0.018532772783847958, + "vega": 0.7274811132998142 + }, + "implied_volatility": 0.3048997097864957, + "last_quote": { + "ask": 21.25, + "ask_exchange": 301, + "ask_size": 110, + "bid": 20.9, + "bid_exchange": 301, + "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" + }, + "open_interest": 8921, + "underlying_asset": { + "change_to_break_even": 23.123999999999995, + "last_updated": 1636573459862384600, + "price": 147.951, + "ticker": "AAPL", + "timeframe": "REAL-TIME" + } + }, + "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": { + "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" + }, + "day": { + "description": "The most recent daily bar for this contract.", + "properties": { + "change": { + "description": "The value of the price change for the contract from the previous trading day.", + "format": "double", + "type": "number" + }, + "change_percent": { + "description": "The percent of the price change for the contract from the previous trading day.", + "format": "double", + "type": "number" + }, + "close": { + "description": "The closing price for the contract of the day.", + "format": "double", + "type": "number" + }, + "high": { + "description": "The highest price for the contract of the day.", + "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" + } + }, + "low": { + "description": "The lowest price for the contract of the day.", + "format": "double", + "type": "number" + }, + "open": { + "description": "The open price for the contract of the day.", + "format": "double", + "type": "number" + }, + "previous_close": { + "description": "The closing price for the contract of previous trading day.", + "format": "double", + "type": "number" + }, + "volume": { + "description": "The trading volume for the contract of the day.", + "format": "double", + "type": "number" + }, + "vwap": { + "description": "The trading volume weighted average price for the contract of the day.", + "format": "double", + "type": "number", + "x-polygon-go-id": "VWAP" + } + }, + "required": [ + "open", + "high", + "low", + "close", + "previous_close", + "volume", + "vwap", + "change_percent", + "change" + ], + "type": "object", + "x-polygon-go-type": { + "name": "Day" + } + }, + "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 this link 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" + }, + "ticker": { + "description": "The ticker symbol for the asset.", + "type": "string" + } + }, + "required": [ + "ticker", + "contract_type", + "exercise_style", + "expiration_date", + "shares_per_contract", + "strike_price" + ], + "type": "object", + "x-polygon-go-type": { + "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, contact us.", + "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 article 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 Exchanges for Polygon.io's mapping of exchange IDs.", + "format": "int32", + "type": "number" + }, + "ask_size": { + "description": "The ask size.", + "format": "double", + "type": "number" + }, + "bid": { + "description": "The bid price.", + "format": "double", + "type": "number" + }, + "bid_exchange": { + "description": "The bid side exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "format": "int32", + "type": "number" + }, + "bid_size": { + "description": "The bid size.", + "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": [ + "ask", + "ask_size", + "bid_size", + "bid", + "midpoint" + ], + "type": "object", + "x-polygon-go-type": { + "name": "LastQuote" + } + }, + "last_trade": { + "description": "The most recent trade for this contract. This is only returned if your current plan includes trades.", + "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/options/get_v3_reference_conditions)\nfor a mapping to exchange conditions.", + "format": "int32", + "type": "integer" + }, + "type": "array" + }, + "exchange": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "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": [ + "exchange", + "price", + "sip_timestamp", + "size" + ], + "type": "object", + "x-polygon-go-type": { + "name": "OptionsLastTrade" + } + }, + "open_interest": { + "description": "The quantity of this contract held at the end of the last trading day.", + "format": "double", + "type": "number" + }, + "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": [ + "ticker", + "change_to_break_even" + ], + "type": "object", + "x-polygon-go-type": { + "name": "UnderlyingAsset" + } + } + }, + "required": [ + "day", + "last_quote", + "underlying_asset", + "details", + "break_even_price", + "open_interest" + ], + "type": "object", + "x-polygon-go-type": { + "name": "OptionSnapshotResult" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + }, + "text/csv": { + "schema": { + "example": "break_even_price,day_close,day_high,day_last_updated,day_low,day_open,day_previous_close,day_volume,day_vwap,day_change,day_change_percent,details_contract_type,details_exercise_style,details_expiration_date,details_shares_per_contract,details_strike_price,details_ticker,greeks_delta,greeks_gamma,greeks_theta,greeks_vega,implied_volatility,last_quote_ask,last_quote_ask_size,last_quote_bid,last_quote_bid_size,last_quote_last_updated,last_quote_midpoint,last_quote_timeframe,open_interest,underlying_asset_change_to_break_even,underlying_asset_last_updated,underlying_asset_price,underlying_asset_ticker,underlying_asset_timeframe\n0,171.075,21.4,22.49,1636520400000000000,21.35,22.49,22.45,37,21.6741,-1.05,-4.67,call,american,2023-06-16,100,150,O:AAPL230616C00150000,0.5520187372272933,0.00706756515659829,-0.018532772783847958,0.7274811132998142,0.3048997097864957,21.25,110,20.9,172,1636573458756383500,21.075,REAL-TIME,8921,23.123999999999995,1636573459862384600,147.951,AAPL,REAL-TIME\n", + "type": "string" + } + } + }, + "description": "Snapshot of the option contract." + } + }, + "summary": "Option Contract", + "tags": [ + "options: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": "Aggregate data", + "name": "aggregates" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + } + } + }, + "/v3/trades/{cryptoTicker}": { + "get": { + "description": "Get trades for a crypto ticker symbol in a given time range.", + "operationId": "TradesCrypto", + "parameters": [ + { + "description": "The ticker symbol to get trades for.", + "example": "X:BTC-USD", + "in": "path", + "name": "cryptoTicker", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + }, + { + "description": "Order results based on the `sort` field.", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "example": "asc", + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 1000 and max is 50000.", + "in": "query", + "name": "limit", + "schema": { + "default": 1000, + "example": 10, + "maximum": 50000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "timestamp", + "enum": [ + "timestamp" + ], + "example": "timestamp", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v3/trades/X:BTC-USD?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": [ + { + "conditions": [ + 1 + ], + "exchange": 1, + "id": "191450340", + "participant_timestamp": 1625097600103000000, + "price": 35060, + "size": 1.0434526 + }, + { + "conditions": [ + 2 + ], + "exchange": 1, + "id": "191450341", + "participant_timestamp": 1625097600368000000, + "price": 35059.99, + "size": 0.0058883 + } + ], + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "results": { + "items": { + "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", + "x-polygon-go-type": { + "name": "Int32Array" + } + }, + "exchange": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "id": { + "description": "The Trade ID which uniquely identifies a trade on the exchange that the trade happened on.", + "type": "string" + }, + "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 in the base currency of the crypto pair.", + "format": "double", + "type": "number" + }, + "size": { + "description": "The size of a trade (also known as volume).", + "format": "double", + "type": "number" + } + }, + "required": [ + "exchange", + "price", + "size", + "id" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + }, + "text/csv": { + "example": "conditions,exchange,id,participant_timestamp,price,size\n1,1,191450340,1625097600103000000,35060,1.0434526\n2,1,191450341,1625097600368000000,35059.99,0.0058883\n", + "schema": { + "type": "string" + } + } + }, + "description": "A list of trades." + } + }, + "summary": "Trades", + "tags": [ + "crypto:trades" + ], + "x-polygon-entitlement-data-type": { + "description": "Trade data", + "name": "trades" + }, + "x-polygon-entitlement-market-type": { + "description": "Crypto data", + "name": "crypto" + }, + "x-polygon-paginate": { + "limit": { + "default": 1000, + "example": 10, + "max": 50000 + }, + "order": { + "default": "desc" + }, + "sort": { + "default": "timestamp", + "enum": [ + "timestamp" + ] + } + }, + "x-polygon-replaces": { + "date": 1654056060000, + "replaces": { + "name": "Historic Crypto Trades", + "path": "get_v1_historic_crypto__from___to___date" + } + } + }, + "x-polygon-ignore": true + }, + "/v3/trades/{optionsTicker}": { + "get": { + "description": "Get trades for an options ticker symbol in a given time range.", + "operationId": "TradesOptions", + "parameters": [ + { + "description": "The options ticker symbol to get trades for.", + "example": "O:TSLA210903C00700000", + "in": "path", + "name": "optionsTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + }, + { + "description": "Order results based on the `sort` field.", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "example": "asc", + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 1000 and max is 50000.", + "in": "query", + "name": "limit", + "schema": { + "default": 1000, + "example": 10, + "maximum": 50000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "timestamp", + "enum": [ + "timestamp" + ], + "example": "timestamp", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v3/trades/O:AZO140621P00530000?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": [ + { + "exchange": 46, + "participant_timestamp": 1401715883806000000, + "price": 6.91, + "sip_timestamp": 1401715883806000000, + "size": 1 + }, + { + "conditions": [ + 209 + ], + "exchange": 67, + "participant_timestamp": 1401716547786000000, + "price": 7.2, + "sip_timestamp": 1401716547786000000, + "size": 1 + } + ], + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "results": { + "items": { + "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", + "x-polygon-go-type": { + "name": "Int32Array" + } + }, + "correction": { + "description": "The trade correction indicator.", + "type": "integer" + }, + "exchange": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "participant_timestamp": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the trade was actually 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", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "size": { + "description": "The size of a trade (also known as volume).", + "format": "double", + "type": "number" + } + }, + "required": [ + "exchange", + "price", + "sip_timestamp", + "size" + ], + "type": "object" + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + }, + "text/csv": { + "example": "conditions,exchange,participant_timestamp,price,sip_timestamp,size\n,46,1401715883806000000,6.91,1401715883806000000,1\n209,67,1401716547786000000,7.2,1401716547786000000,1\n", + "schema": { + "type": "string" + } + } + }, + "description": "A list of trades." + } + }, + "summary": "Trades", + "tags": [ + "options:trades" + ], + "x-polygon-entitlement-data-type": { + "description": "Trade data", + "name": "trades" + }, + "x-polygon-entitlement-market-type": { + "description": "Options data", + "name": "options" + }, + "x-polygon-paginate": { + "limit": { + "default": 1000, + "example": 10, + "max": 50000 + }, + "order": { + "default": "desc" + }, + "sort": { + "default": "timestamp", + "enum": [ + "timestamp" + ] + } + } + }, + "x-polygon-ignore": true + }, + "/v3/trades/{stockTicker}": { + "get": { + "description": "Get trades for a ticker symbol in a given time range.", + "operationId": "Trades", + "parameters": [ + { + "description": "The ticker symbol to get trades for.", + "example": "AAPL", + "in": "path", + "name": "stockTicker", + "required": true, + "schema": { + "type": "string" + }, + "x-polygon-go-id": "Ticker" + }, + { + "description": "Query by trade timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp.", + "in": "query", + "name": "timestamp", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.gt", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lte", + "schema": { + "type": "string" + } + }, + { + "description": "Range by timestamp.", + "in": "query", + "name": "timestamp.lt", + "schema": { + "type": "string" + } + }, + { + "description": "Order results based on the `sort` field.", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "example": "asc", + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 1000 and max is 50000.", + "in": "query", + "name": "limit", + "schema": { + "default": 1000, + "example": 10, + "maximum": 50000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "timestamp", + "enum": [ + "timestamp" + ], + "example": "timestamp", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/v3/trades/AAPL?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "a47d1beb8c11b6ae897ab76cdbbf35a3", + "results": [ + { + "conditions": [ + 12, + 41 + ], + "exchange": 11, + "id": "1", + "participant_timestamp": 1517562000015577000, + "price": 171.55, + "sequence_number": 1063, + "sip_timestamp": 1517562000016036600, + "size": 100, + "tape": 3 + }, + { + "conditions": [ + 12, + 41 + ], + "exchange": 11, + "id": "2", + "participant_timestamp": 1517562000015577600, + "price": 171.55, + "sequence_number": 1064, + "sip_timestamp": 1517562000016038100, + "size": 100, + "tape": 3 + } + ], + "status": "OK" + }, + "schema": { + "properties": { + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "results": { + "items": { + "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", + "x-polygon-go-type": { + "name": "Int32Array" + } + }, + "correction": { + "description": "The trade correction indicator.", + "type": "integer" + }, + "exchange": { + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs.", + "type": "integer" + }, + "id": { + "description": "The Trade ID which uniquely identifies a trade. These are unique per\ncombination of ticker, exchange, and TRF. For example: A trade for AAPL\nexecuted on NYSE and a trade for AAPL executed on NASDAQ could potentially\nhave the same Trade ID.", + "type": "string" + }, + "participant_timestamp": { + "description": "The nanosecond accuracy Participant/Exchange Unix Timestamp. This is the timestamp of when the trade was actually 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" + }, + "sequence_number": { + "description": "The sequence number represents the sequence in which trade events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11). Values reset after each trading session/day.", + "format": "int64", + "type": "integer" + }, + "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", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + }, + "size": { + "description": "The size of a trade (also known as volume).", + "format": "double", + "type": "number" + }, + "tape": { + "description": "There are 3 tapes which define which exchange the ticker is listed on. These are integers in our objects which represent the letter of the alphabet. Eg: 1 = A, 2 = B, 3 = C.\n* Tape A is NYSE listed securities\n* Tape B is NYSE ARCA / NYSE American\n* Tape C is NASDAQ", + "format": "int32", + "type": "integer" + }, + "trf_id": { + "description": "The ID for the Trade Reporting Facility where the trade took place.", + "type": "integer" + }, + "trf_timestamp": { + "description": "The nanosecond accuracy TRF (Trade Reporting Facility) Unix Timestamp. This is the timestamp of when the trade reporting facility received this trade.", + "format": "int64", + "type": "integer", + "x-polygon-go-type": { + "name": "INanoseconds", + "path": "github.com/polygon-io/ptime" + } + } + }, + "required": [ + "exchange", + "id", + "price", + "sequence_number", + "sip_timestamp", + "participant_timestamp", + "size" + ], + "type": "object", + "x-polygon-go-type": { + "name": "CommonTrade" + } + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status" + ], + "type": "object" + } + }, + "text/csv": { + "example": "conditions,exchange,id,participant_timestamp,price,sequence_number,sip_timestamp,size,tape\n\"12,41\",11,1,1517562000015577088,171.55,1063,1517562000016036581,100,3\n\"12,41\",11,2,1517562000015577600,171.55,1064,1517562000016038175,100,3\n", + "schema": { + "type": "string" + } + } + }, + "description": "A list of trades." + } + }, + "summary": "Trades", + "tags": [ + "stocks:trades" + ], + "x-polygon-entitlement-data-type": { + "description": "Trade data", + "name": "trades" + }, + "x-polygon-entitlement-market-type": { + "description": "Stocks data", + "name": "stocks" + }, + "x-polygon-paginate": { + "limit": { + "default": 1000, + "example": 10, + "max": 50000 + }, + "order": { + "default": "desc" + }, + "sort": { + "default": "timestamp", + "enum": [ + "timestamp" + ] + } + }, + "x-polygon-replaces": { + "date": 1654056060000, + "replaces": { + "name": "Trades", + "path": "get_v2_ticks_stocks_trades__ticker___date" + } + } + } + }, + "/vX/reference/financials": { + "get": { + "description": "Get historical financial data for a stock ticker.\nThe financials data is extracted from XBRL from company SEC filings using the methodology outlined here.", + "operationId": "ListFinancials", + "parameters": [ + { + "description": "Query by company ticker.", + "in": "query", + "name": "ticker", + "schema": { + "type": "string" + } + }, + { + "description": "Query by central index key (CIK) Number", + "in": "query", + "name": "cik", + "schema": { + "type": "string" + } + }, + { + "description": "Query by company name.", + "in": "query", + "name": "company_name", + "schema": { + "type": "string" + }, + "x-polygon-filter-field": { + "search": true + } + }, + { + "description": "Query by standard industrial classification (SIC)", + "in": "query", + "name": "sic", + "schema": { + "type": "string" + } + }, + { + "description": "Query by the date when the filing with financials data was filed in YYYY-MM-DD format.\n\nBest used when querying over date ranges to find financials based on filings that happen in a time period.\n\nExamples:\n\nTo get financials based on filings that have happened after January 1, 2009 use the query param filing_date.gte=2009-01-01\n\nTo get financials based on filings that happened in the year 2009 use the query params filing_date.gte=2009-01-01&filing_date.lt=2010-01-01", + "in": "query", + "name": "filing_date", + "schema": { + "format": "date", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "The period of report for the filing with financials data in YYYY-MM-DD format.", + "in": "query", + "name": "period_of_report_date", + "schema": { + "format": "date", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true + } + }, + { + "description": "Query by timeframe. Annual financials originate from 10-K filings, and quarterly financials originate from 10-Q filings. Note: Most companies do not file quarterly reports for Q4 and instead include those financials in their annual report, so some companies my not return quarterly financials for Q4", + "in": "query", + "name": "timeframe", + "schema": { + "enum": [ + "annual", + "quarterly", + "ttm" + ], + "type": "string" + } + }, + { + "description": "Whether or not to include the `xpath` and `formula` attributes for each financial data point.\nSee the `xpath` and `formula` response attributes for more info. False by default.", + "in": "query", + "name": "include_sources", + "schema": { + "default": false, + "type": "boolean" + } + }, + { + "description": "Search by company_name.", + "in": "query", + "name": "company_name.search", + "schema": { + "type": "string" + } + }, + { + "description": "Search by filing_date.", + "in": "query", + "name": "filing_date.gte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Search by filing_date.", + "in": "query", + "name": "filing_date.gt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Search by filing_date.", + "in": "query", + "name": "filing_date.lte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Search by filing_date.", + "in": "query", + "name": "filing_date.lt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Search by period_of_report_date.", + "in": "query", + "name": "period_of_report_date.gte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Search by period_of_report_date.", + "in": "query", + "name": "period_of_report_date.gt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Search by period_of_report_date.", + "in": "query", + "name": "period_of_report_date.lte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Search by period_of_report_date.", + "in": "query", + "name": "period_of_report_date.lt", + "schema": { + "format": "date", + "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 100.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 100, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "period_of_report_date", + "enum": [ + "filing_date", + "period_of_report_date" + ], + "example": "filing_date", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "count": 1, + "next_url": "https://api.polygon.io/vX/reference/financials?", + "request_id": "55eb92ed43b25568ab0cce159830ea34", + "results": [ + { + "cik": "0001650729", + "company_name": "SiteOne Landscape Supply, Inc.", + "end_date": "2022-04-03", + "filing_date": "2022-05-04", + "financials": { + "balance_sheet": { + "assets": { + "label": "Assets", + "order": 100, + "unit": "USD", + "value": 2407400000 + }, + "current_assets": { + "label": "Current Assets", + "order": 200, + "unit": "USD", + "value": 1385900000 + }, + "current_liabilities": { + "label": "Current Liabilities", + "order": 700, + "unit": "USD", + "value": 597500000 + }, + "equity": { + "label": "Equity", + "order": 1400, + "unit": "USD", + "value": 1099200000 + }, + "equity_attributable_to_noncontrolling_interest": { + "label": "Equity Attributable To Noncontrolling Interest", + "order": 1500, + "unit": "USD", + "value": 0 + }, + "equity_attributable_to_parent": { + "label": "Equity Attributable To Parent", + "order": 1600, + "unit": "USD", + "value": 1099200000 + }, + "liabilities": { + "label": "Liabilities", + "order": 600, + "unit": "USD", + "value": 1308200000 + }, + "liabilities_and_equity": { + "label": "Liabilities And Equity", + "order": 1900, + "unit": "USD", + "value": 2407400000 + }, + "noncurrent_assets": { + "label": "Noncurrent Assets", + "order": 300, + "unit": "USD", + "value": 1021500000 + }, + "noncurrent_liabilities": { + "label": "Noncurrent Liabilities", + "order": 800, + "unit": "USD", + "value": 710700000 + } + }, + "cash_flow_statement": { + "exchange_gains_losses": { + "label": "Exchange Gains/Losses", + "order": 1000, + "unit": "USD", + "value": 100000 + }, + "net_cash_flow": { + "label": "Net Cash Flow", + "order": 1100, + "unit": "USD", + "value": -8600000 + }, + "net_cash_flow_continuing": { + "label": "Net Cash Flow, Continuing", + "order": 1200, + "unit": "USD", + "value": -8700000 + }, + "net_cash_flow_from_financing_activities": { + "label": "Net Cash Flow From Financing Activities", + "order": 700, + "unit": "USD", + "value": 150600000 + }, + "net_cash_flow_from_financing_activities_continuing": { + "label": "Net Cash Flow From Financing Activities, Continuing", + "order": 800, + "unit": "USD", + "value": 150600000 + }, + "net_cash_flow_from_investing_activities": { + "label": "Net Cash Flow From Investing Activities", + "order": 400, + "unit": "USD", + "value": -41000000 + }, + "net_cash_flow_from_investing_activities_continuing": { + "label": "Net Cash Flow From Investing Activities, Continuing", + "order": 500, + "unit": "USD", + "value": -41000000 + }, + "net_cash_flow_from_operating_activities": { + "label": "Net Cash Flow From Operating Activities", + "order": 100, + "unit": "USD", + "value": -118300000 + }, + "net_cash_flow_from_operating_activities_continuing": { + "label": "Net Cash Flow From Operating Activities, Continuing", + "order": 200, + "unit": "USD", + "value": -118300000 + } + }, + "comprehensive_income": { + "comprehensive_income_loss": { + "label": "Comprehensive Income/Loss", + "order": 100, + "unit": "USD", + "value": 40500000 + }, + "comprehensive_income_loss_attributable_to_noncontrolling_interest": { + "label": "Comprehensive Income/Loss Attributable To Noncontrolling Interest", + "order": 200, + "unit": "USD", + "value": 0 + }, + "comprehensive_income_loss_attributable_to_parent": { + "label": "Comprehensive Income/Loss Attributable To Parent", + "order": 300, + "unit": "USD", + "value": 40500000 + }, + "other_comprehensive_income_loss": { + "label": "Other Comprehensive Income/Loss", + "order": 400, + "unit": "USD", + "value": 40500000 + }, + "other_comprehensive_income_loss_attributable_to_parent": { + "label": "Other Comprehensive Income/Loss Attributable To Parent", + "order": 600, + "unit": "USD", + "value": 8200000 + } + }, + "income_statement": { + "basic_earnings_per_share": { + "label": "Basic Earnings Per Share", + "order": 4200, + "unit": "USD / shares", + "value": 0.72 + }, + "benefits_costs_expenses": { + "label": "Benefits Costs and Expenses", + "order": 200, + "unit": "USD", + "value": 768400000 + }, + "cost_of_revenue": { + "label": "Cost Of Revenue", + "order": 300, + "unit": "USD", + "value": 536100000 + }, + "costs_and_expenses": { + "label": "Costs And Expenses", + "order": 600, + "unit": "USD", + "value": 768400000 + }, + "diluted_earnings_per_share": { + "label": "Diluted Earnings Per Share", + "order": 4300, + "unit": "USD / shares", + "value": 0.7 + }, + "gross_profit": { + "label": "Gross Profit", + "order": 800, + "unit": "USD", + "value": 269200000 + }, + "income_loss_from_continuing_operations_after_tax": { + "label": "Income/Loss From Continuing Operations After Tax", + "order": 1400, + "unit": "USD", + "value": 32300000 + }, + "income_loss_from_continuing_operations_before_tax": { + "label": "Income/Loss From Continuing Operations Before Tax", + "order": 1500, + "unit": "USD", + "value": 36900000 + }, + "income_tax_expense_benefit": { + "label": "Income Tax Expense/Benefit", + "order": 2200, + "unit": "USD", + "value": 4600000 + }, + "interest_expense_operating": { + "label": "Interest Expense, Operating", + "order": 2700, + "unit": "USD", + "value": 4300000 + }, + "net_income_loss": { + "label": "Net Income/Loss", + "order": 3200, + "unit": "USD", + "value": 32300000 + }, + "net_income_loss_attributable_to_noncontrolling_interest": { + "label": "Net Income/Loss Attributable To Noncontrolling Interest", + "order": 3300, + "unit": "USD", + "value": 0 + }, + "net_income_loss_attributable_to_parent": { + "label": "Net Income/Loss Attributable To Parent", + "order": 3500, + "unit": "USD", + "value": 32300000 + }, + "net_income_loss_available_to_common_stockholders_basic": { + "label": "Net Income/Loss Available To Common Stockholders, Basic", + "order": 3700, + "unit": "USD", + "value": 32300000 + }, + "operating_expenses": { + "label": "Operating Expenses", + "order": 1000, + "unit": "USD", + "value": 228000000 + }, + "operating_income_loss": { + "label": "Operating Income/Loss", + "order": 1100, + "unit": "USD", + "value": 41200000 + }, + "participating_securities_distributed_and_undistributed_earnings_loss_basic": { + "label": "Participating Securities, Distributed And Undistributed Earnings/Loss, Basic", + "order": 3800, + "unit": "USD", + "value": 0 + }, + "preferred_stock_dividends_and_other_adjustments": { + "label": "Preferred Stock Dividends And Other Adjustments", + "order": 3900, + "unit": "USD", + "value": 0 + }, + "revenues": { + "label": "Revenues", + "order": 100, + "unit": "USD", + "value": 805300000 + } + } + }, + "fiscal_period": "Q1", + "fiscal_year": "2022", + "source_filing_file_url": "https://api.polygon.io/v1/reference/sec/filings/0001650729-22-000010/files/site-20220403_htm.xml", + "source_filing_url": "https://api.polygon.io/v1/reference/sec/filings/0001650729-22-000010", + "start_date": "2022-01-03" + } + ], + "status": "OK" + }, + "schema": { + "properties": { + "count": { + "description": "The total number of results for this request.", + "type": "integer" + }, + "next_url": { + "description": "If present, this value can be used to fetch the next page of data.", + "type": "string" + }, + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "items": { + "properties": { + "acceptance_datetime": { + "description": "The datetime (EST timezone) the filing was accepted by EDGAR in YYYYMMDDHHMMSS format." + }, + "cik": { + "description": "The CIK number for the company.", + "type": "string" + }, + "company_name": { + "description": "The company name.", + "type": "string" + }, + "end_date": { + "description": "The end date of the period that these financials cover in YYYYMMDD format.", + "type": "string" + }, + "filing_date": { + "description": "The date that the SEC filing which these financials were derived from was made available. Note that this is not necessarily the date when this information became public, as some companies may publish a press release before filing with the SEC." + }, + "financials": { + "properties": { + "balance_sheet": { + "description": "Balance sheet.\nThe keys in this object can be any of the fields listed in the Balance Sheet section of the financials API glossary of terms.", + "properties": { + "*": { + "description": "An individual financial data point.", + "properties": { + "derived_from": { + "description": "The list of report IDs (or errata) which were used to derive this data point.\nThis value is only returned for data points taken directly from XBRL when the `include_sources` query parameter is `true` and if source is SourceInterReportDerived.", + "items": { + "type": "string" + }, + "type": "array" + }, + "formula": { + "description": "The name of the formula used to derive this data point from other financial data points.\nInformation about the formulas can be found here.\nThis value is only returned for data points that are not explicitly expressed within the XBRL source file when the `include_sources` query parameter is `true` and if source is SourceIntraReportImpute.", + "type": "string" + }, + "label": { + "description": "A human readable label for the financial data point.", + "type": "string" + }, + "order": { + "description": "An indicator of what order within the statement that you would find this data point.", + "type": "integer" + }, + "source": { + "description": "The source where this data point came from. This will be one of: SourceDirectReport, SourceIntraReportImpute or SourceInterReportDerived." + }, + "unit": { + "description": "The unit of the financial data point.", + "type": "string" + }, + "value": { + "description": "The value of the financial data point.", + "type": "number" + }, + "xpath": { + "description": "The XPath 1.0 query that identifies the fact from within the XBRL source file.\nThis value is only returned for data points taken directly from XBRL when the `include_sources` query parameter is `true` and if source is SourceDirectReport.", + "type": "string" + } + }, + "required": [ + "label", + "order", + "value", + "unit" + ], + "type": "object" + } + }, + "type": "object" + }, + "cash_flow_statement": { + "description": "Cash flow statement.\nThe keys in this object can be any of the fields listed in the Cash Flow Statement section of the financials API glossary of terms.\nSee the attributes of the objects within `balance_sheet` for more details.", + "type": "object" + }, + "comprehensive_income": { + "description": "Comprehensive income.\nThe keys in this object can be any of the fields listed in the Comprehensive Income section of the financials API glossary of terms.\nSee the attributes of the objects within `balance_sheet` for more details.", + "type": "object" + }, + "income_statement": { + "description": "Income statement.\nThe keys in this object can be any of the fields listed in the Income Statement section of the financials API glossary of terms.\nSee the attributes of the objects within `balance_sheet` for more details.", + "type": "object" + } + }, + "type": "object" + }, + "fiscal_period": { + "description": "Fiscal period of the report according to the company (Q1, Q2, Q3, Q4, or FY).", + "type": "string" + }, + "fiscal_year": { + "description": "Fiscal year of the report according to the company.", + "type": "string" + }, + "source_filing_file_url": { + "description": "The URL of the specific XBRL instance document within the SEC filing that these financials were derived from." + }, + "source_filing_url": { + "description": "The URL of the SEC filing that these financials were derived from.", + "type": "string" + }, + "start_date": { + "description": "The start date of the period that these financials cover in YYYYMMDD format.", + "type": "string" + }, + "tickers": { + "description": "The list of ticker symbols for the company.", + "items": { + "type": "string" + }, + "type": "array" + }, + "timeframe": { + "description": "The timeframe of the report (quarterly, annual or ttm).", + "type": "string" + } + }, + "required": [ + "cik", + "company_name", + "financials", + "timeframe", + "fiscal_period" + ], + "type": "object", + "x-polygon-go-type": { + "name": "FinancialReport" + } + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "required": [ + "status", + "request_id", + "count", + "results" + ], + "type": "object" + } + } + }, + "description": "FIXME" + } + }, + "summary": "Stock Financials vX", + "tags": [ + "reference:stocks" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-experimental": {}, + "x-polygon-paginate": { + "limit": { + "default": 10, + "max": 100 + }, + "sort": { + "default": "period_of_report_date", + "enum": [ + "filing_date", + "period_of_report_date" + ] + } + } + } + }, + "/vX/reference/ipos": { + "get": { + "description": "The IPOs API provides access to detailed information about Initial Public Offerings (IPOs), including both upcoming and historical events. With this API, you can query for a comprehensive list of IPOs, along with key details such as the issuer name, ticker symbol, ISIN, IPO date, number of shares offered, expected price range, and final offering price. You can filter the results by status to focus on new, rumors, pending, historical, and more.", + "operationId": "ListIPOs", + "parameters": [ + { + "description": "Specify a case-sensitive ticker symbol. For example, AAPL represents Apple Inc.", + "in": "query", + "name": "ticker", + "schema": { + "type": "string" + } + }, + { + "description": "Specify a us_code. This is a unique nine-character alphanumeric code that identifies a North American financial security for the purposes of facilitating clearing and settlement of trades.", + "in": "query", + "name": "us_code", + "schema": { + "type": "string" + } + }, + { + "description": "Specify an International Securities Identification Number (ISIN). This is a unique twelve-digit code that is assigned to every security issuance in the world.", + "in": "query", + "name": "isin", + "schema": { + "type": "string" + } + }, + { + "description": "Specify a listing date. This is the first trading date for the newly listed entity.", + "in": "query", + "name": "listing_date", + "schema": { + "format": "date", + "type": "string" + }, + "x-polygon-filter-field": { + "range": true, + "type": "string" + } + }, + { + "description": "Specify an IPO status.", + "in": "query", + "name": "ipo_status", + "schema": { + "enum": [ + "direct_listing_process", + "history", + "new", + "pending", + "postponed", + "rumor", + "withdrawn" + ], + "type": "string" + } + }, + { + "description": "Range by listing_date.", + "in": "query", + "name": "listing_date.gte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by listing_date.", + "in": "query", + "name": "listing_date.gt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by listing_date.", + "in": "query", + "name": "listing_date.lte", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Range by listing_date.", + "in": "query", + "name": "listing_date.lt", + "schema": { + "format": "date", + "type": "string" + } + }, + { + "description": "Order results based on the `sort` field.", + "in": "query", + "name": "order", + "schema": { + "default": "desc", + "enum": [ + "asc", + "desc" + ], + "example": "asc", + "type": "string" + } + }, + { + "description": "Limit the number of results returned, default is 10 and max is 1000.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "example": 10, + "maximum": 1000, + "minimum": 1, + "type": "integer" + } + }, + { + "description": "Sort field used for ordering.", + "in": "query", + "name": "sort", + "schema": { + "default": "listing_date", + "enum": [ + "listing_date", + "ticker", + "last_updated", + "security_type", + "issuer_name", + "currency_code", + "isin", + "us_code", + "final_issue_price", + "min_shares_offered", + "max_shares_offered", + "lowest_offer_price", + "highest_offer_price", + "total_offer_size", + "shares_outstanding", + "primary_exchange", + "lot_size", + "security_description", + "ipo_status" + ], + "example": "listing_date", + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "next_url": "https://api.polygon.io/vX/reference/ipos?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUElN0M5YWRjMjY0ZTgyM2E1ZjBiOGUyNDc5YmZiOGE1YmYwNDVkYzU0YjgwMDcyMWE2YmI1ZjBjMjQwMjU4MjFmNGZiJnNvcnQ9dGlja2Vy", + "request_id": "6a7e466379af0a71039d60cc78e72282", + "results": [ + { + "currency_code": "USD", + "final_issue_price": 17, + "highest_offer_price": 17, + "ipo_status": "history", + "isin": "US75383L1026", + "issue_end_date": "2024-06-06", + "issue_start_date": "2024-06-01", + "issuer_name": "Rapport Therapeutics Inc.", + "last_updated": "2024-06-27", + "listing_date": "2024-06-07", + "lot_size": 100, + "lowest_offer_price": 17, + "max_shares_offered": 8000000, + "min_shares_offered": 1000000, + "primary_exchange": "XNAS", + "security_description": "Ordinary Shares", + "security_type": "CS", + "shares_outstanding": 35376457, + "ticker": "RAPP", + "total_offer_size": 136000000, + "us_code": "75383L102" + } + ], + "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": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "description": "An array of results containing the requested data.", + "items": { + "properties": { + "currency_code": { + "description": "Underlying currency of the security.", + "example": "USD", + "type": "string" + }, + "final_issue_price": { + "description": "The price set by the company and its underwriters before the IPO goes live.", + "example": 14.5, + "format": "float", + "type": "number" + }, + "highest_offer_price": { + "description": "The highest price within the IPO price range that the company might use to price the shares.", + "example": 20, + "format": "float", + "type": "number" + }, + "ipo_status": { + "description": "The status of the IPO event. IPO events start out as status \"rumor\" or \"pending\". On listing day, the status changes to \"new\". After the listing day, the status changes to \"history\".\n\nThe status \"direct_listing_process\" corresponds to a type of offering where, instead of going through all the IPO processes, the company decides to list its shares directly on an exchange, without using an investment bank or other intermediaries. This is called a direct listing, direct placement, or direct public offering (DPO).", + "enum": [ + "direct_listing_process", + "history", + "new", + "pending", + "postponed", + "rumor", + "withdrawn" + ], + "example": "history", + "type": "string" + }, + "isin": { + "description": "International Securities Identification Number. This is a unique twelve-digit code that is assigned to every security issuance in the world.", + "example": "US0378331005", + "type": "string" + }, + "issuer_name": { + "description": "Name of issuer.", + "example": "Apple Inc.", + "type": "string" + }, + "last_updated": { + "description": "The date when the IPO event was last modified.", + "example": "2023-01-02", + "format": "date", + "type": "string" + }, + "listing_date": { + "description": "First trading date for the newly listed entity.", + "example": "2023-02-01", + "format": "date", + "type": "string" + }, + "lot_size": { + "description": "The minimum number of shares that can be bought or sold in a single transaction.", + "example": 100, + "type": "number" + }, + "lowest_offer_price": { + "description": "The lowest price within the IPO price range that the company is willing to offer its shares to investors.", + "example": 10, + "format": "float", + "type": "number" + }, + "max_shares_offered": { + "description": "The upper limit of the shares that the company is offering to investors.", + "example": 1000, + "type": "number" + }, + "min_shares_offered": { + "description": "The lower limit of shares that the company is willing to sell in the IPO.", + "example": 1000, + "type": "number" + }, + "primary_exchange": { + "description": "Market Identifier Code (MIC) of the primary exchange where the security is listed. The Market Identifier Code (MIC) (ISO 10383) is a unique identification code used to identify securities trading exchanges, regulated and non-regulated trading markets.", + "example": "XNAS", + "type": "string" + }, + "security_description": { + "description": "Description of the security.", + "example": "Ordinary Shares - Class A", + "type": "string" + }, + "security_type": { + "description": "The classification of the stock. For example, \"CS\" stands for Common Stock.", + "example": "CS", + "type": "string" + }, + "shares_outstanding": { + "description": "The total number of shares that the company has issued and are held by investors.", + "example": 1000000, + "type": "number" + }, + "ticker": { + "description": "The ticker symbol of the IPO event.", + "example": "AAPL", + "type": "string" + }, + "total_offer_size": { + "description": "The total amount raised by the company for IPO.", + "example": 1000000, + "format": "float", + "type": "number" + }, + "us_code": { + "description": "This is a unique nine-character alphanumeric code that identifies a North American financial security for the purposes of facilitating clearing and settlement of trades.", + "example": 37833100, + "type": "string" + } + }, + "required": [ + "name", + "last_updated", + "primary_exchange", + "security_type", + "security_description", + "ipo_status" + ], + "type": "object", + "x-polygon-go-type": { + "name": "IPOsResult" + } + }, + "type": "array" + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "A list of IPO events." + } + }, + "summary": "IPOs", + "tags": [ + "reference:stocks:ipos" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-paginate": { + "limit": { + "default": 10, + "max": 1000 + }, + "order": { + "default": "desc" + }, + "sort": { + "default": "listing_date", + "enum": [ + "listing_date", + "ticker", + "last_updated", + "security_type", + "issuer_name", + "currency_code", + "isin", + "us_code", + "final_issue_price", + "min_shares_offered", + "max_shares_offered", + "lowest_offer_price", + "highest_offer_price", + "total_offer_size", + "shares_outstanding", + "primary_exchange", + "lot_size", + "security_description", + "ipo_status" + ] + } + } + } + }, + "/vX/reference/tickers/taxonomies": { + "get": { + "description": "Many investors place a high value on sector data. It is used to measure economic activity, identify peers and competitors, build ETF products, quantify market share, and compare company performance. However, there are some limitations to industry standard sectors:\n* They have difficulty identifying the primary area of activity for large, complex businesses.\n* Studies confirm significant disagreement between classification schemes when attempting to categorize the same companies.\n* The systems' hierarchical nature is inflexible and struggles to convey business nuances.\n
\n
\nAs a result, we've developed a new taxonomy to supplement existing sector classifications. The taxonomy is created by reviewing related 10K filings to create a set of structured categories and tags.\n
\n
\nThe categories are based on company operating models and are industry agnostic. Our current version only supports one category, Revenue Streams, with future plans to support more.\n
\n
\nThe tags define a specific type within the category. Within the Revenue Streams category, for example, tags for \"product sales\" and \"advertising\" may be found. A company may have many tags in a given category. The complete Revenue Streams taxonomy is shown below.\n
\n
\nOur taxonomy is powered by AI and is currently in early beta testing. You should expect some inaccuracies in the responses.\n
\n
\n## **Revenue Streams**\n *Latest Revision (7/7/2023)*\n
\n
\n- **Physical Product Sales:**\n Revenue generated from the sale of tangible goods or physical products to customers, either in-store or online.\n - Consumer Goods\n - Industrial Goods\n - Electronics\n - Vehicles\n - Healthcare Products\n
\n
\n- **Digital Product Sales:**\n Revenue earned from the sale of digital goods or products, such as software licenses, e-books, music downloads, or digital media content. It also includes revenue obtained by selling aggregated, anonymized, or processed data to third parties for market research, analytics, or other purposes.\n - Software\n - E-books and Digital Media\n - Mobile Applications\n - Games\n - Online Courses\n - Market Research Data\n - Customer Behavior Data\n
\n
\n- **Professional Services:**\n Revenue obtained by providing specialized services, expertise, or consulting to clients in exchange for fees. This includes services offered by professionals such as lawyers, accountants, or consultants.\n - Consulting\n - Legal Services\n - Financial Services\n - Marketing Services\n - Construction Services\n - Education & Tutoring\n
\n
\n- **Consumer Services:**\n Revenue earned from providing services directly to consumers, including services like healthcare, personal grooming, fitness, or hospitality.\n - Dining & Hospitality\n - Personal Care\n - Entertainment & Recreation\n - Fitness & Wellness\n - Travel & Tourism\n - Transportation\n - Home Services\n - Child & Family Care\n - Automotive\n
\n
\n- **Subscription-based Revenue:**\n Revenue obtained from recurring fees charged to customers for accessing a product or service over a defined period. This includes revenue from subscription-based models, membership programs, or software-as-a-service (SaaS) offerings.\n - Software as a Service (SaaS)\n - Streaming Services\n - Physical Media\n - Memberships\n
\n
\n- **Licensing and Royalties:**\n Revenue generated from the licensing of intellectual property rights to third parties, including franchise rights, patent licensing, brand licensing, and the receipt of royalties for authorized use of intellectual property like music royalties, book royalties, or patent royalties.\n - Franchise Fees\n - Patent Licensing\n - Brand Licensing\n - Media Royalties\n
\n
\n- **Advertising:**\n Revenue generated by displaying ads or promotional content to customers, whether through traditional or digital advertising channels, including revenue from display ads, sponsored content, or affiliate marketing.\n - Print Advertising\n - Online Display Advertising\n - Social Media Advertising\n - Influencer Marketing\n
\n
\n- **Commission-Based Revenue:**\n Revenue earned by acting as an intermediary and receiving a percentage or commission on sales made on behalf of another party. This includes revenue from affiliate programs, referral fees, or any other commission-based revenue models.\n - Real Estate Commissions\n - Affiliate Marketing Commissions\n - Online Marketplace Commissions\n
\n
\n- **Rentals or Leasing:**\n Revenue earned by leasing or renting out assets, properties, or equipment to customers, including rental income from real estate properties, equipment leasing, or vehicle rentals.\n - Property Rentals\n - Equipment Leasing\n - Vehicle Rentals", + "operationId": "ListTickerTaxonomyClassifications", + "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.\n\nWarning: The maximum number of characters allowed in a URL are subject to your own technology stack.\n", + "enabled": true, + "example": "AAPL,AMD,MSFT" + }, + "range": true, + "type": "string" + } + }, + { + "description": "Filter by taxonomy category. The current version of this API supports the following category: revenue_streams", + "in": "query", + "name": "category", + "schema": { + "type": "string" + } + }, + { + "description": "Filter by taxonomy tag. Each category has a set of associated tags.", + "in": "query", + "name": "tag", + "schema": { + "type": "string" + } + }, + { + "description": "Order results ascending or descending based on the ticker.", + "in": "query", + "name": "order", + "schema": { + "enum": [ + "asc", + "desc" + ], + "type": "string" + } + }, + { + "description": "Limit the number of results returned. The default is 10 and the max is 250.", + "in": "query", + "name": "limit", + "schema": { + "default": 10, + "maximum": 250, + "minimum": 1, + "type": "integer" + } + }, + { + "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.\n\nWarning: The maximum number of characters allowed in a URL are subject to your own technology stack.\n", + "example": "AAPL,AMD,MSFT", + "in": "query", + "name": "ticker.any_of", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "a4f9947955398c28905337f003bfee7c", + "results": [ + { + "category": "revenue_streams", + "reason": "The text mentions revenue earned from the sale of digital goods or products, such as software licenses, e-books, music downloads, or digital media content.", + "tag": "digital_product_sales", + "ticker": "AAPL" + }, + { + "category": "revenue_streams", + "reason": "The text mentions revenue generated from the licensing of intellectual property rights to third parties, including franchise rights, patent licensing, brand licensing, and the receipt of royalties for authorized use of intellectual property like music royalties, book royalties, or patent royalties.", + "tag": "licensing_and_royalties", + "ticker": "AAPL" + } + ], + "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": { + "category": { + "description": "A dimension of a company\u2019s operating model that is agnostic to industry. Category contains a comprehensive list of tags which reflect defined types within that category. The current version of this API supports the following category: revenue_streams", + "type": "string" + }, + "reason": { + "description": "The reason why the classification was given. The reason is provided by our AI to help you determine whether or not you agree with its applicability for your uses.", + "type": "string" + }, + "tag": { + "description": "A specific type within a category. For example \u201cproduct_sales\u201d is a type of revenue stream. A company may have multiple tags within a given category. A taxonomy of tags are determined based on 10k filings.", + "type": "string" + }, + "ticker": { + "description": "The identifying ticker symbol for the asset.", + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "TaxonomyClassificationResult" + } + }, + "type": "array" + }, + "status": { + "type": "string" + } + }, + "required": [ + "status", + "request_id" + ], + "type": "object" + } + } + }, + "description": "Taxonomy classification data." + } + }, + "summary": "Ticker Taxonomies", + "tags": [ + "Internal", + "Public" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-experimental": {} + }, + "x-polygon-draft": true + }, + "/vX/reference/tickers/{id}/events": { + "get": { + "description": "Get a timeline of events for the entity associated with the given ticker, CUSIP, or Composite FIGI.", + "operationId": "GetEvents", + "parameters": [ + { + "description": "Identifier of an asset. This can currently be a Ticker, CUSIP, or Composite FIGI.\nWhen given a ticker, we return events for the entity currently represented by that ticker.\nTo find events for entities previously associated with a ticker, find the relevant identifier using the \n[Ticker Details Endpoint](https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker)", + "example": "META", + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "A comma-separated list of the types of event to include. Currently ticker_change is the only supported event_type.\nLeave blank to return all supported event_types.", + "in": "query", + "name": "types", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "example": { + "request_id": "31d59dda-80e5-4721-8496-d0d32a654afe", + "results": { + "events": [ + { + "date": "2022-06-09", + "ticker_change": { + "ticker": "META" + }, + "type": "ticker_change" + }, + { + "date": "2012-05-18", + "ticker_change": { + "ticker": "FB" + }, + "type": "ticker_change" + } + ], + "name": "Meta Platforms, Inc. Class A Common Stock" + }, + "status": "OK" + }, + "schema": { + "properties": { + "request_id": { + "description": "A request id assigned by the server.", + "type": "string" + }, + "results": { + "properties": { + "events": { + "items": { + "oneOf": [ + { + "properties": { + "date": { + "description": "The date the event took place", + "format": "date", + "type": "string" + }, + "event_type": { + "description": "The type of historical event for the asset", + "type": "string" + }, + "ticker_change": { + "properties": { + "ticker": { + "type": "string" + } + }, + "type": "object" + } + }, + "required": [ + "event_type", + "date" + ], + "type": "object" + } + ] + }, + "type": "array" + }, + "name": { + "type": "string" + } + }, + "type": "object", + "x-polygon-go-type": { + "name": "EventsResults" + } + }, + "status": { + "description": "The status of this request's response.", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Ticker Events." + }, + "401": { + "description": "Unauthorized - Check our API Key and account status" + } + }, + "summary": "Ticker Events", + "tags": [ + "reference:tickers:get" + ], + "x-polygon-entitlement-data-type": { + "description": "Reference data", + "name": "reference" + }, + "x-polygon-experimental": {} + } + } + }, + "security": [ + { + "apiKey": [] + } + ], + "servers": [ + { + "description": "Polygon Platform API", + "url": "https://api.polygon.io" + }, + { + "description": "Polygon Platform API (Staging)", + "url": "https://api.staging.polygon.io" + } + ], + "tags": [ + { + "description": "Reference API", + "name": "reference", + "x-polygon-sub-tags": [ + "tickers:list", + "tickers:types", + "tickers:get", + "options:contracts:list", + "news", + "tickers", + "stocks", + "sec:filings", + "sec:filing", + "sec:filing:files", + "sec:filing:file", + "stocks:market", + "conditions", + "stocks:meta:exchanges", + "crypto", + "exchanges" + ] + }, + { + "description": "Stocks API", + "name": "stocks", + "x-polygon-sub-tags": [ + "trades", + "quotes", + "last:trade", + "last:quote", + "open-close", + "aggregates", + "snapshot" + ] + }, + { + "description": "Options API", + "name": "options", + "x-polygon-sub-tags": [ + "trades", + "quotes", + "last:trade", + "last:quote", + "open-close", + "aggregates", + "snapshot" + ] + }, + { + "description": "Forex API", + "name": "fx", + "x-polygon-sub-tags": [ + "trades", + "quotes", + "conversion", + "last:trade", + "last:quote", + "aggregates", + "snapshot" + ] + }, + { + "description": "Crypto API", + "name": "crypto", + "x-polygon-sub-tags": [ + "trades", + "last:trade", + "open-close", + "aggregates", + "snapshot" + ] + }, + { + "description": "Indices API", + "name": "indices", + "x-polygon-sub-tags": [ + "trades", + "last:trade", + "open-close", + "aggregates", + "snapshot" + ] + } + ], + "x-polygon-order": { + "crypto": { + "market": [ + { + "launchpad": "shared", + "paths": [ + "/v2/aggs/ticker/{cryptoTicker}/range/{multiplier}/{timespan}/{from}/{to}" + ] + }, + { + "launchpad": "exclusive", + "paths": [ + "/v1/summaries" + ] + }, + { + "paths": [ + "/v2/aggs/grouped/locale/global/market/crypto/{date}" + ] + }, + { + "paths": [ + "/v1/open-close/crypto/{from}/{to}/{date}" + ] + }, + { + "paths": [ + "/v2/aggs/ticker/{cryptoTicker}/prev" + ] + }, + { + "paths": [ + "/v3/trades/{cryptoTicker}" + ] + }, + { + "paths": [ + "/v1/historic/crypto/{from}/{to}/{date}" + ] + }, + { + "paths": [ + "/v1/last/crypto/{from}/{to}" + ] + }, + { + "group": "Snapshots", + "paths": [ + "/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", + "/v3/snapshot" + ] + }, + { + "group": "Technical Indicators", + "paths": [ + "/v1/indicators/sma/{cryptoTicker}", + "/v1/indicators/ema/{cryptoTicker}", + "/v1/indicators/macd/{cryptoTicker}", + "/v1/indicators/rsi/{cryptoTicker}" + ] + } + ], + "reference": [ + { + "paths": [ + "/v3/reference/tickers" + ] + }, + { + "paths": [ + "/v1/marketstatus/upcoming" + ] + }, + { + "paths": [ + "/v1/marketstatus/now" + ] + }, + { + "paths": [ + "/v3/reference/conditions" + ] + }, + { + "paths": [ + "/v3/reference/exchanges" + ] + } + ] + }, + "fx": { + "market": [ + { + "launchpad": "shared", + "paths": [ + "/v2/aggs/ticker/{forexTicker}/range/{multiplier}/{timespan}/{from}/{to}" + ] + }, + { + "launchpad": "exclusive", + "paths": [ + "/v1/summaries" + ] + }, + { + "paths": [ + "/v2/aggs/grouped/locale/global/market/fx/{date}" + ] + }, + { + "paths": [ + "/v2/aggs/ticker/{forexTicker}/prev" + ] + }, + { + "paths": [ + "/v3/quotes/{fxTicker}" + ] + }, + { + "paths": [ + "/v1/historic/forex/{from}/{to}/{date}" + ] + }, + { + "paths": [ + "/v1/last_quote/currencies/{from}/{to}" + ] + }, + { + "paths": [ + "/v1/conversion/{from}/{to}" + ] + }, + { + "group": "Snapshots", + "paths": [ + "/v2/snapshot/locale/global/markets/forex/tickers", + "/v2/snapshot/locale/global/markets/forex/{direction}", + "/v2/snapshot/locale/global/markets/forex/tickers/{ticker}", + "/v3/snapshot" + ] + }, + { + "group": "Technical Indicators", + "paths": [ + "/v1/indicators/sma/{fxTicker}", + "/v1/indicators/ema/{fxTicker}", + "/v1/indicators/macd/{fxTicker}", + "/v1/indicators/rsi/{fxTicker}" + ] + } + ], + "reference": [ + { + "paths": [ + "/v3/reference/tickers" + ] + }, + { + "paths": [ + "/v1/marketstatus/upcoming" + ] + }, + { + "paths": [ + "/v1/marketstatus/now" + ] + }, + { + "paths": [ + "/v3/reference/conditions" + ] + }, + { + "paths": [ + "/v3/reference/exchanges" + ] + } + ] + }, + "indices": { + "market": [ + { + "launchpad": "shared", + "paths": [ + "/v2/aggs/ticker/{indicesTicker}/range/{multiplier}/{timespan}/{from}/{to}" + ] + }, + { + "paths": [ + "/v2/aggs/ticker/{indicesTicker}/prev" + ] + }, + { + "paths": [ + "/v1/open-close/{indicesTicker}/{date}" + ] + }, + { + "group": "Technical Indicators", + "paths": [ + "/v1/indicators/sma/{indicesTicker}", + "/v1/indicators/ema/{indicesTicker}", + "/v1/indicators/macd/{indicesTicker}", + "/v1/indicators/rsi/{indicesTicker}" + ] + }, + { + "group": "Snapshots", + "paths": [ + "/v3/snapshot/indices", + "/v3/snapshot" + ] + } + ], + "reference": [ + { + "paths": [ + "/v3/reference/tickers" + ] + }, + { + "paths": [ + "/v3/reference/tickers/types" + ] + }, + { + "paths": [ + "/v1/marketstatus/upcoming" + ] + }, + { + "paths": [ + "/v1/marketstatus/now" + ] + } + ] + }, + "options": { + "market": [ + { + "launchpad": "shared", + "paths": [ + "/v2/aggs/ticker/{optionsTicker}/range/{multiplier}/{timespan}/{from}/{to}" + ] + }, + { + "launchpad": "exclusive", + "paths": [ + "/v1/summaries" + ] + }, + { + "paths": [ + "/v1/open-close/{optionsTicker}/{date}" + ] + }, + { + "paths": [ + "/v2/aggs/ticker/{optionsTicker}/prev" + ] + }, + { + "paths": [ + "/v3/trades/{optionsTicker}" + ] + }, + { + "paths": [ + "/v2/last/trade/{optionsTicker}" + ] + }, + { + "paths": [ + "/v3/quotes/{optionsTicker}" + ] + }, + { + "group": "Snapshots", + "paths": [ + "/v3/snapshot/options/{underlyingAsset}/{optionContract}", + "/v3/snapshot/options/{underlyingAsset}", + "/v3/snapshot" + ] + }, + { + "group": "Technical Indicators", + "paths": [ + "/v1/indicators/sma/{optionsTicker}", + "/v1/indicators/ema/{optionsTicker}", + "/v1/indicators/macd/{optionsTicker}", + "/v1/indicators/rsi/{optionsTicker}" + ] + } + ], + "reference": [ + { + "paths": [ + "/v3/reference/options/contracts/{options_ticker}" + ] + }, + { + "paths": [ + "/v3/reference/options/contracts" + ] + }, + { + "paths": [ + "/v3/reference/tickers" + ] + }, + { + "paths": [ + "/v1/meta/symbols/{stocksTicker}/company" + ] + }, + { + "paths": [ + "/v3/reference/tickers/{ticker}" + ] + }, + { + "paths": [ + "/v2/reference/news" + ] + }, + { + "paths": [ + "/v3/reference/tickers/types" + ] + }, + { + "paths": [ + "/v1/marketstatus/upcoming" + ] + }, + { + "paths": [ + "/v1/marketstatus/now" + ] + }, + { + "paths": [ + "/v3/reference/conditions" + ] + }, + { + "paths": [ + "/v3/reference/exchanges" + ] + } + ] + }, + "stocks": { + "market": [ + { + "launchpad": "shared", + "paths": [ + "/v2/aggs/ticker/{stocksTicker}/range/{multiplier}/{timespan}/{from}/{to}" + ] + }, + { + "launchpad": "exclusive", + "paths": [ + "/v1/summaries" + ] + }, + { + "paths": [ + "/v2/aggs/grouped/locale/us/market/stocks/{date}" + ] + }, + { + "paths": [ + "/v1/open-close/{stocksTicker}/{date}" + ] + }, + { + "paths": [ + "/v2/aggs/ticker/{stocksTicker}/prev" + ] + }, + { + "paths": [ + "/v3/trades/{stockTicker}" + ] + }, + { + "paths": [ + "/v2/ticks/stocks/trades/{ticker}/{date}" + ] + }, + { + "paths": [ + "/v2/last/trade/{stocksTicker}" + ] + }, + { + "paths": [ + "/v3/quotes/{stockTicker}" + ] + }, + { + "paths": [ + "/v2/ticks/stocks/nbbo/{ticker}/{date}" + ] + }, + { + "paths": [ + "/v2/last/nbbo/{stocksTicker}" + ] + }, + { + "group": "Snapshots", + "paths": [ + "/v2/snapshot/locale/us/markets/stocks/tickers", + "/v2/snapshot/locale/us/markets/stocks/{direction}", + "/v2/snapshot/locale/us/markets/stocks/tickers/{stocksTicker}", + "/v3/snapshot" + ] + }, + { + "group": "Technical Indicators", + "paths": [ + "/v1/indicators/sma/{stockTicker}", + "/v1/indicators/ema/{stockTicker}", + "/v1/indicators/macd/{stockTicker}", + "/v1/indicators/rsi/{stockTicker}" + ] + } + ], + "reference": [ + { + "paths": [ + "/v3/reference/tickers" + ] + }, + { + "paths": [ + "/v1/meta/symbols/{stocksTicker}/company" + ] + }, + { + "paths": [ + "/v3/reference/tickers/{ticker}" + ] + }, + { + "paths": [ + "/vX/reference/tickers/{id}/events" + ] + }, + { + "paths": [ + "/v2/reference/news" + ] + }, + { + "paths": [ + "/v3/reference/tickers/types" + ] + }, + { + "paths": [ + "/vX/reference/tickers/taxonomies" + ] + }, + { + "paths": [ + "/v1/marketstatus/upcoming" + ] + }, + { + "paths": [ + "/v1/marketstatus/now" + ] + }, + { + "group": "SEC Filings", + "paths": [ + "/v1/reference/sec/filings", + "/v1/reference/sec/filings/{filing_id}", + "/v1/reference/sec/filings/{filing_id}/files", + "/v1/reference/sec/filings/{filing_id}/files/{file_id}" + ] + }, + { + "paths": [ + "/v3/reference/splits" + ] + }, + { + "paths": [ + "/v3/reference/dividends" + ] + }, + { + "paths": [ + "/vX/reference/financials" + ] + }, + { + "paths": [ + "/v3/reference/conditions" + ] + }, + { + "paths": [ + "/v3/reference/exchanges" + ] + }, + { + "paths": [ + "/v1/related-companies/{ticker}" + ] + }, + { + "paths": [ + "/vX/reference/ipos" + ] + }, + { + "paths": [ + "/vX/reference/short-interest/{identifier_type}/{identifier}" + ] + } + ] + } + } +} \ No newline at end of file diff --git a/.polygon/rest.py b/.polygon/rest.py new file mode 100644 index 00000000..e4ae124c --- /dev/null +++ b/.polygon/rest.py @@ -0,0 +1,8 @@ +import urllib.request +import json + +contents = urllib.request.urlopen("https://api.polygon.io/openapi").read() +parsed = json.loads(contents) +formatted = json.dumps(parsed, indent=2) +with open(".polygon/rest.json", "w") as f: + f.write(formatted) diff --git a/.polygon/websocket.json b/.polygon/websocket.json new file mode 100644 index 00000000..ff09762a --- /dev/null +++ b/.polygon/websocket.json @@ -0,0 +1,5549 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Polygon Websocket Spec", + "description": "The future of fintech.", + "version": "2.0.0" + }, + "servers": [ + { + "url": "wss://socket.polygon.io", + "description": "Real-time" + }, + { + "url": "wss://delayed.polygon.io", + "description": "Delayed" + } + ], + "x-polygon-order": { + "stocks": { + "market": [ + { + "paths": [ + "/stocks/AM" + ] + }, + { + "paths": [ + "/stocks/A" + ] + }, + { + "paths": [ + "/stocks/T" + ] + }, + { + "paths": [ + "/stocks/Q" + ] + }, + { + "paths": [ + "/stocks/NOI" + ] + }, + { + "paths": [ + "/stocks/LULD" + ] + }, + { + "paths": [ + "/business/stocks/FMV" + ] + }, + { + "paths": [ + "/launchpad/stocks/AM" + ], + "launchpad": "exclusive" + }, + { + "paths": [ + "/launchpad/stocks/LV" + ], + "launchpad": "exclusive" + } + ] + }, + "options": { + "market": [ + { + "paths": [ + "/options/AM" + ] + }, + { + "paths": [ + "/options/A" + ] + }, + { + "paths": [ + "/options/T" + ] + }, + { + "paths": [ + "/options/Q" + ] + }, + { + "paths": [ + "/business/options/FMV" + ] + }, + { + "paths": [ + "/launchpad/options/AM" + ], + "launchpad": "exclusive" + }, + { + "paths": [ + "/launchpad/options/LV" + ], + "launchpad": "exclusive" + } + ] + }, + "fx": { + "market": [ + { + "paths": [ + "/forex/CA" + ] + }, + { + "paths": [ + "/forex/CAS" + ] + }, + { + "paths": [ + "/forex/C" + ] + }, + { + "paths": [ + "/business/forex/FMV" + ] + }, + { + "paths": [ + "/launchpad/forex/AM" + ], + "launchpad": "exclusive" + }, + { + "paths": [ + "/launchpad/forex/LV" + ], + "launchpad": "exclusive" + } + ] + }, + "crypto": { + "market": [ + { + "paths": [ + "/crypto/XA" + ] + }, + { + "paths": [ + "/crypto/XAS" + ] + }, + { + "paths": [ + "/crypto/XT" + ] + }, + { + "paths": [ + "/crypto/XQ" + ] + }, + { + "paths": [ + "/crypto/XL2" + ] + }, + { + "paths": [ + "/business/crypto/FMV" + ] + }, + { + "paths": [ + "/launchpad/crypto/AM" + ], + "launchpad": "exclusive" + }, + { + "paths": [ + "/launchpad/crypto/LV" + ], + "launchpad": "exclusive" + } + ] + }, + "indices": { + "market": [ + { + "paths": [ + "/indices/AM" + ] + }, + { + "paths": [ + "/indices/A" + ] + }, + { + "paths": [ + "/indices/V" + ] + } + ] + } + }, + "paths": { + "/stocks/T": { + "get": { + "summary": "Trades", + "description": "Stream real-time trades 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 trade event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "T" + ], + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "x": { + "type": "integer", + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "i": { + "type": "string", + "description": "The trade ID." + }, + "z": { + "type": "integer", + "description": "The tape. (1 = NYSE, 2 = AMEX, 3 = Nasdaq).\n" + }, + "p": { + "type": "number", + "format": "double", + "description": "The price." + }, + "s": { + "type": "integer", + "description": "The trade size." + }, + "c": { + "type": "array", + "description": "The trade conditions. See Conditions and Indicators for Polygon.io's trade conditions glossary.\n", + "items": { + "type": "integer", + "description": "The ID of the condition." + } + }, + "t": { + "type": "integer", + "description": "The SIP timestamp in Unix MS." + }, + "q": { + "type": "integer", + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n" + }, + "trfi": { + "type": "integer", + "description": "The ID for the Trade Reporting Facility where the trade took place." + }, + "trft": { + "type": "integer", + "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n" + } + } + }, + "example": { + "ev": "T", + "sym": "MSFT", + "x": 4, + "i": "12345", + "z": 3, + "p": 114.125, + "s": 100, + "c": [ + 0, + 12 + ], + "t": 1536036818784, + "q": 3681328 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "trades", + "description": "Trade data" + }, + "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" + } + ] + } + }, + "/stocks/Q": { + "get": { + "summary": "Quotes", + "description": "Stream real-time quotes 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 quote event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "Q" + ], + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "bx": { + "type": "integer", + "description": "The bid exchange ID." + }, + "bp": { + "type": "number", + "format": "double", + "description": "The bid price." + }, + "bs": { + "type": "integer", + "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." + }, + "ax": { + "type": "integer", + "description": "The ask exchange ID." + }, + "ap": { + "type": "number", + "format": "double", + "description": "The ask price." + }, + "as": { + "type": "integer", + "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." + }, + "c": { + "type": "integer", + "description": "The condition." + }, + "i": { + "type": "array", + "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n", + "items": { + "type": "integer", + "description": "The indicator code.\n" + } + }, + "t": { + "type": "integer", + "description": "The SIP timestamp in Unix MS." + }, + "q": { + "type": "integer", + "description": "The sequence number represents the sequence in which quote events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11). Values reset after each trading session/day.\n" + }, + "z": { + "type": "integer", + "description": "The tape. (1 = NYSE, 2 = AMEX, 3 = Nasdaq)." + } + } + }, + "example": { + "ev": "Q", + "sym": "MSFT", + "bx": 4, + "bp": 114.125, + "bs": 100, + "ax": 7, + "ap": 114.128, + "as": 160, + "c": 0, + "i": [ + 604 + ], + "t": 1536036818784, + "q": 50385480, + "z": 3 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "nbbo", + "description": "NBBO data" + }, + "x-polygon-entitlement-market-type": { + "name": "stocks", + "description": "Stocks data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/stocks/A": { + "get": { + "summary": "Aggregates (Per Second)", + "description": "Stream real-time second aggregates 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 second aggregate event.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The tick's volume weighted average price." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening tick price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing tick price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest tick price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest tick price for this aggregate window." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + }, + "otc": { + "type": "boolean", + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "A" + ], + "description": "The event type." + } + } + } + ] + }, + "example": { + "ev": "A", + "sym": "SPCE", + "v": 200, + "av": 8642007, + "op": 25.66, + "vw": 25.3981, + "o": 25.39, + "c": 25.39, + "h": 25.39, + "l": 25.39, + "a": 25.3714, + "z": 50, + "s": 1610144868000, + "e": 1610144869000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "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" + } + ] + } + }, + "/stocks/AM": { + "get": { + "summary": "Aggregates (Per Minute)", + "description": "Stream real-time minute aggregates 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 minute aggregate event.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The tick's volume weighted average price." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening tick price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing tick price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest tick price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest tick price for this aggregate window." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + }, + "otc": { + "type": "boolean", + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "AM" + ], + "description": "The event type." + } + } + } + ] + }, + "example": { + "ev": "AM", + "sym": "GTE", + "v": 4110, + "av": 9470157, + "op": 0.4372, + "vw": 0.4488, + "o": 0.4488, + "c": 0.4486, + "h": 0.4489, + "l": 0.4486, + "a": 0.4352, + "z": 685, + "s": 1610144640000, + "e": 1610144700000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "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" + } + ] + } + }, + "/stocks/LULD": { + "get": { + "summary": "Limit-Up Limit-Down (LULD)", + "description": "Stream real-time LULD events 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 LULD event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "LULD" + ], + "description": "The event type." + }, + "T": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "h": { + "type": "number", + "format": "double", + "description": "The high price." + }, + "l": { + "type": "number", + "format": "double", + "description": "The low price." + }, + "i": { + "type": "array", + "description": "The Indicators.", + "items": { + "type": "integer" + } + }, + "z": { + "type": "integer", + "description": "The tape. (1 = NYSE, 2 = AMEX, 3 = Nasdaq).\n" + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "q": { + "type": "integer", + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n" + } + } + }, + "example": { + "ev": "LULD", + "T": "MSFT", + "h": 218.96, + "l": 198.11, + "i": [ + 21 + ], + "z": 3, + "t": 1601316752683746, + "q": 290317 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "limit-up-limit-down", + "description": "Limit-Up Limit-Down data" + }, + "x-polygon-entitlement-market-type": { + "name": "stocks", + "description": "Stocks data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/stocks/NOI": { + "get": { + "summary": "Imbalances", + "description": "Stream real-time imbalance events 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 an imbalance event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "NOI" + ], + "description": "The event type." + }, + "T": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "at": { + "type": "integer", + "description": "The time that the auction is planned to take place in the format (hour x 100) + minutes in Eastern Standard Time, \nfor example 930 would be 9:30 am EST, and 1600 would be 4:00 pm EST.\n" + }, + "a": { + "type": "string", + "description": "The auction type.\n`O` - Early Opening Auction (non-NYSE only)\n`M` - Core Opening Auction\n`H` - Reopening Auction (Halt Resume)\n`C` - Closing Auction\n`P` - Extreme Closing Imbalance (NYSE only)\n`R` - Regulatory Closing Imbalance (NYSE only)\n" + }, + "i": { + "type": "integer", + "description": "The symbol sequence." + }, + "x": { + "type": "integer", + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "o": { + "type": "integer", + "description": "The imbalance quantity." + }, + "p": { + "type": "integer", + "description": "The paired quantity." + }, + "b": { + "type": "number", + "format": "double", + "description": "The book clearing price." + } + } + }, + "example": { + "ev": "NOI", + "T": "NTEST.Q", + "t": 1601318039223013600, + "at": 930, + "a": "M", + "i": 44, + "x": 10, + "o": 480, + "p": 440, + "b": 25.03 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "imbalances", + "description": "Imbalances data" + }, + "x-polygon-entitlement-market-type": { + "name": "stocks", + "description": "Stocks data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/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", + "fmv": 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)", + "description": "Stream real-time minute aggregates 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 minute aggregate event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The volume-weighted average value for the aggregate window." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for the symbol in the given time period." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for the symbol in the given time period." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest price for the symbol in the given time period." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest price for the symbol in the given time period." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "example": { + "ev": "AM", + "sym": "GTE", + "v": 4110, + "av": 9470157, + "op": 0.4372, + "vw": 0.4488, + "o": 0.4488, + "c": 0.4486, + "h": 0.4489, + "l": 0.4486, + "a": 0.4352, + "z": 685, + "s": 1610144640000, + "e": 1610144700000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "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/LV": { + "get": { + "summary": "Value", + "description": "Real-time 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 value event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "LV" + ], + "description": "The event type." + }, + "val": { + "description": "The current value of the security." + }, + "sym": { + "description": "The ticker symbol for the given security." + }, + "t": { + "description": "The nanosecond timestamp." + } + } + }, + "example": { + "ev": "LV", + "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" + } + ] + } + }, + "/options/T": { + "get": { + "summary": "Trades", + "description": "Stream real-time trades for a given option contract.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify an option contract or use * to subscribe to all option contracts.\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": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a trade event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "T" + ], + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given option contract." + }, + "x": { + "type": "integer", + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "p": { + "type": "number", + "format": "double", + "description": "The price." + }, + "s": { + "type": "integer", + "description": "The trade size." + }, + "c": { + "type": "array", + "description": "The trade conditions", + "items": { + "type": "integer", + "description": "The ID of the condition." + } + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "q": { + "type": "integer", + "description": "The sequence number represents the sequence in which trade events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11)." + } + } + }, + "example": { + "ev": "T", + "sym": "O:AMC210827C00037000", + "x": 65, + "p": 1.54, + "s": 1, + "c": [ + 233 + ], + "t": 1629820676333, + "q": 651921857 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "trades", + "description": "Trade data" + }, + "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" + } + ] + } + }, + "/options/Q": { + "get": { + "summary": "Quotes", + "description": "Stream real-time quotes for a given option contract.\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 trade event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "Q" + ], + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given option contract." + }, + "bx": { + "type": "integer", + "description": "The bid exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "ax": { + "type": "integer", + "description": "The ask exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "bp": { + "type": "number", + "format": "double", + "description": "The bid price." + }, + "ap": { + "type": "number", + "format": "double", + "description": "The ask price." + }, + "bs": { + "type": "integer", + "description": "The bid size." + }, + "as": { + "type": "integer", + "description": "The ask size." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "q": { + "type": "integer", + "description": "The sequence number represents the sequence in which trade events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11)." + } + } + }, + "example": { + "ev": "Q", + "sym": "O:SPY241220P00720000", + "bx": 302, + "ax": 302, + "bp": 9.71, + "ap": 9.81, + "bs": 17, + "as": 24, + "t": 1644506128351, + "q": 844090872 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "nbbo", + "description": "NBBO data" + }, + "x-polygon-entitlement-market-type": { + "name": "options", + "description": "Options data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/options/A": { + "get": { + "summary": "Aggregates (Per Second)", + "description": "Stream real-time second aggregates for a given option contract.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify an option contract or use * to subscribe to all option contracts.\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": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a second aggregate event.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given option contract." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The tick's volume weighted average price." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening tick price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing tick price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest tick price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest tick price for this aggregate window." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "A" + ], + "description": "The event type." + } + } + } + ] + }, + "example": { + "ev": "AM", + "sym": "O:ONEM220121C00025000", + "v": 2, + "av": 8, + "op": 2.2, + "vw": 2.05, + "o": 2.05, + "c": 2.05, + "h": 2.05, + "l": 2.05, + "a": 2.1312, + "z": 2, + "s": 1632419640000, + "e": 1632419700000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "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" + } + ] + } + }, + "/options/AM": { + "get": { + "summary": "Aggregates (Per Minute)", + "description": "Stream real-time minute aggregates for a given option contract.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify an option contract or use * to subscribe to all option contracts.\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": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a minute aggregate event.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given option contract." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The tick's volume weighted average price." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening tick price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing tick price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest tick price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest tick price for this aggregate window." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "AM" + ], + "description": "The event type." + } + } + } + ] + }, + "example": { + "ev": "AM", + "sym": "O:ONEM220121C00025000", + "v": 2, + "av": 8, + "op": 2.2, + "vw": 2.05, + "o": 2.05, + "c": 2.05, + "h": 2.05, + "l": 2.05, + "a": 2.1312, + "z": 2, + "s": 1632419640000, + "e": 1632419700000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "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" + } + ] + } + }, + "/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", + "fmv": 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)", + "description": "Stream real-time minute aggregates for a given option contract.\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 minute aggregate event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The volume-weighted average value for the aggregate window." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for the symbol in the given time period." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for the symbol in the given time period." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest price for the symbol in the given time period." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest price for the symbol in the given time period." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "example": { + "ev": "AM", + "sym": "O:ONEM220121C00025000", + "v": 2, + "av": 8, + "op": 2.2, + "vw": 2.05, + "o": 2.05, + "c": 2.05, + "h": 2.05, + "l": 2.05, + "a": 2.1312, + "z": 1, + "s": 1632419640000, + "e": 1632419700000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "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/LV": { + "get": { + "summary": "Value", + "description": "Real-time 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 value event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "LV" + ], + "description": "The event type." + }, + "val": { + "description": "The current value of the security." + }, + "sym": { + "description": "The ticker symbol for the given security." + }, + "t": { + "description": "The nanosecond timestamp." + } + } + }, + "example": { + "ev": "LV", + "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" + } + ] + } + }, + "/forex/C": { + "get": { + "summary": "Quotes", + "description": "Stream real-time forex quotes for a given forex pair.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a forex pair in the format {from}/{to} or use * to subscribe to all forex pairs.\nYou can also use a comma separated list to subscribe to multiple forex pairs.\nYou can retrieve active forex tickers from our [Forex Tickers API](https://polygon.io/docs/forex/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(?([A-Z]{3})\\/?([A-Z]{3}))$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a forex quote event.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "type": "string", + "description": "The event type." + }, + "p": { + "type": "string", + "description": "The current pair." + }, + "x": { + "type": "integer", + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "a": { + "type": "number", + "format": "double", + "description": "The ask price." + }, + "b": { + "type": "number", + "format": "double", + "description": "The bid price." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "C" + ], + "description": "The event type." + } + } + } + ] + }, + "example": { + "ev": "C", + "p": "USD/CNH", + "x": "44", + "a": 6.83366, + "b": 6.83363, + "t": 1536036818784 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "nbbo", + "description": "NBBO data" + }, + "x-polygon-entitlement-market-type": { + "name": "fx", + "description": "Forex data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/forex/CA": { + "get": { + "summary": "Aggregates (Per Minute)", + "description": "Stream real-time per-minute forex aggregates for a given forex pair.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a forex pair in the format {from}/{to} or use * to subscribe to all forex pairs.\nYou can also use a comma separated list to subscribe to multiple forex pairs.\nYou can retrieve active forex tickers from our [Forex Tickers API](https://polygon.io/docs/forex/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(?([A-Z]{3})\\/?([A-Z]{3}))$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a forex per-minute aggregate event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "CA" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The currency pair." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The high price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The low price for this aggregate window." + }, + "v": { + "type": "integer", + "description": "The volume of trades during this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "example": { + "ev": "CA", + "pair": "USD/EUR", + "o": 0.8687, + "c": 0.86889, + "h": 0.86889, + "l": 0.8686, + "v": 20, + "s": 1539145740000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "x-polygon-entitlement-market-type": { + "name": "fx", + "description": "Forex data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/forex/CAS": { + "get": { + "summary": "Aggregates (Per Second)", + "description": "Stream real-time per-second forex aggregates for a given forex pair.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a forex pair in the format {from}/{to} or use * to subscribe to all forex pairs.\nYou can also use a comma separated list to subscribe to multiple forex pairs.\nYou can retrieve active forex tickers from our [Forex Tickers API](https://polygon.io/docs/forex/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(?([A-Z]{3})\\/?([A-Z]{3}))$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a forex per-second aggregate event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "CAS" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The currency pair." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The high price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The low price for this aggregate window." + }, + "v": { + "type": "integer", + "description": "The volume of trades during this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "example": { + "ev": "CAS", + "pair": "USD/EUR", + "o": 0.8687, + "c": 0.86889, + "h": 0.86889, + "l": 0.8686, + "v": 20, + "s": 1539145740000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "x-polygon-entitlement-market-type": { + "name": "fx", + "description": "Forex data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/business/forex/FMV": { + "get": { + "summary": "Fair Market Value", + "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", + "fmv": 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)", + "description": "Stream real-time per-minute forex aggregates for a given forex pair.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a forex pair in the format {from}/{to} or use * to subscribe to all forex pairs.\nYou can also use a comma separated list to subscribe to multiple forex pairs.\nYou can retrieve active forex tickers from our [Forex Tickers API](https://polygon.io/docs/forex/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(?([A-Z]{3})\\/?([A-Z]{3}))$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a minute aggregate event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The volume-weighted average value for the aggregate window." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for the symbol in the given time period." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for the symbol in the given time period." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest price for the symbol in the given time period." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest price for the symbol in the given time period." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "example": { + "ev": "AM", + "sym": "C:USD-EUR", + "v": 4110, + "av": 9470157, + "op": 0.9272, + "vw": 0.9288, + "o": 0.9288, + "c": 0.9286, + "h": 0.9289, + "l": 0.9206, + "a": 0.9352, + "z": 685, + "s": 1610144640000, + "e": 1610144700000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "x-polygon-entitlement-market-type": { + "name": "fx", + "description": "Forex data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "delayed", + "description": "15 minute delayed data" + }, + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/launchpad/forex/LV": { + "get": { + "summary": "Value", + "description": "Real-time 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 value event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "LV" + ], + "description": "The event type." + }, + "val": { + "description": "The current value of the security." + }, + "sym": { + "description": "The ticker symbol for the given security." + }, + "t": { + "description": "The nanosecond timestamp." + } + } + }, + "example": { + "ev": "LV", + "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" + } + ] + } + }, + "/crypto/XT": { + "get": { + "summary": "Trades", + "description": "Stream real-time crypto trades for a given crypto pair.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs.\nYou can also use a comma separated list to subscribe to multiple crypto pairs.\nYou can retrieve active crypto tickers from our [Crypto Tickers API](https://polygon.io/docs/crypto/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(?([A-Z]*)-(?[A-Z]{3}))$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a crypto trade event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "XT" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The crypto pair." + }, + "p": { + "type": "number", + "format": "double", + "description": "The price." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "s": { + "type": "number", + "format": "double", + "description": "The size." + }, + "c": { + "type": "array", + "description": "The conditions.\n0 (or empty array): empty\n1: sellside\n2: buyside\n", + "items": { + "type": "integer", + "description": "The ID of the condition." + } + }, + "i": { + "type": "integer", + "description": "The ID of the trade (optional)." + }, + "x": { + "type": "integer", + "description": "The crypto exchange ID. See Exchanges for a list of exchanges and their IDs.\n" + }, + "r": { + "type": "integer", + "description": "The timestamp that the tick was received by Polygon." + } + } + }, + "example": { + "ev": "XT", + "pair": "BTC-USD", + "p": 33021.9, + "t": 1610462007425, + "s": 0.01616617, + "c": [ + 2 + ], + "i": 14272084, + "x": 3, + "r": 1610462007576 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "trades", + "description": "Trade data" + }, + "x-polygon-entitlement-market-type": { + "name": "crypto", + "description": "Crypto data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/crypto/XQ": { + "get": { + "summary": "Quotes", + "description": "Stream real-time crypto quotes for a given crypto pair.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs.\nYou can also use a comma separated list to subscribe to multiple crypto pairs.\nYou can retrieve active crypto tickers from our [Crypto Tickers API](https://polygon.io/docs/crypto/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(?([A-Z]*)-(?[A-Z]{3}))$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a crypto quote event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "XQ" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The crypto pair." + }, + "bp": { + "type": "number", + "format": "double", + "description": "The bid price." + }, + "bs": { + "type": "number", + "format": "double", + "description": "The bid size." + }, + "ap": { + "type": "number", + "format": "double", + "description": "The ask price." + }, + "as": { + "type": "number", + "format": "double", + "description": "The ask size." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "x": { + "type": "integer", + "description": "The crypto exchange ID. See Exchanges for a list of exchanges and their IDs.\n" + }, + "r": { + "type": "integer", + "description": "The timestamp that the tick was received by Polygon." + } + } + }, + "example": { + "ev": "XQ", + "pair": "BTC-USD", + "bp": 33052.79, + "bs": 0.48, + "ap": 33073.19, + "as": 0.601, + "t": 1610462411115, + "x": 1, + "r": 1610462411128 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "nbbo", + "description": "NBBO data" + }, + "x-polygon-entitlement-market-type": { + "name": "crypto", + "description": "Crypto data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/crypto/XL2": { + "get": { + "summary": "Level 2 Book", + "description": "Stream real-time level 2 book data for a given crypto pair.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs.\nYou can also use a comma separated list to subscribe to multiple crypto pairs.\nYou can retrieve active crypto tickers from our [Crypto Tickers API](https://polygon.io/docs/crypto/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(?([A-Z]*)-(?[A-Z]{3}))$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a crypto level 2 book event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "XL2" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The crypto pair." + }, + "b": { + "type": "array", + "description": "An array of bid prices, where each entry contains two elements: the first is the bid price, and the second is the size, with a maximum depth of 100.", + "items": { + "type": "array", + "description": "An array where the first item is bid price and the second item is size.", + "items": { + "type": "number", + "format": "double" + } + } + }, + "a": { + "type": "array", + "description": "An array of ask prices, where each entry contains two elements: the first is the ask price, and the second is the size, with a maximum depth of 100.", + "items": { + "type": "array", + "description": "An array where the first item is ask price and the second item is size.", + "items": { + "type": "number", + "format": "double" + } + } + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "x": { + "type": "integer", + "description": "The crypto exchange ID. See Exchanges for a list of exchanges and their IDs.\n" + }, + "r": { + "type": "integer", + "description": "The timestamp that the tick was received by Polygon." + } + } + }, + "example": { + "ev": "XL2", + "pair": "BTC-USD", + "t": 1610462411115, + "r": 1610462411128, + "x": 1, + "b": [ + [ + 33712.71, + 0.18635 + ], + [ + 33712.7, + 0.134 + ] + ], + "a": [ + [ + 33718.23, + 3.5527483 + ], + [ + 33718.24, + 0.1 + ] + ] + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "nbbo", + "description": "NBBO data" + }, + "x-polygon-entitlement-market-type": { + "name": "crypto", + "description": "Crypto data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ], + "x-polygon-deprecation": { + "date": 1719838800000 + } + } + }, + "/crypto/XA": { + "get": { + "summary": "Aggregates (Per Minute)", + "description": "Stream real-time per-minute crypto aggregates for a given crypto pair.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs.\nYou can also use a comma separated list to subscribe to multiple crypto pairs.\nYou can retrieve active crypto tickers from our [Crypto Tickers API](https://polygon.io/docs/crypto/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(?([A-Z]*)-(?[A-Z]{3}))$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a crypto per-minute aggregate event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "XA" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The crypto pair." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The high price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The low price for this aggregate window." + }, + "v": { + "type": "integer", + "description": "The volume of trades during this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + }, + "vw": { + "type": "number", + "format": "double", + "description": "The volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + } + } + }, + "example": { + "ev": "XA", + "pair": "BCD-USD", + "v": 951.6112, + "vw": 0.7756, + "z": 73, + "o": 0.772, + "c": 0.784, + "h": 0.784, + "l": 0.771, + "s": 1610463240000, + "e": 1610463300000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "x-polygon-entitlement-market-type": { + "name": "crypto", + "description": "Crypto data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/crypto/XAS": { + "get": { + "summary": "Aggregates (Per Second)", + "description": "Stream real-time per-second crypto aggregates for a given crypto pair.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs.\nYou can also use a comma separated list to subscribe to multiple crypto pairs.\nYou can retrieve active crypto tickers from our [Crypto Tickers API](https://polygon.io/docs/crypto/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(?([A-Z]*)-(?[A-Z]{3}))$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a crypto per-second aggregate event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "XAS" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The crypto pair." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The high price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The low price for this aggregate window." + }, + "v": { + "type": "integer", + "description": "The volume of trades during this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + }, + "vw": { + "type": "number", + "format": "double", + "description": "The volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + } + } + }, + "example": { + "ev": "XAS", + "pair": "BCD-USD", + "v": 951.6112, + "vw": 0.7756, + "z": 73, + "o": 0.772, + "c": 0.784, + "h": 0.784, + "l": 0.771, + "s": 1610463240000, + "e": 1610463300000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "x-polygon-entitlement-market-type": { + "name": "crypto", + "description": "Crypto data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/business/crypto/FMV": { + "get": { + "summary": "Fair Market Value", + "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", + "fmv": 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)", + "description": "Stream real-time per-minute crypto aggregates for a given crypto pair.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify a crypto pair in the format {from}-{to} or use * to subscribe to all crypto pairs.\nYou can also use a comma separated list to subscribe to multiple crypto pairs.\nYou can retrieve active crypto tickers from our [Crypto Tickers API](https://polygon.io/docs/crypto/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(?([A-Z]*)-(?[A-Z]{3}))$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a minute aggregate event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The volume-weighted average value for the aggregate window." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for the symbol in the given time period." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for the symbol in the given time period." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest price for the symbol in the given time period." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest price for the symbol in the given time period." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "example": { + "ev": "AM", + "sym": "X:BTC-USD", + "v": 951.6112, + "av": 738.6112, + "op": 26503.8, + "vw": 26503.8, + "o": 27503.8, + "c": 27203.8, + "h": 27893.8, + "l": 26503.8, + "a": 26503.8, + "z": 10, + "s": 1610463240000, + "e": 1610463300000 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "x-polygon-entitlement-market-type": { + "name": "crypto", + "description": "Crypto data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "delayed", + "description": "15 minute delayed data" + }, + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/launchpad/crypto/LV": { + "get": { + "summary": "Value", + "description": "Real-time 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 value event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "LV" + ], + "description": "The event type." + }, + "val": { + "description": "The current value of the security." + }, + "sym": { + "description": "The ticker symbol for the given security." + }, + "t": { + "description": "The nanosecond timestamp." + } + } + }, + "example": { + "ev": "LV", + "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" + } + ] + } + }, + "/indices/A": { + "get": { + "summary": "Aggregates (Per Second)", + "description": "Stream real-time second aggregates for a given index ticker symbol.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify an index ticker using \"I:\" prefix or use * to subscribe to all index tickers.\nYou can also use a comma separated list to subscribe to multiple index tickers.\nYou can retrieve available index tickers from our [Index Tickers API](https://polygon.io/docs/indices/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(I:[a-zA-Z0-9]+)$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a second aggregate event.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The symbol representing the given index." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening value." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening index value for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing index value for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest index value for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest index value for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "A" + ], + "description": "The event type." + } + } + } + ] + }, + "example": { + "ev": "A", + "sym": "I:SPX", + "op": 3985.67, + "o": 3985.67, + "c": 3985.67, + "h": 3985.67, + "l": 3985.67, + "s": 1678220675805, + "e": 1678220675805 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "x-polygon-entitlement-market-type": { + "name": "indices", + "description": "Indices data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "delayed", + "description": "15 minute delayed data" + }, + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/indices/AM": { + "get": { + "summary": "Aggregates (Per Minute)", + "description": "Stream real-time minute aggregates for a given index ticker symbol.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify an index ticker using \"I:\" prefix or use * to subscribe to all index tickers.\nYou can also use a comma separated list to subscribe to multiple index tickers.\nYou can retrieve available index tickers from our [Index Tickers API](https://polygon.io/docs/indices/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(I:[a-zA-Z0-9]+)$/" + }, + "example": "*" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a minute aggregate event.", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The symbol representing the given index." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening value." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening index value for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing index value for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest index value for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest index value for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "AM" + ], + "description": "The event type." + } + } + } + ] + }, + "example": { + "ev": "AM", + "sym": "I:SPX", + "op": 3985.67, + "o": 3985.67, + "c": 3985.67, + "h": 3985.67, + "l": 3985.67, + "s": 1678220675805, + "e": 1678220675805 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "aggregates", + "description": "Aggregate data" + }, + "x-polygon-entitlement-market-type": { + "name": "indices", + "description": "Indices data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "delayed", + "description": "15 minute delayed data" + }, + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + }, + "/indices/V": { + "get": { + "summary": "Value", + "description": "Real-time value for a given index ticker symbol.\n", + "parameters": [ + { + "name": "ticker", + "in": "query", + "description": "Specify an index ticker using \"I:\" prefix or use * to subscribe to all index tickers.\nYou can also use a comma separated list to subscribe to multiple index tickers.\nYou can retrieve available index tickers from our [Index Tickers API](https://polygon.io/docs/indices/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(I:[a-zA-Z0-9]+)$/" + }, + "example": "I:SPX" + } + ], + "responses": { + "200": { + "description": "The WebSocket message for a value event.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "V" + ], + "description": "The event type." + }, + "val": { + "description": "The value of the index." + }, + "T": { + "description": "The assigned ticker of the index." + }, + "t": { + "description": "The Timestamp in Unix MS." + } + } + }, + "example": { + "ev": "V", + "val": 3988.5, + "T": "I:SPX", + "t": 1678220098130 + } + } + } + } + }, + "x-polygon-entitlement-data-type": { + "name": "value", + "description": "Value data" + }, + "x-polygon-entitlement-market-type": { + "name": "indices", + "description": "Indices data" + }, + "x-polygon-entitlement-allowed-timeframes": [ + { + "name": "delayed", + "description": "15 minute delayed data" + }, + { + "name": "realtime", + "description": "Real Time Data" + } + ] + } + } + }, + "components": { + "schemas": { + "Event": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "status" + ], + "description": "A constant denoting that this message describes a status event." + }, + "message": { + "type": "string", + "description": "The descriptive message explaining this status event." + }, + "status": { + "type": "string" + } + } + }, + "ConnectEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "enum": [ + "status" + ], + "description": "A constant denoting that this message describes a status event." + }, + "message": { + "type": "string", + "description": "The descriptive message explaining this status event." + }, + "status": { + "type": "string" + } + } + }, + { + "title": "connect", + "properties": { + "status": { + "enum": [ + "success" + ], + "description": "The status indicating that the connection event was successful." + } + }, + "example": "{\"ev\":\"status\",\"status\":\"success\",\"message\":\"Connected Successfully\"}" + } + ] + }, + "DisconnectEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "enum": [ + "status" + ], + "description": "A constant denoting that this message describes a status event." + }, + "message": { + "type": "string", + "description": "The descriptive message explaining this status event." + }, + "status": { + "type": "string" + } + } + }, + { + "title": "disconnect", + "properties": { + "status": { + "enum": [ + "max_connections", + "force_disconnect", + "slow_consumer" + ], + "description": "The event that caused the WebSocket to disconnect." + } + }, + "example": "{\"ev\":\"status\",\"status\":\"max_connections\",\"message\":\"Maximum number of connections exceeded.\"}" + } + ] + }, + "AuthEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "enum": [ + "status" + ], + "description": "A constant denoting that this message describes a status event." + }, + "message": { + "type": "string", + "description": "The descriptive message explaining this status event." + }, + "status": { + "type": "string" + } + } + }, + { + "title": "auth", + "properties": { + "status": { + "enum": [ + "auth_success", + "auth_timeout", + "auth_failed" + ], + "description": "The result of the authentication action." + } + }, + "example": "{\"ev\":\"status\",\"status\":\"auth_success\",\"message\":\"authenticated\"}" + } + ] + }, + "SubscribeEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "enum": [ + "status" + ], + "description": "A constant denoting that this message describes a status event." + }, + "message": { + "type": "string", + "description": "The descriptive message explaining this status event." + }, + "status": { + "type": "string" + } + } + }, + { + "title": "subscribe", + "properties": { + "status": { + "enum": [ + "success", + "auth_required", + "error" + ], + "description": "The result of a subscribe action." + } + }, + "example": "{\"ev\":\"status\",\"status\":\"success\",\"message\":\"subscribed to: T.MSFT\"}" + } + ] + }, + "UnsubscribeEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "enum": [ + "status" + ], + "description": "A constant denoting that this message describes a status event." + }, + "message": { + "type": "string", + "description": "The descriptive message explaining this status event." + }, + "status": { + "type": "string" + } + } + }, + { + "title": "unsubscribe", + "properties": { + "status": { + "enum": [ + "success" + ], + "description": "The result of an unsubscribe action." + } + }, + "example": "{\"ev\":\"status\",\"status\":\"success\",\"message\":\"unsubscribed to: T.MSFT\"}" + } + ] + }, + "Timestamp": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "AggsOpen": { + "type": "number", + "format": "double", + "description": "The open price for this aggregate window." + }, + "AggsClose": { + "type": "number", + "format": "double", + "description": "The close price for this aggregate window." + }, + "AggsHigh": { + "type": "number", + "format": "double", + "description": "The high price for this aggregate window." + }, + "AggsLow": { + "type": "number", + "format": "double", + "description": "The low price for this aggregate window." + }, + "AggsVolume": { + "type": "integer", + "description": "The volume of trades during this aggregate window." + }, + "AggsStartTime": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "AggsEndTime": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + }, + "StockTradeEvent": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "T" + ], + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "x": { + "type": "integer", + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "i": { + "type": "string", + "description": "The trade ID." + }, + "z": { + "type": "integer", + "description": "The tape. (1 = NYSE, 2 = AMEX, 3 = Nasdaq).\n" + }, + "p": { + "type": "number", + "format": "double", + "description": "The price." + }, + "s": { + "type": "integer", + "description": "The trade size." + }, + "c": { + "type": "array", + "description": "The trade conditions. See Conditions and Indicators for Polygon.io's trade conditions glossary.\n", + "items": { + "type": "integer", + "description": "The ID of the condition." + } + }, + "t": { + "type": "integer", + "description": "The SIP timestamp in Unix MS." + }, + "q": { + "type": "integer", + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n" + }, + "trfi": { + "type": "integer", + "description": "The ID for the Trade Reporting Facility where the trade took place." + }, + "trft": { + "type": "integer", + "description": "The TRF (Trade Reporting Facility) Timestamp in Unix MS. \nThis is the timestamp of when the trade reporting facility received this trade.\n" + } + } + }, + "StockQuoteEvent": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "Q" + ], + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "bx": { + "type": "integer", + "description": "The bid exchange ID." + }, + "bp": { + "type": "number", + "format": "double", + "description": "The bid price." + }, + "bs": { + "type": "integer", + "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." + }, + "ax": { + "type": "integer", + "description": "The ask exchange ID." + }, + "ap": { + "type": "number", + "format": "double", + "description": "The ask price." + }, + "as": { + "type": "integer", + "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." + }, + "c": { + "type": "integer", + "description": "The condition." + }, + "i": { + "type": "array", + "description": "The indicators. For more information, see our glossary of [Conditions and\nIndicators](https://polygon.io/glossary/us/stocks/conditions-indicators).\n", + "items": { + "type": "integer", + "description": "The indicator code.\n" + } + }, + "t": { + "type": "integer", + "description": "The SIP timestamp in Unix MS." + }, + "q": { + "type": "integer", + "description": "The sequence number represents the sequence in which quote events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11). Values reset after each trading session/day.\n" + }, + "z": { + "type": "integer", + "description": "The tape. (1 = NYSE, 2 = AMEX, 3 = Nasdaq)." + } + } + }, + "StockBaseAggregateEvent": { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The tick's volume weighted average price." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening tick price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing tick price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest tick price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest tick price for this aggregate window." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + }, + "otc": { + "type": "boolean", + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false." + } + } + }, + "StockSecondAggregateEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The tick's volume weighted average price." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening tick price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing tick price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest tick price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest tick price for this aggregate window." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + }, + "otc": { + "type": "boolean", + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "A" + ], + "description": "The event type." + } + } + } + ] + }, + "StockMinuteAggregateEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The tick's volume weighted average price." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening tick price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing tick price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest tick price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest tick price for this aggregate window." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + }, + "otc": { + "type": "boolean", + "description": "Whether or not this aggregate is for an OTC ticker. This field will be left off if false." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "AM" + ], + "description": "The event type." + } + } + } + ] + }, + "StockLULDEvent": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "LULD" + ], + "description": "The event type." + }, + "T": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "h": { + "type": "number", + "format": "double", + "description": "The high price." + }, + "l": { + "type": "number", + "format": "double", + "description": "The low price." + }, + "i": { + "type": "array", + "description": "The Indicators.", + "items": { + "type": "integer" + } + }, + "z": { + "type": "integer", + "description": "The tape. (1 = NYSE, 2 = AMEX, 3 = Nasdaq).\n" + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "q": { + "type": "integer", + "description": "The sequence number represents the sequence in which message events happened.\nThese are increasing and unique per ticker symbol, but will not always be\nsequential (e.g., 1, 2, 6, 9, 10, 11).\n" + } + } + }, + "StockImbalanceEvent": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "NOI" + ], + "description": "The event type." + }, + "T": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "at": { + "type": "integer", + "description": "The time that the auction is planned to take place in the format (hour x 100) + minutes in Eastern Standard Time, \nfor example 930 would be 9:30 am EST, and 1600 would be 4:00 pm EST.\n" + }, + "a": { + "type": "string", + "description": "The auction type.\n`O` - Early Opening Auction (non-NYSE only)\n`M` - Core Opening Auction\n`H` - Reopening Auction (Halt Resume)\n`C` - Closing Auction\n`P` - Extreme Closing Imbalance (NYSE only)\n`R` - Regulatory Closing Imbalance (NYSE only)\n" + }, + "i": { + "type": "integer", + "description": "The symbol sequence." + }, + "x": { + "type": "integer", + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "o": { + "type": "integer", + "description": "The imbalance quantity." + }, + "p": { + "type": "integer", + "description": "The paired quantity." + }, + "b": { + "type": "number", + "format": "double", + "description": "The book clearing price." + } + } + }, + "StockSymbol": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "StockTape": { + "type": "integer", + "description": "The tape. (1 = NYSE, 2 = AMEX, 3 = Nasdaq).\n" + }, + "StockExchangeID": { + "type": "integer", + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "OptionTradeEvent": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "T" + ], + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given option contract." + }, + "x": { + "type": "integer", + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "p": { + "type": "number", + "format": "double", + "description": "The price." + }, + "s": { + "type": "integer", + "description": "The trade size." + }, + "c": { + "type": "array", + "description": "The trade conditions", + "items": { + "type": "integer", + "description": "The ID of the condition." + } + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "q": { + "type": "integer", + "description": "The sequence number represents the sequence in which trade events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11)." + } + } + }, + "OptionQuoteEvent": { + "type": "object", + "properties": { + "ev": { + "enum": [ + "Q" + ], + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given option contract." + }, + "bx": { + "type": "integer", + "description": "The bid exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "ax": { + "type": "integer", + "description": "The ask exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "bp": { + "type": "number", + "format": "double", + "description": "The bid price." + }, + "ap": { + "type": "number", + "format": "double", + "description": "The ask price." + }, + "bs": { + "type": "integer", + "description": "The bid size." + }, + "as": { + "type": "integer", + "description": "The ask size." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "q": { + "type": "integer", + "description": "The sequence number represents the sequence in which trade events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11)." + } + } + }, + "OptionBaseAggregateEvent": { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given option contract." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The tick's volume weighted average price." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening tick price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing tick price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest tick price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest tick price for this aggregate window." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "OptionSecondAggregateEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given option contract." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The tick's volume weighted average price." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening tick price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing tick price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest tick price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest tick price for this aggregate window." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "A" + ], + "description": "The event type." + } + } + } + ] + }, + "OptionMinuteAggregateEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given option contract." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The tick's volume weighted average price." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening tick price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing tick price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest tick price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest tick price for this aggregate window." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "AM" + ], + "description": "The event type." + } + } + } + ] + }, + "OptionSymbol": { + "type": "string", + "description": "The ticker symbol for the given option contract." + }, + "ForexBaseQuoteEvent": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "description": "The event type." + }, + "p": { + "type": "string", + "description": "The current pair." + }, + "x": { + "type": "integer", + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "a": { + "type": "number", + "format": "double", + "description": "The ask price." + }, + "b": { + "type": "number", + "format": "double", + "description": "The bid price." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + } + } + }, + "ForexQuoteEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "type": "string", + "description": "The event type." + }, + "p": { + "type": "string", + "description": "The current pair." + }, + "x": { + "type": "integer", + "description": "The exchange ID. See Exchanges for Polygon.io's mapping of exchange IDs." + }, + "a": { + "type": "number", + "format": "double", + "description": "The ask price." + }, + "b": { + "type": "number", + "format": "double", + "description": "The bid price." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "C" + ], + "description": "The event type." + } + } + } + ] + }, + "ForexMinuteAggregateEvent": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "CA" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The currency pair." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The high price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The low price for this aggregate window." + }, + "v": { + "type": "integer", + "description": "The volume of trades during this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "ForexSecondAggregateEvent": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "CAS" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The currency pair." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The high price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The low price for this aggregate window." + }, + "v": { + "type": "integer", + "description": "The volume of trades during this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "CryptoQuoteEvent": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "XQ" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The crypto pair." + }, + "bp": { + "type": "number", + "format": "double", + "description": "The bid price." + }, + "bs": { + "type": "number", + "format": "double", + "description": "The bid size." + }, + "ap": { + "type": "number", + "format": "double", + "description": "The ask price." + }, + "as": { + "type": "number", + "format": "double", + "description": "The ask size." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "x": { + "type": "integer", + "description": "The crypto exchange ID. See Exchanges for a list of exchanges and their IDs.\n" + }, + "r": { + "type": "integer", + "description": "The timestamp that the tick was received by Polygon." + } + } + }, + "CryptoTradeEvent": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "XT" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The crypto pair." + }, + "p": { + "type": "number", + "format": "double", + "description": "The price." + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "s": { + "type": "number", + "format": "double", + "description": "The size." + }, + "c": { + "type": "array", + "description": "The conditions.\n0 (or empty array): empty\n1: sellside\n2: buyside\n", + "items": { + "type": "integer", + "description": "The ID of the condition." + } + }, + "i": { + "type": "integer", + "description": "The ID of the trade (optional)." + }, + "x": { + "type": "integer", + "description": "The crypto exchange ID. See Exchanges for a list of exchanges and their IDs.\n" + }, + "r": { + "type": "integer", + "description": "The timestamp that the tick was received by Polygon." + } + } + }, + "CryptoMinuteAggregateEvent": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "XA" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The crypto pair." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The high price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The low price for this aggregate window." + }, + "v": { + "type": "integer", + "description": "The volume of trades during this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + }, + "vw": { + "type": "number", + "format": "double", + "description": "The volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + } + } + }, + "CryptoSecondAggregateEvent": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "XAS" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The crypto pair." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The high price for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The low price for this aggregate window." + }, + "v": { + "type": "integer", + "description": "The volume of trades during this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + }, + "vw": { + "type": "number", + "format": "double", + "description": "The volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + } + } + }, + "CryptoL2BookEvent": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "XL2" + ], + "description": "The event type." + }, + "pair": { + "type": "string", + "description": "The crypto pair." + }, + "b": { + "type": "array", + "description": "An array of bid prices, where each entry contains two elements: the first is the bid price, and the second is the size, with a maximum depth of 100.", + "items": { + "type": "array", + "description": "An array where the first item is bid price and the second item is size.", + "items": { + "type": "number", + "format": "double" + } + } + }, + "a": { + "type": "array", + "description": "An array of ask prices, where each entry contains two elements: the first is the ask price, and the second is the size, with a maximum depth of 100.", + "items": { + "type": "array", + "description": "An array where the first item is ask price and the second item is size.", + "items": { + "type": "number", + "format": "double" + } + } + }, + "t": { + "type": "integer", + "description": "The Timestamp in Unix MS." + }, + "x": { + "type": "integer", + "description": "The crypto exchange ID. See Exchanges for a list of exchanges and their IDs.\n" + }, + "r": { + "type": "integer", + "description": "The timestamp that the tick was received by Polygon." + } + } + }, + "CryptoPair": { + "type": "string", + "description": "The crypto pair." + }, + "CryptoExchangeID": { + "type": "integer", + "description": "The crypto exchange ID. See Exchanges for a list of exchanges and their IDs.\n" + }, + "CryptoReceivedTimestamp": { + "type": "integer", + "description": "The timestamp that the tick was received by Polygon." + }, + "IndicesBaseAggregateEvent": { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The symbol representing the given index." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening value." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening index value for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing index value for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest index value for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest index value for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "IndicesMinuteAggregateEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The symbol representing the given index." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening value." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening index value for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing index value for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest index value for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest index value for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "AM" + ], + "description": "The event type." + } + } + } + ] + }, + "IndicesSecondAggregateEvent": { + "allOf": [ + { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The symbol representing the given index." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening value." + }, + "o": { + "type": "number", + "format": "double", + "description": "The opening index value for this aggregate window." + }, + "c": { + "type": "number", + "format": "double", + "description": "The closing index value for this aggregate window." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest index value for this aggregate window." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest index value for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + { + "properties": { + "ev": { + "enum": [ + "A" + ], + "description": "The event type." + } + } + } + ] + }, + "IndicesValueEvent": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "V" + ], + "description": "The event type." + }, + "val": { + "description": "The value of the index." + }, + "T": { + "description": "The assigned ticker of the index." + }, + "t": { + "description": "The Timestamp in Unix MS." + } + } + }, + "LaunchpadWebsocketMinuteAggregateEvent": { + "type": "object", + "properties": { + "ev": { + "description": "The event type." + }, + "sym": { + "type": "string", + "description": "The ticker symbol for the given stock." + }, + "v": { + "type": "integer", + "description": "The tick volume." + }, + "av": { + "type": "integer", + "description": "Today's accumulated volume." + }, + "op": { + "type": "number", + "format": "double", + "description": "Today's official opening price." + }, + "vw": { + "type": "number", + "format": "float", + "description": "The volume-weighted average value for the aggregate window." + }, + "o": { + "type": "number", + "format": "double", + "description": "The open price for the symbol in the given time period." + }, + "c": { + "type": "number", + "format": "double", + "description": "The close price for the symbol in the given time period." + }, + "h": { + "type": "number", + "format": "double", + "description": "The highest price for the symbol in the given time period." + }, + "l": { + "type": "number", + "format": "double", + "description": "The lowest price for the symbol in the given time period." + }, + "a": { + "type": "number", + "format": "float", + "description": "Today's volume weighted average price." + }, + "z": { + "type": "integer", + "description": "The average trade size for this aggregate window." + }, + "s": { + "type": "integer", + "description": "The start timestamp of this aggregate window in Unix Milliseconds." + }, + "e": { + "type": "integer", + "description": "The end timestamp of this aggregate window in Unix Milliseconds." + } + } + }, + "LaunchpadWebsocketValueEvent": { + "type": "object", + "properties": { + "ev": { + "type": "string", + "enum": [ + "LV" + ], + "description": "The event type." + }, + "val": { + "description": "The current value of the security." + }, + "sym": { + "description": "The ticker symbol for the given security." + }, + "t": { + "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": { + "StocksTickerParam": { + "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": "*" + }, + "OptionsTickerParam": { + "name": "ticker", + "in": "query", + "description": "Specify an option contract or use * to subscribe to all option contracts.\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": "*" + }, + "OptionsTickerWithoutWildcardParam": { + "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" + }, + "ForexTickerParam": { + "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": "*" + }, + "CryptoTickerParam": { + "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": "*" + }, + "IndicesIndexParam": { + "name": "ticker", + "in": "query", + "description": "Specify an index ticker using \"I:\" prefix or use * to subscribe to all index tickers.\nYou can also use a comma separated list to subscribe to multiple index tickers.\nYou can retrieve available index tickers from our [Index Tickers API](https://polygon.io/docs/indices/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(I:[a-zA-Z0-9]+)$/" + }, + "example": "*" + }, + "IndicesIndexParamWithoutWildcard": { + "name": "ticker", + "in": "query", + "description": "Specify an index ticker using \"I:\" prefix or use * to subscribe to all index tickers.\nYou can also use a comma separated list to subscribe to multiple index tickers.\nYou can retrieve available index tickers from our [Index Tickers API](https://polygon.io/docs/indices/get_v3_reference_tickers).\n", + "required": true, + "schema": { + "type": "string", + "pattern": "/^(I:[a-zA-Z0-9]+)$/" + }, + "example": "I:SPX" + } + } + } +} diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..7e83cd34 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,11 @@ +# https://docs.readthedocs.io/en/latest/config-file/index.html#configuration-file +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/source/conf.py + +python: + install: + - requirements: docs/requirements.txt + diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..03f609ba --- /dev/null +++ b/Makefile @@ -0,0 +1,49 @@ +.DEFAULT_GOAL := help +TARGET_MAX_CHAR_NUM := 20 + +GREEN := $(shell tput -Txterm setaf 2) +YELLOW := $(shell tput -Txterm setaf 3) +WHITE := $(shell tput -Txterm setaf 7) +RESET := $(shell tput -Txterm sgr0) + +.PHONY: help lint style static test test_rest test_websocket + +## Show help +help: + @awk '/^[a-zA-Z\-_0-9]+:/ { \ + helpMessage = match(lastLine, /^## (.*)/); \ + if (helpMessage) { \ + helpCommand = substr($$1, 0, index($$1, ":")-1); \ + helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \ + printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} ${GREEN}%s${RESET}\n", helpCommand, helpMessage; \ + } \ + } \ + { lastLine = $$0 }' $(MAKEFILE_LIST) + +## Check code style +style: + poetry run black $(if $(CI),--check,) polygon test_* examples + +## Check static types +static: + poetry run mypy polygon test_* examples + +## Check code style and static types +lint: style static + +## Update the REST API spec +rest-spec: + poetry run python .polygon/rest.py + +## Update the WebSocket API spec +ws-spec: + curl https://api.polygon.io/specs/websocket.json > .polygon/websocket.json + +test_rest: + poetry run python -m unittest discover -s test_rest + +test_websocket: + poetry run python -m unittest discover -s test_websocket + +## Run the unit tests +test: test_rest test_websocket diff --git a/README.md b/README.md index 6a1636e1..aaf7bb5f 100644 --- a/README.md +++ b/README.md @@ -1,115 +1,204 @@ -[![Build Status](https://drone.polygon.io/api/badges/polygon-io/client-python/status.svg)](https://drone.polygon.io/polygon-io/client-python) [![PyPI version](https://badge.fury.io/py/polygon-api-client.svg)](https://badge.fury.io/py/polygon-api-client) +[![Docs](https://readthedocs.org/projects/polygon-api-client/badge/?version=latest)](https://polygon-api-client.readthedocs.io/en/latest/) # Polygon Python Client - WebSocket & RESTful APIs -Python client for the Polygon.io [Stocks API](https://polygon.io) +Welcome to the official Python client library for the [Polygon](https://polygon.io/) REST and WebSocket API. To get started, please see the [Getting Started](https://polygon.io/docs/stocks/getting-started) section in our documentation, view the [examples](./examples/) directory for code snippets, or the [blog post](https://polygon.io/blog/polygon-io-with-python-for-stock-market-data/) with video tutorials to learn more. -## Getting Started +## Prerequisites -For a basic product overview, check out our [setup and use documentation](https://polygon.io/sockets) +Before installing the Polygon Python client, ensure your environment has Python 3.8 or higher. -### Install +## Install -`pip install polygon-api-client` - -`polygon-api-client` supports python version >= 3.6 +Please use pip to install or update to the latest stable version. +``` +pip install -U polygon-api-client +``` -## Simple WebSocket Demo -```python -import time +## Getting started -from polygon import WebSocketClient, STOCKS_CLUSTER +To get started, please see the [Getting Started](https://polygon-api-client.readthedocs.io/en/latest/Getting-Started.html) section in our docs, view the [examples](./examples) directory for code snippets, or view the [blog post with videos](https://polygon.io/blog/polygon-io-with-python-for-stock-market-data/) to learn more. +The free tier of our API comes with usage limitations, potentially leading to rate limit errors if these are exceeded. For uninterrupted access and to support larger data requirements, we recommend reviewing our [subscription plans](https://polygon.io/pricing), which are tailored for a wide range of needs from development to high-demand applications. Refer to our pricing page for detailed information on limits and features to ensure a seamless experience, especially for real-time data processing. -def my_custom_process_message(message): - print("this is my custom message processing", message) +## REST API Client +Import the RESTClient. +```python +from polygon import RESTClient +``` +Create a new client with your [API key](https://polygon.io/dashboard/api-keys) +```python +client = RESTClient(api_key="") +``` +### Using the Client +Request data using client methods. +```python +ticker = "AAPL" +# List Aggregates (Bars) +aggs = [] +for a in client.list_aggs(ticker=ticker, multiplier=1, timespan="minute", from_="2023-01-01", to="2023-06-13", limit=50000): + aggs.append(a) -def my_custom_error_handler(ws, error): - print("this is my custom error handler", error) +print(aggs) +# Get Last Trade +trade = client.get_last_trade(ticker=ticker) +print(trade) -def my_custom_close_handler(ws): - print("this is my custom close handler") +# List Trades +trades = client.list_trades(ticker=ticker, timestamp="2022-01-04") +for trade in trades: + print(trade) +# Get Last Quote +quote = client.get_last_quote(ticker=ticker) +print(quote) -def main(): - key = 'your api key' - my_client = WebSocketClient(STOCKS_CLUSTER, key, my_custom_process_message) - my_client.run_async() +# List Quotes +quotes = client.list_quotes(ticker=ticker, timestamp="2022-01-04") +for quote in quotes: + print(quote) +``` - my_client.subscribe("T.MSFT", "T.AAPL", "T.AMD", "T.NVDA") - time.sleep(1) +### Additional Filter Parameters - my_client.close_connection() +Many of the APIs in this client library support the use of additional filter parameters to refine your queries. Please refer to the specific API documentation for details on which filter parameters are supported for each endpoint. These filters can be applied using the following operators: +- `.gt`: greater than +- `.gte`: greater than or equal to +- `.lt`: less than +- `.lte`: less than or equal to -if __name__ == "__main__": - main() -``` +Here's a sample code snippet that demonstrates how to use these filter parameters when requesting an Options Chain using the `list_snapshot_options_chain` method. In this example, the filter parameters ensure that the returned options chain data will only include options with an expiration date that is greater than or equal to "2024-03-16" and a strike price that falls between 29 and 30 (inclusive). -## Simple REST Demo ```python -from polygon import RESTClient +options_chain = [] +for o in client.list_snapshot_options_chain( + "HCP", + params={ + "expiration_date.gte": "2024-03-16", + "strike_price.gte": 29, + "strike_price.lte": 30, + }, +): + options_chain.append(o) + +print(options_chain) +print(len(options_chain)) +``` +Also, please refer to the API documentation to get a full understanding of how the API works and the supported arguments. All required arguments are annotated with red asterisks " * " and argument examples are set. -def main(): - key = "your api key" +## Debugging with RESTClient - # RESTClient can be used as a context manager to facilitate closing the underlying http session - # https://requests.readthedocs.io/en/master/user/advanced/#session-objects - with RESTClient(key) as client: - resp = client.stocks_equities_daily_open_close("AAPL", "2021-06-11") - print(f"On: {resp.from_} Apple opened at {resp.open} and closed at {resp.close}") +Sometimes you may find it useful to see the actual request and response details while working with the API. The `RESTClient` allows for this through its `trace=True` option. +### How to Enable Debug Mode -if __name__ == '__main__': - main() +You can activate the debug mode as follows: +```python +client = RESTClient(trace=True) ``` -### Query parameters for REST calls +### What Does Debug Mode Do? + +When debug mode is enabled, the client will print out useful debugging information for each API request. This includes: the request URL, the headers sent in the request, and the headers received in the response. + +### Example Output + +For instance, if you made a request for `TSLA` data for the date `2023-08-01`, you would see debug output similar to the following: + +``` +Request URL: https://api.polygon.io/v2/aggs/ticker/TSLA/range/1/minute/2023-08-01/2023-08-01?limit=50000 +Request Headers: {'Authorization': 'Bearer REDACTED', 'Accept-Encoding': 'gzip', 'User-Agent': 'Polygon.io PythonClient/1.12.4'} +Response Headers: {'Server': 'nginx/1.19.2', 'Date': 'Tue, 05 Sep 2023 23:07:02 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Content-Encoding': 'gzip', 'Vary': 'Accept-Encoding', 'X-Request-Id': '727c82feed3790b44084c3f4cae1d7d4', 'Strict-Transport-Security': 'max-age=15724800; includeSubDomains'} +``` -Every function call under our RESTClient has the `query_params` kwargs. These kwargs are passed along and mapped 1:1 -as query parameters to the underling HTTP call. For more information on the different query parameters please reference -our [API Docs](https://polygon.io/docs/). +This can be an invaluable tool for debugging issues or understanding how the client interacts with the API. -#### Example with query parameters +## WebSocket Client +Import classes ```python -import datetime +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage +from typing import List +``` +### Using the client +Create a new client with your [API key](https://polygon.io/dashboard/api-keys) and subscription options. +```python +# Note: Multiple subscriptions can be added to the array +# For example, if you want to subscribe to AAPL and META, +# you can do so by adding "T.META" to the subscriptions array. ["T.AAPL", "T.META"] +# If you want to subscribe to all tickers, place an asterisk in place of the symbol. ["T.*"] +ws = WebSocketClient(api_key=, subscriptions=["T.AAPL"]) +``` +Create a handler function and run the WebSocket. +```python +def handle_msg(msg: List[WebSocketMessage]): + for m in msg: + print(m) -from polygon import RESTClient +ws.run(handle_msg=handle_msg) +``` +Check out more detailed examples [here](https://github.com/polygon-io/client-python/tree/master/examples/websocket). +## Contributing -def ts_to_datetime(ts) -> str: - return datetime.datetime.fromtimestamp(ts / 1000.0).strftime('%Y-%m-%d %H:%M') +If you found a bug or have an idea for a new feature, please first discuss it with us by +[submitting a new issue](https://github.com/polygon-io/client-python/issues/new/choose). +We will respond to issues within at most 3 weeks. +We're also open to volunteers if you want to submit a PR for any open issues but +please discuss it with us beforehand. PRs that aren't linked to an existing issue or +discussed with us ahead of time will generally be declined. If you have more general +feedback or want to discuss using this client with other users, feel free to reach out +on our [Slack channel](https://polygon-io.slack.com/archives/C03FRFN7UF3). +### Development -def main(): - key = "your api key" +If you plan to contribute by developing new features then you will need to install certain dependencies. - # RESTClient can be used as a context manager to facilitate closing the underlying http session - # https://requests.readthedocs.io/en/master/user/advanced/#session-objects - with RESTClient(key) as client: - from_ = "2021-01-01" - to = "2021-02-01" - resp = client.stocks_equities_aggregates("AAPL", 1, "minute", from_, to, unadjusted=False) +#### Poetry - print(f"Minute aggregates for {resp.ticker} between {from_} and {to}.") +Poetry is a packaging and dependency manager for Python. +Installation instructions can be found [on their website](https://python-poetry.org/docs/#installation). +Once installed run `poetry install` to install the required dependencies. This step should be run after incorporating new upstream changes. - for result in resp.results: - dt = ts_to_datetime(result["t"]) - print(f"{dt}\n\tO: {result['o']}\n\tH: {result['h']}\n\tL: {result['l']}\n\tC: {result['c']} ") +#### Makefile +Our Makefile has the common operations needed when developing on this repo. Running tests and linting can both be +run through our Makefile. Just run `make help` to see the list of available commands. -if __name__ == '__main__': - main() -``` +If you're using `pyenv` to manage active Python versions then you might need to launch a Poetry shell before running +Make commands in order to actually use your chosen Python version. This is because Poetry uses the system Python version +by default. -## Notes about the REST Client +```shell +poetry shell # start shell +poetry install # install deps -We use swagger as our API spec and we used this swagger to generate most of the code that defines the REST client. -We made this decision due to the size of our API, many endpoints and object definitions, and to accommodate future changes. +make test # run your make commands +``` +## Release planning +This client will attempt to follow the release cadence of our API. +When endpoints are deprecated and newer versions are added, the client will +maintain two methods in a backwards compatible way +(e.g. `list_trades` and `list_trades_v4(...)`). +When deprecated endpoints are removed from the API, we'll rename the versioned +method (e.g. `list_trades_v4(...)` -> `list_trades(...)`), remove the old method, +and release a new major version of the client. + +The goal is to give users ample time to upgrade to newer versions of our API +_before_ we bump the major version of the client, and in general, we'll try to +bundle breaking changes like this to avoid frequent major version bumps. + +Exceptions to this are: + +- Methods under `client.vx`. These are expiremental. +- Methods that start with `_*`. We use these internally. +- Type annotations. We may modify these based on our JSON responses. +- We may add model fields. diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..bed4efb2 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..e8c712fd --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,2 @@ +sphinx-autodoc-typehints~=1.19.2 +websockets~=10.3 diff --git a/docs/source/Aggs.rst b/docs/source/Aggs.rst new file mode 100644 index 00000000..921166e9 --- /dev/null +++ b/docs/source/Aggs.rst @@ -0,0 +1,72 @@ +.. _aggs_header: + +Aggs +========== + +=========== +List aggs +=========== + +- `Stocks aggs`_ +- `Options aggs`_ +- `Forex aggs`_ +- `Crypto aggs`_ + +.. automethod:: polygon.RESTClient.list_aggs + +=========== +Get aggs +=========== + +- `Stocks aggs`_ +- `Options aggs`_ +- `Forex aggs`_ +- `Crypto aggs`_ + +.. automethod:: polygon.RESTClient.get_aggs + +============================ +Get grouped daily aggs +============================ + +- `Stocks grouped daily aggs`_ +- `Forex grouped daily aggs`_ +- `Crypto grouped daily aggs`_ + +.. automethod:: polygon.RESTClient.get_grouped_daily_aggs + +============================ +Get daily open close agg +============================ + +- `Stocks daily open/close agg`_ +- `Options daily open/close agg`_ +- `Crypto daily open/close agg`_ + +.. automethod:: polygon.RESTClient.get_daily_open_close_agg + +============================ +Get previous close agg +============================ + +- `Stocks previous close agg`_ +- `Options previous close agg`_ +- `Forex previous close agg`_ +- `Crypto previous close agg`_ + +.. automethod:: polygon.RESTClient.get_previous_close_agg + +.. _Stocks aggs: https://polygon.io/docs/stocks/get_v2_aggs_ticker__stocksticker__range__multiplier___timespan___from___to +.. _Options aggs: https://polygon.io/docs/options/get_v2_aggs_ticker__optionsticker__range__multiplier___timespan___from___to +.. _Forex aggs: https://polygon.io/docs/forex/get_v2_aggs_ticker__forexticker__range__multiplier___timespan___from___to +.. _Crypto aggs: https://polygon.io/docs/crypto/get_v2_aggs_ticker__cryptoticker__range__multiplier___timespan___from___to +.. _Stocks grouped daily aggs: https://polygon.io/docs/stocks/get_v2_aggs_grouped_locale_us_market_stocks__date +.. _Forex grouped daily aggs: https://polygon.io/docs/forex/get_v2_aggs_grouped_locale_global_market_fx__date +.. _Crypto grouped daily aggs: https://polygon.io/docs/crypto/get_v2_aggs_grouped_locale_global_market_crypto__date +.. _Stocks daily open/close agg: https://polygon.io/docs/stocks/get_v1_open-close__stocksticker___date +.. _Options daily open/close agg: https://polygon.io/docs/options/get_v1_open-close__optionsticker___date +.. _Crypto daily open/close agg: https://polygon.io/docs/crypto/get_v1_open-close_crypto__from___to___date +.. _Stocks previous close agg: https://polygon.io/docs/stocks/get_v2_aggs_ticker__stocksticker__prev +.. _Options previous close agg: https://polygon.io/docs/options/get_v2_aggs_ticker__optionsticker__prev +.. _Forex previous close agg: https://polygon.io/docs/forex/get_v2_aggs_ticker__forexticker__prev +.. _Crypto previous close agg: https://polygon.io/docs/crypto/get_v2_aggs_ticker__cryptoticker__prev \ No newline at end of file diff --git a/docs/source/Contracts.rst b/docs/source/Contracts.rst new file mode 100644 index 00000000..9278168f --- /dev/null +++ b/docs/source/Contracts.rst @@ -0,0 +1,24 @@ +.. _contracts_header: + +Contracts +================================= + +================================= +Get option contract +================================= + +- `Options Contract`_ + +.. automethod:: polygon.RESTClient.get_options_contract + +================================= +List Options Contracts +================================= + +- `Options Contracts`_ + +.. automethod:: polygon.RESTClient.list_options_contracts + + +.. _Options Contract: https://polygon.io/docs/options/get_v3_reference_options_contracts__options_ticker +.. _Options Contracts: https://polygon.io/docs/options/get_v3_reference_options_contracts \ No newline at end of file diff --git a/docs/source/Enums.rst b/docs/source/Enums.rst new file mode 100644 index 00000000..8f2233a4 --- /dev/null +++ b/docs/source/Enums.rst @@ -0,0 +1,102 @@ +.. _enums_header: + +Enums +============================================================== + +============================================================== +Sort +============================================================== +.. autoclass:: polygon.rest.models.Sort + :members: + :undoc-members: + +============================================================== +Order +============================================================== +.. autoclass:: polygon.rest.models.Order + :members: + :undoc-members: + +============================================================== +Locale +============================================================== +.. autoclass:: polygon.rest.models.Locale + :members: + :undoc-members: + +============================================================== +Market +============================================================== +.. autoclass:: polygon.rest.models.Market + :members: + :undoc-members: + +============================================================== +AssetClass +============================================================== +.. autoclass:: polygon.rest.models.AssetClass + :members: + :undoc-members: + +============================================================== +DividendType +============================================================== +.. autoclass:: polygon.rest.models.DividendType + :members: + :undoc-members: + +============================================================== +Frequency +============================================================== +.. autoclass:: polygon.rest.models.Frequency + :members: + :undoc-members: + +============================================================== +DataType +============================================================== +.. autoclass:: polygon.rest.models.DataType + :members: + :undoc-members: + +============================================================== +SIP +============================================================== +.. autoclass:: polygon.rest.models.SIP + :members: + :undoc-members: + +============================================================== +ExchangeType +============================================================== +.. autoclass:: polygon.rest.models.ExchangeType + :members: + :undoc-members: + +============================================================== +Direction +============================================================== +.. autoclass:: polygon.rest.models.Direction + :members: + :undoc-members: + +============================================================== +SnapshotMarketType +============================================================== +.. autoclass:: polygon.rest.models.SnapshotMarketType + :members: + :undoc-members: + +============================================================== +Timeframe +============================================================== +.. autoclass:: polygon.rest.models.Timeframe + :members: + :undoc-members: + +============================================================== +Precision +============================================================== +.. autoclass:: polygon.rest.models.Precision + :members: + :undoc-members: diff --git a/docs/source/Exceptions.rst b/docs/source/Exceptions.rst new file mode 100644 index 00000000..554bef82 --- /dev/null +++ b/docs/source/Exceptions.rst @@ -0,0 +1,19 @@ +.. _exceptions_header: + +Exceptions +============================================================== + +============================================================== +AuthError +============================================================== +.. autoclass:: polygon.exceptions.AuthError + :members: + :undoc-members: + +============================================================== +BadResponse +============================================================== +.. autoclass:: polygon.exceptions.BadResponse + :members: + :undoc-members: + diff --git a/docs/source/Getting-Started.rst b/docs/source/Getting-Started.rst new file mode 100644 index 00000000..a723f93f --- /dev/null +++ b/docs/source/Getting-Started.rst @@ -0,0 +1,89 @@ +Getting Started +=============== + +Requirements: + - `Polygon.io API key `_ + - `Python >= 3.8 `_ + - `This package `_ + +.. code-block:: shell + + pip install polygon-api-client + +HTTP client usage +----------------- + +.. automethod:: polygon.RESTClient.__init__ + +You can pass your API key via the environment variable :code:`POLYGON_API_KEY` or as the first parameter to the :code:`RESTClient` constructor: + +.. code-block:: python + + from polygon import RESTClient + + client = RESTClient() # POLYGON_API_KEY is used + client = RESTClient("api_key") # api_key is used + +For non-paginated endpoints call :code:`get_*`: + +.. literalinclude:: ../../examples/rest/simple-get.py + +For paginated endpoints call :code:`list_*` and use the provided iterator: + +.. literalinclude:: ../../examples/rest/simple-list.py + +.. note:: + The number of network requests made by the iterator depends on the value of the parameter :code:`limit`. + :code:`limit` specifies how many results should be returned per network request. + You can see each network request by passing :code:`verbose = True` to the client. + +For endpoints that have a set of parameters you can use the provided :doc:`enums `. + +.. code-block:: python + + from polygon.rest.models import Sort + + client.list_trades(..., sort=Sort.ASC) + +To handle the raw `urllib3 response `_ yourself pass :code:`raw=True`: + +.. literalinclude:: ../../examples/rest/raw-get.py + +If it is a paginated :code:`list_*` response it's up to you to handle the "next_url" iteration: + +.. literalinclude:: ../../examples/rest/raw-list.py + +To provide your own JSON processing library (exposing loads/dumps functions) pass :code:`custom_json=my_module`: + +.. literalinclude:: ../../examples/websocket/custom-json-get.py + +WebSocket client usage +---------------------- + +.. automethod:: polygon.WebSocketClient.__init__ + +The simplest way to use the websocket client is to just provide a callback: + +.. literalinclude:: ../../examples/websocket/simple.py + +.. note:: + Raises :code:`AuthError` if invalid API key is provided. + +If you want to capture state you can use a global variable inside the callback. +Alternatively, you can wrap a class method in a closure. + +.. literalinclude:: ../../examples/websocket/aggs.py + +Under the hood our client uses an asynchronous runtime. To manage the runtime +yourself (including unsubscribing and subscribing) you can use asyncio and the +:code:`.connect` method: + +.. literalinclude:: ../../examples/websocket/async.py + +To handle raw string or byte messages yourself pass :code:`raw=True`: + +.. literalinclude:: ../../examples/websocket/raw.py + +To provide your own JSON processing library (exposing loads/dumps functions) pass :code:`custom_json=my_module`: + +.. literalinclude:: ../../examples/websocket/custom-json.py diff --git a/docs/source/Models.rst b/docs/source/Models.rst new file mode 100644 index 00000000..f0eed1c7 --- /dev/null +++ b/docs/source/Models.rst @@ -0,0 +1,219 @@ +.. _models_header: + +Models +============================================================== + +============================================================== +Universal Snapshot +============================================================== +.. autoclass:: polygon.rest.models.UniversalSnapshot + +============================================================== +Universal Snapshot Session +============================================================== +.. autoclass:: polygon.rest.models.UniversalSnapshotSession + +============================================================== +Universal Snapshot Last Quote +============================================================== +.. autoclass:: polygon.rest.models.UniversalSnapshotLastQuote + +============================================================== +Universal Snapshot Last Trade +============================================================== +.. autoclass:: polygon.rest.models.UniversalSnapshotLastTrade + +============================================================== +Universal Snapshot Details +============================================================== +.. autoclass:: polygon.rest.models.UniversalSnapshotDetails + +============================================================== +Universal Snapshot Underlying Asset +============================================================== +.. autoclass:: polygon.rest.models.UniversalSnapshotUnderlyingAsset + +============================================================== +Agg +============================================================== +.. autoclass:: polygon.rest.models.Agg + +============================================================== +Grouped Daily Agg +============================================================== +.. autoclass:: polygon.rest.models.GroupedDailyAgg + +============================================================== +Daily Open Close Agg +============================================================== +.. autoclass:: polygon.rest.models.DailyOpenCloseAgg + +============================================================== +Previous Close Agg +============================================================== +.. autoclass:: polygon.rest.models.PreviousCloseAgg + +============================================================== +Trade +============================================================== +.. autoclass:: polygon.rest.models.Trade + +============================================================== +Last Trade +============================================================== +.. autoclass:: polygon.rest.models.LastTrade + +============================================================== +Crypto Trade +============================================================== +.. autoclass:: polygon.rest.models.CryptoTrade + +============================================================== +Quote +============================================================== +.. autoclass:: polygon.rest.models.Quote + +============================================================== +Last Quote +============================================================== +.. autoclass:: polygon.rest.models.LastQuote + +============================================================== +Snapshot Min +============================================================== +.. autoclass:: polygon.rest.models.MinuteSnapshot + +============================================================== +Snapshot +============================================================== +.. autoclass:: polygon.rest.models.TickerSnapshot + +============================================================== +Day Option Contract Snapshot +============================================================== +.. autoclass:: polygon.rest.models.DayOptionContractSnapshot + +============================================================== +Option Details +============================================================== +.. autoclass:: polygon.rest.models.OptionDetails + +============================================================== +Option Greeks +============================================================== +.. autoclass:: polygon.rest.models.Greeks + +============================================================== +Underlying Asset +============================================================== +.. autoclass:: polygon.rest.models.UnderlyingAsset + +============================================================== +Option Contract Snapshot +============================================================== +.. autoclass:: polygon.rest.models.OptionContractSnapshot + +============================================================== +Order Book Quote +============================================================== +.. autoclass:: polygon.rest.models.OrderBookQuote + +============================================================== +Snapshot Ticker Full Book +============================================================== +.. autoclass:: polygon.rest.models.SnapshotTickerFullBook + +============================================================== +Ticker +============================================================== +.. autoclass:: polygon.rest.models.Ticker + +============================================================== +Address +============================================================== +.. autoclass:: polygon.rest.models.CompanyAddress + +============================================================== +Branding +============================================================== +.. autoclass:: polygon.rest.models.Branding + +============================================================== +Publisher +============================================================== +.. autoclass:: polygon.rest.models.Publisher + +============================================================== +Ticker Details +============================================================== +.. autoclass:: polygon.rest.models.TickerDetails + +============================================================== +Ticker News +============================================================== +.. autoclass:: polygon.rest.models.TickerNews + +============================================================== +Ticker Types +============================================================== +.. autoclass:: polygon.rest.models.TickerTypes + +============================================================== +Market Holiday +============================================================== +.. autoclass:: polygon.rest.models.MarketHoliday + +============================================================== +Market Currencies +============================================================== +.. autoclass:: polygon.rest.models.MarketCurrencies + +============================================================== +Market Exchanges +============================================================== +.. autoclass:: polygon.rest.models.MarketExchanges + +============================================================== +Market Status +============================================================== +.. autoclass:: polygon.rest.models.MarketStatus + +============================================================== +Split +============================================================== +.. autoclass:: polygon.rest.models.Split + +============================================================== +Dividend +============================================================== +.. autoclass:: polygon.rest.models.Dividend + +============================================================== +Sip Mapping +============================================================== +.. autoclass:: polygon.rest.models.SipMapping + +============================================================== +Consolidated +============================================================== +.. autoclass:: polygon.rest.models.Consolidated + +============================================================== +Market Center +============================================================== +.. autoclass:: polygon.rest.models.MarketCenter + +============================================================== +Update Rules +============================================================== +.. autoclass:: polygon.rest.models.UpdateRules + +============================================================== +Condition +============================================================== +.. autoclass:: polygon.rest.models.Condition + +============================================================== +Exchange +============================================================== +.. autoclass:: polygon.rest.models.Exchange diff --git a/docs/source/Quotes.rst b/docs/source/Quotes.rst new file mode 100644 index 00000000..2ef22574 --- /dev/null +++ b/docs/source/Quotes.rst @@ -0,0 +1,45 @@ +.. _quotes_header: + +Quotes +================================= + +================================= +List quotes +================================= + +- `Stocks quotes`_ +- `Options quotes`_ +- `Forex quotes`_ + +.. automethod:: polygon.RESTClient.list_quotes + +================================= +Get last quote +================================= + +- `Stocks last quote`_ + +.. automethod:: polygon.RESTClient.get_last_quote + +================================= +Get last forex quote +================================= + +- `Forex last quote for a currency pair`_ + +.. automethod:: polygon.RESTClient.get_last_forex_quote + +================================= +Get real-time currency conversion +================================= + +- `Forex real-time currency conversion`_ + +.. automethod:: polygon.RESTClient.get_real_time_currency_conversion + +.. _Stocks quotes: https://polygon.io/docs/stocks/get_v3_quotes__stockticker +.. _Options quotes: https://polygon.io/docs/options/get_v3_quotes__optionsticker +.. _Forex quotes: https://polygon.io/docs/forex/get_v3_quotes__fxticker +.. _Stocks last quote: https://polygon.io/docs/stocks/get_v2_last_nbbo__stocksticker +.. _Forex last quote for a currency pair: https://polygon.io/docs/forex/get_v1_last_quote_currencies__from___to +.. _Forex real-time currency conversion: https://polygon.io/docs/forex/get_v1_conversion__from___to diff --git a/docs/source/Reference.rst b/docs/source/Reference.rst new file mode 100644 index 00000000..3b7bd3d3 --- /dev/null +++ b/docs/source/Reference.rst @@ -0,0 +1,131 @@ +.. _reference_header: + +Reference +=============== + +==================== +Get market holidays +==================== + +- `Stocks market holidays`_ +- `Options market holidays`_ +- `Forex market holidays`_ +- `Crypto market holidays`_ + +.. automethod:: polygon.RESTClient.get_market_holidays + +==================== +Get market status +==================== + +- `Stocks market status`_ +- `Options market status`_ +- `Forex market status`_ +- `Crypto market status`_ + +.. automethod:: polygon.RESTClient.get_market_status + +==================== +List tickers +==================== + +- `Stocks tickers`_ +- `Options tickers`_ +- `Forex tickers`_ +- `Crypto tickers`_ + +.. automethod:: polygon.RESTClient.list_tickers + +==================== +Get ticker details +==================== + +- `Stocks ticker details`_ +- `Options ticker details`_ + +.. automethod:: polygon.RESTClient.get_ticker_details + +==================== +List ticker news +==================== + +- `Stocks ticker news`_ +- `Options ticker news`_ + +.. automethod:: polygon.RESTClient.list_ticker_news + +==================== +Get ticker types +==================== + +- `Stocks ticker types`_ +- `Options ticker types`_ + +.. automethod:: polygon.RESTClient.get_ticker_types + +==================== +List splits +==================== + +- `Stocks splits`_ + +.. automethod:: polygon.RESTClient.list_splits + +==================== +List dividends +==================== + +- `Stocks dividends`_ + +.. automethod:: polygon.RESTClient.list_dividends + +==================== +List conditions +==================== + +- `Stocks conditions`_ +- `Options conditions`_ +- `Forex conditions`_ +- `Crypto conditions`_ + +.. automethod:: polygon.RESTClient.list_conditions + +==================== +Get exchanges +==================== + +- `Stocks exchanges`_ +- `Options exchanges`_ +- `Forex exchanges`_ +- `Crypto exchanges`_ + +.. automethod:: polygon.RESTClient.get_exchanges + +.. _Stocks market holidays: https://polygon.io/docs/stocks/get_v1_marketstatus_upcoming +.. _Options market holidays: https://polygon.io/docs/options/get_v1_marketstatus_upcoming +.. _Forex market holidays: https://polygon.io/docs/forex/get_v1_marketstatus_upcoming +.. _Crypto market holidays: https://polygon.io/docs/crypto/get_v1_marketstatus_upcoming +.. _Stocks market status: https://polygon.io/docs/stocks/get_v1_marketstatus_now +.. _Options market status: https://polygon.io/docs/options/get_v1_marketstatus_now +.. _Forex market status: https://polygon.io/docs/forex/get_v1_marketstatus_now +.. _Crypto market status: https://polygon.io/docs/crypto/get_v1_marketstatus_now +.. _Stocks tickers: https://polygon.io/docs/stocks/get_v3_reference_tickers +.. _Options tickers: https://polygon.io/docs/options/get_v3_reference_tickers +.. _Forex tickers: https://polygon.io/docs/forex/get_v3_reference_tickers +.. _Crypto tickers: https://polygon.io/docs/crypto/get_v3_reference_tickers +.. _Stocks ticker details: https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker +.. _Options ticker details: https://polygon.io/docs/options/get_v3_reference_tickers__ticker +.. _Stocks ticker news: https://polygon.io/docs/stocks/get_v2_reference_news +.. _Options ticker news: https://polygon.io/docs/options/get_v2_reference_news +.. _Stocks ticker types: https://polygon.io/docs/stocks/get_v3_reference_tickers_types +.. _Options ticker types: https://polygon.io/docs/options/get_v3_reference_tickers_types +.. _Stocks splits: https://polygon.io/docs/stocks/get_v3_reference_splits +.. _Stocks dividends: https://polygon.io/docs/stocks/get_v3_reference_dividends +.. _Stocks conditions: https://polygon.io/docs/stocks/get_v3_reference_conditions +.. _Options conditions: https://polygon.io/docs/options/get_v3_reference_conditions +.. _Forex conditions: https://polygon.io/docs/forex/get_v3_reference_conditions +.. _Crypto conditions: https://polygon.io/docs/crypto/get_v3_reference_conditions +.. _Stocks exchanges: https://polygon.io/docs/stocks/get_v3_reference_exchanges +.. _Options exchanges: https://polygon.io/docs/options/get_v3_reference_exchanges +.. _Forex exchanges: https://polygon.io/docs/forex/get_v3_reference_exchanges +.. _Crypto exchanges: https://polygon.io/docs/crypto/get_v3_reference_exchanges \ No newline at end of file diff --git a/docs/source/Snapshot.rst b/docs/source/Snapshot.rst new file mode 100644 index 00000000..7744ba1c --- /dev/null +++ b/docs/source/Snapshot.rst @@ -0,0 +1,78 @@ +.. _snapshot_header: + +Snapshot +================================= + +================================= +Get snapshots for all asset types +================================= + +- `Stocks snapshot all tickers`_ +- `Options snapshot all tickers`_ +- `Forex snapshot all tickers`_ +- `Crypto snapshot all tickers`_ + +.. automethod:: polygon.RESTClient.list_universal_snapshots + +================================= +Get all snapshots +================================= + +- `Stocks snapshot all tickers (deprecated)`_ +- `Forex snapshot all tickers (deprecated)`_ +- `Crypto snapshot all tickers (deprecated)`_ + +.. automethod:: polygon.RESTClient.get_snapshot_all + +================================= +Get gainers/losers snapshot +================================= + +- `Stocks snapshot gainers/losers`_ +- `Forex snapshot gainers/losers`_ +- `Crypto snapshot gainers/losers`_ + +.. automethod:: polygon.RESTClient.get_snapshot_direction + +================================= +Get ticker snapshot +================================= + +- `Stocks snapshot ticker`_ +- `Forex snapshot ticker`_ +- `Crypto snapshot ticker`_ + +.. automethod:: polygon.RESTClient.get_snapshot_ticker + +================================= +Get options snapshot +================================= + +- `Options snapshot option contract`_ + +.. automethod:: polygon.RESTClient.get_snapshot_option + +================================= +Get crypto L2 book snapshot +================================= + +- `Crypto snapshot ticker full book (L2)`_ + +.. automethod:: polygon.RESTClient.get_snapshot_crypto_book + +.. _Stocks snapshot all tickers: https://polygon.io/docs/stocks/get_v3_snapshot +.. _Options snapshot all tickers: https://polygon.io/docs/options/get_v3_snapshot +.. _Forex snapshot all tickers: https://polygon.io/docs/forex/get_v3_snapshot +.. _Crypto snapshot all tickers:: https://polygon.io/docs/crypto/get_v3_snapshot +.. _Stocks snapshot all tickers (deprecated): https://polygon.io/docs/stocks/get_v2_snapshot_locale_us_markets_stocks_tickers +.. _Options snapshot all tickers (deprecated): https://polygon.io/docs/options/get_v2_snapshot_locale_us_markets_stocks_tickers +.. _Forex snapshot all tickers (deprecated): https://polygon.io/docs/forex/get_v2_snapshot_locale_global_markets_forex_tickers +.. _Crypto snapshot all tickers (deprecated):: https://polygon.io/docs/crypto/get_v2_snapshot_locale_global_markets_crypto_tickers +.. _Stocks snapshot gainers/losers: https://polygon.io/docs/stocks/get_v2_snapshot_locale_us_markets_stocks__direction +.. _Forex snapshot gainers/losers: https://polygon.io/docs/forex/get_v2_snapshot_locale_global_markets_forex__direction +.. _Crypto snapshot gainers/losers: https://polygon.io/docs/crypto/get_v2_snapshot_locale_global_markets_crypto__direction +.. _Stocks snapshot ticker: https://polygon.io/docs/stocks/get_v2_snapshot_locale_us_markets_stocks_tickers__stocksticker +.. _Forex snapshot ticker: https://polygon.io/docs/forex/get_v2_snapshot_locale_global_markets_forex_tickers__ticker +.. _Crypto snapshot ticker: https://polygon.io/docs/crypto/get_v2_snapshot_locale_global_markets_crypto_tickers__ticker +.. _Options snapshot option contract: https://polygon.io/docs/options/get_v3_snapshot_options__underlyingasset___optioncontract +.. _Crypto snapshot ticker full book (L2): https://polygon.io/docs/crypto/get_v2_snapshot_locale_global_markets_crypto_tickers__ticker__book \ No newline at end of file diff --git a/docs/source/Trades.rst b/docs/source/Trades.rst new file mode 100644 index 00000000..5d6e6992 --- /dev/null +++ b/docs/source/Trades.rst @@ -0,0 +1,38 @@ +.. _trades_header: + +Trades +================================================================== + +================================================================== +List trades +================================================================== + +- `Stocks trades`_ +- `Options trades`_ +- `Crypto trades`_ + +.. automethod:: polygon.RESTClient.list_trades + +================================================================== +Get last trade +================================================================== + +- `Stocks last trade`_ +- `Options last trade`_ + +.. automethod:: polygon.RESTClient.get_last_trade + +================================================================== +Get last crypto trade +================================================================== + +- `Crypto last trade for crypto pair`_ + +.. automethod:: polygon.RESTClient.get_last_crypto_trade + +.. _Stocks trades: https://polygon.io/docs/stocks/get_v3_trades__stockticker +.. _Options trades: https://polygon.io/docs/options/get_v3_trades__optionsticker +.. _Crypto trades: https://polygon.io/docs/crypto/get_v3_trades__cryptoticker +.. _Stocks last trade: https://polygon.io/docs/stocks/get_v2_last_trade__stocksticker +.. _Options last trade: https://polygon.io/docs/options/get_v2_last_trade__optionsticker +.. _Crypto last trade for crypto pair: https://polygon.io/docs/crypto/get_v1_last_crypto__from___to \ No newline at end of file diff --git a/docs/source/WebSocket-Enums.rst b/docs/source/WebSocket-Enums.rst new file mode 100644 index 00000000..dc2fd199 --- /dev/null +++ b/docs/source/WebSocket-Enums.rst @@ -0,0 +1,25 @@ +.. _websocket_enums_header: + +WebSocket Enums +============================== + +============================================================== +Feed +============================================================== +.. autoclass:: polygon.websocket.models.Feed + :members: + :undoc-members: + +============================================================== +Market +============================================================== +.. autoclass:: polygon.websocket.models.Market + :members: + :undoc-members: + +============================================================== +EventType +============================================================== +.. autoclass:: polygon.websocket.models.EventType + :members: + :undoc-members: \ No newline at end of file diff --git a/docs/source/WebSocket.rst b/docs/source/WebSocket.rst new file mode 100644 index 00000000..5f508122 --- /dev/null +++ b/docs/source/WebSocket.rst @@ -0,0 +1,45 @@ +.. _websocket_header: + +WebSocket +========== + +- `Stocks getting started`_ +- `Options getting started`_ +- `Forex getting started`_ +- `Crypto getting started`_ + +=========== +Init client +=========== +.. automethod:: polygon.WebSocketClient.__init__ + :noindex: + +============================ +Connect +============================ +.. automethod:: polygon.WebSocketClient.connect + +============================ +Run +============================ +.. automethod:: polygon.WebSocketClient.run + +============================ +Subscribe +============================ +.. automethod:: polygon.WebSocketClient.subscribe + +============================ +Unsubscribe +============================ +.. automethod:: polygon.WebSocketClient.unsubscribe + +============================ +Close +============================ +.. automethod:: polygon.WebSocketClient.close + +.. _Stocks getting started: https://polygon.io/docs/stocks/ws_getting-started +.. _Options getting started: https://polygon.io/docs/options/ws_getting-started +.. _Forex getting started: https://polygon.io/docs/forex/ws_getting-started +.. _Crypto getting started: https://polygon.io/docs/crypto/ws_getting-started \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 00000000..235ee004 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,59 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +import os +import sys +sys.path.insert(0, os.path.abspath('../..')) +print('docs path', sys.path[0]) +os.environ['POLYGON_API_KEY'] = 'POLYGON_API_KEY' + +# -- Project information ----------------------------------------------------- + +project = 'polygon-api-client' +copyright = '2022, Polygon.io' +author = 'Polygon.io' + +# The full version, including alpha/beta/rc tags +release = '0.3.0' + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx_autodoc_typehints', + 'sphinx_rtd_theme', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'sphinx_rtd_theme' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 00000000..b445b803 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,28 @@ +Welcome to polygon-api-client's documentation! +============================================== + +This documentation is for the Python client only. For details about the responses see `the official docs `_. + +.. toctree:: + :maxdepth: 1 + :caption: Contents: + + Getting-Started + Aggs + WebSocket + Snapshot + Quotes + Reference + Trades + vX + Models + Enums + WebSocket-Enums + Exceptions + Contracts + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`search` diff --git a/docs/source/vX.rst b/docs/source/vX.rst new file mode 100644 index 00000000..69a25311 --- /dev/null +++ b/docs/source/vX.rst @@ -0,0 +1,19 @@ +.. _vX_header: + +vX +========== + +.. note:: + To call vX methods, use the vx class member on RESTClient. + + For example, :code:`financials = RESTClient().vx.list_stock_financials()` + +====================== +List stock financials +====================== + +- `Stocks financials vX`_ + +.. automethod:: polygon.rest.VXClient.list_stock_financials + +.. _Stocks financials vX: https://polygon.io/docs/stocks/get_vx_reference_financials diff --git a/examples/launchpad/README.md b/examples/launchpad/README.md new file mode 100644 index 00000000..53301593 --- /dev/null +++ b/examples/launchpad/README.md @@ -0,0 +1,49 @@ +# Launchpad + +Users of the Launchpad product will need to pass in certain headers in order to make API requests. + + ```python + +# import RESTClient +from polygon import RESTClient +from polygon.rest.models.request import RequestOptionBuilder + +# create client +c = RESTClient(api_key="API_KEY") + +# create request options +options = RequestOptionBuilder().edge_headers( + edge_id="YOUR_EDGE_ID", # required + edge_ip_address="IP_ADDRESS", # required +) +# get response +res = c.get_aggs("AAPL", 1, "day", "2022-04-04", "2022-04-04", options=options) + +# do something with response + + ``` +Launchpad users can also provide the optional User Agent value describing their Edge User's origination request. + + ```python + +# import RESTClient +from polygon import RESTClient +from polygon.rest.models.request import RequestOptionBuilder + +# create client +c = RESTClient(api_key="API_KEY") + +# create request options +options = RequestOptionBuilder().edge_headers( + edge_id="YOUR_EDGE_ID", # required + edge_ip_address="IP_ADDRESS" # required +).update_edge_header( + edge_user="EDGE_USER" # optional + ) + +# get response +res = c.get_aggs("AAPL", 1, "day", "2022-04-04", "2022-04-04", options=options) + +# do something with response + + ``` \ No newline at end of file diff --git a/examples/launchpad/launchpad.py b/examples/launchpad/launchpad.py new file mode 100644 index 00000000..6c6fbe35 --- /dev/null +++ b/examples/launchpad/launchpad.py @@ -0,0 +1,31 @@ +from polygon import RESTClient +from polygon.rest.models.request import RequestOptionBuilder + + +def get_list_trades_launchpad(): + client = RESTClient() + + """ + set headers example: + options = RequestOptionBuilder() + .edge_headers(edge_id="EDGE_ID", edge_ip_address="EDGE_ID_ADDRESS", edge_user="EDGE_USER") + + update headers example: + options = options.update_edge_header(edge_ip_address="NEW_IP") + """ + options = RequestOptionBuilder().edge_headers( + edge_id="EDGE_ID", edge_ip_address="EDGE_ID_ADDRESS", edge_user="EDGE_USER" + ) + + trades = [] + for t in client.list_trades("AAA", "2022-04-04", limit=5, options=options): + trades.append(t) + print(trades) + + +def main(): + get_list_trades_launchpad() + + +if __name__ == "__main__": + main() diff --git a/examples/rest/bulk_aggs_downloader.py b/examples/rest/bulk_aggs_downloader.py new file mode 100644 index 00000000..c5c6099e --- /dev/null +++ b/examples/rest/bulk_aggs_downloader.py @@ -0,0 +1,97 @@ +import datetime +import concurrent.futures +import logging +from polygon import RESTClient +import signal +import sys +import pickle +import lz4.frame # type: ignore + +""" +This script performs the following tasks: + +1. Downloads aggregated market data (referred to as 'aggs') for specific stock symbols using the Polygon API. +2. Handles data for multiple dates and performs these operations in parallel to improve efficiency. +3. Saves the downloaded data in a compressed format (LZ4) using Python's pickle serialization. +4. Utilizes logging to track its progress and any potential errors. +5. Designed to be interruptible: listens for a Ctrl+C keyboard interrupt and exits gracefully when detected. + +Usage: +1. pip install lz4 +2. Set your Polygon API key in the environment variable 'POLYGON_API_KEY'. +3. Specify the date range and stock symbols you are interested in within the script. +4. Run the script. + +The script will create compressed '.pickle.lz4' files containing the aggs for each specified stock symbol and date. + +Note: This script is designed to be compatible with a data reader script, such as 'bulk_aggs_reader.py'. +""" + +# Set up logging +logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(message)s") + + +def signal_handler(sig, frame): + print("You pressed Ctrl+C!") + sys.exit(0) + + +signal.signal(signal.SIGINT, signal_handler) + + +def get_aggs_for_symbol_and_date(symbol_date_pair): + """Retrieve aggs for a given symbol and date""" + symbol, date = symbol_date_pair + aggs = [] + client = RESTClient(trace=True) # Uses POLYGON_API_KEY environment variable + + for a in client.list_aggs( + symbol, + 1, + "minute", + date, + date, + limit=50000, + ): + aggs.append(a) + + print(len(aggs)) + + filename = f"{symbol}-aggs-{date}.pickle.lz4" + with open(filename, "wb") as file: + try: + compressed_data = lz4.frame.compress(pickle.dumps(aggs)) + file.write(compressed_data) + except TypeError as e: + print(f"Serialization Error: {e}") + + logging.info(f"Downloaded aggs for {date} and saved to {filename}") + + +def weekdays_between(start_date, end_date): + """Generate all weekdays between start_date and end_date""" + day = start_date + while day <= end_date: + if day.weekday() < 5: # 0-4 denotes Monday to Friday + yield day + day += datetime.timedelta(days=1) + + +def main(): + start_date = datetime.date(2023, 8, 1) + end_date = datetime.date(2023, 8, 31) + + symbols = ["TSLA", "AAPL", "HCP", "GOOG"] # The array of symbols you want + + dates = list(weekdays_between(start_date, end_date)) + + # Generate a list of (symbol, date) pairs + symbol_date_pairs = [(symbol, date) for symbol in symbols for date in dates] + + # Use ThreadPoolExecutor to download data in parallel + with concurrent.futures.ThreadPoolExecutor(max_workers=50) as executor: + executor.map(get_aggs_for_symbol_and_date, symbol_date_pairs) + + +if __name__ == "__main__": + main() diff --git a/examples/rest/bulk_aggs_reader.py b/examples/rest/bulk_aggs_reader.py new file mode 100644 index 00000000..fcc91915 --- /dev/null +++ b/examples/rest/bulk_aggs_reader.py @@ -0,0 +1,57 @@ +import lz4.frame # type: ignore +import pickle +import datetime + +""" +This script performs the following tasks: + +1. Reads aggregated market data ('aggs') for a specific stock symbol for multiple dates. +2. Data is read from compressed (LZ4) and pickled files, which should have been generated by a separate data downloading script. +3. Displays the read data to the console. +4. Handles exceptions gracefully: informs the user if a file for a specific date was not found or if any other error occurred. + +Usage: +1. pip install lz4 +2. Ensure that the compressed '.pickle.lz4' files for the specified stock symbol and date range exist in the same directory as this script. +3. Modify the date range and stock symbol in the script as per your requirements. +4. Run the script. + +The script will read and display the market data for each specified date and stock symbol. + +Note: This script is designed to be compatible with files generated by a data downloading script, such as 'bulk_aggs_downloader.py'. +""" + + +def read_trades_for_date(symbol, date): + """Reads trades for a given symbol and date, then prints them.""" + + # Construct the filename, similar to your writer script + filename = f"{symbol}-aggs-{date}.pickle.lz4" + + try: + with open(filename, "rb") as file: + compressed_data = file.read() + trades = pickle.loads(lz4.frame.decompress(compressed_data)) + print(trades) + return trades + except FileNotFoundError: + print(f"No file found for {date}") + except Exception as e: + print(f"An error occurred: {e}") + + +def main(): + start_date = datetime.date(2023, 8, 1) + end_date = datetime.date(2023, 8, 31) + symbol = "HCP" + + # Loop through each weekday between the start and end dates and read the trades + day = start_date + while day <= end_date: + if day.weekday() < 5: # 0-4 denotes Monday to Friday + read_trades_for_date(symbol, day) + day += datetime.timedelta(days=1) + + +if __name__ == "__main__": + main() diff --git a/examples/rest/crypto-aggregates_bars.py b/examples/rest/crypto-aggregates_bars.py new file mode 100644 index 00000000..a3831aeb --- /dev/null +++ b/examples/rest/crypto-aggregates_bars.py @@ -0,0 +1,30 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v2_aggs_ticker__cryptoticker__range__multiplier___timespan___from___to +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#polygon.RESTClient.list_aggs + +# API key injected below for easy use. If not provided, the script will attempt +# to use the environment variable "POLYGON_API_KEY". +# +# setx POLYGON_API_KEY "" <- windows +# export POLYGON_API_KEY="" <- mac/linux +# +# Note: To persist the environment variable you need to add the above command +# to the shell startup script (e.g. .bashrc or .bash_profile. +# +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = [] +for a in client.list_aggs( + "X:BTCUSD", + 1, + "day", + "2023-01-30", + "2023-02-03", + limit=50000, +): + aggs.append(a) + +print(aggs) diff --git a/examples/rest/crypto-conditions.py b/examples/rest/crypto-conditions.py new file mode 100644 index 00000000..93e3feda --- /dev/null +++ b/examples/rest/crypto-conditions.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v3_reference_conditions +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-conditions + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +conditions = [] +for c in client.list_conditions("crypto", limit=1000): + conditions.append(c) +print(conditions) diff --git a/examples/rest/crypto-daily_open_close.py b/examples/rest/crypto-daily_open_close.py new file mode 100644 index 00000000..8ff3ad41 --- /dev/null +++ b/examples/rest/crypto-daily_open_close.py @@ -0,0 +1,16 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v1_open-close_crypto__from___to___date +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-daily-open-close-agg + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +# make request +request = client.get_daily_open_close_agg( + "X:BTCUSD", + "2023-01-09", +) + +print(request) diff --git a/examples/rest/crypto-exchanges.py b/examples/rest/crypto-exchanges.py new file mode 100644 index 00000000..cf0a46d0 --- /dev/null +++ b/examples/rest/crypto-exchanges.py @@ -0,0 +1,25 @@ +from polygon import RESTClient +from polygon.rest.models import ( + Exchange, +) + +# docs +# https://polygon.io/docs/crypto/get_v3_reference_exchanges +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-exchanges + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +exchanges = client.get_exchanges("crypto") +print(exchanges) + +# loop over exchanges +for exchange in exchanges: + # verify this is an exchange + if isinstance(exchange, Exchange): + # print exchange info + print( + "{:<15}{} ({})".format( + exchange.asset_class, exchange.name, exchange.operating_mic + ) + ) diff --git a/examples/rest/crypto-grouped_daily_bars.py b/examples/rest/crypto-grouped_daily_bars.py new file mode 100644 index 00000000..ec1bdb81 --- /dev/null +++ b/examples/rest/crypto-grouped_daily_bars.py @@ -0,0 +1,20 @@ +from polygon import RESTClient +import pprint + +# docs +# https://polygon.io/docs/crypto/get_v2_aggs_grouped_locale_global_market_crypto__date +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-grouped-daily-aggs + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +grouped = client.get_grouped_daily_aggs( + "2023-01-09", locale="global", market_type="crypto" +) + +# print(grouped) + +# pprint (short for "pretty-print") is a module that provides a more human- +# readable output format for data structures. +pp = pprint.PrettyPrinter(indent=2) +pp.pprint(grouped) diff --git a/examples/rest/crypto-last_trade_for_a_crypto_pair.py b/examples/rest/crypto-last_trade_for_a_crypto_pair.py new file mode 100644 index 00000000..850bd98a --- /dev/null +++ b/examples/rest/crypto-last_trade_for_a_crypto_pair.py @@ -0,0 +1,12 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v1_last_crypto__from___to +# https://polygon-api-client.readthedocs.io/en/latest/Trades.html#get-last-crypto-trade + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +trade = client.get_last_crypto_trade("BTC", "USD") + +print(trade) diff --git a/examples/rest/crypto-market_holidays.py b/examples/rest/crypto-market_holidays.py new file mode 100644 index 00000000..6d1df168 --- /dev/null +++ b/examples/rest/crypto-market_holidays.py @@ -0,0 +1,20 @@ +from polygon import RESTClient +from polygon.rest.models import ( + MarketHoliday, +) + +# docs +# https://polygon.io/docs/crypto/get_v1_marketstatus_upcoming +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-market-holidays + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +holidays = client.get_market_holidays() +# print(holidays) + +# print date, name, and exchange +for holiday in holidays: + # verify this is an exchange + if isinstance(holiday, MarketHoliday): + print("{:<15}{:<15} ({})".format(holiday.date, holiday.name, holiday.exchange)) diff --git a/examples/rest/crypto-market_status.py b/examples/rest/crypto-market_status.py new file mode 100644 index 00000000..4265997c --- /dev/null +++ b/examples/rest/crypto-market_status.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v1_marketstatus_now +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-market-status + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +result = client.get_market_status() +print(result) diff --git a/examples/rest/crypto-previous_close.py b/examples/rest/crypto-previous_close.py new file mode 100644 index 00000000..bf309fed --- /dev/null +++ b/examples/rest/crypto-previous_close.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v2_aggs_ticker__cryptoticker__prev +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-previous-close-agg + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = client.get_previous_close_agg( + "X:BTCUSD", +) + +print(aggs) diff --git a/examples/rest/crypto-snapshots_all_tickers.py b/examples/rest/crypto-snapshots_all_tickers.py new file mode 100644 index 00000000..9bb06621 --- /dev/null +++ b/examples/rest/crypto-snapshots_all_tickers.py @@ -0,0 +1,41 @@ +from polygon import RESTClient +from polygon.rest.models import ( + TickerSnapshot, + Agg, +) + +# docs +# https://polygon.io/docs/crypto/get_v2_snapshot_locale_global_markets_crypto_tickers +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-all-snapshots + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +snapshot = client.get_snapshot_all("crypto") # all tickers + +# print raw values +print(snapshot) + +# crunch some numbers +for item in snapshot: + # verify this is an TickerSnapshot + if isinstance(item, TickerSnapshot): + # verify this is an Agg + if isinstance(item.prev_day, Agg): + # verify this is a float + if isinstance(item.prev_day.open, float) and isinstance( + item.prev_day.close, float + ): + percent_change = ( + (item.prev_day.close - item.prev_day.open) + / item.prev_day.open + * 100 + ) + print( + "{:<15}{:<15}{:<15}{:.2f} %".format( + item.ticker, + item.prev_day.open, + item.prev_day.close, + percent_change, + ) + ) diff --git a/examples/rest/crypto-snapshots_gainers_losers.py b/examples/rest/crypto-snapshots_gainers_losers.py new file mode 100644 index 00000000..34db190b --- /dev/null +++ b/examples/rest/crypto-snapshots_gainers_losers.py @@ -0,0 +1,37 @@ +from polygon import RESTClient +from polygon.rest.models import ( + TickerSnapshot, +) + +# docs +# https://polygon.io/docs/crypto/get_v2_snapshot_locale_global_markets_crypto__direction +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-gainers-losers-snapshot + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +# get gainers +gainers = client.get_snapshot_direction("crypto", "gainers") +# print(gainers) + +# print ticker with % change +for gainer in gainers: + # verify this is a TickerSnapshot + if isinstance(gainer, TickerSnapshot): + # verify this is a float + if isinstance(gainer.todays_change_percent, float): + print("{:<15}{:.2f} %".format(gainer.ticker, gainer.todays_change_percent)) + +print() + +# get losers +losers = client.get_snapshot_direction("crypto", "losers") +# print(losers) + +# print ticker with % change +for loser in losers: + # verify this is a TickerSnapshot + if isinstance(loser, TickerSnapshot): + # verify this is a float + if isinstance(loser.todays_change_percent, float): + print("{:<15}{:.2f} %".format(loser.ticker, loser.todays_change_percent)) diff --git a/examples/rest/crypto-snapshots_ticker.py b/examples/rest/crypto-snapshots_ticker.py new file mode 100644 index 00000000..31a48ebd --- /dev/null +++ b/examples/rest/crypto-snapshots_ticker.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v2_snapshot_locale_global_markets_crypto_tickers__ticker +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-ticker-snapshot + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +ticker = client.get_snapshot_ticker("crypto", "X:BTCUSD") +print(ticker) diff --git a/examples/rest/crypto-snapshots_ticker_full_book_l2.py b/examples/rest/crypto-snapshots_ticker_full_book_l2.py new file mode 100644 index 00000000..38d239cf --- /dev/null +++ b/examples/rest/crypto-snapshots_ticker_full_book_l2.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v2_snapshot_locale_global_markets_crypto_tickers__ticker__book +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-crypto-l2-book-snapshot + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +snapshot = client.get_snapshot_crypto_book("X:BTCUSD") + +# print raw values +print(snapshot) diff --git a/examples/rest/crypto-technical_indicators_ema.py b/examples/rest/crypto-technical_indicators_ema.py new file mode 100644 index 00000000..49958006 --- /dev/null +++ b/examples/rest/crypto-technical_indicators_ema.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v1_indicators_ema__cryptoticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +ema = client.get_ema( + ticker="X:BTCUSD", + timespan="day", + window=50, + series_type="close", +) + +print(ema) diff --git a/examples/rest/crypto-technical_indicators_macd.py b/examples/rest/crypto-technical_indicators_macd.py new file mode 100644 index 00000000..ee168d0f --- /dev/null +++ b/examples/rest/crypto-technical_indicators_macd.py @@ -0,0 +1,19 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v1_indicators_macd__cryptoticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +macd = client.get_macd( + ticker="X:BTCUSD", + timespan="day", + short_window=12, + long_window=26, + signal_window=9, + series_type="close", +) + +print(macd) diff --git a/examples/rest/crypto-technical_indicators_rsi.py b/examples/rest/crypto-technical_indicators_rsi.py new file mode 100644 index 00000000..1eb3c01f --- /dev/null +++ b/examples/rest/crypto-technical_indicators_rsi.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v1_indicators_rsi__cryptoticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +rsi = client.get_rsi( + ticker="X:BTCUSD", + timespan="day", + window=14, + series_type="close", +) + +print(rsi) diff --git a/examples/rest/crypto-technical_indicators_sma.py b/examples/rest/crypto-technical_indicators_sma.py new file mode 100644 index 00000000..e8d503fc --- /dev/null +++ b/examples/rest/crypto-technical_indicators_sma.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v1_indicators_sma__cryptoticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +sma = client.get_sma( + ticker="X:BTCUSD", + timespan="day", + window=50, + series_type="close", +) + +print(sma) diff --git a/examples/rest/crypto-tickers.py b/examples/rest/crypto-tickers.py new file mode 100644 index 00000000..8eb07170 --- /dev/null +++ b/examples/rest/crypto-tickers.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v3_reference_tickers +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-tickers + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +tickers = [] +for t in client.list_tickers(market="crypto", limit=1000): + tickers.append(t) +print(tickers) diff --git a/examples/rest/crypto-trades.py b/examples/rest/crypto-trades.py new file mode 100644 index 00000000..7cafd989 --- /dev/null +++ b/examples/rest/crypto-trades.py @@ -0,0 +1,15 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/crypto/get_v3_trades__cryptoticker +# https://polygon-api-client.readthedocs.io/en/latest/Trades.html#polygon.RESTClient.list_trades + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +trades = [] +for t in client.list_trades("X:BTC-USD", "2023-02-01", limit=50000): + trades.append(t) + +# prints each trade that took place +print(trades) diff --git a/examples/rest/custom-json-get.py b/examples/rest/custom-json-get.py new file mode 100644 index 00000000..c10d0a03 --- /dev/null +++ b/examples/rest/custom-json-get.py @@ -0,0 +1,9 @@ +from polygon import RESTClient + +# type: ignore +import orjson + +client = RESTClient(custom_json=orjson) + +aggs = client.get_aggs("AAPL", 1, "day", "2022-04-04", "2022-04-04") +print(aggs) diff --git a/examples/rest/demo_correlation_matrix.py b/examples/rest/demo_correlation_matrix.py new file mode 100644 index 00000000..df939590 --- /dev/null +++ b/examples/rest/demo_correlation_matrix.py @@ -0,0 +1,140 @@ +""" +This script computes and visualizes the correlation matrix of a selected set of +stocks using Polygon's API. This script is for educational purposes only and is +not intended to provide investment advice. The examples provided analyze the +correlation between different stocks from diverse sectors, as well as within +specific sectors. + +Blog: https://polygon.io/blog/finding-correlation-between-stocks/ +Video: https://www.youtube.com/watch?v=q0TgaUGWPFc + +Before running this script, there are 4 prerequisites: + +1) Dependencies: Ensure that the following Python libraries are installed in + your environment: + - pandas + - numpy + - seaborn + - matplotlib.pyplot + - polygon's python-client library + + You can likely run: + pip install pandas numpy seaborn matplotlib polygon-api-client + +2) API Key: You will need a Polygon API key to fetch the stock data. This can + be set manually in the script below, or you can set an environment variable + 'POLYGON_API_KEY'. + + setx POLYGON_API_KEY "" <- windows + export POLYGON_API_KEY="" <- mac/linux + +3) Select Stocks: You need to select the stocks you're interested in analyzing. + Update the 'symbols' variable in this script with your chosen stock symbols. + +4) Select Date Range: You need to specify the date range for the historical + data that you want to fetch. Update the 'start_date' and 'end_date' + variables in this script accordingly. + +Understanding stock correlation is important when building a diverse portfolio, +as it can help manage risk and inform investment strategies. It's always +essential to do your own research or consult a financial advisor for +personalized advice when investing. +""" + +import pandas as pd # type: ignore +import numpy as np # type: ignore +import seaborn as sns # type: ignore +import matplotlib.pyplot as plt # type: ignore +from polygon import RESTClient + +# Less likely to be correlated due to being in different sectors and are +# exposed to different market forces, economic trends, and price risks. +# symbols = ["TSLA", "PFE", "XOM", "HD", "JPM", "AAPL", "KO", "UNH", "LMT", "AMZN"] + +# Here we have two groups, one with 5 technology stocks and another with 5 oil +# stocks. These two groups are likely to be highly correlated within their +# respective sectors but are expected to be less correlated between sectors. +# symbols = ["AAPL", "MSFT", "GOOG", "ADBE", "CRM", "XOM", "CVX", "COP", "PSX", "OXY"] + +# Likely to be highly correlated due to being in the technology sector, +# specifically in the sub-industry of Semiconductors: +symbols = ["INTC", "AMD", "NVDA", "TXN", "QCOM", "MU", "AVGO", "ADI", "MCHP", "NXPI"] + +# Date range you are interested in +start_date = "2022-04-01" +end_date = "2023-05-10" + + +def fetch_stock_data(symbols, start_date, end_date): + stocks = [] + + # client = RESTClient("XXXXXX") # hardcoded api_key is used + client = RESTClient() # POLYGON_API_KEY environment variable is used + + try: + for symbol in symbols: + aggs = client.get_aggs( + symbol, + 1, + "day", + start_date, + end_date, + ) + df = pd.DataFrame(aggs, columns=["timestamp", "close"]) + + # Filter out rows with invalid timestamps + df = df[df["timestamp"] > 0] + + df["timestamp"] = pd.to_datetime(df["timestamp"], unit="ms") + df.set_index("timestamp", inplace=True) + + df.rename(columns={"close": symbol}, inplace=True) + stocks.append(df) + finally: + pass + + merged_stocks = pd.concat(stocks, axis=1) + return merged_stocks + + +def calculate_daily_returns(stock_data): + daily_returns = stock_data.pct_change().dropna() + return daily_returns + + +def compute_correlation_matrix(daily_returns): + correlation_matrix = daily_returns.corr() + return correlation_matrix + + +def plot_correlation_heatmap(correlation_matrix): + plt.figure(figsize=(8, 8)) + ax = sns.heatmap( + correlation_matrix, + annot=True, + cmap="coolwarm", + vmin=-1, + vmax=1, + square=True, + linewidths=0.5, + cbar_kws={"shrink": 0.8}, + ) + ax.xaxis.tick_top() + ax.xaxis.set_label_position("top") + plt.title("Correlation Matrix Heatmap", y=1.08) + plt.show() + + +def main(): + stock_data = fetch_stock_data(symbols, start_date, end_date) + daily_returns = calculate_daily_returns(stock_data) + correlation_matrix = compute_correlation_matrix(daily_returns) + + print("Correlation Matrix:") + print(correlation_matrix) + + plot_correlation_heatmap(correlation_matrix) + + +if __name__ == "__main__": + main() diff --git a/examples/rest/economy-treasury_yields.py b/examples/rest/economy-treasury_yields.py new file mode 100644 index 00000000..7be77fcf --- /dev/null +++ b/examples/rest/economy-treasury_yields.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/rest/economy/treasury-yields + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +yields = [] +for date in client.list_treasury_yields(): + yields.append(date) + +print(yields) diff --git a/examples/rest/financials.py b/examples/rest/financials.py new file mode 100644 index 00000000..f9e6dad5 --- /dev/null +++ b/examples/rest/financials.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +client = RESTClient() + +financials = client.get_ticker_details("NFLX") +print(financials) + +for i, n in enumerate(client.list_ticker_news("INTC", limit=5)): + print(i, n) + if i == 5: + break diff --git a/examples/rest/forex-aggregates_bars.py b/examples/rest/forex-aggregates_bars.py new file mode 100644 index 00000000..b7ab233d --- /dev/null +++ b/examples/rest/forex-aggregates_bars.py @@ -0,0 +1,30 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v2_aggs_ticker__forexticker__range__multiplier___timespan___from___to +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#polygon.RESTClient.list_aggs + +# API key injected below for easy use. If not provided, the script will attempt +# to use the environment variable "POLYGON_API_KEY". +# +# setx POLYGON_API_KEY "" <- windows +# export POLYGON_API_KEY="" <- mac/linux +# +# Note: To persist the environment variable you need to add the above command +# to the shell startup script (e.g. .bashrc or .bash_profile. +# +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = [] +for a in client.list_aggs( + "C:EURUSD", + 1, + "day", + "2023-01-30", + "2023-02-03", + limit=50000, +): + aggs.append(a) + +print(aggs) diff --git a/examples/rest/forex-conditions.py b/examples/rest/forex-conditions.py new file mode 100644 index 00000000..fca1e887 --- /dev/null +++ b/examples/rest/forex-conditions.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v3_reference_conditions +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-conditions + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +conditions = [] +for c in client.list_conditions("fx", limit=1000): + conditions.append(c) +print(conditions) diff --git a/examples/rest/forex-exchanges.py b/examples/rest/forex-exchanges.py new file mode 100644 index 00000000..e85b3425 --- /dev/null +++ b/examples/rest/forex-exchanges.py @@ -0,0 +1,25 @@ +from polygon import RESTClient +from polygon.rest.models import ( + Exchange, +) + +# docs +# https://polygon.io/docs/options/get_v3_reference_exchanges +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-exchanges + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +exchanges = client.get_exchanges("fx") +print(exchanges) + +# loop over exchanges +for exchange in exchanges: + # verify this is an exchange + if isinstance(exchange, Exchange): + # print exchange info + print( + "{:<15}{} ({})".format( + exchange.asset_class, exchange.name, exchange.operating_mic + ) + ) diff --git a/examples/rest/forex-grouped_daily_bars.py b/examples/rest/forex-grouped_daily_bars.py new file mode 100644 index 00000000..f8130877 --- /dev/null +++ b/examples/rest/forex-grouped_daily_bars.py @@ -0,0 +1,22 @@ +from polygon import RESTClient +import pprint + +# docs +# https://polygon.io/docs/forex/get_v2_aggs_grouped_locale_global_market_fx__date +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-grouped-daily-aggs + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +grouped = client.get_grouped_daily_aggs( + "2023-03-27", + locale="global", + market_type="fx", +) + +# print(grouped) + +# pprint (short for "pretty-print") is a module that provides a more human- +# readable output format for data structures. +pp = pprint.PrettyPrinter(indent=2) +pp.pprint(grouped) diff --git a/examples/rest/forex-last_quote_for_a_currency_pair.py b/examples/rest/forex-last_quote_for_a_currency_pair.py new file mode 100644 index 00000000..8b3c78b1 --- /dev/null +++ b/examples/rest/forex-last_quote_for_a_currency_pair.py @@ -0,0 +1,15 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v1_last_quote_currencies__from___to +# https://polygon-api-client.readthedocs.io/en/latest/Quotes.html#get-last-forex-quote + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +quote = client.get_last_forex_quote( + "AUD", + "USD", +) + +print(quote) diff --git a/examples/rest/forex-market_holidays.py b/examples/rest/forex-market_holidays.py new file mode 100644 index 00000000..70c03f44 --- /dev/null +++ b/examples/rest/forex-market_holidays.py @@ -0,0 +1,20 @@ +from polygon import RESTClient +from polygon.rest.models import ( + MarketHoliday, +) + +# docs +# https://polygon.io/docs/forex/get_v1_marketstatus_upcoming +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-market-holidays + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +holidays = client.get_market_holidays() +# print(holidays) + +# print date, name, and exchange +for holiday in holidays: + # verify this is an exchange + if isinstance(holiday, MarketHoliday): + print("{:<15}{:<15} ({})".format(holiday.date, holiday.name, holiday.exchange)) diff --git a/examples/rest/forex-market_status.py b/examples/rest/forex-market_status.py new file mode 100644 index 00000000..06f544cc --- /dev/null +++ b/examples/rest/forex-market_status.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v1_marketstatus_now +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-market-status + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +result = client.get_market_status() +print(result) diff --git a/examples/rest/forex-previous_close.py b/examples/rest/forex-previous_close.py new file mode 100644 index 00000000..0de11709 --- /dev/null +++ b/examples/rest/forex-previous_close.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v2_aggs_ticker__forexticker__prev +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-previous-close-agg + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = client.get_previous_close_agg( + "C:EURUSD", +) + +print(aggs) diff --git a/examples/rest/forex-quotes.py b/examples/rest/forex-quotes.py new file mode 100644 index 00000000..880ebca8 --- /dev/null +++ b/examples/rest/forex-quotes.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v3_quotes__fxticker +# https://polygon-api-client.readthedocs.io/en/latest/Quotes.html#list-quotes + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +quotes = [] +for t in client.list_quotes("C:EUR-USD", "2023-02-01", limit=50000): + quotes.append(t) +print(quotes) diff --git a/examples/rest/forex-real-time_currency_conversion.py b/examples/rest/forex-real-time_currency_conversion.py new file mode 100644 index 00000000..b50099c9 --- /dev/null +++ b/examples/rest/forex-real-time_currency_conversion.py @@ -0,0 +1,15 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v1_conversion__from___to +# https://polygon-api-client.readthedocs.io/en/latest/Quotes.html#get-real-time-currency-conversion + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +rate = client.get_real_time_currency_conversion( + "AUD", + "USD", +) + +print(rate) diff --git a/examples/rest/forex-snapshots_all_tickers.py b/examples/rest/forex-snapshots_all_tickers.py new file mode 100644 index 00000000..8e0ec6bd --- /dev/null +++ b/examples/rest/forex-snapshots_all_tickers.py @@ -0,0 +1,41 @@ +from polygon import RESTClient +from polygon.rest.models import ( + TickerSnapshot, + Agg, +) + +# docs +# https://polygon.io/docs/forex/get_v2_snapshot_locale_global_markets_forex_tickers +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-all-snapshots + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +snapshot = client.get_snapshot_all("forex") # all tickers + +# print raw values +print(snapshot) + +# crunch some numbers +for item in snapshot: + # verify this is an TickerSnapshot + if isinstance(item, TickerSnapshot): + # verify this is an Agg + if isinstance(item.prev_day, Agg): + # verify this is a float + if isinstance(item.prev_day.open, float) and isinstance( + item.prev_day.close, float + ): + percent_change = ( + (item.prev_day.close - item.prev_day.open) + / item.prev_day.open + * 100 + ) + print( + "{:<15}{:<15}{:<15}{:.2f} %".format( + item.ticker, + item.prev_day.open, + item.prev_day.close, + percent_change, + ) + ) diff --git a/examples/rest/forex-snapshots_gainers_losers.py b/examples/rest/forex-snapshots_gainers_losers.py new file mode 100644 index 00000000..dd064e63 --- /dev/null +++ b/examples/rest/forex-snapshots_gainers_losers.py @@ -0,0 +1,37 @@ +from polygon import RESTClient +from polygon.rest.models import ( + TickerSnapshot, +) + +# docs +# https://polygon.io/docs/forex/get_v2_snapshot_locale_global_markets_forex__direction +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-gainers-losers-snapshot + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +# get gainers +gainers = client.get_snapshot_direction("forex", "gainers") +# print(gainers) + +# print ticker with % change +for gainer in gainers: + # verify this is a TickerSnapshot + if isinstance(gainer, TickerSnapshot): + # verify this is a float + if isinstance(gainer.todays_change_percent, float): + print("{:<15}{:.2f} %".format(gainer.ticker, gainer.todays_change_percent)) + +print() + +# get losers +losers = client.get_snapshot_direction("forex", "losers") +# print(losers) + +# print ticker with % change +for loser in losers: + # verify this is a TickerSnapshot + if isinstance(loser, TickerSnapshot): + # verify this is a float + if isinstance(loser.todays_change_percent, float): + print("{:<15}{:.2f} %".format(loser.ticker, loser.todays_change_percent)) diff --git a/examples/rest/forex-snapshots_ticker.py b/examples/rest/forex-snapshots_ticker.py new file mode 100644 index 00000000..9dbfc0ff --- /dev/null +++ b/examples/rest/forex-snapshots_ticker.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v2_snapshot_locale_global_markets_forex_tickers__ticker +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-ticker-snapshot + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +ticker = client.get_snapshot_ticker("forex", "C:EURUSD") +print(ticker) diff --git a/examples/rest/forex-technical_indicators_ema.py b/examples/rest/forex-technical_indicators_ema.py new file mode 100644 index 00000000..ba67ee87 --- /dev/null +++ b/examples/rest/forex-technical_indicators_ema.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v1_indicators_ema__fxticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +ema = client.get_ema( + ticker="C:EURUSD", + timespan="day", + window=50, + series_type="close", +) + +print(ema) diff --git a/examples/rest/forex-technical_indicators_macd.py b/examples/rest/forex-technical_indicators_macd.py new file mode 100644 index 00000000..ee32c4b1 --- /dev/null +++ b/examples/rest/forex-technical_indicators_macd.py @@ -0,0 +1,19 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v1_indicators_macd__fxticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +macd = client.get_macd( + ticker="C:EURUSD", + timespan="day", + short_window=12, + long_window=26, + signal_window=9, + series_type="close", +) + +print(macd) diff --git a/examples/rest/forex-technical_indicators_rsi.py b/examples/rest/forex-technical_indicators_rsi.py new file mode 100644 index 00000000..a63185d4 --- /dev/null +++ b/examples/rest/forex-technical_indicators_rsi.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v1_indicators_rsi__fxticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +rsi = client.get_rsi( + ticker="C:EURUSD", + timespan="day", + window=14, + series_type="close", +) + +print(rsi) diff --git a/examples/rest/forex-technical_indicators_sma.py b/examples/rest/forex-technical_indicators_sma.py new file mode 100644 index 00000000..cd4aab2f --- /dev/null +++ b/examples/rest/forex-technical_indicators_sma.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v1_indicators_sma__fxticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +sma = client.get_sma( + ticker="C:EURUSD", + timespan="day", + window=50, + series_type="close", +) + +print(sma) diff --git a/examples/rest/forex-tickers.py b/examples/rest/forex-tickers.py new file mode 100644 index 00000000..c1736721 --- /dev/null +++ b/examples/rest/forex-tickers.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/forex/get_v3_reference_tickers +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-tickers + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +tickers = [] +for t in client.list_tickers(market="fx", limit=1000): + tickers.append(t) +print(tickers) diff --git a/examples/rest/indices-aggregates_bars.py b/examples/rest/indices-aggregates_bars.py new file mode 100644 index 00000000..b2b561ad --- /dev/null +++ b/examples/rest/indices-aggregates_bars.py @@ -0,0 +1,30 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/indices/get_v2_aggs_ticker__indicesticker__range__multiplier___timespan___from___to +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#polygon.RESTClient.list_aggs + +# API key injected below for easy use. If not provided, the script will attempt +# to use the environment variable "POLYGON_API_KEY". +# +# setx POLYGON_API_KEY "" <- windows +# export POLYGON_API_KEY="" <- mac/linux +# +# Note: To persist the environment variable you need to add the above command +# to the shell startup script (e.g. .bashrc or .bash_profile. +# +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = [] +for a in client.list_aggs( + "I:SPX", + 1, + "day", + "2023-03-10", + "2023-05-12", + limit=50000, +): + aggs.append(a) + +print(aggs) diff --git a/examples/rest/indices-daily_open_close.py b/examples/rest/indices-daily_open_close.py new file mode 100644 index 00000000..f84a51ab --- /dev/null +++ b/examples/rest/indices-daily_open_close.py @@ -0,0 +1,16 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/indices/get_v1_open-close__indicesticker___date +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-daily-open-close-agg + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +# make request +request = client.get_daily_open_close_agg( + "I:SPX", + "2023-03-28", +) + +print(request) diff --git a/examples/rest/indices-market_holidays.py b/examples/rest/indices-market_holidays.py new file mode 100644 index 00000000..0bf112d4 --- /dev/null +++ b/examples/rest/indices-market_holidays.py @@ -0,0 +1,20 @@ +from polygon import RESTClient +from polygon.rest.models import ( + MarketHoliday, +) + +# docs +# https://polygon.io/docs/indices/get_v1_marketstatus_upcoming +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-market-holidays + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +holidays = client.get_market_holidays() +# print(holidays) + +# print date, name, and exchange +for holiday in holidays: + # verify this is an exchange + if isinstance(holiday, MarketHoliday): + print("{:<15}{:<15} ({})".format(holiday.date, holiday.name, holiday.exchange)) diff --git a/examples/rest/indices-market_status.py b/examples/rest/indices-market_status.py new file mode 100644 index 00000000..6c74dee3 --- /dev/null +++ b/examples/rest/indices-market_status.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/indices/get_v1_marketstatus_now +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-market-status + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +result = client.get_market_status() +print(result) diff --git a/examples/rest/indices-previous_close.py b/examples/rest/indices-previous_close.py new file mode 100644 index 00000000..8774bd6e --- /dev/null +++ b/examples/rest/indices-previous_close.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/indices/get_v2_aggs_ticker__indicesticker__prev +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-previous-close-agg + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = client.get_previous_close_agg( + "I:SPX", +) + +print(aggs) diff --git a/examples/rest/indices-snapshots.py b/examples/rest/indices-snapshots.py new file mode 100644 index 00000000..407d2de1 --- /dev/null +++ b/examples/rest/indices-snapshots.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/indices/get_v3_snapshot_indices +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/snapshot.py# + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +tickers = ["I:SPX", "I:DJI", "I:VIX"] +snapshot = client.get_snapshot_indices(tickers) + +# print raw values +print(snapshot) diff --git a/examples/rest/indices-technical_indicators_ema.py b/examples/rest/indices-technical_indicators_ema.py new file mode 100644 index 00000000..bacf9e85 --- /dev/null +++ b/examples/rest/indices-technical_indicators_ema.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/indices/get_v1_indicators_ema__indicesticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +ema = client.get_ema( + ticker="I:SPX", + timespan="day", + window=50, + series_type="close", +) + +print(ema) diff --git a/examples/rest/indices-technical_indicators_macd.py b/examples/rest/indices-technical_indicators_macd.py new file mode 100644 index 00000000..bb3950d1 --- /dev/null +++ b/examples/rest/indices-technical_indicators_macd.py @@ -0,0 +1,19 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/indices/get_v1_indicators_macd__indicesticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +macd = client.get_macd( + ticker="I:SPX", + timespan="day", + short_window=12, + long_window=26, + signal_window=9, + series_type="close", +) + +print(macd) diff --git a/examples/rest/indices-technical_indicators_rsi.py b/examples/rest/indices-technical_indicators_rsi.py new file mode 100644 index 00000000..ec5ca4d6 --- /dev/null +++ b/examples/rest/indices-technical_indicators_rsi.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/indices/get_v1_indicators_rsi__indicesticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +rsi = client.get_rsi( + ticker="I:SPX", + timespan="day", + window=14, + series_type="close", +) + +print(rsi) diff --git a/examples/rest/indices-technical_indicators_sma.py b/examples/rest/indices-technical_indicators_sma.py new file mode 100644 index 00000000..1dfa7b7f --- /dev/null +++ b/examples/rest/indices-technical_indicators_sma.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/indices/get_v1_indicators_sma__indicesticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +sma = client.get_sma( + ticker="I:SPX", + timespan="day", + window=50, + series_type="close", +) + +print(sma) diff --git a/examples/rest/indices-ticker_types.py b/examples/rest/indices-ticker_types.py new file mode 100644 index 00000000..ec3277e9 --- /dev/null +++ b/examples/rest/indices-ticker_types.py @@ -0,0 +1,27 @@ +from typing import Optional, Union, List +from urllib3 import HTTPResponse +from polygon import RESTClient +from polygon.rest.models import ( + TickerTypes, +) + +# docs +# https://polygon.io/docs/indices/get_v3_reference_tickers_types +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-ticker-types + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +types: Optional[Union[List[TickerTypes], HTTPResponse]] = None + +try: + types = client.get_ticker_types("indices") +except TypeError as e: + if "not NoneType" in str(e): + print("None found") + types = None + else: + raise + +if types is not None: + print(types) diff --git a/examples/rest/indices-tickers.py b/examples/rest/indices-tickers.py new file mode 100644 index 00000000..a0786f19 --- /dev/null +++ b/examples/rest/indices-tickers.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/indices/get_v3_reference_tickers +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-tickers + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +tickers = [] +for t in client.list_tickers(market="indices", limit=1000): + tickers.append(t) +print(tickers) diff --git a/examples/rest/options-aggregates_bars.py b/examples/rest/options-aggregates_bars.py new file mode 100644 index 00000000..62e3297b --- /dev/null +++ b/examples/rest/options-aggregates_bars.py @@ -0,0 +1,30 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v2_aggs_ticker__optionsticker__range__multiplier___timespan___from___to +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#polygon.RESTClient.list_aggs + +# API key injected below for easy use. If not provided, the script will attempt +# to use the environment variable "POLYGON_API_KEY". +# +# setx POLYGON_API_KEY "" <- windows +# export POLYGON_API_KEY="" <- mac/linux +# +# Note: To persist the environment variable you need to add the above command +# to the shell startup script (e.g. .bashrc or .bash_profile. +# +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = [] +for a in client.list_aggs( + "O:SPY251219C00650000", + 1, + "day", + "2023-01-30", + "2023-02-03", + limit=50000, +): + aggs.append(a) + +print(aggs) diff --git a/examples/rest/options-conditions.py b/examples/rest/options-conditions.py new file mode 100644 index 00000000..3d72e3e7 --- /dev/null +++ b/examples/rest/options-conditions.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v3_reference_conditions +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-conditions + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +conditions = [] +for c in client.list_conditions("options", limit=1000): + conditions.append(c) +print(conditions) diff --git a/examples/rest/options-contract.py b/examples/rest/options-contract.py new file mode 100644 index 00000000..f87c161e --- /dev/null +++ b/examples/rest/options-contract.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v3_reference_options_contracts__options_ticker +# https://polygon-api-client.readthedocs.io/en/latest/Contracts.html + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +contract = client.get_options_contract("O:EVRI240119C00002500") + +# print raw values +print(contract) diff --git a/examples/rest/options-contracts.py b/examples/rest/options-contracts.py new file mode 100644 index 00000000..34d7327b --- /dev/null +++ b/examples/rest/options-contracts.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v3_reference_options_contracts +# https://polygon-api-client.readthedocs.io/en/latest/Contracts.html#list-options-contracts + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +contracts = [] +for c in client.list_options_contracts("HCP"): + contracts.append(c) +print(contracts) diff --git a/examples/rest/options-daily_open_close.py b/examples/rest/options-daily_open_close.py new file mode 100644 index 00000000..54a700ce --- /dev/null +++ b/examples/rest/options-daily_open_close.py @@ -0,0 +1,16 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v1_open-close__optionsticker___date +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-daily-open-close-agg + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +# make request +request = client.get_daily_open_close_agg( + "O:SPY251219C00650000", + "2023-02-22", +) + +print(request) diff --git a/examples/rest/options-exchanges.py b/examples/rest/options-exchanges.py new file mode 100644 index 00000000..881eed3a --- /dev/null +++ b/examples/rest/options-exchanges.py @@ -0,0 +1,25 @@ +from polygon import RESTClient +from polygon.rest.models import ( + Exchange, +) + +# docs +# https://polygon.io/docs/options/get_v3_reference_exchanges +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-exchanges + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +exchanges = client.get_exchanges("options") +print(exchanges) + +# loop over exchanges +for exchange in exchanges: + # verify this is an exchange + if isinstance(exchange, Exchange): + # print exchange info + print( + "{:<15}{} ({})".format( + exchange.asset_class, exchange.name, exchange.operating_mic + ) + ) diff --git a/examples/rest/options-last_trade.py b/examples/rest/options-last_trade.py new file mode 100644 index 00000000..bf3e7662 --- /dev/null +++ b/examples/rest/options-last_trade.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v2_last_trade__optionsticker +# https://polygon-api-client.readthedocs.io/en/latest/Trades.html#get-last-trade + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +trade = client.get_last_trade( + "O:TSLA210903C00700000", +) + +print(trade) diff --git a/examples/rest/options-market_holidays.py b/examples/rest/options-market_holidays.py new file mode 100644 index 00000000..d6b03ab2 --- /dev/null +++ b/examples/rest/options-market_holidays.py @@ -0,0 +1,20 @@ +from polygon import RESTClient +from polygon.rest.models import ( + MarketHoliday, +) + +# docs +# https://polygon.io/docs/options/get_v1_marketstatus_upcoming +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-market-holidays + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +holidays = client.get_market_holidays() +# print(holidays) + +# print date, name, and exchange +for holiday in holidays: + # verify this is an exchange + if isinstance(holiday, MarketHoliday): + print("{:<15}{:<15} ({})".format(holiday.date, holiday.name, holiday.exchange)) diff --git a/examples/rest/options-market_status.py b/examples/rest/options-market_status.py new file mode 100644 index 00000000..fb8e5ccd --- /dev/null +++ b/examples/rest/options-market_status.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v1_marketstatus_now +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-market-status + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +result = client.get_market_status() +print(result) diff --git a/examples/rest/options-previous_close.py b/examples/rest/options-previous_close.py new file mode 100644 index 00000000..f7b9d06b --- /dev/null +++ b/examples/rest/options-previous_close.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v2_aggs_ticker__optionsticker__prev +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-previous-close-agg + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = client.get_previous_close_agg( + "O:SPY251219C00650000", +) + +print(aggs) diff --git a/examples/rest/options-quotes.py b/examples/rest/options-quotes.py new file mode 100644 index 00000000..71d2577a --- /dev/null +++ b/examples/rest/options-quotes.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v3_quotes__optionsticker +# https://polygon-api-client.readthedocs.io/en/latest/Quotes.html#list-quotes + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +quotes = [] +for t in client.list_quotes("O:SPY241220P00720000", limit=50000): + quotes.append(t) +print(quotes) diff --git a/examples/rest/options-snapshots_option_contract.py b/examples/rest/options-snapshots_option_contract.py new file mode 100644 index 00000000..280e3315 --- /dev/null +++ b/examples/rest/options-snapshots_option_contract.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v3_snapshot_options__underlyingasset___optioncontract +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +snapshot = client.get_snapshot_option("AAPL", "O:AAPL230616C00150000") + +# print raw values +print(snapshot) diff --git a/examples/rest/options-snapshots_options_chain.py b/examples/rest/options-snapshots_options_chain.py new file mode 100644 index 00000000..9ebdd93a --- /dev/null +++ b/examples/rest/options-snapshots_options_chain.py @@ -0,0 +1,19 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v3_snapshot_options__underlyingasset +# ttps://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-all-snapshots + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +options_chain = [] +for o in client.list_snapshot_options_chain( + "HCP", + params={ + "expiration_date.gte": "2024-03-16", + "strike_price.gte": 20, + }, +): + options_chain.append(o) +print(options_chain) diff --git a/examples/rest/options-technical_indicators_ema.py b/examples/rest/options-technical_indicators_ema.py new file mode 100644 index 00000000..ff04ff76 --- /dev/null +++ b/examples/rest/options-technical_indicators_ema.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v1_indicators_ema__optionsticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +ema = client.get_ema( + ticker="O:SPY241220P00720000", timespan="day", window=50, series_type="close" +) + +print(ema) diff --git a/examples/rest/options-technical_indicators_macd.py b/examples/rest/options-technical_indicators_macd.py new file mode 100644 index 00000000..e7961c8f --- /dev/null +++ b/examples/rest/options-technical_indicators_macd.py @@ -0,0 +1,19 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v1_indicators_macd__optionsticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +macd = client.get_macd( + ticker="O:SPY241220P00720000", + timespan="day", + short_window=12, + long_window=26, + signal_window=9, + series_type="close", +) + +print(macd) diff --git a/examples/rest/options-technical_indicators_rsi.py b/examples/rest/options-technical_indicators_rsi.py new file mode 100644 index 00000000..4bf9ebde --- /dev/null +++ b/examples/rest/options-technical_indicators_rsi.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v1_indicators_rsi__optionsticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +rsi = client.get_rsi( + ticker="O:SPY241220P00720000", timespan="day", window=14, series_type="close" +) + +print(rsi) diff --git a/examples/rest/options-technical_indicators_sma.py b/examples/rest/options-technical_indicators_sma.py new file mode 100644 index 00000000..ce6f3d0c --- /dev/null +++ b/examples/rest/options-technical_indicators_sma.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v1_indicators_sma__optionsticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +sma = client.get_sma( + ticker="O:SPY241220P00720000", timespan="day", window=50, series_type="close" +) + +print(sma) diff --git a/examples/rest/options-ticker_details.py b/examples/rest/options-ticker_details.py new file mode 100644 index 00000000..43d59156 --- /dev/null +++ b/examples/rest/options-ticker_details.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v3_reference_tickers__ticker +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-ticker-details + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +details = client.get_ticker_details("TSLA") +print(details) diff --git a/examples/rest/options-ticker_news.py b/examples/rest/options-ticker_news.py new file mode 100644 index 00000000..be9497d7 --- /dev/null +++ b/examples/rest/options-ticker_news.py @@ -0,0 +1,24 @@ +from polygon import RESTClient +from polygon.rest.models import ( + TickerNews, +) + +# docs +# https://polygon.io/docs/options/get_v2_reference_news +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-ticker-news + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +news = [] +for n in client.list_ticker_news("AAPL", order="desc", limit=1000): + news.append(n) + +# print date + title +for index, item in enumerate(news): + # verify this is an agg + if isinstance(item, TickerNews): + print("{:<25}{:<15}".format(item.published_utc, item.title)) + + if index == 20: + break diff --git a/examples/rest/options-tickers.py b/examples/rest/options-tickers.py new file mode 100644 index 00000000..d77ef641 --- /dev/null +++ b/examples/rest/options-tickers.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v3_reference_tickers +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-tickers + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +tickers = [] +for t in client.list_tickers(limit=1000): + tickers.append(t) +print(tickers) diff --git a/examples/rest/options-trades.py b/examples/rest/options-trades.py new file mode 100644 index 00000000..210362d5 --- /dev/null +++ b/examples/rest/options-trades.py @@ -0,0 +1,15 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/options/get_v3_trades__optionsticker +# https://polygon-api-client.readthedocs.io/en/latest/Trades.html#polygon.RESTClient.list_trades + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +trades = [] +for t in client.list_trades("O:TSLA210903C00700000", limit=50000): + trades.append(t) + +# prints each trade that took place +print(trades) diff --git a/examples/rest/raw-get.py b/examples/rest/raw-get.py new file mode 100644 index 00000000..89800015 --- /dev/null +++ b/examples/rest/raw-get.py @@ -0,0 +1,53 @@ +from polygon import RESTClient +from typing import cast +from urllib3 import HTTPResponse + +client = RESTClient() + +aggs = cast( + HTTPResponse, + client.get_aggs( + "AAPL", + 1, + "day", + "2022-04-01", + "2022-04-04", + raw=True, + ), +) +print(aggs.geturl()) +# https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/2022-04-01/2022-04-04 +print(aggs.status) +# 200 +print(aggs.data) +# b'{ +# "ticker": "AAPL", +# "queryCount": 2, +# "resultsCount": 2, +# "adjusted": true, +# "results": [ +# { +# "v": 78251328, +# "vw": 173.4143, +# "o": 174.03, +# "c": 174.31, +# "h": 174.88, +# "l": 171.94, +# "t": 1648785600000, +# "n": 661160 +# }, +# { +# "v": 76545983, +# "vw": 177.4855, +# "o": 174.57, +# "c": 178.44, +# "h": 178.49, +# "l": 174.44, +# "t": 1649044800000, +# "n": 630374 +# } +# ], +# "status": "OK", +# "request_id": "d8882a9d5194978819777f49c44b09c6", +# "count": 2 +# }' diff --git a/examples/rest/raw-list.py b/examples/rest/raw-list.py new file mode 100644 index 00000000..9dd0020e --- /dev/null +++ b/examples/rest/raw-list.py @@ -0,0 +1,83 @@ +from polygon import RESTClient +from typing import cast +from urllib3 import HTTPResponse + +client = RESTClient() + +trades = cast( + HTTPResponse, + client.list_trades("AAA", "2022-04-20", raw=True), +) +print(trades.data) +# b'{ +# "results": [ +# { +# "conditions": [ +# 15 +# ], +# "exchange": 11, +# "id": "52983575627601", +# "participant_timestamp": 1650499200029279200, +# "price": 24.875, +# "sequence_number": 1591291, +# "sip_timestamp": 1650499200029316600, +# "size": 100, +# "tape": 1 +# }, +# { +# "conditions": [ +# 38, +# 41 +# ], +# "exchange": 11, +# "id": "52983575627600", +# "participant_timestamp": 1650499200029279200, +# "price": 24.875, +# "sequence_number": 1591290, +# "sip_timestamp": 1650499200029316600, +# "tape": 1 +# }, +# { +# "conditions": [ +# 15 +# ], +# "exchange": 11, +# "id": "52983575622470", +# "participant_timestamp": 1650493800003024000, +# "price": 24.875, +# "sequence_number": 1571279, +# "sip_timestamp": 1650493800003645400, +# "size": 100, +# "tape": 1 +# }, +# { +# "conditions": [ +# 38, +# 41 +# ], +# "exchange": 11, +# "id": "52983575622469", +# "participant_timestamp": 1650493800003024000, +# "price": 24.875, +# "sequence_number": 1571276, +# "sip_timestamp": 1650493800003635500, +# "tape": 1 +# }, +# { +# "conditions": [ +# 15 +# ], +# "exchange": 11, +# "id": "52983575556178", +# "participant_timestamp": 1650485400002987800, +# "price": 24.875, +# "sequence_number": 1536223, +# "sip_timestamp": 1650485400003870000, +# "size": 100, +# "tape": 1 +# } +# ], +# "status": "OK", +# "request_id": "618bb99e7a632ed9f55454a541404b44", +# "next_url": "https://api.polygon.io/v3/trades/AAA?cursor=YXA9NSZhcz0mbGltaXQ9NSZvcmRlcj1kZXNjJnNvcnQ9dGltZXN0YW1wJnRpbWVzdGFtcC5ndGU9MjAyMi0wNC0yMFQwNCUzQTAwJTNBMDBaJnRpbWVzdGFtcC5sdGU9MjAyMi0wNC0yMFQyMCUzQTEwJTNBMDAuMDAzODY5OTUyWg" +# }' diff --git a/examples/rest/simple-get.py b/examples/rest/simple-get.py new file mode 100644 index 00000000..8a9586ad --- /dev/null +++ b/examples/rest/simple-get.py @@ -0,0 +1,13 @@ +from polygon import RESTClient +from polygon.rest import models + +client = RESTClient() + +aggs = client.get_aggs( + "AAPL", + 1, + "day", + "2022-04-04", + "2022-04-04", +) +print(aggs) diff --git a/examples/rest/simple-list.py b/examples/rest/simple-list.py new file mode 100644 index 00000000..dc93f315 --- /dev/null +++ b/examples/rest/simple-list.py @@ -0,0 +1,8 @@ +from polygon import RESTClient + +client = RESTClient() + +trades = [] +for t in client.list_trades("AAA", "2022-04-04", limit=5): + trades.append(t) +print(trades) diff --git a/examples/rest/stocks-aggregates_bars.py b/examples/rest/stocks-aggregates_bars.py new file mode 100644 index 00000000..c553b00e --- /dev/null +++ b/examples/rest/stocks-aggregates_bars.py @@ -0,0 +1,30 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v2_aggs_ticker__stocksticker__range__multiplier___timespan___from___to +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#polygon.RESTClient.list_aggs + +# API key injected below for easy use. If not provided, the script will attempt +# to use the environment variable "POLYGON_API_KEY". +# +# setx POLYGON_API_KEY "" <- windows +# export POLYGON_API_KEY="" <- mac/linux +# +# Note: To persist the environment variable you need to add the above command +# to the shell startup script (e.g. .bashrc or .bash_profile. +# +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = [] +for a in client.list_aggs( + "AAPL", + 1, + "minute", + "2022-01-01", + "2023-02-03", + limit=50000, +): + aggs.append(a) + +print(aggs) diff --git a/examples/rest/stocks-aggregates_bars_extra.py b/examples/rest/stocks-aggregates_bars_extra.py new file mode 100644 index 00000000..4fd76c37 --- /dev/null +++ b/examples/rest/stocks-aggregates_bars_extra.py @@ -0,0 +1,78 @@ +# This code retrieves stock market data for a specific stock using the +# Polygon REST API and writes it to a CSV file. It uses the "polygon" +# library to communicate with the API and the "csv" library to write +# the data to a CSV file. The script retrieves data for the stock "AAPL" +# for the dates "2023-01-30" to "2023-02-03" in 1 hour intervals. The +# resulting data includes the open, high, low, close, volume, vwap, +# timestamp, transactions, and otc values for each hour. The output is +# then printed to the console. +from polygon import RESTClient +from polygon.rest.models import ( + Agg, +) +import csv +import datetime +import io + +# docs +# https://polygon.io/docs/stocks/get_v2_aggs_ticker__stocksticker__range__multiplier___timespan___from___to +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#polygon.RESTClient.list_aggs + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = [] +for a in client.list_aggs( + "AAPL", + 1, + "hour", + "2023-01-30", + "2023-02-03", + limit=50000, +): + aggs.append(a) + +print(aggs) + +# headers +headers = [ + "timestamp", + "open", + "high", + "low", + "close", + "volume", + "vwap", + "transactions", + "otc", +] + +# creating the csv string +csv_string = io.StringIO() +writer = csv.DictWriter(csv_string, fieldnames=headers) + +# writing headers +writer.writeheader() + +# writing data +for agg in aggs: + # verify this is an agg + if isinstance(agg, Agg): + # verify this is an int + if isinstance(agg.timestamp, int): + writer.writerow( + { + "timestamp": datetime.datetime.fromtimestamp(agg.timestamp / 1000), + "open": agg.open, + "high": agg.high, + "low": agg.low, + "close": agg.close, + "volume": agg.volume, + "vwap": agg.vwap, + "transactions": agg.transactions, + "otc": agg.otc, + } + ) + +# printing the csv string +print(csv_string.getvalue()) diff --git a/examples/rest/stocks-aggregates_bars_highcharts.py b/examples/rest/stocks-aggregates_bars_highcharts.py new file mode 100644 index 00000000..b2529972 --- /dev/null +++ b/examples/rest/stocks-aggregates_bars_highcharts.py @@ -0,0 +1,136 @@ +from polygon import RESTClient +from polygon.rest.models import ( + Agg, +) +import datetime +import http.server +import socketserver +import traceback +import json + +# This program retrieves stock price data for the AAPL stock from the Polygon +# API using a REST client, and formats the data in a format expected by the +# Highcharts JavaScript library. The program creates a web server that serves +# an HTML page that includes a candlestick chart of the AAPL stock prices using +# Highcharts. The chart displays data for the time range from January 1, 2019, +# to February 16, 2023. The chart data is updated by retrieving the latest data +# from the Polygon API every time the HTML page is loaded or refreshed. The +# server listens on port 8888 and exits gracefully when a KeyboardInterrupt is +# received. +# +# Connect to http://localhost:8888 in your browser to view candlestick chart. + +PORT = 8888 + +# https://www.highcharts.com/blog/products/stock/ +# JavaScript StockChart with Date-Time Axis +html = """ + + + + + + + + + + + +
+ + + + +""" + +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = [] +for a in client.list_aggs( + "AAPL", + 1, + "day", + "2019-01-01", + "2023-02-16", + limit=50000, +): + aggs.append(a) + +# print(aggs) + +data = [] + +# writing data +for agg in aggs: + # verify this is an agg + if isinstance(agg, Agg): + # verify this is an int + if isinstance(agg.timestamp, int): + new_record = { + "date": agg.timestamp, + "open": agg.open, + "high": agg.high, + "low": agg.low, + "close": agg.close, + "volume": agg.volume, + } + + data.append(new_record) + +values = [[v for k, v in d.items()] for d in data] + +# json_data = json.dumps(data) +# print(json_data) + + +class handler(http.server.SimpleHTTPRequestHandler): + def do_GET(self): + if self.path == "/data": + self.send_response(200) + self.send_header("Content-type", "application/json") + self.end_headers() + json_data = json.dumps(values) + self.wfile.write(json_data.encode()) + else: + self.send_response(200) + self.send_header("Content-type", "text/html") + self.end_headers() + self.wfile.write(html.encode()) + + +# handle ctrl-c KeyboardInterrupt to exit the program gracefully +try: + while True: + # run http server + with socketserver.TCPServer(("", PORT), handler) as httpd: + print("serving at port", PORT) + httpd.serve_forever() + pass +except KeyboardInterrupt: + print("\nExiting gracefully...") + # traceback.print_exc() diff --git a/examples/rest/stocks-conditions.py b/examples/rest/stocks-conditions.py new file mode 100644 index 00000000..1be9b483 --- /dev/null +++ b/examples/rest/stocks-conditions.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v3_reference_conditions +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-conditions + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +conditions = [] +for c in client.list_conditions(limit=1000): + conditions.append(c) +print(conditions) diff --git a/examples/rest/stocks-daily_open_close.py b/examples/rest/stocks-daily_open_close.py new file mode 100644 index 00000000..65c96265 --- /dev/null +++ b/examples/rest/stocks-daily_open_close.py @@ -0,0 +1,16 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v1_open-close__stocksticker___date +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-daily-open-close-agg + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +# make request +request = client.get_daily_open_close_agg( + "AAPL", + "2023-02-07", +) + +print(request) diff --git a/examples/rest/stocks-dividends.py b/examples/rest/stocks-dividends.py new file mode 100644 index 00000000..75cd795c --- /dev/null +++ b/examples/rest/stocks-dividends.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v3_reference_dividends +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-dividends + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +dividends = [] +for d in client.list_dividends("MSFT", limit=1000): + dividends.append(d) +print(dividends) diff --git a/examples/rest/stocks-exchanges.py b/examples/rest/stocks-exchanges.py new file mode 100644 index 00000000..20c9477a --- /dev/null +++ b/examples/rest/stocks-exchanges.py @@ -0,0 +1,25 @@ +from polygon import RESTClient +from polygon.rest.models import ( + Exchange, +) + +# docs +# https://polygon.io/docs/stocks/get_v3_reference_exchanges +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-exchanges + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +exchanges = client.get_exchanges() +print(exchanges) + +# loop over exchanges +for exchange in exchanges: + # verify this is an exchange + if isinstance(exchange, Exchange): + # print exchange info + print( + "{:<15}{} ({})".format( + exchange.asset_class, exchange.name, exchange.operating_mic + ) + ) diff --git a/examples/rest/stocks-grouped_daily_bars.py b/examples/rest/stocks-grouped_daily_bars.py new file mode 100644 index 00000000..ea0ff1cd --- /dev/null +++ b/examples/rest/stocks-grouped_daily_bars.py @@ -0,0 +1,20 @@ +from polygon import RESTClient +import pprint + +# docs +# https://polygon.io/docs/stocks/get_v2_aggs_grouped_locale_us_market_stocks__date +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-grouped-daily-aggs + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +grouped = client.get_grouped_daily_aggs( + "2023-02-16", +) + +# print(grouped) + +# pprint (short for "pretty-print") is a module that provides a more human- +# readable output format for data structures. +pp = pprint.PrettyPrinter(indent=2) +pp.pprint(grouped) diff --git a/examples/rest/stocks-ipos.py b/examples/rest/stocks-ipos.py new file mode 100644 index 00000000..cc09f61b --- /dev/null +++ b/examples/rest/stocks-ipos.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/rest/stocks/corporate-actions/ipos + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +ipos = [] +for ipo in client.vx.list_ipos(ticker="RDDT"): + ipos.append(ipo) + +print(ipos) diff --git a/examples/rest/stocks-last_quote.py b/examples/rest/stocks-last_quote.py new file mode 100644 index 00000000..15b83e55 --- /dev/null +++ b/examples/rest/stocks-last_quote.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v2_last_nbbo__stocksticker +# https://polygon-api-client.readthedocs.io/en/latest/Quotes.html#get-last-quote + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +quote = client.get_last_quote( + "AAPL", +) + +print(quote) diff --git a/examples/rest/stocks-last_trade.py b/examples/rest/stocks-last_trade.py new file mode 100644 index 00000000..42278ba0 --- /dev/null +++ b/examples/rest/stocks-last_trade.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v2_last_trade__stocksticker +# https://polygon-api-client.readthedocs.io/en/latest/Trades.html#get-last-trade + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +trade = client.get_last_trade( + "AAPL", +) + +print(trade) diff --git a/examples/rest/stocks-market_holidays.py b/examples/rest/stocks-market_holidays.py new file mode 100644 index 00000000..054bfa87 --- /dev/null +++ b/examples/rest/stocks-market_holidays.py @@ -0,0 +1,20 @@ +from polygon import RESTClient +from polygon.rest.models import ( + MarketHoliday, +) + +# docs +# https://polygon.io/docs/stocks/get_v1_marketstatus_upcoming +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-market-holidays + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +holidays = client.get_market_holidays() +# print(holidays) + +# print date, name, and exchange +for holiday in holidays: + # verify this is an exchange + if isinstance(holiday, MarketHoliday): + print("{:<15}{:<15} ({})".format(holiday.date, holiday.name, holiday.exchange)) diff --git a/examples/rest/stocks-market_status.py b/examples/rest/stocks-market_status.py new file mode 100644 index 00000000..bd4362b3 --- /dev/null +++ b/examples/rest/stocks-market_status.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v1_marketstatus_now +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-market-status + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +result = client.get_market_status() +print(result) diff --git a/examples/rest/stocks-previous_close.py b/examples/rest/stocks-previous_close.py new file mode 100644 index 00000000..9785ab2e --- /dev/null +++ b/examples/rest/stocks-previous_close.py @@ -0,0 +1,14 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v2_aggs_ticker__stocksticker__prev +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#get-previous-close-agg + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = client.get_previous_close_agg( + "AAPL", +) + +print(aggs) diff --git a/examples/rest/stocks-quotes.py b/examples/rest/stocks-quotes.py new file mode 100644 index 00000000..4d615dab --- /dev/null +++ b/examples/rest/stocks-quotes.py @@ -0,0 +1,21 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v3_quotes__stockticker +# https://polygon-api-client.readthedocs.io/en/latest/Quotes.html#list-quotes + +# NBBO (National Best Bid and Offer) is a term used in the financial industry +# to describe the best bid and offer prices for a particular stock or security +# being traded on all the available stock exchanges in the United States. It +# provides information on the highest price a buyer is willing to pay (best +# bid) and the lowest price a seller is willing to accept (best offer) for a +# particular security. This information is used by traders to make informed +# investment decisions and execute trades at the best available price. + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +quotes = [] +for t in client.list_quotes("IBIO", "2023-02-01", limit=50000): + quotes.append(t) +print(quotes) diff --git a/examples/rest/stocks-related_companies.py b/examples/rest/stocks-related_companies.py new file mode 100644 index 00000000..84b3a405 --- /dev/null +++ b/examples/rest/stocks-related_companies.py @@ -0,0 +1,10 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v1_related-companies__ticker + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +related_companies = client.get_related_companies("AAPL") +print(related_companies) diff --git a/examples/rest/stocks-short_interest.py b/examples/rest/stocks-short_interest.py new file mode 100644 index 00000000..6a9f7ea1 --- /dev/null +++ b/examples/rest/stocks-short_interest.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/rest/stocks/fundamentals/short-interest + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +items = [] +for item in client.list_short_interest(ticker="RDDT"): + items.append(item) + +print(items) diff --git a/examples/rest/stocks-short_volume.py b/examples/rest/stocks-short_volume.py new file mode 100644 index 00000000..c127867a --- /dev/null +++ b/examples/rest/stocks-short_volume.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/rest/stocks/fundamentals/short-volume + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +items = [] +for item in client.list_short_volume(ticker="RDDT"): + items.append(item) + +print(items) diff --git a/examples/rest/stocks-snapshots_all.py b/examples/rest/stocks-snapshots_all.py new file mode 100644 index 00000000..d1682983 --- /dev/null +++ b/examples/rest/stocks-snapshots_all.py @@ -0,0 +1,45 @@ +from polygon import RESTClient +from polygon.rest.models import ( + TickerSnapshot, + Agg, +) + +# docs +# https://polygon.io/docs/stocks/get_v2_snapshot_locale_us_markets_stocks_tickers +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-all-snapshots + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +# tickers we are interested in +tickers = ["TSLA", "AAPL", "MSFT", "META"] + +# snapshot = client.get_snapshot_all("stocks") # all tickers +snapshot = client.get_snapshot_all("stocks", tickers) + +# print raw values +print(snapshot) + +# crunch some numbers +for item in snapshot: + # verify this is an TickerSnapshot + if isinstance(item, TickerSnapshot): + # verify this is an Agg + if isinstance(item.prev_day, Agg): + # verify this is a float + if isinstance(item.prev_day.open, float) and isinstance( + item.prev_day.close, float + ): + percent_change = ( + (item.prev_day.close - item.prev_day.open) + / item.prev_day.open + * 100 + ) + print( + "{:<15}{:<15}{:<15}{:.2f} %".format( + item.ticker, + item.prev_day.open, + item.prev_day.close, + percent_change, + ) + ) diff --git a/examples/rest/stocks-snapshots_gainers_losers.py b/examples/rest/stocks-snapshots_gainers_losers.py new file mode 100644 index 00000000..d0a0e365 --- /dev/null +++ b/examples/rest/stocks-snapshots_gainers_losers.py @@ -0,0 +1,37 @@ +from polygon import RESTClient +from polygon.rest.models import ( + TickerSnapshot, +) + +# docs +# https://polygon.io/docs/stocks/get_v2_snapshot_locale_us_markets_stocks__direction +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-gainers-losers-snapshot + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +# get gainers +gainers = client.get_snapshot_direction("stocks", "gainers") +# print(gainers) + +# print ticker with % change +for gainer in gainers: + # verify this is a TickerSnapshot + if isinstance(gainer, TickerSnapshot): + # verify this is a float + if isinstance(gainer.todays_change_percent, float): + print("{:<15}{:.2f} %".format(gainer.ticker, gainer.todays_change_percent)) + +print() + +# get losers +losers = client.get_snapshot_direction("stocks", "losers") +# print(losers) + +# print ticker with % change +for loser in losers: + # verify this is a TickerSnapshot + if isinstance(loser, TickerSnapshot): + # verify this is a float + if isinstance(loser.todays_change_percent, float): + print("{:<15}{:.2f} %".format(loser.ticker, loser.todays_change_percent)) diff --git a/examples/rest/stocks-snapshots_ticker.py b/examples/rest/stocks-snapshots_ticker.py new file mode 100644 index 00000000..2b264338 --- /dev/null +++ b/examples/rest/stocks-snapshots_ticker.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v2_snapshot_locale_us_markets_stocks_tickers__stocksticker +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html#get-ticker-snapshot + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +ticker = client.get_snapshot_ticker("stocks", "AAPL") +print(ticker) diff --git a/examples/rest/stocks-stock_financials.py b/examples/rest/stocks-stock_financials.py new file mode 100644 index 00000000..a75087e7 --- /dev/null +++ b/examples/rest/stocks-stock_financials.py @@ -0,0 +1,20 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_vx_reference_financials +# https://polygon-api-client.readthedocs.io/en/latest/vX.html#list-stock-financials + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +financials = [] +for f in client.vx.list_stock_financials("AAPL", filing_date="2024-11-01"): + financials.append(f) + + # get diluted_earnings_per_share + # print(f.financials.income_statement.diluted_earnings_per_share) + + # get net_income_loss + # print(f.financials.income_statement.net_income_loss) + +print(financials) diff --git a/examples/rest/stocks-stock_splits.py b/examples/rest/stocks-stock_splits.py new file mode 100644 index 00000000..55980973 --- /dev/null +++ b/examples/rest/stocks-stock_splits.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v3_reference_splits +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-splits + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +splits = [] +for s in client.list_splits("TSLA", limit=1000): + splits.append(s) +print(splits) diff --git a/examples/rest/stocks-technical_indicators_ema.py b/examples/rest/stocks-technical_indicators_ema.py new file mode 100644 index 00000000..20092d7e --- /dev/null +++ b/examples/rest/stocks-technical_indicators_ema.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v1_indicators_ema__stockticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +ema = client.get_ema( + ticker="AAPL", + timespan="day", + window=50, + series_type="close", +) + +print(ema) diff --git a/examples/rest/stocks-technical_indicators_macd.py b/examples/rest/stocks-technical_indicators_macd.py new file mode 100644 index 00000000..187e8ae6 --- /dev/null +++ b/examples/rest/stocks-technical_indicators_macd.py @@ -0,0 +1,19 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v1_indicators_macd__stockticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +macd = client.get_macd( + ticker="AAPL", + timespan="day", + short_window=12, + long_window=26, + signal_window=9, + series_type="close", +) + +print(macd) diff --git a/examples/rest/stocks-technical_indicators_rsi.py b/examples/rest/stocks-technical_indicators_rsi.py new file mode 100644 index 00000000..a69d6ae3 --- /dev/null +++ b/examples/rest/stocks-technical_indicators_rsi.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v1_indicators_rsi__stockticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +rsi = client.get_rsi( + ticker="AAPL", + timespan="day", + window=14, + series_type="close", +) + +print(rsi) diff --git a/examples/rest/stocks-technical_indicators_sma.py b/examples/rest/stocks-technical_indicators_sma.py new file mode 100644 index 00000000..41a9c7c4 --- /dev/null +++ b/examples/rest/stocks-technical_indicators_sma.py @@ -0,0 +1,17 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v1_indicators_sma__stockticker +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/indicators.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +sma = client.get_sma( + ticker="AAPL", + timespan="day", + window=50, + series_type="close", +) + +print(sma) diff --git a/examples/rest/stocks-ticker_details.py b/examples/rest/stocks-ticker_details.py new file mode 100644 index 00000000..5f81b4bc --- /dev/null +++ b/examples/rest/stocks-ticker_details.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v3_reference_tickers__ticker +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-ticker-details + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +details = client.get_ticker_details("AAPL") +print(details) diff --git a/examples/rest/stocks-ticker_events.py b/examples/rest/stocks-ticker_events.py new file mode 100644 index 00000000..09b13432 --- /dev/null +++ b/examples/rest/stocks-ticker_events.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_vx_reference_tickers__id__events +# https://github.com/polygon-io/client-python/blob/master/polygon/rest/reference.py + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +events = client.get_ticker_events("META") +print(events) diff --git a/examples/rest/stocks-ticker_news.py b/examples/rest/stocks-ticker_news.py new file mode 100644 index 00000000..fa834891 --- /dev/null +++ b/examples/rest/stocks-ticker_news.py @@ -0,0 +1,26 @@ +from polygon import RESTClient +from polygon.rest.models import ( + TickerNews, +) + +# docs +# https://polygon.io/docs/stocks/get_v2_reference_news +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-ticker-news + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +news = [] +for n in client.list_ticker_news("BBBY", order="desc", limit=1000): + news.append(n) + +# print(news) + +# print date + title +for index, item in enumerate(news): + # verify this is an agg + if isinstance(item, TickerNews): + print("{:<25}{:<15}".format(item.published_utc, item.title)) + + if index == 20: + break diff --git a/examples/rest/stocks-ticker_types.py b/examples/rest/stocks-ticker_types.py new file mode 100644 index 00000000..fa09338d --- /dev/null +++ b/examples/rest/stocks-ticker_types.py @@ -0,0 +1,11 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v3_reference_tickers_types +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#get-ticker-types + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +types = client.get_ticker_types() +print(types) diff --git a/examples/rest/stocks-tickers.py b/examples/rest/stocks-tickers.py new file mode 100644 index 00000000..7fc09230 --- /dev/null +++ b/examples/rest/stocks-tickers.py @@ -0,0 +1,13 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v3_reference_tickers +# https://polygon-api-client.readthedocs.io/en/latest/Reference.html#list-tickers + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +tickers = [] +for t in client.list_tickers(market="stocks", type="CS", active=True, limit=1000): + tickers.append(t) +print(tickers) diff --git a/examples/rest/stocks-trades.py b/examples/rest/stocks-trades.py new file mode 100644 index 00000000..8f2f147b --- /dev/null +++ b/examples/rest/stocks-trades.py @@ -0,0 +1,21 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v3_trades__stockticker +# https://polygon-api-client.readthedocs.io/en/latest/Trades.html#polygon.RESTClient.list_trades + +# Trade data refers to the tick records of individual transactions that have +# taken place in a financial market, such as the price, size, and time of +# each trade. It provides a high-frequency, granular view of market activity, +# and is used by traders, investors, and researchers to gain insights into +# market behavior and inform their investment decisions. + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +trades = [] +for t in client.list_trades("IBIO", "2023-02-01", limit=50000): + trades.append(t) + +# prints each trade that took place +print(trades) diff --git a/examples/rest/stocks-trades_extra.py b/examples/rest/stocks-trades_extra.py new file mode 100644 index 00000000..1fcf566d --- /dev/null +++ b/examples/rest/stocks-trades_extra.py @@ -0,0 +1,27 @@ +# This code retrieves trade records and counts the amount of money that changes hands. +from polygon import RESTClient +from polygon.rest.models import ( + Trade, +) + +# docs +# https://polygon.io/docs/stocks/get_v3_trades__stockticker +# https://polygon-api-client.readthedocs.io/en/latest/Trades.html#polygon.RESTClient.list_trades + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + +# used to track money across trades +money = float(0) + +# loop through and count price * volume +for t in client.list_trades("DIS", "2023-02-07", limit=50000): + # verify this is an Trade + if isinstance(t, Trade): + # verify these are float + if isinstance(t.price, float) and isinstance(t.size, int): + money += t.price * t.size + +# format the number so it's human readable +formatted_number = "{:,.2f}".format(money) +print("Roughly " + formatted_number + " changed hands for DIS on 2023-02-07.") diff --git a/examples/rest/universal-snapshot.py b/examples/rest/universal-snapshot.py new file mode 100644 index 00000000..1ab5e804 --- /dev/null +++ b/examples/rest/universal-snapshot.py @@ -0,0 +1,47 @@ +from typing import cast, Iterator, Union +from urllib3 import HTTPResponse +from polygon import RESTClient +from polygon.rest.models import UniversalSnapshot, SnapshotMarketType + +# docs +# https://polygon.io/docs/stocks/get_v3_snapshot +# https://polygon-api-client.readthedocs.io/en/latest/Snapshot.html + +# client = RESTClient("XXXXXX") # hardcoded api_key is used +client = RESTClient() # POLYGON_API_KEY environment variable is used + + +def print_snapshots(iterator: Union[Iterator[UniversalSnapshot], HTTPResponse]): + snapshots = [s for s in iterator] + + print(f"count: {len(snapshots)}") + + for item in snapshots: + print(item) + + +# it = client.list_universal_snapshots() # all tickers for all assets types in lexicographical order + +it = client.list_universal_snapshots( + ticker_any_of=[ + "AAPL", + "O:AAPL230519C00055000", + "DOES_NOT_EXIST", + "X:1INCHUSD", + "C:AEDAUD", + ] +) +print_snapshots(it) + +it = client.list_universal_snapshots(type="stocks", ticker_gt="A", ticker_lt="AAPL") +print_snapshots(it) + +it = client.list_universal_snapshots(type="stocks", ticker_gte="AAPL", ticker_lte="ABB") +print_snapshots(it) + +it = client.list_universal_snapshots( + type="options", + ticker_gte="O:AAPL230804C00050000", + ticker_lte="O:AAPL230804C00070000", +) +print_snapshots(it) diff --git a/examples/tools/async_websocket_rest_handler/async_websocket_rest_handler.py b/examples/tools/async_websocket_rest_handler/async_websocket_rest_handler.py new file mode 100644 index 00000000..d60a257c --- /dev/null +++ b/examples/tools/async_websocket_rest_handler/async_websocket_rest_handler.py @@ -0,0 +1,109 @@ +import asyncio +import logging +import os +import re +from concurrent.futures import ThreadPoolExecutor +from typing import Optional, Union +from polygon import RESTClient, WebSocketClient +from polygon.websocket.models import Market, Feed + + +class ApiCallHandler: + def __init__(self): + self.api_call_queue = asyncio.Queue() + self.executor = ThreadPoolExecutor() # Thread pool for running synchronous code + self.client = RESTClient() # Assumes POLYGON_API_KEY is set in the environment + + async def enqueue_api_call(self, options_ticker): + await self.api_call_queue.put(options_ticker) + + async def start_processing_api_calls(self): + while True: + options_ticker = await self.api_call_queue.get() + try: + # TODO: + # Here, you can process the rest api requets as needed + # Example: Get the options contract for this + contract = await asyncio.get_running_loop().run_in_executor( + self.executor, self.get_options_contract, options_ticker + ) + print(contract) # Or process the contract data as needed + except Exception as e: + logging.error(f"Error processing API call for {options_ticker}: {e}") + finally: + self.api_call_queue.task_done() + + def get_options_contract(self, options_ticker): + return self.client.get_options_contract(options_ticker) + + +class MessageHandler: + def __init__(self, api_call_handler): + self.handler_queue = asyncio.Queue() + self.api_call_handler = api_call_handler + + async def add(self, message_response: Optional[Union[str, bytes]]) -> None: + await self.handler_queue.put(message_response) + + async def start_handling(self) -> None: + while True: + message_response = await self.handler_queue.get() + logging.info(f"Received message: {message_response}") + try: + # TODO: + # Here, you can process the websocket messages as needed + # Example: Extract ticker symbol and enqueue REST API call + # to get the options contract for this trade (non-blocking) + for trade in message_response: + ticker = self.extract_symbol(trade.symbol) + if ticker == "NVDA": + asyncio.create_task( + self.api_call_handler.enqueue_api_call(trade.symbol) + ) + except Exception as e: + logging.error(f"Error handling message: {e}") + finally: + self.handler_queue.task_done() + + def extract_symbol(self, input_string): + match = re.search(r"O:([A-Z]+)", input_string) + if match: + return match.group(1) + else: + return None + + +class MyClient: + def __init__(self, feed, market, subscriptions): + api_key = os.getenv("POLYGON_API_KEY") + self.polygon_websocket_client = WebSocketClient( + api_key=api_key, + feed=feed, + market=market, + verbose=True, + subscriptions=subscriptions, + ) + self.api_call_handler = ApiCallHandler() + self.message_handler = MessageHandler(self.api_call_handler) + + async def start_event_stream(self): + try: + await asyncio.gather( + self.polygon_websocket_client.connect(self.message_handler.add), + self.message_handler.start_handling(), + self.api_call_handler.start_processing_api_calls(), + ) + except Exception as e: + logging.error(f"Error in event stream: {e}") + + +async def main(): + logging.basicConfig(level=logging.INFO) + my_client = MyClient( + feed=Feed.RealTime, market=Market.Options, subscriptions=["T.*"] + ) + await my_client.start_event_stream() + + +# Entry point for the asyncio program +asyncio.run(main()) diff --git a/examples/tools/async_websocket_rest_handler/readme.md b/examples/tools/async_websocket_rest_handler/readme.md new file mode 100644 index 00000000..a4482ff3 --- /dev/null +++ b/examples/tools/async_websocket_rest_handler/readme.md @@ -0,0 +1,16 @@ +# Pattern for Non-Blocking WebSocket and REST Calls in Python + +This script demonstrates a non-blocking pattern for handling WebSocket streams and REST API calls in Python using asyncio. It focuses on efficient, concurrent processing of real-time financial data and asynchronous fetching of additional information, ensuring that real-time data streams are managed without delays or blockages. The tutorial provides both theoretical insights and a practical, adaptable example, ideal for applications in financial data processing and similar real-time data handling scenarios. + +Please see the [tutorial](https://polygon.io/blog/pattern-for-non-blocking-websocket-and-rest-calls-in-python) for more details. + +### Prerequisites + +- Python 3.x +- Polygon.io account and Options API key + +### Running the Example + +``` +python3 async_websocket_rest_handler.py +``` \ No newline at end of file diff --git a/examples/tools/docker/Dockerfile b/examples/tools/docker/Dockerfile new file mode 100644 index 00000000..253c1fc1 --- /dev/null +++ b/examples/tools/docker/Dockerfile @@ -0,0 +1,19 @@ +# Use an official Python runtime as a parent image +FROM python:3.8-slim + +# Set the working directory in the container +WORKDIR /usr/src/app + +# Copy the current directory contents into the container at /usr/src/app +COPY . . + +# Install any needed packages specified in requirements.txt +RUN pip install --no-cache-dir polygon-api-client + +# Set the environment variable for the Polygon API key +# Note: Replace "" with your actual API key or use Docker's --env flag when running the container to set it dynamically +# Warning: Not recommended for production or shared environments +ENV POLYGON_API_KEY= + +# Run the script when the container launches +CMD ["python", "./app.py"] diff --git a/examples/tools/docker/app.py b/examples/tools/docker/app.py new file mode 100644 index 00000000..8e5c0223 --- /dev/null +++ b/examples/tools/docker/app.py @@ -0,0 +1,20 @@ +from polygon import RESTClient + +# docs +# https://polygon.io/docs/stocks/get_v2_aggs_ticker__stocksticker__range__multiplier___timespan___from___to +# https://polygon-api-client.readthedocs.io/en/latest/Aggs.html#polygon.RESTClient.list_aggs + +client = RESTClient() # POLYGON_API_KEY environment variable is used + +aggs = [] +for a in client.list_aggs( + "AAPL", + 1, + "hour", + "2024-01-30", + "2024-01-30", + limit=50000, +): + aggs.append(a) + +print(aggs) diff --git a/examples/tools/docker/readme.md b/examples/tools/docker/readme.md new file mode 100644 index 00000000..776fd70c --- /dev/null +++ b/examples/tools/docker/readme.md @@ -0,0 +1,41 @@ +# Dockerized Python Application with Polygon API Client + +This Docker setup provides a ready-to-use environment for running Python scripts that utilize the `polygon-api-client` for financial data processing. It encapsulates the Python environment and the `polygon-api-client` library in a Docker container, making it easy to deploy and run the application consistently across any system with Docker installed. This approach is particularly useful for developers looking to integrate Polygon's financial data APIs into their applications without worrying about environment inconsistencies. + +### Prerequisites + +- [Docker](https://www.docker.com/) installed on your machine +- [Polygon.io](https://polygon.io/) account and API key + +### Setup and Configuration + +1. Clone the repository or download the Dockerfile and your Python script into a directory. +2. Use Docker's `--env` flag when running the container to set the `POLYGON_API_KEY` environment variable dynamically, or replace `` in the Dockerfile with your Polygon API key (not recommended for production or shared environments). +3. Ensure your Python script (e.g., `app.py`) is in the same directory as the Dockerfile. + +### Building the Docker Image + +Any modifications to the Python script will require rebuilding the Docker image to reflect the changes in the containerized environment. Use the docker build command each time your script is updated to ensure the latest version is used in your Docker container. + +Navigate to the directory containing your Dockerfile and execute the following command to build your Docker image: + +``` +docker build -t polygon-client-app . +``` + +This command creates a Docker image named `polygon-client-app` based on the instructions in your Dockerfile. + +### Running the Docker Container + +Run your Docker container using the following command: + +``` +docker run --env POLYGON_API_KEY="" polygon-client-app +``` + +Replace `` with your actual Polygon API key. This command starts a Docker container based on the `polygon-client-app` image, sets the `POLYGON_API_KEY` environment variable to your provided API key, and runs your Python script inside the container. + +### Additional Notes + +- The Docker setup provided here is a very basic example. Depending on your specific requirements, you might need to customize the Dockerfile, such as adding volume mounts for persistent data or exposing ports for network communication. +- For more details on using the Polygon API and the `polygon-api-client` library, please refer to the [Polygon documentation](https://polygon.io/docs), the [polygon-io/client-python](https://github.com/polygon-io/client-python) repo, or the [polygon-api-client documentation](https://polygon-api-client.readthedocs.io/en/latest/). \ No newline at end of file diff --git a/examples/tools/flatfiles-stock-trades/exchange-heatmap.py b/examples/tools/flatfiles-stock-trades/exchange-heatmap.py new file mode 100644 index 00000000..060b6350 --- /dev/null +++ b/examples/tools/flatfiles-stock-trades/exchange-heatmap.py @@ -0,0 +1,68 @@ +# We can use a Python script that aggregates trades by exchange into 30-minute +# chunks, setting the stage for a visual analysis. This approach will highlight +# trade flows, including opening hours and peak activity times, across the +# exchanges. Please see https://polygon.io/blog/insights-from-trade-level-data +# +import pandas as pd # type: ignore +import seaborn as sns # type: ignore +import matplotlib.pyplot as plt # type: ignore +import numpy as np # type: ignore +import pytz # type: ignore + +# Replace '2024-04-05.csv' with the path to your actual file +file_path = "2024-04-05.csv" + +# Load the CSV file into a pandas DataFrame +df = pd.read_csv(file_path) + +# Convert 'participant_timestamp' to datetime (assuming nanoseconds Unix timestamp) +df["participant_timestamp"] = pd.to_datetime( + df["participant_timestamp"], unit="ns", utc=True +) + +# Convert to Eastern Time (ET), accounting for both EST and EDT +df["participant_timestamp"] = df["participant_timestamp"].dt.tz_convert( + "America/New_York" +) + +# Create a new column for 30-minute time intervals, now in ET +df["time_interval"] = df["participant_timestamp"].dt.floor("30T").dt.time + +# Ensure full 24-hour coverage by generating all possible 30-minute intervals +all_intervals = pd.date_range(start="00:00", end="23:59", freq="30T").time +all_exchanges = df["exchange"].unique() +full_index = pd.MultiIndex.from_product( + [all_exchanges, all_intervals], names=["exchange", "time_interval"] +) + +# Group by 'exchange' and 'time_interval', count trades, and reset index +grouped = ( + df.groupby(["exchange", "time_interval"]) + .size() + .reindex(full_index, fill_value=0) + .reset_index(name="trade_count") +) + +# Pivot the DataFrame for the heatmap, ensuring all intervals and exchanges are represented +pivot_table = grouped.pivot("exchange", "time_interval", "trade_count").fillna(0) + +# Apply a log scale transformation to the trade counts + 1 to handle zero trades correctly +log_scale_data = np.log1p(pivot_table.values) + +# Plotting the heatmap using the log scale data +plt.figure(figsize=(20, 10)) +sns.heatmap( + log_scale_data, + annot=False, + cmap="Reds", + linewidths=0.5, + cbar=False, + xticklabels=[t.strftime("%H:%M") for t in all_intervals], + yticklabels=pivot_table.index, +) +plt.title("Trade Count Heatmap by Exchange and Time Interval (Log Scale, ET)") +plt.ylabel("Exchange") +plt.xlabel("Time Interval (ET)") +plt.xticks(rotation=45) +plt.tight_layout() # Adjust layout to not cut off labels +plt.show() diff --git a/examples/tools/flatfiles-stock-trades/exchanges-seen.py b/examples/tools/flatfiles-stock-trades/exchanges-seen.py new file mode 100644 index 00000000..70fb5081 --- /dev/null +++ b/examples/tools/flatfiles-stock-trades/exchanges-seen.py @@ -0,0 +1,23 @@ +# Here's a Python script for analyzing the dataset, that identifies the +# distribution of trades across different exchanges and calculates their +# respective percentages of the total trades. Please see +# https://polygon.io/blog/insights-from-trade-level-data +# +import pandas as pd # type: ignore + +# Replace '2024-04-05.csv' with the path to your actual file +file_path = "2024-04-05.csv" + +# Load the CSV file into a pandas DataFrame +df = pd.read_csv(file_path) + +# Count the number of trades for each exchange +exchange_counts = df["exchange"].value_counts() + +# Calculate the total number of trades +total_trades = exchange_counts.sum() + +# Print out all exchanges and their percentage of total trades +for exchange, count in exchange_counts.items(): + percentage = (count / total_trades) * 100 + print(f"Exchange {exchange}: {count} trades, {percentage:.2f}% of total trades") diff --git a/examples/tools/flatfiles-stock-trades/heatmap.png b/examples/tools/flatfiles-stock-trades/heatmap.png new file mode 100644 index 00000000..9cf4c0ac Binary files /dev/null and b/examples/tools/flatfiles-stock-trades/heatmap.png differ diff --git a/examples/tools/flatfiles-stock-trades/histogram.png b/examples/tools/flatfiles-stock-trades/histogram.png new file mode 100644 index 00000000..1ccb62dd Binary files /dev/null and b/examples/tools/flatfiles-stock-trades/histogram.png differ diff --git a/examples/tools/flatfiles-stock-trades/readme.md b/examples/tools/flatfiles-stock-trades/readme.md new file mode 100644 index 00000000..c794b3ba --- /dev/null +++ b/examples/tools/flatfiles-stock-trades/readme.md @@ -0,0 +1,86 @@ +# Polygon.io Flat Files Stock Trades Analysis Scripts + +This repository contains Python scripts for analyzing stock market trading data using Flat Files from Polygon.io. These scripts demonstrate various ways to dissect and visualize trade data for comprehensive market analysis. + +Please see the tutorial: [Deep Dive into Trade-Level Data with Flat Files](https://polygon.io/blog/insights-from-trade-level-data) + +## Scripts Overview + +### **exchange-heatmap.py** +This script aggregates trades by exchange into 30-minute chunks and creates a heatmap visualization. It highlights the flow of trades and peak activity times across different exchanges, providing insights into how different exchanges operate throughout the day. + +![Treemap Visualization](./heatmap.png) + +### **exchanges-seen.py** +Analyzes the distribution of trades across different exchanges and calculates their respective percentages of total trades. This script helps identify which exchanges handle the most trading volume, offering a perspective on market structure. + +``` +Exchange 4: 25,570,324 trades, 36.32% of total trades +Exchange 12: 15,147,689 trades, 21.52% of total trades +Exchange 11: 6,877,306 trades, 9.77% of total trades +Exchange 19: 5,098,852 trades, 7.24% of total trades +Exchange 10: 4,006,611 trades, 5.69% of total trades +Exchange 8: 3,686,168 trades, 5.24% of total trades +Exchange 15: 2,446,340 trades, 3.47% of total trades +Exchange 21: 2,173,744 trades, 3.09% of total trades +Exchange 7: 1,509,083 trades, 2.14% of total trades +Exchange 20: 1,296,811 trades, 1.84% of total trades +Exchange 18: 674,553 trades, 0.96% of total trades +Exchange 13: 527,767 trades, 0.75% of total trades +Exchange 2: 417,295 trades, 0.59% of total trades +Exchange 3: 393,919 trades, 0.56% of total trades +Exchange 17: 230,210 trades, 0.33% of total trades +Exchange 1: 183,010 trades, 0.26% of total trades +Exchange 9: 159,020 trades, 0.23% of total trades +Exchange 14: 1,211 trades, 0.00% of total trades +``` + +### **top-10-tickers.py** +Identifies the top 10 most traded stocks and calculates their respective percentages of the total trades. This script provides a clear view of the market's most active stocks, highlighting where the most trading activity is concentrated. + +``` +TSLA: 1,549,605 trades, 2.20% of total trades +NVDA: 788,331 trades, 1.12% of total trades +SPY: 669,762 trades, 0.95% of total trades +AMD: 587,140 trades, 0.83% of total trades +MDIA: 561,698 trades, 0.80% of total trades +AAPL: 540,870 trades, 0.77% of total trades +SOXL: 533,511 trades, 0.76% of total trades +QQQ: 508,822 trades, 0.72% of total trades +CADL: 466,604 trades, 0.66% of total trades +AMZN: 465,526 trades, 0.66% of total trades +``` + +### **trades-histogram.py** +Creates a histogram that aggregates trades into 30-minute intervals throughout the day. This visualization helps understand the distribution of trading volume across different times, including pre-market, regular trading hours, and after-hours. + +![Treemap Visualization](./histogram.png) + +## Download the Data + +First, let's download an actual file and explore the data and see what we can learn. We start by downloading the trades for 2024-04-05 via the [File Browser](https://polygon.io/flat-files/stocks-trades/2024/04). The `us_stocks_sip/trades_v1/2024/04/2024-04-05.csv.gz` file is about 1.35GB and is in a compressed gzip format. + +``` +gunzip 2024-04-05.csv.gz +``` + +## Getting Started + +To run these scripts, you will need Python 3 and several dependencies installed, including pandas, matplotlib, seaborn, and pytz. Ensure that you have the trading data file available and modify the `file_path` variable in each script to point to your data file location. + +``` +pip install pandas matplotlib seaborn pytz +``` + +## Usage + +Each script is designed to be run independently: + +```bash +python exchange-heatmap.py +python exchanges-seen.py +python top-10-tickers.py +python trades-histogram.py +``` + +Adjust the script parameters as necessary to fit your specific analysis needs or to accommodate different datasets. \ No newline at end of file diff --git a/examples/tools/flatfiles-stock-trades/top-10-tickers.py b/examples/tools/flatfiles-stock-trades/top-10-tickers.py new file mode 100644 index 00000000..ec046e0b --- /dev/null +++ b/examples/tools/flatfiles-stock-trades/top-10-tickers.py @@ -0,0 +1,25 @@ +# Here's a Python script for analyzing the dataset, that identifies the top 10 +# most traded stocks and calculates their respective percentages of the total +# trades. Please see https://polygon.io/blog/insights-from-trade-level-data +# +import pandas as pd # type: ignore + +# Replace '2024-04-05.csv' with the path to your actual file +file_path = "2024-04-05.csv" + +# Load the CSV file into a pandas DataFrame +df = pd.read_csv(file_path) + +# Count the number of trades for each ticker +trade_counts = df["ticker"].value_counts() + +# Calculate the total number of trades +total_trades = trade_counts.sum() + +# Get the top 10 traded stocks +top_10_traded = trade_counts.head(10) + +# Print out the top 10 traded stocks and their percentage of total trades +for ticker, count in top_10_traded.items(): + percentage = (count / total_trades) * 100 + print(f"{ticker}: {count} trades, {percentage:.2f}% of total trades") diff --git a/examples/tools/flatfiles-stock-trades/trades-histogram.py b/examples/tools/flatfiles-stock-trades/trades-histogram.py new file mode 100644 index 00000000..6651978d --- /dev/null +++ b/examples/tools/flatfiles-stock-trades/trades-histogram.py @@ -0,0 +1,63 @@ +# To visualize these dynamics, we can use a Python script to create a histogram +# aggregating trades into 30-minute intervals, providing a clear view of when +# trading activity concentrates during the day. This analysis aims to highlight +# the distribution of trading volume across the day, from pre-market to after- +# hours. Please see https://polygon.io/blog/insights-from-trade-level-data +# +import pandas as pd # type: ignore +import matplotlib.pyplot as plt # type: ignore + +# Replace '2024-04-05.csv' with the path to your actual file +file_path = "2024-04-05.csv" + +# Load the CSV file into a pandas DataFrame +df = pd.read_csv(file_path) + +# Convert 'participant_timestamp' to datetime (assuming nanoseconds Unix timestamp) +df["participant_timestamp"] = pd.to_datetime( + df["participant_timestamp"], unit="ns", utc=True +) + +# Convert to Eastern Time (ET), accounting for both EST and EDT +df["participant_timestamp"] = df["participant_timestamp"].dt.tz_convert( + "America/New_York" +) + +# Create a new column for 30-minute time intervals, now in ET +df["time_interval"] = df["participant_timestamp"].dt.floor("30T") + +# Aggregate trades into 30-minute intervals for the entire dataset +trade_counts_per_interval = df.groupby("time_interval").size() + +# Prepare the plot +plt.figure(figsize=(15, 7)) + +# Plotting the histogram/bar chart +bars = plt.bar( + trade_counts_per_interval.index, trade_counts_per_interval.values, width=0.02 +) + +# Adding trade count annotations on each bar +for bar in bars: + height = bar.get_height() + plt.annotate( + f"{int(height)}", + xy=(bar.get_x() + bar.get_width() / 2, height), + xytext=(0, 3), # 3 points vertical offset + textcoords="offset points", + ha="center", + va="bottom", + ) + +plt.title("Trade Counts Aggregated by 30-Minute Intervals (ET)") +plt.xlabel("Time Interval (ET)") +plt.ylabel("Number of Trades") +plt.xticks(rotation=45, ha="right") + +# Ensure that every 30-minute interval is represented on the x-axis +plt.gca().set_xticklabels( + [t.strftime("%Y-%m-%d %H:%M") for t in trade_counts_per_interval.index], rotation=90 +) + +plt.tight_layout() +plt.show() diff --git a/examples/tools/hunting-anomalies/README.md b/examples/tools/hunting-anomalies/README.md new file mode 100644 index 00000000..4b36f1b5 --- /dev/null +++ b/examples/tools/hunting-anomalies/README.md @@ -0,0 +1,49 @@ +# Hunting Anomalies in the Stock Market + +This repository contains all the necessary scripts and data directories used in the [Hunting Anomalies in the Stock Market](https://polygon.io/blog/hunting-anomalies-in-stock-market/) tutorial, hosted on Polygon.io's blog. The tutorial demonstrates how to detect statistical anomalies in historical US stock market data through a comprehensive workflow that involves downloading data, building a lookup table, querying for anomalies, and visualizing them through a web interface. + +### Prerequisites + +- Python 3.8+ +- Access to Polygon.io's historical data via Flat Files +- An active Polygon.io API key, obtainable by signing up for a Stocks paid plan + +### Repository Contents + +- `README.md`: This file, outlining setup and execution instructions. +- `aggregates_day`: Directory where downloaded CSV data files are stored. +- `build-lookup-table.py`: Python script to build a lookup table from the historical data. +- `query-lookup-table.py`: Python script to query the lookup table for anomalies. +- `gui-lookup-table.py`: Python script for a browser-based interface to explore anomalies visually. + +### Running the Tutorial + +1. **Ensure Python 3.8+ is installed:** Check your Python version and ensure all required libraries (polygon-api-client, pandas, pickle, and argparse) are installed. + +2. **Set up your API key:** Make sure you have an active paid Polygon.io Stock subscription for accessing Flat Files. Set up your API key in your environment or directly in the scripts where required. + +3. **Download Historical Data:** Use the MinIO client to download historical stock market data. Adjust the commands and paths based on the data you are interested in. + ```bash + mc alias set s3polygon https://files.polygon.io YOUR_ACCESS_KEY YOUR_SECRET_KEY + mc cp --recursive s3polygon/flatfiles/us_stocks_sip/day_aggs_v1/2024/08/ ./aggregates_day/ + mc cp --recursive s3polygon/flatfiles/us_stocks_sip/day_aggs_v1/2024/09/ ./aggregates_day/ + mc cp --recursive s3polygon/flatfiles/us_stocks_sip/day_aggs_v1/2024/10/ ./aggregates_day/ + gunzip ./aggregates_day/*.gz + ``` + +4. **Build the Lookup Table:** This script processes the downloaded data and builds a lookup table, saving it as `lookup_table.pkl`. + ```bash + python build-lookup-table.py + ``` + +5. **Query Anomalies:** Replace `2024-10-18` with the date you want to analyze for anomalies. + ```bash + python query-lookup-table.py 2024-10-18 + ``` + +6. **Run the GUI:** Access the web interface at `http://localhost:8888` to explore the anomalies visually. + ```bash + python gui-lookup-table.py + ``` + +For a complete step-by-step guide on each phase of the anomaly detection process, including additional configurations and troubleshooting, refer to the detailed [tutorial on our blog](https://polygon.io/blog/hunting-anomalies-in-stock-market/). diff --git a/examples/tools/hunting-anomalies/aggregates_day/README.md b/examples/tools/hunting-anomalies/aggregates_day/README.md new file mode 100644 index 00000000..a0ade480 --- /dev/null +++ b/examples/tools/hunting-anomalies/aggregates_day/README.md @@ -0,0 +1 @@ +Download flat files into here. diff --git a/examples/tools/hunting-anomalies/build-lookup-table.py b/examples/tools/hunting-anomalies/build-lookup-table.py new file mode 100644 index 00000000..16abca2d --- /dev/null +++ b/examples/tools/hunting-anomalies/build-lookup-table.py @@ -0,0 +1,91 @@ +import os +import pandas as pd # type: ignore +from collections import defaultdict +import pickle +import json +from typing import DefaultDict, Dict, Any, BinaryIO + +# Directory containing the daily CSV files +data_dir = "./aggregates_day/" + +# Initialize a dictionary to hold trades data +trades_data = defaultdict(list) + +# List all CSV files in the directory +files = sorted([f for f in os.listdir(data_dir) if f.endswith(".csv")]) + +print("Starting to process files...") + +# Process each file (assuming files are named in order) +for file in files: + print(f"Processing {file}") + file_path = os.path.join(data_dir, file) + df = pd.read_csv(file_path) + # For each stock, store the date and relevant data + for _, row in df.iterrows(): + ticker = row["ticker"] + date = pd.to_datetime(row["window_start"], unit="ns").date() + trades = row["transactions"] + close_price = row["close"] # Ensure 'close' column exists in your CSV + trades_data[ticker].append( + {"date": date, "trades": trades, "close_price": close_price} + ) + +print("Finished processing files.") +print("Building lookup table...") + +# Now, build the lookup table with rolling averages and percentage price change +lookup_table: DefaultDict[str, Dict[str, Any]] = defaultdict( + dict +) # Nested dict: ticker -> date -> stats + +for ticker, records in trades_data.items(): + # Convert records to DataFrame + df_ticker = pd.DataFrame(records) + # Sort records by date + df_ticker.sort_values("date", inplace=True) + df_ticker.set_index("date", inplace=True) + + # Calculate the percentage change in close_price + df_ticker["price_diff"] = ( + df_ticker["close_price"].pct_change() * 100 + ) # Multiply by 100 for percentage + + # Shift trades to exclude the current day from rolling calculations + df_ticker["trades_shifted"] = df_ticker["trades"].shift(1) + # Calculate rolling average and standard deviation over the previous 5 days + df_ticker["avg_trades"] = df_ticker["trades_shifted"].rolling(window=5).mean() + df_ticker["std_trades"] = df_ticker["trades_shifted"].rolling(window=5).std() + # Store the data in the lookup table + for date, row in df_ticker.iterrows(): + # Convert date to string for JSON serialization + date_str = date.strftime("%Y-%m-%d") + # Ensure rolling stats are available + if pd.notnull(row["avg_trades"]) and pd.notnull(row["std_trades"]): + lookup_table[ticker][date_str] = { + "trades": row["trades"], + "close_price": row["close_price"], + "price_diff": row["price_diff"], + "avg_trades": row["avg_trades"], + "std_trades": row["std_trades"], + } + else: + # Store data without rolling stats if not enough data points + lookup_table[ticker][date_str] = { + "trades": row["trades"], + "close_price": row["close_price"], + "price_diff": row["price_diff"], + "avg_trades": None, + "std_trades": None, + } + +print("Lookup table built successfully.") + +# Convert defaultdict to regular dict for JSON serialization +lookup_table_dict = {k: v for k, v in lookup_table.items()} + +# Save the lookup table to a file for later use +with open("lookup_table.pkl", "wb") as f: # type: BinaryIO + pickle.dump(lookup_table_dict, f) + +print("Lookup table saved to 'lookup_table.pkl'.") diff --git a/examples/tools/hunting-anomalies/gui-lookup-table.py b/examples/tools/hunting-anomalies/gui-lookup-table.py new file mode 100644 index 00000000..df58746c --- /dev/null +++ b/examples/tools/hunting-anomalies/gui-lookup-table.py @@ -0,0 +1,302 @@ +import os +import pickle +import json +from datetime import datetime +from polygon import RESTClient +from polygon.rest.models import Agg +import http.server +import socketserver +import traceback +from urllib.parse import urlparse, parse_qs + +PORT = 8888 + +# Load the lookup_table +with open("lookup_table.pkl", "rb") as f: + lookup_table = pickle.load(f) + + +class handler(http.server.SimpleHTTPRequestHandler): + def do_GET(self): + # Parse the path and query parameters + parsed_path = urlparse(self.path) + path = parsed_path.path + query_params = parse_qs(parsed_path.query) + + if path == "/": + # Handle the root path + # Get the date parameter if provided + date_param = query_params.get("date", [None])[0] + + # Get all dates from the lookup table + all_dates = set() + for ticker_data in lookup_table.values(): + all_dates.update(ticker_data.keys()) + all_dates = sorted(all_dates) + + # If date is None, get the latest date from the lookup table + if date_param is None: + if all_dates: + latest_date = max(all_dates) + else: + self.send_response(200) + self.send_header("Content-type", "text/html") + self.end_headers() + html_content = ( + "

No data available.

" + ) + self.wfile.write(html_content.encode()) + return + else: + latest_date = date_param + + # Ensure latest_date is in all_dates + if latest_date not in all_dates: + # Handle the case where the provided date is invalid + self.send_response(400) + self.send_header("Content-type", "text/html") + self.end_headers() + error_html = f"

Error: No data available for date {latest_date}

" + self.wfile.write(error_html.encode()) + return + + # Now, get the anomalies for the latest_date + anomalies = [] + for ticker, date_data in lookup_table.items(): + if latest_date in date_data: + data = date_data[latest_date] + trades = data["trades"] + avg_trades = data["avg_trades"] + std_trades = data["std_trades"] + if ( + avg_trades is not None + and std_trades is not None + and std_trades > 0 + ): + z_score = (trades - avg_trades) / std_trades + threshold_multiplier = 3 # Adjust as needed + if z_score > threshold_multiplier: + anomalies.append( + { + "ticker": ticker, + "date": latest_date, + "trades": trades, + "avg_trades": avg_trades, + "std_trades": std_trades, + "z_score": z_score, + "close_price": data["close_price"], + "price_diff": data["price_diff"], + } + ) + # Sort anomalies by trades in descending order + anomalies.sort(key=lambda x: x["trades"], reverse=True) + # Generate the HTML to display the anomalies + self.send_response(200) + self.send_header("Content-type", "text/html") + self.end_headers() + # Build the HTML content + html_content = 'Anomalies for {}'.format( + latest_date + ) + html_content += '

Anomalies for {}

'.format( + latest_date + ) + # Add navigation links (prev and next dates) + current_index = all_dates.index(latest_date) + prev_date = all_dates[current_index - 1] if current_index > 0 else None + next_date = ( + all_dates[current_index + 1] + if current_index < len(all_dates) - 1 + else None + ) + html_content += "

" + if prev_date: + html_content += 'Previous Date '.format( + prev_date + ) + if next_date: + html_content += 'Next Date '.format(next_date) + html_content += "

" + # Display the anomalies in a table + html_content += ( + '' + ) + html_content += "" + html_content += "" + html_content += "" + html_content += "" + html_content += "" + html_content += "" + html_content += "" + html_content += "" + html_content += "" + html_content += "" + for anomaly in anomalies: + html_content += "" + html_content += "".format(anomaly["ticker"]) + html_content += "".format(anomaly["trades"]) + html_content += "".format(anomaly["avg_trades"]) + html_content += "".format(anomaly["std_trades"]) + html_content += "".format(anomaly["z_score"]) + html_content += "".format(anomaly["close_price"]) + html_content += "".format(anomaly["price_diff"]) + # Add a link to the chart + html_content += ( + ''.format( + anomaly["ticker"], latest_date + ) + ) + html_content += "" + html_content += '
TickerTradesAvg TradesStd DevZ-scoreClose PricePrice DiffChart
{}{}{:.2f}{:.2f}{:.2f}{:.2f}{:.2f}View Chart
' + html_content += "
" + self.wfile.write(html_content.encode()) + elif path == "/chart": + # Handle the chart page + # Get 'ticker' and 'date' from query parameters + ticker = query_params.get("ticker", [None])[0] + date = query_params.get("date", [None])[0] + if ticker is None or date is None: + # Return an error page + self.send_response(400) + self.send_header("Content-type", "text/html") + self.end_headers() + error_html = "

Error: Missing ticker or date parameter

" + self.wfile.write(error_html.encode()) + else: + # Fetch minute aggregates for the ticker and date + client = RESTClient( + trace=True + ) # POLYGON_API_KEY environment variable is used + try: + aggs = [] + date_from = date + date_to = date + for a in client.list_aggs( + ticker, + 1, + "minute", + date_from, + date_to, + limit=50000, + ): + aggs.append(a) + # Prepare data for the chart + data = [] + for agg in aggs: + if isinstance(agg, Agg) and isinstance(agg.timestamp, int): + new_record = [ + agg.timestamp, + agg.open, + agg.high, + agg.low, + agg.close, + ] + data.append(new_record) + # Generate the HTML for the chart page + chart_html = """ + + + + + + + + + + + + +
+ +
+ + + """ % ( + json.dumps(data), + ticker, + date, + ticker, + ) + self.send_response(200) + self.send_header("Content-type", "text/html") + self.send_header("Access-Control-Allow-Origin", "*") + self.end_headers() + self.wfile.write(chart_html.encode()) + except Exception as e: + # Handle exceptions + self.send_response(500) + self.send_header("Content-type", "text/html") + self.end_headers() + error_html = "

Error fetching data: {}

".format( + str(e) + ) + self.wfile.write(error_html.encode()) + else: + # Serve files from the current directory + super().do_GET() + + +def run_server(): + with socketserver.TCPServer(("", PORT), handler) as httpd: + print("serving at port", PORT) + try: + httpd.serve_forever() + except KeyboardInterrupt: + print("\nExiting gracefully...") + httpd.shutdown() + httpd.server_close() + + +if __name__ == "__main__": + run_server() diff --git a/examples/tools/hunting-anomalies/query-lookup-table.py b/examples/tools/hunting-anomalies/query-lookup-table.py new file mode 100644 index 00000000..38bb86cf --- /dev/null +++ b/examples/tools/hunting-anomalies/query-lookup-table.py @@ -0,0 +1,63 @@ +import pickle +import argparse + +# Parse command-line arguments +parser = argparse.ArgumentParser(description="Anomaly Detection Script") +parser.add_argument("date", type=str, help="Target date in YYYY-MM-DD format") +args = parser.parse_args() + +# Load the lookup_table +with open("lookup_table.pkl", "rb") as f: + lookup_table = pickle.load(f) + +# Threshold for considering an anomaly (e.g., 3 standard deviations) +threshold_multiplier = 3 + +# Date for which we want to find anomalies +target_date_str = args.date + +# List to store anomalies +anomalies = [] + +# Iterate over all tickers in the lookup table +for ticker, date_data in lookup_table.items(): + if target_date_str in date_data: + data = date_data[target_date_str] + trades = data["trades"] + avg_trades = data["avg_trades"] + std_trades = data["std_trades"] + if avg_trades is not None and std_trades is not None and std_trades > 0: + z_score = (trades - avg_trades) / std_trades + if z_score > threshold_multiplier: + anomalies.append( + { + "ticker": ticker, + "date": target_date_str, + "trades": trades, + "avg_trades": avg_trades, + "std_trades": std_trades, + "z_score": z_score, + "close_price": data["close_price"], + "price_diff": data["price_diff"], + } + ) + +# Sort anomalies by trades in descending order +anomalies.sort(key=lambda x: x["trades"], reverse=True) + +# Print the anomalies with aligned columns +print(f"\nAnomalies Found for {target_date_str}:\n") +print( + f"{'Ticker':<10}{'Trades':>10}{'Avg Trades':>15}{'Std Dev':>10}{'Z-score':>10}{'Close Price':>12}{'Price Diff':>12}" +) +print("-" * 91) +for anomaly in anomalies: + print( + f"{anomaly['ticker']:<10}" + f"{anomaly['trades']:>10.0f}" + f"{anomaly['avg_trades']:>15.2f}" + f"{anomaly['std_trades']:>10.2f}" + f"{anomaly['z_score']:>10.2f}" + f"{anomaly['close_price']:>12.2f}" + f"{anomaly['price_diff']:>12.2f}" + ) diff --git a/examples/tools/related-companies/data.json b/examples/tools/related-companies/data.json new file mode 100644 index 00000000..2b63ea05 --- /dev/null +++ b/examples/tools/related-companies/data.json @@ -0,0 +1 @@ +{"nodes": [{"id": 1, "label": "MSFT"}, {"id": 2, "label": "GOOGL"}, {"id": 3, "label": "NVDA"}, {"id": 4, "label": "AMZN"}, {"id": 5, "label": "GOOG"}, {"id": 6, "label": "META"}, {"id": 7, "label": "TSLA"}, {"id": 8, "label": "AAPL"}, {"id": 9, "label": "CRM"}, {"id": 10, "label": "ORCL"}, {"id": 11, "label": "AMD"}, {"id": 12, "label": "NFLX"}, {"id": 13, "label": "WMT"}, {"id": 14, "label": "DIS"}, {"id": 15, "label": "SNAP"}, {"id": 16, "label": "SHOP"}, {"id": 17, "label": "INTC"}, {"id": 18, "label": "ANET"}, {"id": 19, "label": "RIVN"}, {"id": 20, "label": "GM"}, {"id": 21, "label": "F"}, {"id": 22, "label": "LCID"}, {"id": 23, "label": "WBD"}, {"id": 24, "label": "CMCSA"}, {"id": 25, "label": "PARA"}, {"id": 26, "label": "T"}, {"id": 27, "label": "ROKU"}], "edges": [{"from": 1, "to": 2}, {"from": 1, "to": 3}, {"from": 1, "to": 4}, {"from": 1, "to": 5}, {"from": 1, "to": 6}, {"from": 1, "to": 7}, {"from": 1, "to": 8}, {"from": 1, "to": 9}, {"from": 1, "to": 10}, {"from": 1, "to": 11}, {"from": 4, "to": 1}, {"from": 4, "to": 2}, {"from": 4, "to": 5}, {"from": 4, "to": 8}, {"from": 4, "to": 7}, {"from": 4, "to": 3}, {"from": 4, "to": 6}, {"from": 4, "to": 12}, {"from": 4, "to": 13}, {"from": 4, "to": 14}, {"from": 6, "to": 5}, {"from": 6, "to": 2}, {"from": 6, "to": 1}, {"from": 6, "to": 4}, {"from": 6, "to": 8}, {"from": 6, "to": 7}, {"from": 6, "to": 3}, {"from": 6, "to": 15}, {"from": 6, "to": 12}, {"from": 6, "to": 11}, {"from": 8, "to": 1}, {"from": 8, "to": 2}, {"from": 8, "to": 4}, {"from": 8, "to": 5}, {"from": 8, "to": 7}, {"from": 8, "to": 3}, {"from": 8, "to": 6}, {"from": 8, "to": 12}, {"from": 8, "to": 14}, {"from": 8, "to": 11}, {"from": 5, "to": 2}, {"from": 5, "to": 1}, {"from": 5, "to": 6}, {"from": 5, "to": 4}, {"from": 5, "to": 8}, {"from": 5, "to": 7}, {"from": 5, "to": 3}, {"from": 5, "to": 15}, {"from": 5, "to": 12}, {"from": 5, "to": 16}, {"from": 3, "to": 11}, {"from": 3, "to": 6}, {"from": 3, "to": 2}, {"from": 3, "to": 7}, {"from": 3, "to": 5}, {"from": 3, "to": 1}, {"from": 3, "to": 8}, {"from": 3, "to": 4}, {"from": 3, "to": 17}, {"from": 3, "to": 18}, {"from": 7, "to": 19}, {"from": 7, "to": 2}, {"from": 7, "to": 4}, {"from": 7, "to": 20}, {"from": 7, "to": 21}, {"from": 7, "to": 22}, {"from": 7, "to": 5}, {"from": 7, "to": 6}, {"from": 7, "to": 8}, {"from": 7, "to": 3}, {"from": 14, "to": 12}, {"from": 14, "to": 23}, {"from": 14, "to": 4}, {"from": 14, "to": 24}, {"from": 14, "to": 25}, {"from": 14, "to": 8}, {"from": 14, "to": 2}, {"from": 14, "to": 26}, {"from": 14, "to": 5}, {"from": 14, "to": 27}]} \ No newline at end of file diff --git a/examples/tools/related-companies/index.html b/examples/tools/related-companies/index.html new file mode 100644 index 00000000..1b5ae182 --- /dev/null +++ b/examples/tools/related-companies/index.html @@ -0,0 +1,30 @@ + + + + Vis Network | Related Companies + + + + + +
+ + diff --git a/examples/tools/related-companies/readme.md b/examples/tools/related-companies/readme.md new file mode 100644 index 00000000..9f107550 --- /dev/null +++ b/examples/tools/related-companies/readme.md @@ -0,0 +1,36 @@ +# See Connections with the Related Companies API + +This repository contains the Python script and HTML file used in our tutorial to demonstrate how to identify and visualize relationships between companies using Polygon.io's Related Companies API. The tutorial showcases how to fetch related company data and create a dynamic network graph using Python and vis.js, providing insights into the interconnected corporate landscape. + +![Related Companies](./related-companies.png) + +Please see the [tutorial](https://polygon.io/blog/related-companies-api) for more details. + +### Prerequisites + +- Python 3.8+ +- Have Polygon.io's [python client](https://github.com/polygon-io/client-python) installed +- An active Polygon.io account with an API key + +### Repository Contents + +- `related-companies-demo.py`: Python script to fetch and process data from the Related Companies API. +- `index.html`: HTML file for visualizing the data as a network graph using vis.js. + +### Running the Example + +To run the Python script, ensure you have Python installed and your API key ready. Execute the following command: + +``` +python related-companies-demo.py +``` + +The script will generate a `data.json` file, which contains the nodes and edges for the network graph. + +To visualize the relationships: + +1. Take the `nodes` and `edges` from the `data.json` file and replace them in the `index.html` file +2. Open `index.html` in your web browser. +3. The web page should display the network graph. + +For a complete step-by-step guide on setting up and exploring the capabilities of the Related Companies API, refer to our detailed [tutorial](https://polygon.io/blog/related-companies-api). \ No newline at end of file diff --git a/examples/tools/related-companies/related-companies-demo.py b/examples/tools/related-companies/related-companies-demo.py new file mode 100644 index 00000000..221d5f0f --- /dev/null +++ b/examples/tools/related-companies/related-companies-demo.py @@ -0,0 +1,40 @@ +from polygon import RESTClient +import json + + +def get_related_tickers(): + client = RESTClient(trace=True) + + # Fetch a limited list of tickers to keep the example manageable + main_tickers = ["MSFT", "AMZN", "META", "AAPL", "GOOG", "NVDA", "TSLA", "DIS"] + + # Prepare data structures for nodes and edges + nodes = [] + edges = [] + id_map = {} + current_id = 1 + + # Iterate over each main ticker and find related tickers + for ticker in main_tickers: + if ticker not in id_map: + id_map[ticker] = current_id + nodes.append({"id": current_id, "label": ticker}) + current_id += 1 + + related_companies = client.get_related_companies(ticker) + for company in related_companies: + related_ticker = company.ticker + if related_ticker not in id_map: + id_map[related_ticker] = current_id + nodes.append({"id": current_id, "label": related_ticker}) + current_id += 1 + + edges.append({"from": id_map[ticker], "to": id_map[related_ticker]}) + + # Save the nodes and edges to a JSON file for web visualization + with open("data.json", "w") as f: + json.dump({"nodes": nodes, "edges": edges}, f) + + +if __name__ == "__main__": + get_related_tickers() diff --git a/examples/tools/related-companies/related-companies.png b/examples/tools/related-companies/related-companies.png new file mode 100644 index 00000000..ac9b14c7 Binary files /dev/null and b/examples/tools/related-companies/related-companies.png differ diff --git a/examples/tools/treemap/market-wide-treemap.png b/examples/tools/treemap/market-wide-treemap.png new file mode 100644 index 00000000..3e072d92 Binary files /dev/null and b/examples/tools/treemap/market-wide-treemap.png differ diff --git a/examples/tools/treemap/polygon_sic_code_data_gatherer.py b/examples/tools/treemap/polygon_sic_code_data_gatherer.py new file mode 100644 index 00000000..bb1a2611 --- /dev/null +++ b/examples/tools/treemap/polygon_sic_code_data_gatherer.py @@ -0,0 +1,130 @@ +import json +import concurrent.futures +from polygon import RESTClient + +# Initialize Polygon API client +client = RESTClient( + trace=True +) # Assuming you have POLYGON_API_KEY environment variable set up + +# Initialize the data structure to hold SIC code groups +sic_code_groups = {} + + +# https://en.wikipedia.org/wiki/Standard_Industrial_Classification +# https://www.investopedia.com/terms/s/sic_code.asp +def sic_code_to_group(sic_code): + """ + Maps a given SIC code to the industry group. + """ + sic_code = int(sic_code) + if 100 <= sic_code <= 999: + return "Agriculture, Forestry and Fishing" + elif 1000 <= sic_code <= 1499: + return "Mining" + elif 1500 <= sic_code <= 1799: + return "Construction" + # Note: 1800-1999 not used + elif 2000 <= sic_code <= 3999: + return "Manufacturing" + elif 4000 <= sic_code <= 4999: + return "Transportation and Public Utilities" + elif 5000 <= sic_code <= 5199: + return "Wholesale Trade" + elif 5200 <= sic_code <= 5999: + return "Retail Trade" + elif 6000 <= sic_code <= 6799: + return "Finance, Insurance and Real Estate" + elif 7000 <= sic_code <= 8999: + return "Services" + elif 9100 <= sic_code <= 9729: + return "Public Administration" + elif 9900 <= sic_code <= 9999: + return "Nonclassifiable" + else: + return None + + +def process_ticker(ticker_snapshot): + ticker = ticker_snapshot.ticker + + try: + details = client.get_ticker_details(ticker) + + # Check if the type is 'CS' (common stock), if not, return early without processing this ticker + # if getattr(details, 'type', None) != 'CS' or getattr(details, 'market_cap', None) != None: + if ( + getattr(details, "type", None) != "CS" + or getattr(details, "market_cap", None) is None + ): + return + + sic_code = details.sic_code + sic_description = getattr( + details, "sic_description", None + ) # Use getattr to avoid AttributeError if sic_description is not present + market_cap = getattr(details, "market_cap", None) + + # if sic_code: + # sic_code = str(sic_code)[:1] # Extract first 1 digits + + if sic_code: + sic_group = sic_code_to_group(sic_code) + if sic_group is None: + return + + # Check if the sic_code is already in the groups, if not create a new entry with sic_description and empty companies list + # if sic_code not in sic_code_groups: + # sic_code_groups[sic_code] = {"sic_description": sic_description, "companies": []} + + if sic_group not in sic_code_groups: + sic_code_groups[sic_group] = { + "sic_description": sic_group, + "companies": [], + } + + # Append the company details to the corresponding SIC code entry + # sic_code_groups[sic_code]["companies"].append({ + # "ticker": ticker, + # "market_cap": market_cap + # }) + + sic_code_groups[sic_group]["companies"].append( + {"ticker": ticker, "market_cap": market_cap} + ) + + except Exception as e: + print(f"Error processing ticker {ticker}: {e}") + + +# Get snapshot data +snapshot = client.get_snapshot_all("stocks") + +# Execute the data processing in parallel, limited to 100 workers +with concurrent.futures.ThreadPoolExecutor(max_workers=100) as executor: + executor.map(process_ticker, snapshot) + +# Modify the SIC Code Groups Dictionary to include the weights +for sic_code, group_data in sic_code_groups.items(): + companies = group_data["companies"] + total_market_cap = sum( + company["market_cap"] for company in companies if company["market_cap"] + ) + + # If total_market_cap is 0, we will skip weight calculation to avoid division by zero + if total_market_cap == 0: + continue + + for company in companies: + if company[ + "market_cap" + ]: # Avoid dividing by zero if a company's market cap is None or 0 + company["weight"] = company["market_cap"] / total_market_cap + else: + company["weight"] = 0 # You can also set to a default value if preferred + +# Save the enhanced data structure to a JSON file +with open("sic_code_groups.json", "w") as f: + json.dump(sic_code_groups, f) + +print("Data collection complete and saved to 'sic_code_groups.json'") diff --git a/examples/tools/treemap/readme.md b/examples/tools/treemap/readme.md new file mode 100644 index 00000000..f0512051 --- /dev/null +++ b/examples/tools/treemap/readme.md @@ -0,0 +1,60 @@ +# Mapping Market Movements with Polygon.io and D3.js Treemap + +This repository offers a tutorial on how to create a Treemap visualization of the current stock market conditions. Using D3.js Treemap, Polygon.io's [Snapshot API](https://polygon.io/docs/stocks/get_v2_snapshot_locale_us_markets_stocks_tickers), and the [python-client library](https://github.com/polygon-io/client-python), we'll guide you through building an interactive visualization. The Snapshot API allows us to fetch the most recent market data for all US-traded stocks, transforming them into color-coded nested rectangles within the Treemap. This presents an insightful and interactive snapshot of the market's current status. + +![Treemap Visualization](./market-wide-treemap.png) + +Please see the [tutorial](https://polygon.io/blog/market-movements-with-treemap) for more details. + +## Structure + +The repo consists of: + +- `polygon_sic_code_data_gatherer.py`: Builds ticker to SIC code mapping for treemap groups. +- `sic_code_groups.json`: Pre-built JSON file containing grouped ticker to SIC code data. +- `treemap_server.py`: Simple server to host the treemap visualization (requires sic_code_groups.json). + +For those interested in the underlying mechanics, the `polygon_sic_code_data_gatherer.py` script retrieves a snapshot of all ticker symbols, processes each one to obtain its SIC code via the Ticker Details API, and then saves these classifications into the file named `sic_code_groups.json`. + +The logic of this SIC code-to-group enables us to transform a large dataset into a neatly structured visualization. This structured approach facilitates easy identification of market conditions, providing a snapshot of the market's overall health. You don't need to do anything since it is pre-built but we added the script if you wanted to modify anything. + +## Getting Started + +Setting up and visualizing the stock market's current conditions is straightforward. All you'll need to do is clone the repository, secure an API key from Polygon.io, install the required Python library, launch the visualization server example, and then dive into the visualization through your web browser. + +### Prerequisites + +- Python 3.x +- Polygon.io account and API key + +### Setup + +1. Clone the repository: + ``` + git clone https://github.com/polygon-io/client-python.git + ``` + +2. Install the necessary Python packages. + ``` + pip install -U polygon-api-client + ``` + +3. Store your Polygon.io API key securely, or set it as an environment variable: + ``` + export POLYGON_API_KEY=YOUR_API_KEY_HERE + ``` + +### Running the Treemap Server + +Change into the treemap example directory and execute the `treemap_server.py` script: +``` +cd examples/tools/treemap +python3 treemap_server.py +``` + +Upon successful execution, the server will start, and you can view the treemap visualization by navigating to: +``` +http://localhost:8889 +``` + +That’s it. You'll now see a Treemap that organizes over 4,000+ US-traded stocks into 10 distinct categories. Use the dropdown box in the top left corner to select different categories and delve deeper into the data. \ No newline at end of file diff --git a/examples/tools/treemap/sic_code_groups.json b/examples/tools/treemap/sic_code_groups.json new file mode 100644 index 00000000..01f8b632 --- /dev/null +++ b/examples/tools/treemap/sic_code_groups.json @@ -0,0 +1 @@ +{"Finance, Insurance and Real Estate": {"sic_description": "Finance, Insurance and Real Estate", "companies": [{"ticker": "TBMC", "market_cap": 93351825.0, "weight": 1.2493789150691097e-05}, {"ticker": "STAG", "market_cap": 6047500977.539999, "weight": 0.0008093703803003641}, {"ticker": "TRMK", "market_cap": 1295296714.95, "weight": 0.00017335669703477278}, {"ticker": "AMAO", "market_cap": 35285404.35, "weight": 4.72244010275941e-06}, {"ticker": "MLP", "market_cap": 251395776.03, "weight": 3.364568201096425e-05}, {"ticker": "LC", "market_cap": 614121778.0, "weight": 8.219130163957187e-05}, {"ticker": "SIGI", "market_cap": 6333021880.5, "weight": 0.0008475832160933139}, {"ticker": "ENER", "market_cap": 110974629.12, "weight": 1.4852346135722834e-05}, {"ticker": "IPVF", "market_cap": 84073374.25, "weight": 1.1252002958342188e-05}, {"ticker": "STRS", "market_cap": 212645946.85, "weight": 2.8459578842652145e-05}, {"ticker": "ADC", "market_cap": 5237990359.309999, "weight": 0.0007010291134915876}, {"ticker": "NAVI", "market_cap": 2011902839.88, "weight": 0.00026926404355927003}, {"ticker": "HUM", "market_cap": 59808549157.5, "weight": 0.008004507706009483}, {"ticker": "XELB", "market_cap": 20988973.14, "weight": 2.809069934098009e-06}, {"ticker": "FMBH", "market_cap": 625121672.4912, "weight": 8.366347813374218e-05}, {"ticker": "UNTY", "market_cap": 237218241.23000002, "weight": 3.1748224404026355e-05}, {"ticker": "VAQC", "market_cap": 169883831.7, "weight": 2.273648933345751e-05}, {"ticker": "FOR", "market_cap": 1316210430.375, "weight": 0.00017615569481416817}, {"ticker": "INAQ", "market_cap": 93441289.92, "weight": 1.2505762733927026e-05}, {"ticker": "KVAC", "market_cap": 197340304.25, "weight": 2.6411140352454063e-05}, {"ticker": "BSVN", "market_cap": 204347278.08, "weight": 2.7348922271730208e-05}, {"ticker": "THG", "market_cap": 3948658065.44, "weight": 0.0005284706677966196}, {"ticker": "GHLD", "market_cap": 677250046.0, "weight": 9.064010561143122e-05}, {"ticker": "CHMI", "market_cap": 89297434.87, "weight": 1.195116777806273e-05}, {"ticker": "AMSF", "market_cap": 967439906.16, "weight": 0.00012947781367453096}, {"ticker": "BSRR", "market_cap": 280974629.25, "weight": 3.7604382930308035e-05}, {"ticker": "CVII", "market_cap": 967255522.305, "weight": 0.00012945313656717754}, {"ticker": "SBSI", "market_cap": 850005451.2, "weight": 0.00011376091345006753}, {"ticker": "PRK", "market_cap": 1515837402.0, "weight": 0.00020287287246199395}, {"ticker": "BLK", "market_cap": 94305515108.12, "weight": 0.012621426753126302}, {"ticker": "ISPO", "market_cap": 43286254.83, "weight": 5.79323801081665e-06}, {"ticker": "RKT", "market_cap": 956369790.8000001, "weight": 0.00012799623913454025}, {"ticker": "CIVB", "market_cap": 243162429.28, "weight": 3.25437678459329e-05}, {"ticker": "DOUG", "market_cap": 185684708.305, "weight": 2.4851207719508965e-05}, {"ticker": "WT", "market_cap": 1051519884.495, "weight": 0.0001407307004939602}, {"ticker": "GCMG", "market_cap": 318421980.53000003, "weight": 4.261616830401854e-05}, {"ticker": "DLB", "market_cap": 7600609660.68, "weight": 0.0010172314736990062}, {"ticker": "OFG", "market_cap": 1385186144.34, "weight": 0.00018538709470160568}, {"ticker": "INDB", "market_cap": 2100846039.6000001, "weight": 0.00028116780209521173}, {"ticker": "SSB", "market_cap": 4944982239.400001, "weight": 0.0006618142221962547}, {"ticker": "GGE", "market_cap": 60814662.120000005, "weight": 8.139161347920096e-06}, {"ticker": "PNBK", "market_cap": 27954561.3, "weight": 3.7413129811042173e-06}, {"ticker": "EXPI", "market_cap": 2254520982.294, "weight": 0.0003017349664946584}, {"ticker": "SHUA", "market_cap": 58625893.199999996, "weight": 7.846226342245958e-06}, {"ticker": "FHN", "market_cap": 5827260639.69, "weight": 0.0007798944022616395}, {"ticker": "KKR", "market_cap": 50826108266.56, "weight": 0.006802338144247296}, {"ticker": "WPC", "market_cap": 11136978033.02, "weight": 0.0014905231399646483}, {"ticker": "BMO", "market_cap": 57086566945.39, "weight": 0.007640209827204926}, {"ticker": "NIC", "market_cap": 1013259564.0999999, "weight": 0.00013561011098376028}, {"ticker": "BLAC", "market_cap": 94336801.0, "weight": 1.2625613916436073e-05}, {"ticker": "FLIC", "market_cap": 248300426.0, "weight": 3.3231414259665275e-05}, {"ticker": "KCGI", "market_cap": 364665000.0, "weight": 4.880512641972204e-05}, {"ticker": "IRT", "market_cap": 3031313429.14, "weight": 0.0004056973801351345}, {"ticker": "EGP", "market_cap": 7394565013.76, "weight": 0.0009896553832021457}, {"ticker": "BCOW", "market_cap": 42777785.15, "weight": 5.725186711643448e-06}, {"ticker": "MGLD", "market_cap": 45347741.849999994, "weight": 6.069138178432725e-06}, {"ticker": "NHI", "market_cap": 2240815992.42, "weight": 0.00029990075217910413}, {"ticker": "TRTX", "market_cap": 458563771.8532, "weight": 6.13721164817024e-05}, {"ticker": "BFS", "market_cap": 819669981.16, "weight": 0.00010970095033240092}, {"ticker": "GBNY", "market_cap": 20078283.220000003, "weight": 2.6871872837894614e-06}, {"ticker": "LAMR", "market_cap": 8122670087.775001, "weight": 0.001087101697447119}, {"ticker": "SEPA", "market_cap": 63495803.28, "weight": 8.497993243668028e-06}, {"ticker": "CNO", "market_cap": 2587624704.7999997, "weight": 0.0003463160732303893}, {"ticker": "SPNT", "market_cap": 1710811273.6000001, "weight": 0.00022896730009278017}, {"ticker": "FCNCA", "market_cap": 19137695212.68, "weight": 0.0025613032077028415}, {"ticker": "OVBC", "market_cap": 114684245.2, "weight": 1.5348824497378143e-05}, {"ticker": "FVCB", "market_cap": 200096143.52, "weight": 2.67799695078838e-05}, {"ticker": "MFA", "market_cap": 867813011.455, "weight": 0.00011614419736673651}, {"ticker": "BNL", "market_cap": 2648023478.2400002, "weight": 0.0003543995739045296}, {"ticker": "CMA", "market_cap": 5159050875.45, "weight": 0.0006904642073742062}, {"ticker": "BRT", "market_cap": 310347059.24999994, "weight": 4.1535457092633554e-05}, {"ticker": "CFG", "market_cap": 12015169790.400002, "weight": 0.00160805638209013}, {"ticker": "VINO", "market_cap": 2028670.4000000001, "weight": 2.71508138526999e-07}, {"ticker": "GSBC", "market_cap": 565867470.4200001, "weight": 7.573316175299639e-05}, {"ticker": "BX", "market_cap": 77607155162.87999, "weight": 0.010386593226109832}, {"ticker": "FHI", "market_cap": 2896962755.96, "weight": 0.00038771648921024553}, {"ticker": "PIPR", "market_cap": 2496101919.0099998, "weight": 0.00033406707447600903}, {"ticker": "COLB", "market_cap": 3930517253.66, "weight": 0.0005260427829919926}, {"ticker": "BPOP", "market_cap": 4401234267.66, "weight": 0.0005890414348400835}, {"ticker": "HFWA", "market_cap": 558311454.0, "weight": 7.472189843842658e-05}, {"ticker": "SKT", "market_cap": 2340261141.0, "weight": 0.00031321004440148614}, {"ticker": "MAQC", "market_cap": 72926383.89, "weight": 9.760139813485338e-06}, {"ticker": "KYCH", "market_cap": 63871436.7, "weight": 8.548266334177325e-06}, {"ticker": "SITC", "market_cap": 2469828767.0694, "weight": 0.00033055079377480233}, {"ticker": "BWAQ", "market_cap": 71700391.56, "weight": 9.596058504187053e-06}, {"ticker": "SJT", "market_cap": 309249361.46, "weight": 4.1388546148584633e-05}, {"ticker": "CMCT", "market_cap": 97299384.07, "weight": 1.3022112733872015e-05}, {"ticker": "GHIX", "market_cap": 683156250.0, "weight": 9.143056543861692e-05}, {"ticker": "MYFW", "market_cap": 158308990.2, "weight": 2.1187364512880416e-05}, {"ticker": "FUNC", "market_cap": 108725360.39999999, "weight": 1.455131410843333e-05}, {"ticker": "FBP", "market_cap": 2374043768.545, "weight": 0.0003177313596034499}, {"ticker": "ATMC", "market_cap": 95852862.0, "weight": 1.2828516714250534e-05}, {"ticker": "HOMB", "market_cap": 4213693224.0, "weight": 0.0005639417835307642}, {"ticker": "GLRE", "market_cap": 390461183.91, "weight": 5.225757186108316e-05}, {"ticker": "IOR", "market_cap": 47061394.059999995, "weight": 6.298485696698766e-06}, {"ticker": "MITT", "market_cap": 102713769.68, "weight": 1.374674979578137e-05}, {"ticker": "HBAN", "market_cap": 14203726677.54, "weight": 0.001900963010238214}, {"ticker": "LNC", "market_cap": 3919488785.705, "weight": 0.0005245667823537091}, {"ticker": "RIOT", "market_cap": 1651334382.3734, "weight": 0.0002210071799952488}, {"ticker": "USIO", "market_cap": 54356420.39309999, "weight": 7.2748192697648594e-06}, {"ticker": "CLPR", "market_cap": 78227920.36, "weight": 1.0469673653138492e-05}, {"ticker": "CDP", "market_cap": 2599552632.6000004, "weight": 0.0003479124535361613}, {"ticker": "SCU", "market_cap": 306335379.58500004, "weight": 4.0998551896890204e-05}, {"ticker": "CLOE", "market_cap": 63292067.28, "weight": 8.470726132110165e-06}, {"ticker": "BFAC", "market_cap": 217246573.44, "weight": 2.9075306050733217e-05}, {"ticker": "CVBF", "market_cap": 2203030900.83, "weight": 0.0002948437651586039}, {"ticker": "ALLY", "market_cap": 7394184097.52, "weight": 0.0009896044030827252}, {"ticker": "LGST", "market_cap": 171607788.1, "weight": 2.2967215918252016e-05}, {"ticker": "NEWT", "market_cap": 346872713.40000004, "weight": 4.6423886660466496e-05}, {"ticker": "LPLA", "market_cap": 17548781416.954998, "weight": 0.0023486501187845216}, {"ticker": "NETC", "market_cap": 182079467.67, "weight": 2.4368698498814095e-05}, {"ticker": "CXW", "market_cap": 1246816422.475, "weight": 0.00016686831234442005}, {"ticker": "CURO", "market_cap": 42487454.68, "weight": 5.6863301849906375e-06}, {"ticker": "UNIT", "market_cap": 1053810186.66, "weight": 0.00014103722425330695}, {"ticker": "LIVB", "market_cap": 72636013.14, "weight": 9.721277895938166e-06}, {"ticker": "DIST", "market_cap": 99204000.0, "weight": 1.327701797908246e-05}, {"ticker": "TCBI", "market_cap": 2724285858.04, "weight": 0.0003646061884335024}, {"ticker": "FHLT", "market_cap": 69540715.35000001, "weight": 9.30701713620626e-06}, {"ticker": "BRDG", "market_cap": 290453467.46000004, "weight": 3.887298808065464e-05}, {"ticker": "GMRE", "market_cap": 569103705.24, "weight": 7.616628489208021e-05}, {"ticker": "STT", "market_cap": 20314913601.600002, "weight": 0.0027188568316998314}, {"ticker": "PEGR", "market_cap": 183037772.17499998, "weight": 2.4496953671411173e-05}, {"ticker": "AFRM", "market_cap": 5252657383.35, "weight": 0.0007029920821408228}, {"ticker": "AMAL", "market_cap": 504659383.13, "weight": 6.754134614662387e-05}, {"ticker": "JHG", "market_cap": 3945971297.1, "weight": 0.0005281110827843639}, {"ticker": "AJG", "market_cap": 49128902820.0, "weight": 0.006575191786961564}, {"ticker": "LCW", "market_cap": 306187500.0, "weight": 4.097876035714599e-05}, {"ticker": "PJT", "market_cap": 1842830396.67, "weight": 0.00024663614681854815}, {"ticker": "NNN", "market_cap": 6378014181.420001, "weight": 0.000853604783653444}, {"ticker": "SKYH", "market_cap": 68593014.0, "weight": 9.180181042271027e-06}, {"ticker": "DUET", "market_cap": 81215824.8, "weight": 1.086956136905378e-05}, {"ticker": "ESS", "market_cap": 13387995381.36, "weight": 0.0017917891958206288}, {"ticker": "WRAC", "market_cap": 87312391.9, "weight": 1.168549853889958e-05}, {"ticker": "SLQT", "market_cap": 194524031.95999998, "weight": 2.6034223112944347e-05}, {"ticker": "GNW", "market_cap": 2692852736.7250004, "weight": 0.00036039932059714564}, {"ticker": "IVT", "market_cap": 1564701031.95, "weight": 0.00020941256131898947}, {"ticker": "WNEB", "market_cap": 146847979.95000002, "weight": 1.96534743557527e-05}, {"ticker": "FFWM", "market_cap": 318122754.6414, "weight": 4.2576121254476695e-05}, {"ticker": "TRC", "market_cap": 423614454.4, "weight": 5.669465674033312e-05}, {"ticker": "BSIG", "market_cap": 755448220.8, "weight": 0.00010110579825236337}, {"ticker": "DOMA", "market_cap": 65975252.65, "weight": 8.829831615746923e-06}, {"ticker": "PRPC", "market_cap": 213638234.20000002, "weight": 2.8592382126656483e-05}, {"ticker": "CHCO", "market_cap": 1364855272.25, "weight": 0.00018266610205746478}, {"ticker": "GL", "market_cap": 10293624460.800001, "weight": 0.0013776524841333476}, {"ticker": "NFYS", "market_cap": 454537499.99999994, "weight": 6.083325833300263e-05}, {"ticker": "ALCC", "market_cap": 660008765.0, "weight": 8.833260996791471e-05}, {"ticker": "INTE", "market_cap": 63300967.52, "weight": 8.471917300273728e-06}, {"ticker": "MCBC", "market_cap": 306222978.90999997, "weight": 4.098350869517619e-05}, {"ticker": "PEPL", "market_cap": 54740326.6, "weight": 7.326199552931796e-06}, {"ticker": "ARGO", "market_cap": 1049613276.1800001, "weight": 0.00014047552859688627}, {"ticker": "BHG", "market_cap": 47114266.510800004, "weight": 6.305561908140542e-06}, {"ticker": "BKU", "market_cap": 1582062857.48, "weight": 0.00021173619010121097}, {"ticker": "SVII", "market_cap": 329053336.91, "weight": 4.4039021311954646e-05}, {"ticker": "OCFC", "market_cap": 825958822.2, "weight": 0.00011054262058315365}, {"ticker": "BK", "market_cap": 31832733379.5, "weight": 0.004260350120992701}, {"ticker": "TREE", "market_cap": 175439280.525, "weight": 2.3480005662752675e-05}, {"ticker": "TCBC", "market_cap": 68463339.11999999, "weight": 9.16282593851316e-06}, {"ticker": "HBCP", "market_cap": 260946662.24, "weight": 3.492392974216804e-05}, {"ticker": "MKTX", "market_cap": 7959544629.63, "weight": 0.001065269718488234}, {"ticker": "PFTA", "market_cap": 108349082.45, "weight": 1.4500954756922482e-05}, {"ticker": "SAGA", "market_cap": 49939412.13, "weight": 6.683666714193165e-06}, {"ticker": "RYAN", "market_cap": 5666603661.24, "weight": 0.0007583927935427803}, {"ticker": "NSA", "market_cap": 2707477703.96, "weight": 0.00036235666055241543}, {"ticker": "CRT", "market_cap": 110700000.0, "weight": 1.481559100726209e-05}, {"ticker": "BRK.B", "market_cap": 741207269259.58, "weight": 0.09919985323360003}, {"ticker": "PPHP", "market_cap": 28411606.66, "weight": 3.802481880160467e-06}, {"ticker": "FMAO", "market_cap": 239831822.45, "weight": 3.2098014380718137e-05}, {"ticker": "SBFG", "market_cap": 94209381.12, "weight": 1.2608560611754281e-05}, {"ticker": "GDNR", "market_cap": 40840448.5, "weight": 5.465902272169381e-06}, {"ticker": "RDN", "market_cap": 4009558017.6785, "weight": 0.0005366212439910858}, {"ticker": "APXI", "market_cap": 119233840.51, "weight": 1.5957721908051295e-05}, {"ticker": "NETD", "market_cap": 388112500.0, "weight": 5.1943234551093114e-05}, {"ticker": "MBI", "market_cap": 359909154.99, "weight": 4.81686254751684e-05}, {"ticker": "PGR", "market_cap": 82469845000.0, "weight": 0.011037393802640455}, {"ticker": "JXN", "market_cap": 2962714757.27, "weight": 0.00039651644186894396}, {"ticker": "BHRB", "market_cap": 342389243.90000004, "weight": 4.582383923132888e-05}, {"ticker": "MMI", "market_cap": 1086896414.7, "weight": 0.0001454653364720391}, {"ticker": "OPRT", "market_cap": 228778576.32, "weight": 3.0618697542735464e-05}, {"ticker": "OXBR", "market_cap": 8805351.0, "weight": 1.1784686458119805e-06}, {"ticker": "OPOF", "market_cap": 90416063.885, "weight": 1.2100880063293954e-05}, {"ticker": "ABCB", "market_cap": 2565067584.8, "weight": 0.00034329712956081634}, {"ticker": "EQC", "market_cap": 2015748495.0900002, "weight": 0.0002697787287873306}, {"ticker": "ARRW", "market_cap": 121919446.9026, "weight": 1.6317151410483546e-05}, {"ticker": "CNS", "market_cap": 2939438506.69, "weight": 0.00039340125299111356}, {"ticker": "CATY", "market_cap": 2421433550.1899996, "weight": 0.00032407379522021387}, {"ticker": "ESAC", "market_cap": 109329553.8, "weight": 1.4632176640535291e-05}, {"ticker": "TRCA", "market_cap": 124633866.0, "weight": 1.6680437075970265e-05}, {"ticker": "CDAQ", "market_cap": 279312417.2, "weight": 3.738191993211343e-05}, {"ticker": "LTC", "market_cap": 1298990699.41, "weight": 0.00017385108333058618}, {"ticker": "OSI", "market_cap": 91722684.75999999, "weight": 1.227575233506948e-05}, {"ticker": "RILY", "market_cap": 1166924804.43, "weight": 0.0001561759768623684}, {"ticker": "BYTS", "market_cap": 116284623.88, "weight": 1.5563011994935705e-05}, {"ticker": "GNL", "market_cap": 2005949049.72, "weight": 0.0002684672150140702}, {"ticker": "FNCB", "market_cap": 115517051.28, "weight": 1.546028352420417e-05}, {"ticker": "HNNA", "market_cap": 50739075.14, "weight": 6.790690021327728e-06}, {"ticker": "AHT", "market_cap": 75023023.19999999, "weight": 1.004074460577719e-05}, {"ticker": "FXNC", "market_cap": 110741760.19999999, "weight": 1.482118000494575e-05}, {"ticker": "CLDT", "market_cap": 468543204.43, "weight": 6.270771893466008e-05}, {"ticker": "UBSI", "market_cap": 3637848921.04, "weight": 0.0004868733673020625}, {"ticker": "INN", "market_cap": 635778521.58, "weight": 8.50897429713734e-05}, {"ticker": "HTBI", "market_cap": 350990566.33000004, "weight": 4.6975001609327705e-05}, {"ticker": "BOH", "market_cap": 1866802367.48, "weight": 0.0002498444477684938}, {"ticker": "SLNH", "market_cap": 7495830.3, "weight": 1.0032082744773504e-06}, {"ticker": "VBTX", "market_cap": 950896694.22, "weight": 0.00012726374445999172}, {"ticker": "NWBI", "market_cap": 1298281625.5049999, "weight": 0.00017375618406256083}, {"ticker": "WSR", "market_cap": 453609804.36, "weight": 6.070909971347725e-05}, {"ticker": "CAC", "market_cap": 399571605.2097, "weight": 5.347686974617985e-05}, {"ticker": "PNFP", "market_cap": 4895666952.12, "weight": 0.0006552140855499483}, {"ticker": "CARV", "market_cap": 10327447.4, "weight": 1.3821791944662353e-06}, {"ticker": "BREZ", "market_cap": 48389420.8, "weight": 6.47622283334328e-06}, {"ticker": "LADR", "market_cap": 1221081539.86, "weight": 0.00016342407119316674}, {"ticker": "ALL", "market_cap": 28859432278.82, "weight": 0.0038624168504496374}, {"ticker": "PLMR", "market_cap": 1213460992.46, "weight": 0.00016240417134194858}, {"ticker": "WHLR", "market_cap": 2569845.3400000003, "weight": 3.4393656286683284e-07}, {"ticker": "SNV", "market_cap": 3828116060.9100003, "weight": 0.000512337867089194}, {"ticker": "MC", "market_cap": 2900048556.2400002, "weight": 0.00038812947886587856}, {"ticker": "CIM", "market_cap": 1136010616.26, "weight": 0.00015203856070836424}, {"ticker": "OCAX", "market_cap": 81194246.71000001, "weight": 1.0866673454364007e-05}, {"ticker": "SMBC", "market_cap": 442122018.0, "weight": 5.917162596199971e-05}, {"ticker": "BRP", "market_cap": 1440469422.0, "weight": 0.00019278596038680416}, {"ticker": "MMC", "market_cap": 93969757404.96, "weight": 0.01257649044953501}, {"ticker": "ESSA", "market_cap": 154561906.29999998, "weight": 2.0685871626409804e-05}, {"ticker": "REXR", "market_cap": 9721341583.69, "weight": 0.0013010607131512246}, {"ticker": "FTHM", "market_cap": 71760751.92, "weight": 9.604136863778841e-06}, {"ticker": "CVLY", "market_cap": 176556090.70000002, "weight": 2.3629474522604065e-05}, {"ticker": "PTRS", "market_cap": 133093269.80000001, "weight": 1.78126057016801e-05}, {"ticker": "WELL", "market_cap": 41913309502.4, "weight": 0.005609489172071817}, {"ticker": "TPHS", "market_cap": 15241520.0, "weight": 2.0398566092954406e-06}, {"ticker": "MIGI", "market_cap": 9927343.843, "weight": 1.3286311306806637e-06}, {"ticker": "NEN", "market_cap": 238413404.78000003, "weight": 3.190817972781667e-05}, {"ticker": "CIA", "market_cap": 139920941.1, "weight": 1.872639057532799e-05}, {"ticker": "FFNW", "market_cap": 115041809.01, "weight": 1.5396679232409385e-05}, {"ticker": "AGNC", "market_cap": 5296631351.904, "weight": 0.0007088773606689372}, {"ticker": "FRGE", "market_cap": 338986575.365, "weight": 4.5368441351041255e-05}, {"ticker": "FIAC", "market_cap": 123804670.71000001, "weight": 1.656946130106703e-05}, {"ticker": "NTRS", "market_cap": 13676766238.669998, "weight": 0.0018304369909129628}, {"ticker": "AMBC", "market_cap": 551349655.66, "weight": 7.37901626039146e-05}, {"ticker": "MCAF", "market_cap": 35962227.35, "weight": 4.8130230544514435e-06}, {"ticker": "CUZ", "market_cap": 2888268126.04, "weight": 0.0003865528389766933}, {"ticker": "GPAC", "market_cap": 124148468.33999999, "weight": 1.6615473632370966e-05}, {"ticker": "RBB", "market_cap": 231170937.9797, "weight": 3.093888048665208e-05}, {"ticker": "AKR", "market_cap": 1297105786.28, "weight": 0.0001735988150196711}, {"ticker": "WRB", "market_cap": 16269085413.583199, "weight": 0.0021773813509472634}, {"ticker": "MSSA", "market_cap": 96046271.64, "weight": 1.2854401792146665e-05}, {"ticker": "TMP", "market_cap": 711698244.6999999, "weight": 9.525049786866787e-05}, {"ticker": "GYRO", "market_cap": 15553313.200000001, "weight": 2.081585611373539e-06}, {"ticker": "UNH", "market_cap": 469933123117.48, "weight": 0.06289373941168858}, {"ticker": "BWB", "market_cap": 262414101.46, "weight": 3.5120325219237014e-05}, {"ticker": "FSBC", "market_cap": 346700302.13, "weight": 4.640081191013801e-05}, {"ticker": "BOWN", "market_cap": 93498300.0, "weight": 1.2513392707084852e-05}, {"ticker": "BPRN", "market_cap": 180821367.52, "weight": 2.4200320023036546e-05}, {"ticker": "BTWN", "market_cap": 310766832.64, "weight": 4.159163767855923e-05}, {"ticker": "NLY", "market_cap": 8598888593.2317, "weight": 0.001150836644212576}, {"ticker": "ZLS", "market_cap": 127972841.62, "weight": 1.7127310582466555e-05}, {"ticker": "EXR", "market_cap": 24497510406.9, "weight": 0.0032786368101605885}, {"ticker": "RRBI", "market_cap": 321047880.71999997, "weight": 4.296760699634854e-05}, {"ticker": "NSTB", "market_cap": 123393387.74000001, "weight": 1.6514417034836028e-05}, {"ticker": "MBWM", "market_cap": 487113948.56, "weight": 6.519314395480997e-05}, {"ticker": "BNS", "market_cap": 51413485555.905, "weight": 0.006880950083595894}, {"ticker": "CMTG", "market_cap": 1475193736.64, "weight": 0.00019743330676181523}, {"ticker": "TSBK", "market_cap": 216626856.24, "weight": 2.899236588293407e-05}, {"ticker": "BFC", "market_cap": 802824404.93, "weight": 0.00010744641403876645}, {"ticker": "BHAC", "market_cap": 114191101.11999999, "weight": 1.5282824307703954e-05}, {"ticker": "SF", "market_cap": 6085697679.0, "weight": 0.0008144824553379239}, {"ticker": "OPI", "market_cap": 189818656.298, "weight": 2.540447675934257e-05}, {"ticker": "PINE", "market_cap": 230278532.99, "weight": 3.0819445009323856e-05}, {"ticker": "ACR", "market_cap": 73243318.875, "weight": 9.802556968983557e-06}, {"ticker": "FRAF", "market_cap": 123907622.72, "weight": 1.658323993587765e-05}, {"ticker": "FPI", "market_cap": 500066355.2, "weight": 6.692663590908265e-05}, {"ticker": "GROW", "market_cap": 41167729.1436, "weight": 5.509704044167314e-06}, {"ticker": "AMT", "market_cap": 73349571229.34999, "weight": 0.009816777307064931}, {"ticker": "DHIL", "market_cap": 490016217.6, "weight": 6.558157061325334e-05}, {"ticker": "BUSE", "market_cap": 1037633435.91, "weight": 0.00013887220055919296}, {"ticker": "BRSP", "market_cap": 748064290.785, "weight": 0.00010011756620964895}, {"ticker": "PPBI", "market_cap": 1994842192.4639997, "weight": 0.00026698072310367323}, {"ticker": "VEL", "market_cap": 369906801.9, "weight": 4.950666565270749e-05}, {"ticker": "LUXH", "market_cap": 187464521.54, "weight": 2.5089409932328042e-05}, {"ticker": "UPST", "market_cap": 2233928332.54, "weight": 0.0002989789387032305}, {"ticker": "EBTC", "market_cap": 330556059.0, "weight": 4.424013888994035e-05}, {"ticker": "L", "market_cap": 14013107511.0, "weight": 0.0018754513967820096}, {"ticker": "AACI", "market_cap": 86379484.3, "weight": 1.1560642374047126e-05}, {"ticker": "MCB", "market_cap": 378787840.96000004, "weight": 5.069526404866485e-05}, {"ticker": "ARYD", "market_cap": 86090814.66, "weight": 1.1522008125425142e-05}, {"ticker": "CWK", "market_cap": 1515094375.27, "weight": 0.0002027734291003034}, {"ticker": "BHF", "market_cap": 2998702069.44, "weight": 0.00040133282216308475}, {"ticker": "NYMT", "market_cap": 738142727.5908, "weight": 9.87897087350512e-05}, {"ticker": "LKFN", "market_cap": 1183788992.175, "weight": 0.0001584330040376132}, {"ticker": "BYFC", "market_cap": 66071758.059, "weight": 8.842747466422014e-06}, {"ticker": "BHR", "market_cap": 178183511.10000002, "weight": 2.3847281162561383e-05}, {"ticker": "PLBC", "market_cap": 203111912.0, "weight": 2.71835864218158e-05}, {"ticker": "STWD", "market_cap": 5698800729.759999, "weight": 0.0007627019046432781}, {"ticker": "PB", "market_cap": 4832329728.24, "weight": 0.0006467373158612267}, {"ticker": "TRNO", "market_cap": 4665960321.61, "weight": 0.0006244711814009651}, {"ticker": "JPM", "market_cap": 413506873495.17, "weight": 0.0553419034904797}, {"ticker": "FR", "market_cap": 6066491530.44, "weight": 0.0008119119906415402}, {"ticker": "PRSR", "market_cap": 111033042.56, "weight": 1.486016392828261e-05}, {"ticker": "TCBK", "market_cap": 1023845759.1, "weight": 0.0001370269197953513}, {"ticker": "UNB", "market_cap": 102761834.4, "weight": 1.37531825621174e-05}, {"ticker": "FRBN", "market_cap": 172198125.0, "weight": 2.304622395860337e-05}, {"ticker": "RLJ", "market_cap": 1517315820.745, "weight": 0.00020307073738939582}, {"ticker": "RBKB", "market_cap": 73707915.05, "weight": 9.864736435219675e-06}, {"ticker": "GBLI", "market_cap": 466531701.0, "weight": 6.243850834632599e-05}, {"ticker": "LOCC", "market_cap": 259015000.0, "weight": 3.466540474025285e-05}, {"ticker": "PACI", "market_cap": 143304872.52, "weight": 1.9179280764265153e-05}, {"ticker": "KNSL", "market_cap": 9646814265.75, "weight": 0.0012910863115119544}, {"ticker": "LIBY", "market_cap": 78640971.3, "weight": 1.052495453653691e-05}, {"ticker": "AFG", "market_cap": 9363006504.5, "weight": 0.0012531027549142425}, {"ticker": "PRA", "market_cap": 937166544.0, "weight": 0.00012542616279668736}, {"ticker": "DHCA", "market_cap": 130391326.25999999, "weight": 1.7450989708786206e-05}, {"ticker": "HST", "market_cap": 11177747008.4016, "weight": 0.0014959794765955327}, {"ticker": "AQU", "market_cap": 48582110.5, "weight": 6.502011557702016e-06}, {"ticker": "ONB", "market_cap": 4086005385.0, "weight": 0.0005468526164194262}, {"ticker": "BOC", "market_cap": 484601446.44, "weight": 6.485688195106293e-05}, {"ticker": "PGSS", "market_cap": 116272704.92, "weight": 1.5561416814840024e-05}, {"ticker": "BMRC", "market_cap": 287582441.28, "weight": 3.848874282632742e-05}, {"ticker": "NNI", "market_cap": 3244553069.94, "weight": 0.0004342364163106384}, {"ticker": "CCBG", "market_cap": 506180776.86, "weight": 6.774496265307999e-05}, {"ticker": "OBK", "market_cap": 870744980.5600001, "weight": 0.00011653659894853966}, {"ticker": "ORI", "market_cap": 7567227109.975, "weight": 0.0010127637029851446}, {"ticker": "PKBK", "market_cap": 192759536.585, "weight": 2.5798070973737435e-05}, {"ticker": "PDM", "market_cap": 638273811.0, "weight": 8.542370130462966e-05}, {"ticker": "ATLC", "market_cap": 432643538.56, "weight": 5.79030688278192e-05}, {"ticker": "SRBK", "market_cap": 81197722.19999999, "weight": 1.0867138598342233e-05}, {"ticker": "HWBK", "market_cap": 114142622.445, "weight": 1.5276336139489196e-05}, {"ticker": "GAQ", "market_cap": 163360784.04, "weight": 2.1863473920165387e-05}, {"ticker": "CFR", "market_cap": 5649887310.21, "weight": 0.0007561555521697513}, {"ticker": "AIZ", "market_cap": 7668140993.940001, "weight": 0.0010262695641575}, {"ticker": "IVCB", "market_cap": 300621656.96000004, "weight": 4.0233852912780536e-05}, {"ticker": "SLAM", "market_cap": 428274107.955, "weight": 5.7318283852405525e-05}, {"ticker": "BHB", "market_cap": 358137957.72999996, "weight": 4.79315763857615e-05}, {"ticker": "ITIC", "market_cap": 269224715.2, "weight": 3.60318271856352e-05}, {"ticker": "BAC", "market_cap": 203824435592.69998, "weight": 0.027278947380555345}, {"ticker": "MET", "market_cap": 44775416375.3, "weight": 0.005992540706380401}, {"ticker": "WNNR", "market_cap": 146613386.74499997, "weight": 1.962207745441247e-05}, {"ticker": "IVZ", "market_cap": 6074322165.759999, "weight": 0.0008129600077167717}, {"ticker": "PUCK", "market_cap": 176910699.57, "weight": 2.3676933781732044e-05}, {"ticker": "C", "market_cap": 76084505142.84, "weight": 0.010182808583434927}, {"ticker": "BXP", "market_cap": 8611863740.1, "weight": 0.0011525731796169108}, {"ticker": "GLBZ", "market_cap": 18499650.12, "weight": 2.4759101170313195e-06}, {"ticker": "NMIH", "market_cap": 2196484621.25, "weight": 0.0002939676404894397}, {"ticker": "SWKH", "market_cap": 198614915.70569998, "weight": 2.6581728627258235e-05}, {"ticker": "TWO", "market_cap": 1141492639.6899998, "weight": 0.00015277225011243927}, {"ticker": "FITB", "market_cap": 16222174635.525, "weight": 0.0021711030230200483}, {"ticker": "FULT", "market_cap": 1942925968.76, "weight": 0.00026003248880340237}, {"ticker": "PLAO", "market_cap": 249161595.81, "weight": 3.3346669360774235e-05}, {"ticker": "BVH", "market_cap": 564912014.0, "weight": 7.560528775530909e-05}, {"ticker": "SEIC", "market_cap": 7603970259.75, "weight": 0.001017681241190971}, {"ticker": "PX", "market_cap": 1269541799.075, "weight": 0.00016990977472194135}, {"ticker": "ASCB", "market_cap": 79384777.60000001, "weight": 1.0624502232376342e-05}, {"ticker": "ATMV", "market_cap": 97037885.0, "weight": 1.298711487235531e-05}, {"ticker": "EARN", "market_cap": 86730464.38000001, "weight": 1.1607615972213127e-05}, {"ticker": "AFL", "market_cap": 44952707710.26, "weight": 0.006016268582693851}, {"ticker": "WD", "market_cap": 2285444504.28, "weight": 0.0003058736318446914}, {"ticker": "LAZ", "market_cap": 2520162928.1400003, "weight": 0.00033728729191496195}, {"ticker": "SKWD", "market_cap": 1067117834.475, "weight": 0.00014281826009157007}, {"ticker": "GBBK", "market_cap": 75586658.8, "weight": 1.011617906401326e-05}, {"ticker": "ARR", "market_cap": 879644004.32, "weight": 0.00011772760433600187}, {"ticker": "LNKB", "market_cap": 108617976.99000001, "weight": 1.4536942394941686e-05}, {"ticker": "SBT", "market_cap": 303603558.06, "weight": 4.063293716862249e-05}, {"ticker": "STC", "market_cap": 1143079645.3999999, "weight": 0.00015298464783173059}, {"ticker": "ESGR", "market_cap": 3808901513.9500003, "weight": 0.0005097662783886593}, {"ticker": "PFC", "market_cap": 595264915.42, "weight": 7.96675838106159e-05}, {"ticker": "CACC", "market_cap": 5495082460.56, "weight": 0.000735437166096083}, {"ticker": "AAMC", "market_cap": 11999674.4, "weight": 1.6059825486062613e-06}, {"ticker": "WFC", "market_cap": 141594915141.90002, "weight": 0.01895042774571249}, {"ticker": "RBCAA", "market_cap": 838586654.29, "weight": 0.00011223267293684667}, {"ticker": "PWP", "market_cap": 410850988.8, "weight": 5.498645180659456e-05}, {"ticker": "ARTE", "market_cap": 76075900.05, "weight": 1.0181656916442182e-05}, {"ticker": "COOP", "market_cap": 3601799658.48, "weight": 0.00048204869584585327}, {"ticker": "HBNC", "market_cap": 445508010.4, "weight": 5.96247919832472e-05}, {"ticker": "CLOV", "market_cap": 504256118.08000004, "weight": 6.748737496280885e-05}, {"ticker": "HT", "market_cap": 396036045.5, "weight": 5.300368630769142e-05}, {"ticker": "BWFG", "market_cap": 191169746.56, "weight": 2.558530061422682e-05}, {"ticker": "PRLH", "market_cap": 268250000.0, "weight": 3.5901375679295893e-05}, {"ticker": "RCFA", "market_cap": 205282886.07999998, "weight": 2.7474139845995083e-05}, {"ticker": "LXP", "market_cap": 2514948991.155, "weight": 0.00033658948199709923}, {"ticker": "TBCP", "market_cap": 123589741.81, "weight": 1.6540696182024207e-05}, {"ticker": "SFST", "market_cap": 214348664.51999998, "weight": 2.8687462931175705e-05}, {"ticker": "FSEA", "market_cap": 34680117.28, "weight": 4.64143119877473e-06}, {"ticker": "FTII", "market_cap": 163759918.25, "weight": 2.1916892250900407e-05}, {"ticker": "CARE", "market_cap": 278885783.8466, "weight": 3.732482123948443e-05}, {"ticker": "RHE", "market_cap": 3992019.3600000003, "weight": 5.342739487880052e-07}, {"ticker": "SWSS", "market_cap": 77058754.5, "weight": 1.0313197743459956e-05}, {"ticker": "MBCN", "market_cap": 214210486.72, "weight": 2.866896983477929e-05}, {"ticker": "BYNO", "market_cap": 111292025.76, "weight": 1.489482507705363e-05}, {"ticker": "HOUS", "market_cap": 618715613.5999999, "weight": 8.280611997203978e-05}, {"ticker": "REFI", "market_cap": 262076444.2849, "weight": 3.507513469884904e-05}, {"ticker": "CBRE", "market_cap": 21896257890.97, "weight": 0.002930496851871244}, {"ticker": "DLR", "market_cap": 35341612900.545, "weight": 0.004729962802813481}, {"ticker": "CBRG", "market_cap": 106116572.6, "weight": 1.4202165661554062e-05}, {"ticker": "EFSC", "market_cap": 1364520526.0, "weight": 0.00018262130112222345}, {"ticker": "BACA", "market_cap": 97440435.17, "weight": 1.3040990379840621e-05}, {"ticker": "BTM", "market_cap": 32132596.6, "weight": 4.30048246817471e-06}, {"ticker": "CTO", "market_cap": 360899344.8, "weight": 4.8301148033836136e-05}, {"ticker": "MTG", "market_cap": 4724633584.235, "weight": 0.0006323237474543859}, {"ticker": "BCAL", "market_cap": 268953371.235, "weight": 3.599551172757081e-05}, {"ticker": "AMK", "market_cap": 1779318310.68, "weight": 0.00023813597437007572}, {"ticker": "ELME", "market_cap": 1172882361.72, "weight": 0.00015697330958333472}, {"ticker": "PEBK", "market_cap": 121320338.3, "weight": 1.6236969404837167e-05}, {"ticker": "SAFT", "market_cap": 1012579993.685, "weight": 0.0001355191603303793}, {"ticker": "HAIA", "market_cap": 78059560.64999999, "weight": 1.0447141145410747e-05}, {"ticker": "UVSP", "market_cap": 500423726.76, "weight": 6.697446491423702e-05}, {"ticker": "SGII", "market_cap": 74782350.09, "weight": 1.0008533997247782e-05}, {"ticker": "TPG", "market_cap": 2359113989.25, "weight": 0.00031573322497053743}, {"ticker": "FISI", "market_cap": 254899790.0, "weight": 3.4114643509277283e-05}, {"ticker": "CHMG", "market_cap": 187612686.0, "weight": 2.510923959846329e-05}, {"ticker": "CPT", "market_cap": 9902967306.75, "weight": 0.0013253686845085435}, {"ticker": "COHN", "market_cap": 10011834.067200001, "weight": 1.3399389229648472e-06}, {"ticker": "FINW", "market_cap": 108690460.285, "weight": 1.4546643233727402e-05}, {"ticker": "PLD", "market_cap": 99518414640.0, "weight": 0.013319097822921084}, {"ticker": "SFE", "market_cap": 16686280.7, "weight": 2.233216895063875e-06}, {"ticker": "ECPG", "market_cap": 1113428022.08, "weight": 0.00014901620768890752}, {"ticker": "GOCO", "market_cap": 136400072.4, "weight": 1.8255173315621844e-05}, {"ticker": "TCBS", "market_cap": 41147575.0, "weight": 5.507006704070844e-06}, {"ticker": "KFFB", "market_cap": 40352707.85, "weight": 5.400625253307447e-06}, {"ticker": "RYN", "market_cap": 4062558489.2, "weight": 0.0005437145891514705}, {"ticker": "TPL", "market_cap": 13464327142.08, "weight": 0.0018020050959804456}, {"ticker": "GDST", "market_cap": 81355837.5, "weight": 1.0888300040228328e-05}, {"ticker": "PBBK", "market_cap": 34952978.1, "weight": 4.677949665902338e-06}, {"ticker": "FAF", "market_cap": 5478013421.6, "weight": 0.0007331527225539115}, {"ticker": "IDCC", "market_cap": 2128940079.5200002, "weight": 0.00028492778226862106}, {"ticker": "TRTL", "market_cap": 451950000.0, "weight": 6.048695894970282e-05}, {"ticker": "IHT", "market_cap": 12428564.28, "weight": 1.6633832446246326e-06}, {"ticker": "VII", "market_cap": 96062570.04, "weight": 1.285658309683025e-05}, {"ticker": "CVCY", "market_cap": 164074583.25, "weight": 2.1959005601797425e-05}, {"ticker": "SOFI", "market_cap": 6969088896.615, "weight": 0.0009327115698780422}, {"ticker": "VBFC", "market_cap": 69684629.7, "weight": 9.32627798670017e-06}, {"ticker": "OPHC", "market_cap": 23200700.8, "weight": 3.1050776344594253e-06}, {"ticker": "CITE", "market_cap": 107217105.39999999, "weight": 1.4349456030613473e-05}, {"ticker": "RCAC", "market_cap": 81187977.78, "weight": 1.0865834448917457e-05}, {"ticker": "AAIC", "market_cap": 121802990.4, "weight": 1.6301565395012383e-05}, {"ticker": "MCAA", "market_cap": 201208425.6, "weight": 2.692883234782948e-05}, {"ticker": "WMC", "market_cap": 51058277.95999999, "weight": 6.833410693680795e-06}, {"ticker": "TROO", "market_cap": 373880632.64000005, "weight": 5.003850531825335e-05}, {"ticker": "FUSB", "market_cap": 50229240.75000001, "weight": 6.722456075495056e-06}, {"ticker": "PMT", "market_cap": 1002950316.48, "weight": 0.00013423036756614052}, {"ticker": "CCI", "market_cap": 38742672728.24, "weight": 0.005185145380937766}, {"ticker": "MPW", "market_cap": 3081760000.0, "weight": 0.00041244892269683847}, {"ticker": "BRD", "market_cap": 138176255.5932, "weight": 1.849288969994365e-05}, {"ticker": "EGBN", "market_cap": 596025284.55, "weight": 7.976934820126294e-05}, {"ticker": "MTR", "market_cap": 25251644.5, "weight": 3.3795667314614203e-06}, {"ticker": "WRLD", "market_cap": 759484231.416, "weight": 0.00010164595979335366}, {"ticker": "TCI", "market_cap": 258229155.24, "weight": 3.4560230805660616e-05}, {"ticker": "TGVC", "market_cap": 45778268.05, "weight": 6.126757872173563e-06}, {"ticker": "JNVR", "market_cap": 10594777.38, "weight": 1.4179574387992033e-06}, {"ticker": "WHG", "market_cap": 88154073.6, "weight": 1.1798145438858901e-05}, {"ticker": "BOKF", "market_cap": 5034104426.799999, "weight": 0.0006737419356397141}, {"ticker": "UBCP", "market_cap": 64072226.26, "weight": 8.575139107433766e-06}, {"ticker": "BFST", "market_cap": 471908408.16, "weight": 6.315810269364647e-05}, {"ticker": "FOA", "market_cap": 109720382.5, "weight": 1.4684483399099881e-05}, {"ticker": "RDZN", "market_cap": 268811768.48, "weight": 3.5976560250573685e-05}, {"ticker": "LBC", "market_cap": 420852423.805, "weight": 5.6324998965761625e-05}, {"ticker": "BRAC", "market_cap": 82352989.2753, "weight": 1.1021754357075754e-05}, {"ticker": "CUBE", "market_cap": 8276327725.44, "weight": 0.0011076665458191759}, {"ticker": "ARES", "market_cap": 18780270796.0, "weight": 0.0025134671284477365}, {"ticker": "UMBF", "market_cap": 2841299460.48, "weight": 0.0003802667636461257}, {"ticker": "CIO", "market_cap": 153763036.35, "weight": 2.0578954458865166e-05}, {"ticker": "UNM", "market_cap": 9329341275.34, "weight": 0.001248597151785062}, {"ticker": "RVSB", "market_cap": 116804212.07000001, "weight": 1.5632551345570245e-05}, {"ticker": "ROSE", "market_cap": 62717375.98, "weight": 8.393812028621169e-06}, {"ticker": "COIN", "market_cap": 16946242633.800001, "weight": 0.002268009033172617}, {"ticker": "SHBI", "market_cap": 334376886.90000004, "weight": 4.475150134229389e-05}, {"ticker": "MOFG", "market_cap": 323584087.49, "weight": 4.330704152402849e-05}, {"ticker": "VIRT", "market_cap": 1594144838.85, "weight": 0.00021335318824516108}, {"ticker": "PROV", "market_cap": 90750751.0, "weight": 1.2145673084172368e-05}, {"ticker": "KEY", "market_cap": 9452781112.199999, "weight": 0.0012651177853615831}, {"ticker": "MCVT", "market_cap": 20752078.75, "weight": 2.7773650524886607e-06}, {"ticker": "OBT", "market_cap": 227505751.2, "weight": 3.044834834308154e-05}, {"ticker": "HOPE", "market_cap": 1024355524.77, "weight": 0.00013709514454400768}, {"ticker": "FRHC", "market_cap": 5039678103.03, "weight": 0.0006744878914430617}, {"ticker": "TROW", "market_cap": 22705392871.77, "weight": 0.003038787845052831}, {"ticker": "AOMR", "market_cap": 202140084.6, "weight": 2.7053521405663576e-05}, {"ticker": "GPMT", "market_cap": 230295060.065, "weight": 3.082165691884279e-05}, {"ticker": "SPFI", "market_cap": 443185931.5208, "weight": 5.931401537113493e-05}, {"ticker": "FSNB", "market_cap": 177561878.58, "weight": 2.376408465693235e-05}, {"ticker": "PHYT", "market_cap": 153784090.26000002, "weight": 2.0581772219657073e-05}, {"ticker": "COOL", "market_cap": 114202520.48, "weight": 1.5284352623578616e-05}, {"ticker": "HBT", "market_cap": 570047624.4, "weight": 7.629261479468616e-05}, {"ticker": "SELF", "market_cap": 53435038.86, "weight": 7.151505701959497e-06}, {"ticker": "ACIC", "market_cap": 325982709.86, "weight": 4.362806237330391e-05}, {"ticker": "DGICB", "market_cap": 454050455.29999995, "weight": 6.07680744569642e-05}, {"ticker": "CFFN", "market_cap": 617607904.415, "weight": 8.26578691478307e-05}, {"ticker": "HSPO", "market_cap": 97449735.0, "weight": 1.3042235027335806e-05}, {"ticker": "NRAC", "market_cap": 92080118.3071, "weight": 1.2323589636299007e-05}, {"ticker": "HMNF", "market_cap": 86561212.97999999, "weight": 1.1584964124699064e-05}, {"ticker": "OPY", "market_cap": 391035014.7768, "weight": 5.233437080805561e-05}, {"ticker": "OCN", "market_cap": 166015298.0, "weight": 2.221874215100936e-05}, {"ticker": "CULL", "market_cap": 76999881.77, "weight": 1.0305318481588582e-05}, {"ticker": "ONL", "market_cap": 263068006.23999998, "weight": 3.520784089925665e-05}, {"ticker": "AFBI", "market_cap": 96389717.0, "weight": 1.2900366977215336e-05}, {"ticker": "STRW", "market_cap": 38086916.448, "weight": 5.097381904438404e-06}, {"ticker": "COF", "market_cap": 35161272768.82, "weight": 0.004705826889228717}, {"ticker": "SCRM", "market_cap": 979696875.0000001, "weight": 0.0001311182313558516}, {"ticker": "MS", "market_cap": 129939319203.6, "weight": 0.017390495113664087}, {"ticker": "CNFR", "market_cap": 14667457.2, "weight": 1.963026621424766e-06}, {"ticker": "GSHD", "market_cap": 1758904767.4299998, "weight": 0.00023540391738903634}, {"ticker": "BGC", "market_cap": 2616170116.0899997, "weight": 0.0003501364629215069}, {"ticker": "CMPO", "market_cap": 121391232.7086, "weight": 1.6246457594200487e-05}, {"ticker": "MOH", "market_cap": 18869669500.0, "weight": 0.002525431849631506}, {"ticker": "JWSM", "market_cap": 301329672.78, "weight": 4.032861057145976e-05}, {"ticker": "RC", "market_cap": 1649209696.26, "weight": 0.0002207228215447073}, {"ticker": "GDOT", "market_cap": 696208210.6, "weight": 9.317738124794392e-05}, {"ticker": "EVGR", "market_cap": 163684350.0, "weight": 2.1906778535587537e-05}, {"ticker": "FSRX", "market_cap": 98984453.6, "weight": 1.3247634874570113e-05}, {"ticker": "IBOC", "market_cap": 2641422268.98, "weight": 0.00035351609769360354}, {"ticker": "CHAA", "market_cap": 106960597.59, "weight": 1.4315126176926677e-05}, {"ticker": "IBKR", "market_cap": 9192072595.550001, "weight": 0.0012302257279560153}, {"ticker": "BAFN", "market_cap": 44218811.35, "weight": 5.918047188698093e-06}, {"ticker": "WTM", "market_cap": 3856040712.0, "weight": 0.000516075177022075}, {"ticker": "GBCI", "market_cap": 3132342061.25, "weight": 0.00041921859868404967}, {"ticker": "BITE", "market_cap": 89142732.77, "weight": 1.1930463143540918e-05}, {"ticker": "SVC", "market_cap": 1206237108.96, "weight": 0.00016143735920626557}, {"ticker": "FBNC", "market_cap": 1134717376.3600001, "weight": 0.0001518654792862082}, {"ticker": "DCOM", "market_cap": 750136113.72, "weight": 0.00010039484968972506}, {"ticker": "QCRH", "market_cap": 795407781.275, "weight": 0.00010645380642605403}, {"ticker": "CB", "market_cap": 84670960802.94, "weight": 0.011331981259695383}, {"ticker": "GREE", "market_cap": 30502505.04, "weight": 4.08231833215529e-06}, {"ticker": "CBOE", "market_cap": 16736028371.550001, "weight": 0.0022398749000796694}, {"ticker": "AVHI", "market_cap": 33674184.33, "weight": 4.5068016489289426e-06}, {"ticker": "JAQC", "market_cap": 61734941.839999996, "weight": 8.262327454006794e-06}, {"ticker": "NBHC", "market_cap": 1106328597.22, "weight": 0.00014806605253883936}, {"ticker": "CI", "market_cap": 83889649663.05, "weight": 0.011227414084464777}, {"ticker": "OCTO", "market_cap": 1461423.3355999999, "weight": 1.9559033810946996e-07}, {"ticker": "JLL", "market_cap": 6225383854.08, "weight": 0.0008331774258831279}, {"ticker": "DEI", "market_cap": 1978343166.45, "weight": 0.0002647725675350951}, {"ticker": "MFIN", "market_cap": 152087199.39, "weight": 2.0354667963885818e-05}, {"ticker": "CFB", "market_cap": 492416990.1, "weight": 6.590287922627485e-05}, {"ticker": "KRG", "market_cap": 4514698068.719999, "weight": 0.000604226920573004}, {"ticker": "FRPH", "market_cap": 513525995.84, "weight": 6.872801378466498e-05}, {"ticker": "TCBX", "market_cap": 220842535.11, "weight": 2.9556573416410826e-05}, {"ticker": "PCB", "market_cap": 218883183.4, "weight": 2.9294342580143982e-05}, {"ticker": "AUBN", "market_cap": 76908485.69999999, "weight": 1.0293086441906638e-05}, {"ticker": "JRVR", "market_cap": 556960383.9449999, "weight": 7.454107728795647e-05}, {"ticker": "MTRY", "market_cap": 48388978.8, "weight": 6.476163678047659e-06}, {"ticker": "FEXD", "market_cap": 73463911.92, "weight": 9.832080151763742e-06}, {"ticker": "WMPN", "market_cap": 136099064.66, "weight": 1.8214887791088327e-05}, {"ticker": "VNO", "market_cap": 4042388117.19, "weight": 0.0005410150771174643}, {"ticker": "DECA", "market_cap": 118073475.0, "weight": 1.5802423797707182e-05}, {"ticker": "LARK", "market_cap": 93973806.0, "weight": 1.257703229531881e-05}, {"ticker": "CUBI", "market_cap": 1009462531.8599999, "weight": 0.00013510193323570943}, {"ticker": "BOAC", "market_cap": 226321198.92, "weight": 3.0289813184028243e-05}, {"ticker": "NICK", "market_cap": 33872000.0, "weight": 4.5332764100992e-06}, {"ticker": "NBST", "market_cap": 94438601.85, "weight": 1.2639238485160477e-05}, {"ticker": "SFNC", "market_cap": 2066902179.19, "weight": 0.0002766249082104587}, {"ticker": "FNB", "market_cap": 3764027758.32, "weight": 0.0005037605763979284}, {"ticker": "WBS", "market_cap": 6604477931.599999, "weight": 0.00088391367525812}, {"ticker": "BFIN", "market_cap": 106739909.1858, "weight": 1.4285590231699283e-05}, {"ticker": "MGYR", "market_cap": 64788903.05, "weight": 8.671055911453978e-06}, {"ticker": "ACGL", "market_cap": 29854988753.149998, "weight": 0.003995657659377416}, {"ticker": "IXAQ", "market_cap": 113509558.9, "weight": 1.5191609756794279e-05}, {"ticker": "SUI", "market_cap": 14303193180.24, "weight": 0.0019142751604001463}, {"ticker": "CRD.B", "market_cap": 417862487.88, "weight": 5.592483936501438e-05}, {"ticker": "BKKT", "market_cap": 103677501.16, "weight": 1.3875731290347795e-05}, {"ticker": "TWOA", "market_cap": 108773574.0, "weight": 1.4557766800200159e-05}, {"ticker": "RDFN", "market_cap": 774461422.845, "weight": 0.00010365043985342172}, {"ticker": "EVR", "market_cap": 4954897792.440001, "weight": 0.0006631412752987972}, {"ticker": "CONX", "market_cap": 224018272.66, "weight": 2.9981599872483135e-05}, {"ticker": "HNVR", "market_cap": 129188437.9, "weight": 1.7290000531106387e-05}, {"ticker": "HMN", "market_cap": 1178504479.935, "weight": 0.00015772574864447218}, {"ticker": "CSTR", "market_cap": 298727222.98, "weight": 3.998031037404576e-05}, {"ticker": "ISRL", "market_cap": 210252711.85000002, "weight": 2.8139279014790675e-05}, {"ticker": "APGB", "market_cap": 374103655.52000004, "weight": 5.006835369924108e-05}, {"ticker": "WAFD", "market_cap": 1615649018.88, "weight": 0.0002162312111563717}, {"ticker": "AFCG", "market_cap": 225239243.97, "weight": 3.014500919100672e-05}, {"ticker": "EFC", "market_cap": 811444050.72, "weight": 0.00010860002873300412}, {"ticker": "HIW", "market_cap": 2045880080.6399999, "weight": 0.00027381140492020435}, {"ticker": "USB", "market_cap": 48265929322.0, "weight": 0.006459695288348426}, {"ticker": "CRVL", "market_cap": 3361309084.17, "weight": 0.00044986251707368946}, {"ticker": "SBXC", "market_cap": 176467500.0, "weight": 2.3617617941048084e-05}, {"ticker": "INVH", "market_cap": 19172099684.8416, "weight": 0.002565907747796491}, {"ticker": "CSTA", "market_cap": 132111065.96999998, "weight": 1.7681151950722135e-05}, {"ticker": "UE", "market_cap": 1735184129.5, "weight": 0.00023222925370337938}, {"ticker": "MITA", "market_cap": 102444058.64, "weight": 1.3710652881067879e-05}, {"ticker": "OPBK", "market_cap": 134952490.76, "weight": 1.8061435487908547e-05}, {"ticker": "INTG", "market_cap": 63966116.11, "weight": 8.560937801344162e-06}, {"ticker": "AMG", "market_cap": 4446929713.05, "weight": 0.0005951571080992789}, {"ticker": "JMSB", "market_cap": 254835529.51999998, "weight": 3.4106043175134456e-05}, {"ticker": "OUT", "market_cap": 1504364374.57, "weight": 0.0002013373739794467}, {"ticker": "ACT", "market_cap": 4386229698.0199995, "weight": 0.0005870332906031709}, {"ticker": "FBMS", "market_cap": 811331166.0, "weight": 0.00010858492074888045}, {"ticker": "DAVE", "market_cap": 67234705.56, "weight": 8.998391138849599e-06}, {"ticker": "APO", "market_cap": 49710691607.94, "weight": 0.006653055786371951}, {"ticker": "RNST", "market_cap": 1452260645.81, "weight": 0.00019436404484429333}, {"ticker": "BCBP", "market_cap": 182994464.70000002, "weight": 2.4491157593388077e-05}, {"ticker": "JUN", "market_cap": 129818274.2, "weight": 1.737429499381937e-05}, {"ticker": "SSBK", "market_cap": 198741690.0, "weight": 2.659869552964833e-05}, {"ticker": "KINS", "market_cap": 17908999.740000002, "weight": 2.3968601219241476e-06}, {"ticker": "SRCE", "market_cap": 1029114319.485, "weight": 0.0001377320402638357}, {"ticker": "PDLB", "market_cap": 175315485.555, "weight": 2.3463437499751083e-05}, {"ticker": "BANR", "market_cap": 1431508352.8, "weight": 0.0001915866511162082}, {"ticker": "WSBF", "market_cap": 221282271.8, "weight": 2.9615425800782346e-05}, {"ticker": "ACAC", "market_cap": 63341188.423999995, "weight": 8.47730028549149e-06}, {"ticker": "FRXB", "market_cap": 136874651.4, "weight": 1.831868883833761e-05}, {"ticker": "AACT", "market_cap": 642500000.0, "weight": 8.59893154667199e-05}, {"ticker": "WSBC", "market_cap": 1431109899.882, "weight": 0.00019153332396653575}, {"ticker": "GS", "market_cap": 101006274764.955, "weight": 0.013518226342228646}, {"ticker": "STBA", "market_cap": 1034826301.0799999, "weight": 0.0001384965062363066}, {"ticker": "CZFS", "market_cap": 216071392.59, "weight": 2.8918025121797658e-05}, {"ticker": "ACBA", "market_cap": 40533667.74, "weight": 5.424844112557304e-06}, {"ticker": "AXP", "market_cap": 107213682585.76001, "weight": 0.014348997936522476}, {"ticker": "LCNB", "market_cap": 153300189.35, "weight": 2.0517009094358045e-05}, {"ticker": "SPG", "market_cap": 34061420064.0, "weight": 0.004558627541054877}, {"ticker": "BSBK", "market_cap": 97804955.82, "weight": 1.3089776187104407e-05}, {"ticker": "KRNY", "market_cap": 440710247.835, "weight": 5.898268098132315e-05}, {"ticker": "NDAQ", "market_cap": 23720744204.8, "weight": 0.0031746779089990894}, {"ticker": "CCNE", "market_cap": 374983487.76, "weight": 5.018610649619539e-05}, {"ticker": "CALB", "market_cap": 166510384.857, "weight": 2.228500235323504e-05}, {"ticker": "VERY", "market_cap": 162137500.0, "weight": 2.169975507624171e-05}, {"ticker": "KRNL", "market_cap": 147150421.44, "weight": 1.9693951766949327e-05}, {"ticker": "MCAG", "market_cap": 33992853.059999995, "weight": 4.549450841074232e-06}, {"ticker": "MSBI", "market_cap": 439196130.09999996, "weight": 5.878003826137191e-05}, {"ticker": "HWEL", "market_cap": 107196762.4, "weight": 1.434673341482431e-05}, {"ticker": "NTST", "market_cap": 1007240055.7, "weight": 0.00013480448700436392}, {"ticker": "SKGR", "market_cap": 281388000.0, "weight": 3.7659706615641054e-05}, {"ticker": "ALTU", "market_cap": 89583300.30000001, "weight": 1.1989426723807944e-05}, {"ticker": "AIV", "market_cap": 957928952.1600001, "weight": 0.00012820491029103608}, {"ticker": "TGAA", "market_cap": 105905054.685, "weight": 1.4173857053429863e-05}, {"ticker": "IIPR", "market_cap": 2016495305.5300002, "weight": 0.0002698786785437804}, {"ticker": "MPB", "market_cap": 332126447.03999996, "weight": 4.4450312574884666e-05}, {"ticker": "ICE", "market_cap": 61849684668.44, "weight": 0.008277684119022003}, {"ticker": "PLTN", "market_cap": 52858107.190000005, "weight": 7.074291757407947e-06}, {"ticker": "LSBK", "market_cap": 56909760.0, "weight": 7.616546779416836e-06}, {"ticker": "FCAP", "market_cap": 92143150.0, "weight": 1.2332025515093061e-05}, {"ticker": "NCPL", "market_cap": 3669877.348, "weight": 4.91159908173294e-07}, {"ticker": "EMLD", "market_cap": 360112893.79999995, "weight": 4.8195892962804044e-05}, {"ticker": "FCBC", "market_cap": 554647767.12, "weight": 7.423156703469802e-05}, {"ticker": "SUAC", "market_cap": 168161188.88, "weight": 2.2505938552312825e-05}, {"ticker": "AX", "market_cap": 2143513668.1499999, "weight": 0.00028687824594206425}, {"ticker": "OVLY", "market_cap": 204971109.75, "weight": 2.743241310172205e-05}, {"ticker": "MCAC", "market_cap": 123711940.00000001, "weight": 1.6557050639159418e-05}, {"ticker": "PRU", "market_cap": 32844240000.0, "weight": 0.004395725625874957}, {"ticker": "CRBG", "market_cap": 12152443227.000399, "weight": 0.0016264284425493243}, {"ticker": "PTHR", "market_cap": 180452443.35000002, "weight": 2.4150944868425764e-05}, {"ticker": "ROSS", "market_cap": 161463505.52, "weight": 2.1609550680967707e-05}, {"ticker": "CNDA", "market_cap": 360275414.52, "weight": 4.82176440063246e-05}, {"ticker": "ASRV", "market_cap": 44582902.0, "weight": 5.966775446692385e-06}, {"ticker": "REG", "market_cap": 10379064206.45, "weight": 0.0013890873561054784}, {"ticker": "PCH", "market_cap": 3611989765.6000004, "weight": 0.00048341249403383984}, {"ticker": "AVB", "market_cap": 23756362542.24, "weight": 0.0031794449073718964}, {"ticker": "SEVN", "market_cap": 150102338.85999998, "weight": 2.0089023141673196e-05}, {"ticker": "RENE", "market_cap": 310931250.0, "weight": 4.1613642559862336e-05}, {"ticker": "GIPR", "market_cap": 10280485.6, "weight": 1.3758940379913948e-06}, {"ticker": "MARPS", "market_cap": 10400000.0, "weight": 1.391889308722003e-06}, {"ticker": "CHCT", "market_cap": 751621822.5, "weight": 0.0001005936902826824}, {"ticker": "ALCY", "market_cap": 154645265.0, "weight": 2.0697027980575094e-05}, {"ticker": "PPYA", "market_cap": 200528087.06, "weight": 2.6837778892047025e-05}, {"ticker": "KMPR", "market_cap": 2495314296.1949997, "weight": 0.0003339616625745182}, {"ticker": "TURN", "market_cap": 41058578.9178, "weight": 5.4950958679811975e-06}, {"ticker": "PGRE", "market_cap": 942023668.83, "weight": 0.00012607621857764942}, {"ticker": "NREF", "market_cap": 258289143.95700002, "weight": 3.4568259426221795e-05}, {"ticker": "WAL", "market_cap": 4668679889.195, "weight": 0.0006248351561169179}, {"ticker": "FORL", "market_cap": 71651525.4, "weight": 9.589518476719524e-06}, {"ticker": "DOC", "market_cap": 2755340545.7799997, "weight": 0.000368762408419176}, {"ticker": "FNWB", "market_cap": 119914440.89999999, "weight": 1.604881040866216e-05}, {"ticker": "ALTI", "market_cap": 397262834.59999996, "weight": 5.316787425310936e-05}, {"ticker": "AMH", "market_cap": 11962334015.94, "weight": 0.0016009850792450414}, {"ticker": "ESQ", "market_cap": 370139256.5, "weight": 4.953777633275588e-05}, {"ticker": "ACAB", "market_cap": 115371550.60000001, "weight": 1.5440810366424963e-05}, {"ticker": "TRUP", "market_cap": 1078146866.84, "weight": 0.00014429433626795394}, {"ticker": "SMMF", "market_cap": 329096257.21, "weight": 4.404476557221398e-05}, {"ticker": "MDRR", "market_cap": 11702891.464, "weight": 1.5662624528726528e-06}, {"ticker": "RLI", "market_cap": 6165061661.160001, "weight": 0.0008251041744019728}, {"ticker": "EQBK", "market_cap": 369660153.91499996, "weight": 4.947365539373255e-05}, {"ticker": "PRI", "market_cap": 6857575274.549999, "weight": 0.0009177870873463941}, {"ticker": "GODN", "market_cap": 92356880.0, "weight": 1.2360630178742402e-05}, {"ticker": "CHCI", "market_cap": 45672612.045, "weight": 6.112617346811854e-06}, {"ticker": "USCB", "market_cap": 208151875.05, "weight": 2.7858112449282047e-05}, {"ticker": "OPFI", "market_cap": 39275983.0, "weight": 5.256521233389149e-06}, {"ticker": "MHLD", "market_cap": 161045216.775, "weight": 2.155356879326345e-05}, {"ticker": "SASR", "market_cap": 910481778.855, "weight": 0.00012185479363216016}, {"ticker": "BHLB", "market_cap": 880621050.48, "weight": 0.00011785836780756263}, {"ticker": "TMTC", "market_cap": 84900200.0, "weight": 1.136266160464998e-05}, {"ticker": "LCAA", "market_cap": 308278521.0, "weight": 4.12586132200511e-05}, {"ticker": "NFNT", "market_cap": 371910000.0, "weight": 4.9774764692961555e-05}, {"ticker": "TWLV", "market_cap": 135574709.62, "weight": 1.814471046665078e-05}, {"ticker": "FRLA", "market_cap": 73829541.96000001, "weight": 9.881014434804474e-06}, {"ticker": "FCF", "market_cap": 1239115201.5, "weight": 0.00016583761550411158}, {"ticker": "KW", "market_cap": 1920805733.86, "weight": 0.0002570720158741976}, {"ticker": "CBU", "market_cap": 2236350205.36, "weight": 0.00029930307128835}, {"ticker": "CLBK", "market_cap": 1627909563.6423, "weight": 0.00021787210742307868}, {"ticker": "AXR", "market_cap": 89401400.64, "weight": 1.1965082089960428e-05}, {"ticker": "MAA", "market_cap": 14787638670.84, "weight": 0.0019791111699217546}, {"ticker": "AEI", "market_cap": 12559761.840000002, "weight": 1.6809421370375572e-06}, {"ticker": "CME", "market_cap": 72449919783.98999, "weight": 0.009696371996644462}, {"ticker": "CXAC", "market_cap": 389921875.0, "weight": 5.218539317782089e-05}, {"ticker": "KNSW", "market_cap": 109247739.97, "weight": 1.4621227044835042e-05}, {"ticker": "NECB", "market_cap": 222004180.54, "weight": 2.9712042825501476e-05}, {"ticker": "TBNK", "market_cap": 75920224.38, "weight": 1.0160821983682457e-05}, {"ticker": "AON", "market_cap": 65351508697.02, "weight": 0.008746352525407224}, {"ticker": "ALEX", "market_cap": 1178703750.0, "weight": 0.00015775241805533968}, {"ticker": "NTIP", "market_cap": 53931931.2, "weight": 7.218007541924099e-06}, {"ticker": "MARX", "market_cap": 97751840.0, "weight": 1.3082667404221523e-05}, {"ticker": "AGM.A", "market_cap": 1307811332.24, "weight": 0.00017503159722791686}, {"ticker": "BDN", "market_cap": 675483319.425, "weight": 9.040365485843338e-05}, {"ticker": "AEAE", "market_cap": 77011793.78, "weight": 1.0306912731527466e-05}, {"ticker": "BRX", "market_cap": 5996827177.95, "weight": 0.0008025884264655909}, {"ticker": "MTB", "market_cap": 20078922023.0928, "weight": 0.0026872727783274655}, {"ticker": "UCBI", "market_cap": 2911313077.695, "weight": 0.00038963707184482894}, {"ticker": "WTFC", "market_cap": 4434810631.650001, "weight": 0.0005935351446538759}, {"ticker": "CMCA", "market_cap": 108682575.38999999, "weight": 1.4545587954780198e-05}, {"ticker": "CATC", "market_cap": 457973413.16999996, "weight": 6.129310552598534e-05}, {"ticker": "LOB", "market_cap": 1197406186.5149999, "weight": 0.00016025546819305894}, {"ticker": "BENF", "market_cap": 523948388.0, "weight": 7.012289995955075e-05}, {"ticker": "RMAX", "market_cap": 208189341.52499998, "weight": 2.786312679408858e-05}, {"ticker": "CBL", "market_cap": 681476990.46, "weight": 9.120582088089621e-05}, {"ticker": "GCBC", "market_cap": 411197896.2, "weight": 5.503288033555384e-05}, {"ticker": "FLFV", "market_cap": 136591533.48749998, "weight": 1.828079760799949e-05}, {"ticker": "LPRO", "market_cap": 827384467.815, "weight": 0.00011073342259176373}, {"ticker": "VCXB", "market_cap": 162738333.0, "weight": 2.178016786749434e-05}, {"ticker": "ZION", "market_cap": 4872493424.37, "weight": 0.0006521126446345062}, {"ticker": "OWL", "market_cap": 5800154899.44, "weight": 0.0007762666916790461}, {"ticker": "UDR", "market_cap": 11572992165.5, "weight": 0.001548877313950284}, {"ticker": "ROCL", "market_cap": 61685976.6, "weight": 8.25577416611689e-06}, {"ticker": "HALL", "market_cap": 3491485.44, "weight": 4.6728473610524407e-07}, {"ticker": "DMYY", "market_cap": 82541937.5, "weight": 1.1047042339177863e-05}, {"ticker": "GLLI", "market_cap": 88228986.375, "weight": 1.1808171428340556e-05}, {"ticker": "NSTS", "market_cap": 48370687.2, "weight": 6.473715612424639e-06}, {"ticker": "PECO", "market_cap": 3842501999.9999995, "weight": 0.0005142632165906647}, {"ticker": "QFTA", "market_cap": 107963210.3426, "weight": 1.4449311366458627e-05}, {"ticker": "MDV", "market_cap": 120261067.46, "weight": 1.609520135125669e-05}, {"ticker": "ASCA", "market_cap": 58554316.800000004, "weight": 7.836646878215498e-06}, {"ticker": "NODK", "market_cap": 268712799.6, "weight": 3.5963314699999825e-05}, {"ticker": "VLY", "market_cap": 3949398207.1800003, "weight": 0.0005285697250442009}, {"ticker": "LFT", "market_cap": 107047746.024, "weight": 1.4326789732076337e-05}, {"ticker": "SLM", "market_cap": 2948094388.3199997, "weight": 0.0003945597173274943}, {"ticker": "AAT", "market_cap": 1115511453.1000001, "weight": 0.00014929504474296503}, {"ticker": "ARL", "market_cap": 242442165.43, "weight": 3.2447370965906556e-05}, {"ticker": "FRME", "market_cap": 1626955961.76, "weight": 0.00021774448162839116}, {"ticker": "VABK", "market_cap": 143486358.67999998, "weight": 1.920357005712909e-05}, {"ticker": "UWMC", "market_cap": 427862864.40999997, "weight": 5.7263244862639514e-05}, {"ticker": "MDWT", "market_cap": 98109699.0, "weight": 1.3130561646157096e-05}, {"ticker": "JGGC", "market_cap": 37189809.08, "weight": 4.977317081910045e-06}, {"ticker": "KRC", "market_cap": 3509478344.6, "weight": 0.0004696928256769359}, {"ticker": "IRRX", "market_cap": 133651342.3954, "weight": 1.788729563235587e-05}, {"ticker": "PBT", "market_cap": 900481938.72, "weight": 0.00012051645992323365}, {"ticker": "FCCO", "market_cap": 132055469.01, "weight": 1.7673711103200848e-05}, {"ticker": "FSFG", "market_cap": 101409653.17, "weight": 1.357221269697398e-05}, {"ticker": "AHH", "market_cap": 691698362.92, "weight": 9.257380348162114e-05}, {"ticker": "CLST", "market_cap": 58201156.5, "weight": 7.789381489192896e-06}, {"ticker": "AGO", "market_cap": 3449206974.4, "weight": 0.00046162637608045457}, {"ticker": "JOE", "market_cap": 3101890205.6, "weight": 0.00041514305903885923}, {"ticker": "BY", "market_cap": 829070026.1250001, "weight": 0.00011095901014858264}, {"ticker": "HGTY", "market_cap": 659781497.65, "weight": 8.830219352611791e-05}, {"ticker": "HFBL", "market_cap": 44587584.730000004, "weight": 5.967402162252254e-06}, {"ticker": "ESRT", "market_cap": 1219240203.3436, "weight": 0.00016317763498057672}, {"ticker": "BXMT", "market_cap": 3509985825.36, "weight": 0.00046976074462349617}, {"ticker": "BVFL", "market_cap": 114315795.30000001, "weight": 1.5299512816934906e-05}, {"ticker": "STEL", "market_cap": 1140796421.6, "weight": 0.0001526790714089768}, {"ticker": "CWBC", "market_cap": 114437572.71, "weight": 1.5315810958764024e-05}, {"ticker": "APAM", "market_cap": 2419987569.415, "weight": 0.0003238802716450851}, {"ticker": "BMTX", "market_cap": 24808916.549999997, "weight": 3.3203140102809e-06}, {"ticker": "CCVI", "market_cap": 431686438.15, "weight": 5.777497480589108e-05}, {"ticker": "IPXX", "market_cap": 319375000.0, "weight": 4.274371615125863e-05}, {"ticker": "AMNB", "market_cap": 398285437.22, "weight": 5.330473479674871e-05}, {"ticker": "HMST", "market_cap": 131558210.0, "weight": 1.7607160189769624e-05}, {"ticker": "SBR", "market_cap": 904757702.3375, "weight": 0.00012108870892956256}, {"ticker": "PLYM", "market_cap": 890182968.66, "weight": 0.00011913809200810267}, {"ticker": "FIBK", "market_cap": 2510882749.881, "weight": 0.00033604527452056414}, {"ticker": "MORN", "market_cap": 9710114805.0, "weight": 0.0012995581714944939}, {"ticker": "EVE", "market_cap": 166641866.28, "weight": 2.2302599236597467e-05}, {"ticker": "VOYA", "market_cap": 6813825012.670001, "weight": 0.0009119317487151867}, {"ticker": "TRV", "market_cap": 36882586146.5672, "weight": 0.004936199743790879}, {"ticker": "SBCF", "market_cap": 1792767687.83, "weight": 0.00023993597862623483}, {"ticker": "FGBI", "market_cap": 125970534.66, "weight": 1.685933080838928e-05}, {"ticker": "FRST", "market_cap": 193791097.4, "weight": 2.5936130441977343e-05}, {"ticker": "ORRF", "market_cap": 212652957.0, "weight": 2.8460517049655754e-05}, {"ticker": "PKST", "market_cap": 565934286.0600001, "weight": 7.57421040582821e-05}, {"ticker": "LMFA", "market_cap": 6754518.063, "weight": 9.039943728326301e-07}, {"ticker": "MRBK", "market_cap": 109653737.31, "weight": 1.4675563906076925e-05}, {"ticker": "EIG", "market_cap": 1020789236.145, "weight": 0.00013661784848545438}, {"ticker": "HLNE", "market_cap": 3376112851.93, "weight": 0.0004518437868884921}, {"ticker": "LSAK", "market_cap": 239915754.0, "weight": 3.210924740255559e-05}, {"ticker": "EQH", "market_cap": 9260384325.0, "weight": 0.001239368263136954}, {"ticker": "BCML", "market_cap": 227833069.14000002, "weight": 3.0492155106662207e-05}, {"ticker": "TENK", "market_cap": 96205160.0, "weight": 1.2875666696912471e-05}, {"ticker": "TIPT", "market_cap": 564527886.1552, "weight": 7.555387780912067e-05}, {"ticker": "SAMA", "market_cap": 95915970.28, "weight": 1.283696284311821e-05}, {"ticker": "BEEP", "market_cap": 51525438.0, "weight": 6.8959332960979255e-06}, {"ticker": "CCTS", "market_cap": 59922503.550000004, "weight": 8.019758850298199e-06}, {"ticker": "DBRG", "market_cap": 2579473365.8199997, "weight": 0.0003452251346171171}, {"ticker": "RMBI", "market_cap": 120741902.75, "weight": 1.6159554187738156e-05}, {"ticker": "PLMI", "market_cap": 140803963.82, "weight": 1.8844570371801704e-05}, {"ticker": "CTRE", "market_cap": 2021358090.88, "weight": 0.00027052949190332605}, {"ticker": "SQFT", "market_cap": 8959565.731, "weight": 1.1991080530548979e-06}, {"ticker": "CCV", "market_cap": 283138406.2608, "weight": 3.789397313105717e-05}, {"ticker": "AC", "market_cap": 771906562.9900001, "weight": 0.00010330850888058929}, {"ticker": "SBAC", "market_cap": 20624148549.96, "weight": 0.0027602434488638197}, {"ticker": "UMH", "market_cap": 876239694.6750001, "weight": 0.00011727198681691969}, {"ticker": "GABC", "market_cap": 785761066.51, "weight": 0.00010516273343127575}, {"ticker": "NYCB", "market_cap": 7820795035.9, "weight": 0.0010467000957860887}, {"ticker": "HTBK", "market_cap": 509194776.9250001, "weight": 6.814834289028778e-05}, {"ticker": "CFBK", "market_cap": 101910562.32000001, "weight": 1.3639252128755329e-05}, {"ticker": "EWBC", "market_cap": 7071353726.639999, "weight": 0.0009463982356059335}, {"ticker": "LBAI", "market_cap": 801813513.0600001, "weight": 0.00010731112080933118}, {"ticker": "QOMO", "market_cap": 51023235.36, "weight": 6.82872074942216e-06}, {"ticker": "SLAC", "market_cap": 104163230.82000001, "weight": 1.3940739167336563e-05}, {"ticker": "AVTA", "market_cap": 940717313.69, "weight": 0.00012590138187065325}, {"ticker": "MKL", "market_cap": 19278877962.64, "weight": 0.002580198473111043}, {"ticker": "IVCA", "market_cap": 176564008.56, "weight": 2.363053421343887e-05}, {"ticker": "PFS", "market_cap": 1130821374.9, "weight": 0.00015134405594207943}, {"ticker": "SEDA", "market_cap": 265186944.76999998, "weight": 3.549143011903993e-05}, {"ticker": "TRIS", "market_cap": 175693533.48, "weight": 2.3514033736769545e-05}, {"ticker": "RWT", "market_cap": 770843947.4997, "weight": 0.00010316629319402859}, {"ticker": "FPH", "market_cap": 192621889.8808, "weight": 2.577964895681851e-05}, {"ticker": "PGC", "market_cap": 455783564.6, "weight": 6.100002602480235e-05}, {"ticker": "HR", "market_cap": 5691915815.74, "weight": 0.0007617804586609793}, {"ticker": "RPT", "market_cap": 863034285.28, "weight": 0.0001155046341097853}, {"ticker": "AJX", "market_cap": 147198706.622, "weight": 1.9700414038929665e-05}, {"ticker": "AEL", "market_cap": 4169384315.25, "weight": 0.0005580116781105466}, {"ticker": "AGM", "market_cap": 1622843445.5, "weight": 0.00021719408091548352}, {"ticker": "PWOD", "market_cap": 148166545.205, "weight": 1.9829945209722584e-05}, {"ticker": "COLD", "market_cap": 7819827007.184999, "weight": 0.0010465705391688826}, {"ticker": "SFBC", "market_cap": 94477304.25, "weight": 1.2644418240620274e-05}, {"ticker": "BMAC", "market_cap": 126367221.42, "weight": 1.691242158340424e-05}, {"ticker": "IVR", "market_cap": 401887464.94500005, "weight": 5.3786814015993686e-05}, {"ticker": "TFIN", "market_cap": 1413297771.6, "weight": 0.00018914942868564146}, {"ticker": "CPF", "market_cap": 427387620.06, "weight": 5.719964029246687e-05}, {"ticker": "LCA", "market_cap": 141550980.12, "weight": 1.8944547679629692e-05}, {"ticker": "ATEK", "market_cap": 129836490.80999999, "weight": 1.737673302311746e-05}, {"ticker": "EQR", "market_cap": 21775412011.95, "weight": 0.002914323381966335}, {"ticker": "HRTG", "market_cap": 160943455.047, "weight": 2.1539949460451885e-05}, {"ticker": "JBGS", "market_cap": 1424359532.79, "weight": 0.0001906298851410258}, {"ticker": "FBK", "market_cap": 1329549333.99, "weight": 0.00017794091378837892}, {"ticker": "OHAA", "market_cap": 59241105.0, "weight": 7.928563527536307e-06}, {"ticker": "NWLI", "market_cap": 1548399117.0, "weight": 0.00020723078621027788}, {"ticker": "RELI", "market_cap": 5018181.279999999, "weight": 6.716108531597014e-07}, {"ticker": "RRAC", "market_cap": 348921959.04, "weight": 4.66981484967416e-05}, {"ticker": "HHGC", "market_cap": 58510511.4006, "weight": 7.830784160226156e-06}, {"ticker": "CBNK", "market_cap": 260697597.6, "weight": 3.489059604893759e-05}, {"ticker": "FCPT", "market_cap": 1994259928.92, "weight": 0.0002669027955650433}, {"ticker": "NXRT", "market_cap": 782553060.24, "weight": 0.00010473338827459054}, {"ticker": "FFBC", "market_cap": 1839233116.2450001, "weight": 0.000246154702956622}, {"ticker": "EG", "market_cap": 16620749907.3, "weight": 0.002224446547972413}, {"ticker": "OSBC", "market_cap": 594625008.6700001, "weight": 7.958194156408668e-05}, {"ticker": "ABR", "market_cap": 2514979132.875, "weight": 0.00033659351602958136}, {"ticker": "AAME", "market_cap": 37336187.04, "weight": 4.996907650905866e-06}, {"ticker": "AXS", "market_cap": 4763014488.81, "weight": 0.0006374604754098689}, {"ticker": "OSCR", "market_cap": 1233795586.36, "weight": 0.00016512566209643065}, {"ticker": "XFIN", "market_cap": 112132746.88000001, "weight": 1.5007343417298322e-05}, {"ticker": "RGTI", "market_cap": 168232026.16, "weight": 2.2515419095840802e-05}, {"ticker": "RFAC", "market_cap": 76499237.55, "weight": 1.0238314506849018e-05}, {"ticker": "VALU", "market_cap": 416433922.55999994, "weight": 5.5733646596195236e-05}, {"ticker": "BANC", "market_cap": 675994731.39, "weight": 9.047209993982146e-05}, {"ticker": "HTLF", "market_cap": 1229396136.975, "weight": 0.00016453685954227247}, {"ticker": "MPU", "market_cap": 27797121.6822, "weight": 3.7202419694902653e-06}, {"ticker": "CZWI", "market_cap": 95696161.4925, "weight": 1.2807544621840865e-05}, {"ticker": "WSFS", "market_cap": 2183384016.0, "weight": 0.0002922143142985491}, {"ticker": "ACRE", "market_cap": 475857839.66999996, "weight": 6.368667687579058e-05}, {"ticker": "ALOR", "market_cap": 78522999.49, "weight": 1.0509165719126375e-05}, {"ticker": "WY", "market_cap": 21644755760.0, "weight": 0.0028968369357925956}, {"ticker": "HTH", "market_cap": 1832334395.1999998, "weight": 0.0002452314091040844}, {"ticker": "INBK", "market_cap": 141745909.5607, "weight": 1.8970636160828297e-05}, {"ticker": "PORT", "market_cap": 303887500.0, "weight": 4.06709386831017e-05}, {"ticker": "APLE", "market_cap": 3398810511.6600003, "weight": 0.0004548815397645688}, {"ticker": "EVBN", "market_cap": 146632808.85, "weight": 1.962467682174924e-05}, {"ticker": "SMBK", "market_cap": 358531279.82, "weight": 4.79842168484495e-05}, {"ticker": "SIEB", "market_cap": 75599587.75999999, "weight": 1.01179094179745e-05}, {"ticker": "CG", "market_cap": 10685178444.72, "weight": 0.001430056311441593}, {"ticker": "VHC", "market_cap": 18325487.699, "weight": 2.452601000514873e-06}, {"ticker": "EHTH", "market_cap": 214879335.3, "weight": 2.875848552590005e-05}, {"ticker": "TRST", "market_cap": 510045048.72999996, "weight": 6.826213945133461e-05}, {"ticker": "GATE", "market_cap": 124346140.86000001, "weight": 1.664192923498791e-05}, {"ticker": "NRIM", "market_cap": 214332052.35, "weight": 2.8685239632924005e-05}, {"ticker": "PEB", "market_cap": 1555076516.205, "weight": 0.00020812445934138444}, {"ticker": "BETR", "market_cap": 314285155.1318, "weight": 4.206251416519121e-05}, {"ticker": "VAC", "market_cap": 3503988887.44, "weight": 0.0004689581413758117}, {"ticker": "CFIV", "market_cap": 225176814.7398, "weight": 3.0136653943115652e-05}, {"ticker": "FBRT", "market_cap": 1033798596.8, "weight": 0.00013835896290939699}, {"ticker": "RGLD", "market_cap": 6740977883.08, "weight": 0.0009021822159413973}, {"ticker": "OMF", "market_cap": 4492812742.6, "weight": 0.0006012978867802809}, {"ticker": "NKSH", "market_cap": 140282305.59, "weight": 1.8774753976307105e-05}, {"ticker": "GOOD", "market_cap": 460973006.26, "weight": 6.16945575983399e-05}, {"ticker": "ESHA", "market_cap": 148384500.0, "weight": 1.9859115300967312e-05}, {"ticker": "ALX", "market_cap": 871661184.3, "weight": 0.00011665921954376244}, {"ticker": "VICI", "market_cap": 28507733859.5, "weight": 0.003815347112974067}, {"ticker": "DX", "market_cap": 607630415.99, "weight": 8.132252689142156e-05}, {"ticker": "MCY", "market_cap": 1525457937.5119002, "weight": 0.00020416044174307032}, {"ticker": "LAND", "market_cap": 492420193.08, "weight": 6.590330789873812e-05}, {"ticker": "CBAN", "market_cap": 171803069.28, "weight": 2.2993351474659383e-05}, {"ticker": "SCHW", "market_cap": 93140838910.18001, "weight": 0.012465551719661336}, {"ticker": "MACA", "market_cap": 64617443.28999999, "weight": 8.64810850695205e-06}, {"ticker": "SRC", "market_cap": 4660401530.05, "weight": 0.000623727217695025}, {"ticker": "CASH", "market_cap": 1205326875.48, "weight": 0.00016131553764383742}, {"ticker": "MAC", "market_cap": 2308619795.625, "weight": 0.0003089753087917705}, {"ticker": "CNC", "market_cap": 37134640998.54, "weight": 0.004969933633567077}, {"ticker": "CZNC", "market_cap": 270651640.5, "weight": 3.622280046154049e-05}, {"ticker": "ALRS", "market_cap": 349833087.44549996, "weight": 4.6820089831980866e-05}, {"ticker": "MNSB", "market_cap": 152077359.97, "weight": 2.035335110008755e-05}, {"ticker": "SACH", "market_cap": 149869947.845, "weight": 2.005792097155574e-05}, {"ticker": "FZT", "market_cap": 151184718.21, "weight": 2.0233883934485358e-05}, {"ticker": "HWC", "market_cap": 2935157040.0, "weight": 0.0003928282407111654}, {"ticker": "BRKL", "market_cap": 780606544.0799999, "weight": 0.00010447287529070989}, {"ticker": "AMTB", "market_cap": 585645256.9, "weight": 7.838013190219815e-05}, {"ticker": "FRT", "market_cap": 7118668129.482, "weight": 0.0009527305828621207}, {"ticker": "AGBA", "market_cap": 37827962.680199996, "weight": 5.0627246947408945e-06}, {"ticker": "FG", "market_cap": 3346029230.18, "weight": 0.0004478175300152746}, {"ticker": "SHFS", "market_cap": 37494902.67, "weight": 5.018149438263951e-06}, {"ticker": "GTY", "market_cap": 1371359814.45, "weight": 0.00018353664078307164}, {"ticker": "VRE", "market_cap": 1441273082.0149999, "weight": 0.00019289351863514316}, {"ticker": "NXTP", "market_cap": 5220314.0248, "weight": 6.986633922394855e-07}, {"ticker": "PACW", "market_cap": 889883863.65, "weight": 0.00011909806113640997}, {"ticker": "AIG", "market_cap": 41763377872.0728, "weight": 0.00558942299579377}, {"ticker": "ATLO", "market_cap": 144099476.17499998, "weight": 1.9285626950040717e-05}, {"ticker": "HCVI", "market_cap": 470028192.48, "weight": 6.290646306834998e-05}, {"ticker": "TFSL", "market_cap": 3227989563.4700003, "weight": 0.0004320196309673172}, {"ticker": "ACNB", "market_cap": 274142666.82, "weight": 3.669002375108617e-05}, {"ticker": "BLUA", "market_cap": 105792012.1, "weight": 1.4158727941363343e-05}, {"ticker": "CIGI", "market_cap": 4439107487.84, "weight": 0.0005941102165954121}, {"ticker": "BHM", "market_cap": 48348509.42, "weight": 6.4707474379176016e-06}, {"ticker": "ROOT", "market_cap": 126440000.00000001, "weight": 1.6922161941808662e-05}, {"ticker": "ECBK", "market_cap": 97716380.55, "weight": 1.3077921670630353e-05}, {"ticker": "FSBW", "market_cap": 222606056.97, "weight": 2.979259526474078e-05}, {"ticker": "COFS", "market_cap": 145068771.51000002, "weight": 1.9415353085981168e-05}, {"ticker": "CBFV", "market_cap": 111470623.61999999, "weight": 1.4918727812812729e-05}, {"ticker": "WABC", "market_cap": 1139759167.8200002, "weight": 0.00015254025001986015}, {"ticker": "WASH", "market_cap": 432033382.01500005, "weight": 5.7821408215162256e-05}, {"ticker": "JEF", "market_cap": 7310268720.0, "weight": 0.0009783735456973925}, {"ticker": "GHL", "market_cap": 278278391.2, "weight": 3.7243530534580686e-05}, {"ticker": "VMCA", "market_cap": 130016608.8, "weight": 1.7400839206251067e-05}, {"ticker": "ERIE", "market_cap": 15651141840.42, "weight": 0.0020946785574011743}, {"ticker": "KFS", "market_cap": 198435094.2, "weight": 2.6557662124252263e-05}, {"ticker": "LATG", "market_cap": 95231197.08, "weight": 1.2745315872350964e-05}, {"ticker": "IRM", "market_cap": 16728980083.88, "weight": 0.002238931588901528}, {"ticker": "CTBI", "market_cap": 617285585.89, "weight": 8.261473148350854e-05}, {"ticker": "PNC", "market_cap": 47814446555.64, "weight": 0.006399270861851434}, {"ticker": "REFR", "market_cap": 36860215.7, "weight": 4.933205783655474e-06}, {"ticker": "AIRC", "market_cap": 4482674751.08, "weight": 0.0005999410635102229}, {"ticker": "RGA", "market_cap": 9343809074.880001, "weight": 0.0012505334571216446}, {"ticker": "MVBF", "market_cap": 281871277.68, "weight": 3.77243863306349e-05}, {"ticker": "EBMT", "market_cap": 94739245.52, "weight": 1.2679475284199704e-05}, {"ticker": "FNVT", "market_cap": 98944710.48, "weight": 1.3242315833817878e-05}, {"ticker": "ALHC", "market_cap": 1356514876.8, "weight": 0.0001815498609750255}, {"ticker": "LBBB", "market_cap": 62278817.13999999, "weight": 8.335117282405637e-06}, {"ticker": "ML", "market_cap": 200414074.545, "weight": 2.682251996890385e-05}, {"ticker": "WTBA", "market_cap": 266096245.54, "weight": 3.561312685174913e-05}, {"ticker": "STHO", "market_cap": 159901221.76000002, "weight": 2.140046163647405e-05}, {"ticker": "PFSI", "market_cap": 3235304583.6800003, "weight": 0.0004329986404311042}, {"ticker": "LOAN", "market_cap": 53296370.25000001, "weight": 7.132946917756196e-06}, {"ticker": "JYNT", "market_cap": 128512156.63000001, "weight": 1.719949008212543e-05}, {"ticker": "STEP", "market_cap": 1884417781.29, "weight": 0.0002522020156676143}, {"ticker": "VTR", "market_cap": 16280211088.26, "weight": 0.002178870361296779}, {"ticker": "APPS", "market_cap": 565921561.1741999, "weight": 7.574040101669556e-05}, {"ticker": "PWUP", "market_cap": 95396939.69, "weight": 1.2767498119164299e-05}, {"ticker": "RJF", "market_cap": 20123971083.48, "weight": 0.002693301942319861}, {"ticker": "OPAD", "market_cap": 237950966.14000002, "weight": 3.184628901637859e-05}, {"ticker": "IRAA", "market_cap": 88534557.60000001, "weight": 1.1849067709218497e-05}, {"ticker": "DRH", "market_cap": 1644525360.465, "weight": 0.00022009589107244534}, {"ticker": "BRO", "market_cap": 19850079679.17, "weight": 0.0026566455464150586}, {"ticker": "BTCS", "market_cap": 13759960.32, "weight": 1.8415713132545185e-06}, {"ticker": "FNF", "market_cap": 10590303647.22, "weight": 0.0014173586944889569}, {"ticker": "VSAC", "market_cap": 50721135.92, "weight": 6.788289116661881e-06}, {"ticker": "ISTR", "market_cap": 101114221.12, "weight": 1.3532673397757747e-05}, {"ticker": "HAFC", "market_cap": 479407944.73, "weight": 6.416180699866114e-05}, {"ticker": "FBIZ", "market_cap": 246636691.9, "weight": 3.300874755713199e-05}, {"ticker": "PSA", "market_cap": 45270812611.020004, "weight": 0.0060588423144649975}, {"ticker": "MCBS", "market_cap": 490808210.09, "weight": 6.568756733242824e-05}, {"ticker": "AMP", "market_cap": 32390850628.86, "weight": 0.004335046027954001}, {"ticker": "ACAQ", "market_cap": 50482463.4, "weight": 6.756346258116329e-06}, {"ticker": "CSR", "market_cap": 858972987.6, "weight": 0.00011496108826167671}, {"ticker": "GLPI", "market_cap": 11722944345.029999, "weight": 0.001568946240441377}, {"ticker": "SNEX", "market_cap": 1931521654.14, "weight": 0.00025850618653485623}, {"ticker": "BNIX", "market_cap": 58242114.58, "weight": 7.794863134736912e-06}, {"ticker": "CIZN", "market_cap": 57568489.5, "weight": 7.70470817830047e-06}, {"ticker": "SRG", "market_cap": 413222449.31, "weight": 5.5303837434472e-05}, {"ticker": "SYF", "market_cap": 11987217414.9, "weight": 0.0016043153616466842}, {"ticker": "ACAH", "market_cap": 130815894.36, "weight": 1.750781199717221e-05}, {"ticker": "TCOA", "market_cap": 112575019.9, "weight": 1.5066535252690072e-05}, {"ticker": "KREF", "market_cap": 746967413.349, "weight": 9.997076505809638e-05}, {"ticker": "EQIX", "market_cap": 66550861276.56, "weight": 0.008906868490104329}, {"ticker": "CCB", "market_cap": 552635546.2377, "weight": 7.396226042576912e-05}, {"ticker": "ORC", "market_cap": 403938990.0, "weight": 5.406138091893886e-05}, {"ticker": "FSP", "market_cap": 189277545.99, "weight": 2.5332056985059447e-05}, {"ticker": "WINV", "market_cap": 45213484.68, "weight": 6.051169801553661e-06}, {"ticker": "RHP", "market_cap": 4943697206.4, "weight": 0.0006616422391487494}, {"ticker": "PBHC", "market_cap": 86502459.0, "weight": 1.157710075579456e-05}, {"ticker": "AIB", "market_cap": 40857576.8727, "weight": 5.468194656672933e-06}, {"ticker": "ICCH", "market_cap": 50287408.0, "weight": 6.730240919090512e-06}, {"ticker": "CSLM", "market_cap": 101915685.27000001, "weight": 1.3639937761383609e-05}, {"ticker": "PTWO", "market_cap": 58409610.0, "weight": 7.817279969771326e-06}, {"ticker": "THCP", "market_cap": 103403747.88, "weight": 1.3839093380380526e-05}, {"ticker": "SAFE", "market_cap": 1186084663.72, "weight": 0.0001587402464106731}, {"ticker": "HOOD", "market_cap": 8749205621.7318, "weight": 0.0011709544004518209}, {"ticker": "ALSA", "market_cap": 135566958.15, "weight": 1.814367304470656e-05}, {"ticker": "NFBK", "market_cap": 412942768.367, "weight": 5.526640619270133e-05}, {"ticker": "CETU", "market_cap": 78632775.0, "weight": 1.0523857580542577e-05}, {"ticker": "PEBO", "market_cap": 892747962.1199999, "weight": 0.00011948137921713304}, {"ticker": "GAMC", "market_cap": 97709560.11999999, "weight": 1.3077008854899787e-05}, {"ticker": "MBIN", "market_cap": 1163061751.35, "weight": 0.00015565896318149553}, {"ticker": "SAMG", "market_cap": 150162556.85999998, "weight": 2.0097082448441718e-05}, {"ticker": "CNOB", "market_cap": 667788637.9499999, "weight": 8.937383323544551e-05}, {"ticker": "BRKH", "market_cap": 183898789.61999997, "weight": 2.461218838067258e-05}, {"ticker": "ARE", "market_cap": 16773355259.039999, "weight": 0.0022448705631205536}, {"ticker": "VCTR", "market_cap": 2110479588.4400003, "weight": 0.00028245711302169705}, {"ticker": "WTW", "market_cap": 21800018097.06, "weight": 0.0029176165499273077}, {"ticker": "SFBS", "market_cap": 2830013732.0, "weight": 0.00037875633241415924}, {"ticker": "NRT", "market_cap": 102291266.7, "weight": 1.3690203893784717e-05}, {"ticker": "HASI", "market_cap": 1648732762.26, "weight": 0.00022065899083936443}, {"ticker": "CWD", "market_cap": 29749837.599999998, "weight": 3.981584701120755e-06}, {"ticker": "CFSB", "market_cap": 43443805.1, "weight": 5.814323831624273e-06}, {"ticker": "NBTB", "market_cap": 1510559717.84, "weight": 0.00020216653090842515}, {"ticker": "GNTY", "market_cap": 322265033.71999997, "weight": 4.3130505289404206e-05}, {"ticker": "ARIZ", "market_cap": 55321240.42, "weight": 7.403946450561302e-06}, {"ticker": "CORR", "market_cap": 12603945.1246, "weight": 1.6868554294855342e-06}, {"ticker": "USCT", "market_cap": 84987748.80000001, "weight": 1.1374378742987622e-05}, {"ticker": "NWFL", "market_cap": 207745415.75, "weight": 2.7803713761387754e-05}, {"ticker": "KERN", "market_cap": 1695378.5114, "weight": 2.2690184848602735e-07}, {"ticker": "WE", "market_cap": 121341141.39999999, "weight": 1.6239753598344692e-05}, {"ticker": "HCI", "market_cap": 463935006.0, "weight": 6.209097834550754e-05}, {"ticker": "HIPO", "market_cap": 172875476.715, "weight": 2.3136877671137315e-05}, {"ticker": "SFR", "market_cap": 8112039.6906, "weight": 1.0856789728148736e-06}, {"ticker": "EPRT", "market_cap": 3290547298.86, "weight": 0.0004403920774160865}, {"ticker": "BLFY", "market_cap": 202187661.2405, "weight": 2.7059888849630586e-05}, {"ticker": "MSB", "market_cap": 250723391.1, "weight": 3.355569303063609e-05}, {"ticker": "FFIN", "market_cap": 3429357233.8999996, "weight": 0.0004589697759282568}, {"ticker": "OPEN", "market_cap": 1733683394.4099998, "weight": 0.00023202840205655294}, {"ticker": "RITM", "market_cap": 4330552629.76, "weight": 0.0005795817217520095}, {"ticker": "ACTG", "market_cap": 353098148.27000004, "weight": 4.7257070914091316e-05}, {"ticker": "BOTJ", "market_cap": 47432448.72, "weight": 6.348145986526217e-06}, {"ticker": "GMFI", "market_cap": 69767864.43180001, "weight": 9.337417749518128e-06}, {"ticker": "HONE", "market_cap": 437062038.42, "weight": 5.84944210120234e-05}, {"ticker": "LDI", "market_cap": 263000559.96500003, "weight": 3.5198814192613806e-05}, {"ticker": "FNLC", "market_cap": 255199881.14, "weight": 3.415480636018191e-05}, {"ticker": "HPLT", "market_cap": 76874922.95, "weight": 1.028859455412815e-05}, {"ticker": "MOBV", "market_cap": 88003510.26, "weight": 1.1777994717394338e-05}, {"ticker": "PEAK", "market_cap": 9499597711.119999, "weight": 0.0012713835087757633}, {"ticker": "APCA", "market_cap": 236971875.0, "weight": 3.171525185387566e-05}, {"ticker": "ACRO", "market_cap": 171079471.70999998, "weight": 2.289650842451513e-05}, {"ticker": "ASB", "market_cap": 2472842059.65, "weight": 0.0003309540793254743}, {"ticker": "ELS", "market_cap": 11724219370.439999, "weight": 0.001569116884117966}, {"ticker": "CLSK", "market_cap": 548752764.1600001, "weight": 7.344260630441835e-05}, {"ticker": "CIFR", "market_cap": 626134578.7850001, "weight": 8.379904096461503e-05}, {"ticker": "EEFT", "market_cap": 3800426075.94, "weight": 0.0005086319638162694}, {"ticker": "CPSS", "market_cap": 181592096.4, "weight": 2.4303470916113014e-05}, {"ticker": "BANF", "market_cap": 2795107996.6, "weight": 0.0003740847054991266}, {"ticker": "ARI", "market_cap": 1348508888.82, "weight": 0.0001804783754870333}, {"ticker": "HPP", "market_cap": 847035589.02, "weight": 0.00011336344042922908}, {"ticker": "UHT", "market_cap": 557030710.5999999, "weight": 7.455048949172692e-05}, {"ticker": "PW", "market_cap": 2459199.0555000002, "weight": 3.291281609009325e-07}, {"ticker": "CHEA", "market_cap": 156543750.0, "weight": 2.095111268963943e-05}, {"ticker": "SSRM", "market_cap": 2548383387.5, "weight": 0.00034106419149865496}, {"ticker": "HYAC", "market_cap": 300794568.0, "weight": 4.025699455008207e-05}, {"ticker": "ANY", "market_cap": 13923542.879999999, "weight": 1.8634644686734967e-06}, {"ticker": "FDBC", "market_cap": 246310986.22, "weight": 3.29651565711914e-05}, {"ticker": "LMND", "market_cap": 794427969.6, "weight": 0.00010632267283038158}, {"ticker": "PFIS", "market_cap": 279521824.40000004, "weight": 3.740994605161819e-05}, {"ticker": "HIG", "market_cap": 21277187162.0, "weight": 0.0028476432048523902}, {"ticker": "BEN", "market_cap": 11763402106.5, "weight": 0.0015743609255995422}, {"ticker": "CINF", "market_cap": 15738947295.08, "weight": 0.002106430045246244}, {"ticker": "IGTA", "market_cap": 75694407.04, "weight": 1.0130599604714185e-05}, {"ticker": "SBRA", "market_cap": 3150354215.25, "weight": 0.00042162926450901644}, {"ticker": "THFF", "market_cap": 398486060.56750005, "weight": 5.3331585324870375e-05}, {"ticker": "EPR", "market_cap": 3034065502.76, "weight": 0.00040606570531287434}, {"ticker": "FMNB", "market_cap": 418737385.6, "weight": 5.604193174796566e-05}, {"ticker": "ESNT", "market_cap": 5007058477.2, "weight": 0.0006701222271692839}, {"ticker": "IBTX", "market_cap": 1570519782.36, "weight": 0.00021019131675031644}, {"ticker": "MNTN", "market_cap": 233948812.5, "weight": 3.13106587410537e-05}, {"ticker": "TBBK", "market_cap": 1842604424.865, "weight": 0.00024660590376667776}, {"ticker": "IROQ", "market_cap": 48642077.0, "weight": 6.510037204839658e-06}, {"ticker": "BYN", "market_cap": 118508460.97999999, "weight": 1.5860640368380834e-05}, {"ticker": "OLP", "market_cap": 382923574.512, "weight": 5.1248772059698665e-05}, {"ticker": "ABL", "market_cap": 453953770.48, "weight": 6.075513459472635e-05}, {"ticker": "FNWD", "market_cap": 88671782.02780001, "weight": 1.1867433210559874e-05}, {"ticker": "RF", "market_cap": 15253325563.535, "weight": 0.002041436612917345}, {"ticker": "KIM", "market_cap": 10389098128.400002, "weight": 0.0013904302511715128}, {"ticker": "CNA", "market_cap": 10397027774.744999, "weight": 0.0013914915194378156}, {"ticker": "AB", "market_cap": 3459257585.2, "weight": 0.0004629715047072474}, {"ticker": "ADRT", "market_cap": 36766500.0, "weight": 4.920663295108416e-06}, {"ticker": "FHB", "market_cap": 2219131135.29, "weight": 0.0002969985482559877}, {"ticker": "LGVC", "market_cap": 133538934.80999999, "weight": 1.7872251505784953e-05}, {"ticker": "DEA", "market_cap": 1037848493.66, "weight": 0.0001389009829229413}, {"ticker": "PSTL", "market_cap": 271740325.5204, "weight": 3.6368505176969384e-05}, {"ticker": "NMRK", "market_cap": 992569209.93, "weight": 0.0001328410068719435}, {"ticker": "AIHS", "market_cap": 3872659.1999999997, "weight": 5.182993208465293e-07}, {"ticker": "BRBS", "market_cap": 64098140.4, "weight": 8.578607339588643e-06}, {"ticker": "PVBC", "market_cap": 163592910.0, "weight": 2.189454061651162e-05}, {"ticker": "IBCP", "market_cap": 370922083.07, "weight": 4.9642546326348815e-05}, {"ticker": "PBFS", "market_cap": 223537927.79500002, "weight": 2.9917312672281883e-05}, {"ticker": "SLG", "market_cap": 2250359621.4, "weight": 0.0003011780286352264}, {"ticker": "SOHO", "market_cap": 31862824.95, "weight": 4.2643774416909316e-06}, {"ticker": "O", "market_cap": 34916151417.3024, "weight": 0.004673020948025175}, {"ticker": "ROIC", "market_cap": 1464794116.875, "weight": 0.00019604146834203853}, {"ticker": "UBFO", "market_cap": 123078945.60000001, "weight": 1.6472333510520867e-05}, {"ticker": "PFG", "market_cap": 16397938951.68, "weight": 0.002194626529992258}, {"ticker": "RNR", "market_cap": 10338158052.66, "weight": 0.0013836126601322824}, {"ticker": "TW", "market_cap": 17013010298.9, "weight": 0.0022769449177131}, {"ticker": "ELV", "market_cap": 102384801609.7984, "weight": 0.013702722186182858}, {"ticker": "CBSH", "market_cap": 5737447368.08, "weight": 0.000767874197210168}, {"ticker": "BOCN", "market_cap": 254265000.00000003, "weight": 3.402968606559617e-05}, {"ticker": "UFCS", "market_cap": 496827533.07, "weight": 6.649316649604426e-05}, {"ticker": "VRTS", "market_cap": 1382511896.8000002, "weight": 0.00018502918541700938}, {"ticker": "ENVA", "market_cap": 1483026504.99, "weight": 0.0001984816093122057}, {"ticker": "RM", "market_cap": 258816205.79999998, "weight": 3.4638799017020546e-05}, {"ticker": "ONYX", "market_cap": 93452037.6, "weight": 1.2507201155166021e-05}, {"ticker": "OHI", "market_cap": 8008554294.875, "weight": 0.00107182895205348}, {"ticker": "TFC", "market_cap": 35810175270.815, "weight": 0.004792673086818121}, {"ticker": "HCMA", "market_cap": 155419546.94, "weight": 2.0800654399250338e-05}, {"ticker": "SYBT", "market_cap": 1139478606.46, "weight": 0.00015250270094703086}, {"ticker": "RFL", "market_cap": 46648307.2328, "weight": 6.243200010318616e-06}, {"ticker": "BRK.A", "market_cap": 750167421366.0, "weight": 0.10039903976450859}, {"ticker": "CRD.A", "market_cap": 453623286.96, "weight": 6.07109041641305e-05}, {"ticker": "CFFI", "market_cap": 173533277.06, "weight": 2.3224914716087234e-05}, {"ticker": "MDBH", "market_cap": 100299869.27999999, "weight": 1.3423684203562159e-05}, {"ticker": "FGF", "market_cap": 16382945.010000002, "weight": 2.1926198081537973e-06}, {"ticker": "UVE", "market_cap": 408482244.52, "weight": 5.466942970674567e-05}, {"ticker": "HLI", "market_cap": 7225214115.070001, "weight": 0.0009669902192301194}, {"ticker": "AROW", "market_cap": 290014529.49, "weight": 3.8814242593382026e-05}, {"ticker": "EBC", "market_cap": 2074189698.0, "weight": 0.00027760023701033846}, {"ticker": "FFIC", "market_cap": 354808216.0, "weight": 4.748593870164684e-05}, {"ticker": "AUB", "market_cap": 2127883509.22, "weight": 0.00028478637564319}, {"ticker": "DFS", "market_cap": 21686737872.94, "weight": 0.0029024556333078592}, {"ticker": "NYC", "market_cap": 20442633.505, "weight": 2.73595029016651e-06}]}, "Services": {"sic_description": "Services", "companies": [{"ticker": "CDNS", "market_cap": 63484708200.0, "weight": 0.004965096858049927}, {"ticker": "SNAP", "market_cap": 13858777339.539999, "weight": 0.0010838857699114945}, {"ticker": "WAVD", "market_cap": 5701731.362, "weight": 4.459286223971481e-07}, {"ticker": "ATIF", "market_cap": 11938040.48, "weight": 9.336662159931113e-07}, {"ticker": "BYD", "market_cap": 5856705179.52, "weight": 0.00045804902172267507}, {"ticker": "SWI", "market_cap": 1548539578.2, "weight": 0.00012111025178007796}, {"ticker": "WW", "market_cap": 839804048.1, "weight": 6.568051675472488e-05}, {"ticker": "ONTF", "market_cap": 285160428.96, "weight": 2.2302207728655282e-05}, {"ticker": "CTV", "market_cap": 161591774.64, "weight": 1.2637985355846304e-05}, {"ticker": "QUBT", "market_cap": 75845892.43, "weight": 5.931856865653606e-06}, {"ticker": "FUBO", "market_cap": 721220669.25, "weight": 5.640618946491181e-05}, {"ticker": "DASH", "market_cap": 30665429232.09, "weight": 0.002398322850462475}, {"ticker": "EXPO", "market_cap": 4314024069.6, "weight": 0.0003373969568552372}, {"ticker": "OPCH", "market_cap": 5808218836.74, "weight": 0.000454256937061328}, {"ticker": "SQ", "market_cap": 25458479492.16, "weight": 0.001991090770064406}, {"ticker": "AYX", "market_cap": 2545787033.0699997, "weight": 0.000199104312795126}, {"ticker": "GDDY", "market_cap": 10796585440.34, "weight": 0.0008443937755627854}, {"ticker": "ELYS", "market_cap": 17853946.132842, "weight": 1.3963452674098683e-06}, {"ticker": "DOCN", "market_cap": 1982193503.29, "weight": 0.00015502603720295838}, {"ticker": "DUOT", "market_cap": 35182614.06, "weight": 2.7516088752738285e-06}, {"ticker": "FROG", "market_cap": 2553718601.42, "weight": 0.00019972463548716596}, {"ticker": "NFTG", "market_cap": 5301661.6499499995, "weight": 4.1463943596751907e-07}, {"ticker": "LTRPB", "market_cap": 2080118734.98, "weight": 0.00016268470452574258}, {"ticker": "KFRC", "market_cap": 1183502397.36, "weight": 9.256093634571816e-05}, {"ticker": "SP", "market_cap": 688129377.22, "weight": 5.3818141496425354e-05}, {"ticker": "NVEE", "market_cap": 1601817054.47, "weight": 0.00012527704780912556}, {"ticker": "UPLD", "market_cap": 147598859.79999998, "weight": 1.154360878112584e-05}, {"ticker": "AMED", "market_cap": 3035844361.83, "weight": 0.00023743137095258348}, {"ticker": "MGRX", "market_cap": 11198715.0, "weight": 8.758440613057207e-07}, {"ticker": "PNTG", "market_cap": 329249283.28999996, "weight": 2.5750367739397895e-05}, {"ticker": "ETSY", "market_cap": 7821217404.0, "weight": 0.0006116922178548473}, {"ticker": "FOUR", "market_cap": 3059215371.24, "weight": 0.00023925920207414238}, {"ticker": "ASAN", "market_cap": 3740013285.1499996, "weight": 0.0002925039546950812}, {"ticker": "CANO", "market_cap": 72110891.538, "weight": 5.6397449268972596e-06}, {"ticker": "PLTK", "market_cap": 3421236052.6000004, "weight": 0.00026757259908790753}, {"ticker": "XGN", "market_cap": 35993461.13999999, "weight": 2.8150246867883705e-06}, {"ticker": "AKAM", "market_cap": 16087678013.880001, "weight": 0.00125820661108488}, {"ticker": "CSGS", "market_cap": 1627125795.0, "weight": 0.00012725642759442486}, {"ticker": "VCYT", "market_cap": 1552627538.5974, "weight": 0.0001214299684472952}, {"ticker": "TRU", "market_cap": 13442082000.000002, "weight": 0.0010512963041995913}, {"ticker": "EFSH", "market_cap": 3006070.3101000004, "weight": 2.351027621444542e-07}, {"ticker": "ACN", "market_cap": 193820060000.0, "weight": 0.015158538145931785}, {"ticker": "PRGS", "market_cap": 2245923741.67, "weight": 0.00017565220396154318}, {"ticker": "BGLC", "market_cap": 12919940.77, "weight": 1.010459985438165e-06}, {"ticker": "TGL", "market_cap": 4065547.5579, "weight": 3.1796377392787393e-07}, {"ticker": "TTEK", "market_cap": 8182251813.009999, "weight": 0.0006399284791632588}, {"ticker": "LFMD", "market_cap": 219079059.2, "weight": 1.7134027694852883e-05}, {"ticker": "SCWX", "market_cap": 526035390.99999994, "weight": 4.1140878506505676e-05}, {"ticker": "KBNT", "market_cap": 4004281.0884, "weight": 3.1317216404506655e-07}, {"ticker": "TH", "market_cap": 1577786749.6799998, "weight": 0.00012339765363383954}, {"ticker": "MLGO", "market_cap": 94261218.20580001, "weight": 7.372107262037887e-06}, {"ticker": "AL", "market_cap": 4116890504.16, "weight": 0.00032197927164986787}, {"ticker": "SRT", "market_cap": 129771824.98, "weight": 1.0149368229617271e-05}, {"ticker": "VVI", "market_cap": 550475072.285, "weight": 4.305228974553371e-05}, {"ticker": "STER", "market_cap": 1262898020.34, "weight": 9.877041527974774e-05}, {"ticker": "CREX", "market_cap": 15613540.5, "weight": 1.221124631074311e-06}, {"ticker": "SPLK", "market_cap": 24642829924.44, "weight": 0.0019272993591753762}, {"ticker": "DOMO", "market_cap": 337374254.8, "weight": 2.638581636411169e-05}, {"ticker": "STAF", "market_cap": 3201673.2, "weight": 2.5040073423260465e-07}, {"ticker": "ADP", "market_cap": 99841418077.59999, "weight": 0.0078085309873148455}, {"ticker": "ESTC", "market_cap": 7441466033.92, "weight": 0.0005819921154540559}, {"ticker": "BILL", "market_cap": 11031548005.4, "weight": 0.0008627700417001913}, {"ticker": "STCN", "market_cap": 63129979.3, "weight": 4.937353746412697e-06}, {"ticker": "NHC", "market_cap": 1016516495.9957001, "weight": 7.950107992186017e-05}, {"ticker": "CEVA", "market_cap": 440755785.7, "weight": 3.4471217223715567e-05}, {"ticker": "R", "market_cap": 4609180004.88, "weight": 0.00036048090649357724}, {"ticker": "SMAR", "market_cap": 5424229146.96, "weight": 0.0004242253584921405}, {"ticker": "CDLX", "market_cap": 501354737.60999995, "weight": 3.9210620999213416e-05}, {"ticker": "TSP", "market_cap": 297925780.4736, "weight": 2.3300577391037665e-05}, {"ticker": "QTWO", "market_cap": 1816518214.56, "weight": 0.00014206868292264307}, {"ticker": "SAIC", "market_cap": 5585738554.08, "weight": 0.00043685690193896097}, {"ticker": "APDN", "market_cap": 15160957.200000001, "weight": 1.1857283918137222e-06}, {"ticker": "CCCS", "market_cap": 8005904412.9, "weight": 0.000626136466140957}, {"ticker": "AGTI", "market_cap": 755652894.975, "weight": 5.90991109669573e-05}, {"ticker": "CERT", "market_cap": 2249648163.84, "weight": 0.00017594348854547894}, {"ticker": "BSQR", "market_cap": 23217298.65, "weight": 1.8158095051230274e-06}, {"ticker": "WMG", "market_cap": 16465351308.6, "weight": 0.0012877441885921453}, {"ticker": "PTC", "market_cap": 16479789701.480001, "weight": 0.0012888734057084617}, {"ticker": "NOTV", "market_cap": 61362925.96, "weight": 4.799153678471917e-06}, {"ticker": "ASGN", "market_cap": 3813194000.0, "weight": 0.0002982273697925705}, {"ticker": "VMW", "market_cap": 71299239206.0, "weight": 0.005576266137158692}, {"ticker": "BB", "market_cap": 2474922365.2000003, "weight": 0.00019356203419348812}, {"ticker": "DTST", "market_cap": 22304805.2145, "weight": 1.7444439996643093e-06}, {"ticker": "TLSI", "market_cap": 136752000.0, "weight": 1.069528308128923e-05}, {"ticker": "LFLY", "market_cap": 16129314.25, "weight": 1.2614629534545915e-06}, {"ticker": "TENB", "market_cap": 5107775292.55, "weight": 0.000399475712745972}, {"ticker": "CRM", "market_cap": 195582730000.0, "weight": 0.015296395395762837}, {"ticker": "DDOG", "market_cap": 28482952586.76, "weight": 0.002227632801760395}, {"ticker": "RXT", "market_cap": 368094826.77000004, "weight": 2.878845189147706e-05}, {"ticker": "INTA", "market_cap": 2387764125.615, "weight": 0.00018674544617116736}, {"ticker": "LDOS", "market_cap": 12482470421.76, "weight": 0.0009762457200958155}, {"ticker": "CNVS", "market_cap": 14497972.059999999, "weight": 1.1338767644079936e-06}, {"ticker": "BAER", "market_cap": 369844394.64000005, "weight": 2.892528443242402e-05}, {"ticker": "BBSI", "market_cap": 613709884.5799999, "weight": 4.799784241084912e-05}, {"ticker": "CHH", "market_cap": 6050097271.525, "weight": 0.00047317408877599934}, {"ticker": "AI", "market_cap": 2829750230.1600003, "weight": 0.00022131288581450038}, {"ticker": "GOOG", "market_cap": 1706629410900.0, "weight": 0.1334743525829924}, {"ticker": "RUM", "market_cap": 1445529407.28, "weight": 0.00011305389473783076}, {"ticker": "SOND", "market_cap": 87550146.15, "weight": 6.847238774442015e-06}, {"ticker": "EGAN", "market_cap": 196771162.5, "weight": 1.5389341912161166e-05}, {"ticker": "GSMG", "market_cap": 35685966.662999995, "weight": 2.7909757479980935e-06}, {"ticker": "EB", "market_cap": 936718193.4, "weight": 7.326010768257014e-05}, {"ticker": "AKU", "market_cap": 13240280.440499999, "weight": 1.035513538279545e-06}, {"ticker": "DRCT", "market_cap": 34960990.400000006, "weight": 2.734275836040681e-06}, {"ticker": "TEAM", "market_cap": 48886883700.04, "weight": 0.0038234107006405176}, {"ticker": "CSSE", "market_cap": 10434606.4375, "weight": 8.160836381983842e-07}, {"ticker": "SSY", "market_cap": 5523675.736649999, "weight": 4.320030102135293e-07}, {"ticker": "CVLT", "market_cap": 2969001828.71, "weight": 0.0002322036608380049}, {"ticker": "LVS", "market_cap": 33700651417.455, "weight": 0.0026357055614070167}, {"ticker": "NIR", "market_cap": 10737191.4575, "weight": 8.39748611617841e-07}, {"ticker": "LGF.A", "market_cap": 1828876030.04, "weight": 0.00014303517946254697}, {"ticker": "ZDGE", "market_cap": 29959115.6, "weight": 2.343082530471717e-06}, {"ticker": "LH", "market_cap": 17741264000.0, "weight": 0.0013875324726503866}, {"ticker": "ASPA", "market_cap": 26512486.0, "weight": 2.073523918909541e-06}, {"ticker": "TISI", "market_cap": 31583691.060000002, "weight": 2.470139498059874e-06}, {"ticker": "DMTK", "market_cap": 47053051.0506, "weight": 3.679987867267174e-06}, {"ticker": "BRZE", "market_cap": 4457906987.940001, "weight": 0.000348649944323123}, {"ticker": "NTRA", "market_cap": 5079436459.440001, "weight": 0.0003972593514327564}, {"ticker": "TOST", "market_cap": 9258415281.475, "weight": 0.0007240945091809204}, {"ticker": "BALY", "market_cap": 498728609.69, "weight": 3.900523327901864e-05}, {"ticker": "BMBL", "market_cap": 1913972041.28, "weight": 0.00014969048197585846}, {"ticker": "PRO", "market_cap": 1555412919.215, "weight": 0.00012164781121518427}, {"ticker": "GRNQ", "market_cap": 7534146.0285, "weight": 5.892405562666615e-07}, {"ticker": "IONQ", "market_cap": 2933864417.3412004, "weight": 0.00022945558723518357}, {"ticker": "XHR", "market_cap": 1239204043.6200001, "weight": 9.691732509940759e-05}, {"ticker": "SHO", "market_cap": 1925781702.845, "weight": 0.00015061410776218622}, {"ticker": "SEZL", "market_cap": 71230230.36, "weight": 5.5708690011527615e-06}, {"ticker": "ADUS", "market_cap": 1340465363.51, "weight": 0.00010483690566428805}, {"ticker": "SNPS", "market_cap": 69940305761.96, "weight": 0.005469984855183738}, {"ticker": "OBLG", "market_cap": 1429447.31, "weight": 1.117961245922356e-07}, {"ticker": "SERA", "market_cap": 68821511.0, "weight": 5.38248466002004e-06}, {"ticker": "EVI", "market_cap": 284817747.75, "weight": 2.227540685885017e-05}, {"ticker": "JOB", "market_cap": 63949966.596, "weight": 5.0014844081491325e-06}, {"ticker": "ENZ", "market_cap": 67132913.4, "weight": 5.250420563389749e-06}, {"ticker": "MTCH", "market_cap": 10469354534.889, "weight": 0.0008188012638134505}, {"ticker": "GH", "market_cap": 3271840852.6, "weight": 0.00025588849973297436}, {"ticker": "IMXI", "market_cap": 584401834.5, "weight": 4.570567928222065e-05}, {"ticker": "OMQS", "market_cap": 12095074.953599999, "weight": 9.459477778618461e-07}, {"ticker": "BAH", "market_cap": 15109301483.4, "weight": 0.0011816884325311972}, {"ticker": "SHC", "market_cap": 4055535625.0499997, "weight": 0.0003171807473101893}, {"ticker": "LTRPA", "market_cap": 33456455.178, "weight": 2.616607135728727e-06}, {"ticker": "ACON", "market_cap": 3281990.175, "weight": 2.5668227149610225e-07}, {"ticker": "EVCM", "market_cap": 1889294336.93, "weight": 0.00014776045511102567}, {"ticker": "AMN", "market_cap": 3313324524.16, "weight": 0.0002591329101297907}, {"ticker": "OABI", "market_cap": 594781327.36, "weight": 4.651745252413243e-05}, {"ticker": "INPX", "market_cap": 7593379.63, "weight": 5.938731768935391e-07}, {"ticker": "FORA", "market_cap": 82754876.4, "weight": 6.472203912594341e-06}, {"ticker": "BRTX", "market_cap": 9472977.409500001, "weight": 7.408752706889877e-07}, {"ticker": "XWEL", "market_cap": 9940458.2379, "weight": 7.774366357499271e-07}, {"ticker": "UHS", "market_cap": 8583931665.400001, "weight": 0.0006713435935993294}, {"ticker": "BIGC", "market_cap": 716863635.25, "weight": 5.606542872996971e-05}, {"ticker": "BLND", "market_cap": 293833389.99, "weight": 2.2980514249721447e-05}, {"ticker": "IT", "market_cap": 27198642851.100002, "weight": 0.002127187790448389}, {"ticker": "PDFS", "market_cap": 1215484519.96, "weight": 9.506223690985982e-05}, {"ticker": "TOON", "market_cap": 46981131.64, "weight": 3.674363097937245e-06}, {"ticker": "AUGX", "market_cap": 203954285.0, "weight": 1.5951129151434288e-05}, {"ticker": "LSTA", "market_cap": 16854678.99, "weight": 1.3181932479401254e-06}, {"ticker": "MDB", "market_cap": 23831241748.449997, "weight": 0.0018638255870357349}, {"ticker": "LINC", "market_cap": 270629119.3, "weight": 2.1165723652696084e-05}, {"ticker": "ATVI", "market_cap": 73750933924.36, "weight": 0.005768011552521992}, {"ticker": "KIND", "market_cap": 704424414.9, "weight": 5.509256556925701e-05}, {"ticker": "HQI", "market_cap": 208639000.0, "weight": 1.6317517599721418e-05}, {"ticker": "PAYO", "market_cap": 2156824220.97, "weight": 0.00016868378963273123}, {"ticker": "FPAY", "market_cap": 21978527.9616, "weight": 1.718926072447516e-06}, {"ticker": "BL", "market_cap": 3237485059.3900003, "weight": 0.0002532015559671561}, {"ticker": "CNXC", "market_cap": 5287041000.0, "weight": 0.0004134959646468241}, {"ticker": "CACI", "market_cap": 7015824795.72, "weight": 0.0005487029969503451}, {"ticker": "AWRE", "market_cap": 31801111.89, "weight": 2.487143836750488e-06}, {"ticker": "LFST", "market_cap": 2430573699.63, "weight": 0.00019009355451824698}, {"ticker": "HHLA", "market_cap": 154721616.55, "weight": 1.210067485518994e-05}, {"ticker": "CXM", "market_cap": 3744711699.3, "weight": 0.0002928714145447901}, {"ticker": "YELP", "market_cap": 2892154413.84, "weight": 0.00022619347556758894}, {"ticker": "INCY", "market_cap": 12964593594.224998, "weight": 0.0010139522531597736}, {"ticker": "FLT", "market_cap": 18442760329.18, "weight": 0.001442396034580489}, {"ticker": "PEGA", "market_cap": 3612129114.57, "weight": 0.00028250221866219703}, {"ticker": "GDRX", "market_cap": 2040946517.25, "weight": 0.00015962107139756715}, {"ticker": "PENN", "market_cap": 3109858954.14, "weight": 0.000243220003052309}, {"ticker": "SNCE", "market_cap": 49421341.021905005, "weight": 3.865210252765634e-06}, {"ticker": "MPLN", "market_cap": 1071643311.75, "weight": 8.381251156353497e-05}, {"ticker": "SNCR", "market_cap": 84047113.4941, "weight": 6.573268917344122e-06}, {"ticker": "CCRD", "market_cap": 169176818.925, "weight": 1.3231206630944222e-05}, {"ticker": "BKD", "market_cap": 693646431.94, "weight": 5.424962668132476e-05}, {"ticker": "PYPL", "market_cap": 63922251374.26501, "weight": 0.004999316819067317}, {"ticker": "SQSP", "market_cap": 3879098824.77, "weight": 0.0003033817423599766}, {"ticker": "KELYA", "market_cap": 654801635.5, "weight": 5.121160095474777e-05}, {"ticker": "RDI", "market_cap": 45437784.96, "weight": 3.553658979275961e-06}, {"ticker": "DHX", "market_cap": 133739415.45, "weight": 1.0459670844769337e-05}, {"ticker": "PAYS", "market_cap": 97066208.16000001, "weight": 7.591483663116785e-06}, {"ticker": "HHS", "market_cap": 45789056.25, "weight": 3.5811316735318375e-06}, {"ticker": "PRST", "market_cap": 101897823.84, "weight": 7.969361116006656e-06}, {"ticker": "PMD", "market_cap": 19927380.67, "weight": 1.5585072052639892e-06}, {"ticker": "TTEC", "market_cap": 1212941184.8, "weight": 9.48633243564288e-05}, {"ticker": "VSEC", "market_cap": 823872740.02, "weight": 6.443453973229865e-05}, {"ticker": "HEES", "market_cap": 1447110107.496, "weight": 0.0001131775202517302}, {"ticker": "FSLY", "market_cap": 2320432000.0, "weight": 0.00018147944535277093}, {"ticker": "RCM", "market_cap": 5836092113.95, "weight": 0.0004564368875568542}, {"ticker": "MSFT", "market_cap": 2357835517176.7, "weight": 0.18440474958554756}, {"ticker": "CTSH", "market_cap": 33948882370.239998, "weight": 0.0026551195393347523}, {"ticker": "IZEA", "market_cap": 33853749.6, "weight": 2.6476792685670558e-06}, {"ticker": "XMTR", "market_cap": 840887787.47, "weight": 6.576527529096924e-05}, {"ticker": "MODN", "market_cap": 902518933.52, "weight": 7.05854062845125e-05}, {"ticker": "KPLT", "market_cap": 43232350.5, "weight": 3.3811734151384693e-06}, {"ticker": "PD", "market_cap": 2037918529.92, "weight": 0.0001593842545198549}, {"ticker": "ZFOX", "market_cap": 94890092.754, "weight": 7.421291122717195e-06}, {"ticker": "INST", "market_cap": 3694442180.6324997, "weight": 0.0002889398688817718}, {"ticker": "CHE", "market_cap": 7626432338.055, "weight": 0.0005964582072349706}, {"ticker": "TOI", "market_cap": 99218919.68, "weight": 7.75984580113855e-06}, {"ticker": "PWSC", "market_cap": 3596050942.0, "weight": 0.0002812447554655639}, {"ticker": "YOU", "market_cap": 1567217609.2099998, "weight": 0.00012257104817832475}, {"ticker": "ADT", "market_cap": 5697776965.174999, "weight": 0.0004456193516482074}, {"ticker": "PHR", "market_cap": 979953963.5, "weight": 7.664154854235312e-05}, {"ticker": "LQDT", "market_cap": 561341096.92, "weight": 4.390211431438526e-05}, {"ticker": "PYCR", "market_cap": 4083133111.935, "weight": 0.00031933912842759335}, {"ticker": "XELA", "market_cap": 24315648.459999997, "weight": 1.90171071417467e-06}, {"ticker": "GSD", "market_cap": 37171704.28, "weight": 2.9071743001094716e-06}, {"ticker": "NTNX", "market_cap": 8110932512.150001, "weight": 0.0006343506440174671}, {"ticker": "META", "market_cap": 783476174851.04, "weight": 0.061275151204205645}, {"ticker": "SPHR", "market_cap": 1393734059.32, "weight": 0.00010900301497939156}, {"ticker": "LGF.B", "market_cap": 1689186525.8200002, "weight": 0.0001321101561274744}, {"ticker": "APPN", "market_cap": 3137813565.93, "weight": 0.0002454063146713098}, {"ticker": "SCI", "market_cap": 8266984972.0, "weight": 0.0006465554032431256}, {"ticker": "MMS", "market_cap": 4443890531.31, "weight": 0.00034755372656064445}, {"ticker": "WFCF", "market_cap": 77677828.9452, "weight": 6.075131403627562e-06}, {"ticker": "GROM", "market_cap": 2251272.4119, "weight": 1.7607051990733057e-07}, {"ticker": "SLP", "market_cap": 830649450.0150001, "weight": 6.49645417195188e-05}, {"ticker": "HQY", "market_cap": 6153193659.06, "weight": 0.00048123718876243556}, {"ticker": "VRDN", "market_cap": 605923428.375, "weight": 4.738886884327764e-05}, {"ticker": "EVGO", "market_cap": 322051651.32, "weight": 2.518744572411412e-05}, {"ticker": "LAW", "market_cap": 383080429.55, "weight": 2.9960465930583288e-05}, {"ticker": "HSON", "market_cap": 50846012.1, "weight": 3.976632831433233e-06}, {"ticker": "SLE", "market_cap": 6165133.392, "weight": 4.82170987344601e-07}, {"ticker": "ALKT", "market_cap": 1598121736.96, "weight": 0.0001249880394813154}, {"ticker": "PINS", "market_cap": 17534067069.280003, "weight": 0.0013713277383311472}, {"ticker": "SBET", "market_cap": 4590649.08, "weight": 3.5903161516804116e-07}, {"ticker": "GRPN", "market_cap": 430677827.8614, "weight": 3.3683026835530206e-05}, {"ticker": "CFLT", "market_cap": 8653794513.225, "weight": 0.0006768075205207157}, {"ticker": "DV", "market_cap": 4618654260.41, "weight": 0.0003612218817252215}, {"ticker": "IVDA", "market_cap": 12814914.991700001, "weight": 1.0022459890816129e-06}, {"ticker": "MEDP", "market_cap": 7395579810.54, "weight": 0.0005784033844038308}, {"ticker": "AVAH", "market_cap": 220893113.67999998, "weight": 1.7275903690732143e-05}, {"ticker": "ACM", "market_cap": 11121726914.64, "weight": 0.0008698228742897233}, {"ticker": "MAR", "market_cap": 58050843633.035, "weight": 0.004540117919759608}, {"ticker": "RMR", "market_cap": 392379667.98, "weight": 3.0687753191093214e-05}, {"ticker": "BCOV", "market_cap": 131049863.39999999, "weight": 1.0249322765497283e-05}, {"ticker": "BKYI", "market_cap": 4798850.236, "weight": 3.7531488927936427e-07}, {"ticker": "AMSWA", "market_cap": 385055891.5, "weight": 3.0114965497474928e-05}, {"ticker": "HIMS", "market_cap": 1299055839.6959999, "weight": 0.00010159829431343308}, {"ticker": "DT", "market_cap": 13588128016.5, "weight": 0.0010627184661377138}, {"ticker": "PRCH", "market_cap": 73646673.5082, "weight": 5.759857414630011e-06}, {"ticker": "SSNC", "market_cap": 12795158507.95, "weight": 0.0010007008476109424}, {"ticker": "MGRC", "market_cap": 2446907775.455, "weight": 0.00019137103173846764}, {"ticker": "ZM", "market_cap": 19796948434.12, "weight": 0.0015483061867365665}, {"ticker": "NTWK", "market_cap": 21484512.9216, "weight": 1.6802894843229226e-06}, {"ticker": "G", "market_cap": 6480309036.96, "weight": 0.0005068206651787469}, {"ticker": "CRAI", "market_cap": 698281136.6800001, "weight": 5.461210386039705e-05}, {"ticker": "SEAT", "market_cap": 611075789.96, "weight": 4.7791831620339294e-05}, {"ticker": "SHCO", "market_cap": 1348440537.3600001, "weight": 0.00010546063871351766}, {"ticker": "TDOC", "market_cap": 3000478953.6600003, "weight": 0.00023466546587138916}, {"ticker": "WHLM", "market_cap": 20319935.36, "weight": 1.5892086468110065e-06}, {"ticker": "BSY", "market_cap": 14919394240.08, "weight": 0.0011668359131786856}, {"ticker": "PRDO", "market_cap": 1132748967.075, "weight": 8.859154427653781e-05}, {"ticker": "OPGN", "market_cap": 3581880.41952, "weight": 2.8013648831529646e-07}, {"ticker": "INLX", "market_cap": 18820757.34, "weight": 1.4719589297089044e-06}, {"ticker": "BOXL", "market_cap": 17330045.1143, "weight": 1.3553713167555275e-06}, {"ticker": "GTLB", "market_cap": 6925919000.000001, "weight": 0.0005416715243877942}, {"ticker": "IDAI", "market_cap": 12659262.559600001, "weight": 9.900725157605598e-07}, {"ticker": "SPSC", "market_cap": 6059902133.04, "weight": 0.00047394092048212255}, {"ticker": "ZS", "market_cap": 22585991592.31, "weight": 0.0017664353994923214}, {"ticker": "TCX", "market_cap": 209217239.10000002, "weight": 1.6362741295632046e-05}, {"ticker": "AUUD", "market_cap": 6153718.2955, "weight": 4.812782202299136e-07}, {"ticker": "ICFI", "market_cap": 2271307566.0, "weight": 0.0001776374560009654}, {"ticker": "ACEL", "market_cap": 917801418.88, "weight": 7.178063931299369e-05}, {"ticker": "SQL", "market_cap": 5062618.4, "weight": 3.9594402217549693e-07}, {"ticker": "MSGS", "market_cap": 4160072909.6000004, "weight": 0.00032535653889504025}, {"ticker": "LAUR", "market_cap": 2183791356.0, "weight": 0.0001707928713502725}, {"ticker": "RBLX", "market_cap": 18027882631.753002, "weight": 0.0014099487254508587}, {"ticker": "EBIX", "market_cap": 202713446.39999998, "weight": 1.5854083988766165e-05}, {"ticker": "ARC", "market_cap": 137917133.09, "weight": 1.0786407366308295e-05}, {"ticker": "HTCR", "market_cap": 20634263.1, "weight": 1.6137920105614591e-06}, {"ticker": "VERX", "market_cap": 3530651046.36, "weight": 0.0002761298730700116}, {"ticker": "VRNS", "market_cap": 3292746226.77, "weight": 0.0002575234951602326}, {"ticker": "VRAR", "market_cap": 22274752.181, "weight": 1.7420935718772645e-06}, {"ticker": "AOGO", "market_cap": 46413529.03, "weight": 3.6299712748441375e-06}, {"ticker": "OB", "market_cap": 245179134.32999998, "weight": 1.9175297233567246e-05}, {"ticker": "ALRM", "market_cap": 2999359134.2000003, "weight": 0.00023457788553527242}, {"ticker": "CISO", "market_cap": 24208870.128000002, "weight": 1.8933596517573904e-06}, {"ticker": "EXAS", "market_cap": 11723373069.03, "weight": 0.0009168772203758509}, {"ticker": "FATP", "market_cap": 38613838.23, "weight": 3.0199626383888954e-06}, {"ticker": "OKTA", "market_cap": 12756677843.52, "weight": 0.0009976913004069896}, {"ticker": "CYN", "market_cap": 16830411.5764, "weight": 1.316295309642311e-06}, {"ticker": "EUDA", "market_cap": 37958379.6217, "weight": 2.9686996560278594e-06}, {"ticker": "CAR", "market_cap": 6546494146.56, "weight": 0.0005119969586365255}, {"ticker": "SJ", "market_cap": 114088244.86, "weight": 8.92276584638719e-06}, {"ticker": "TRIP", "market_cap": 2196077842.29, "weight": 0.00017175378928160754}, {"ticker": "MG", "market_cap": 162721659.45000002, "weight": 1.272635289630055e-05}, {"ticker": "CASS", "market_cap": 500347222.55, "weight": 3.913182391562151e-05}, {"ticker": "TWKS", "market_cap": 1328106175.0, "weight": 0.0001038703017406199}, {"ticker": "HRB", "market_cap": 6124130458.47, "weight": 0.0004789641751497766}, {"ticker": "IOT", "market_cap": 13020733067.38, "weight": 0.0010183428840640906}, {"ticker": "EVBG", "market_cap": 908963565.4, "weight": 7.108943666294427e-05}, {"ticker": "FRSH", "market_cap": 5514652582.205, "weight": 0.00043129731529809506}, {"ticker": "BWMN", "market_cap": 390038410.81, "weight": 3.0504645023028043e-05}, {"ticker": "VERI", "market_cap": 84170968.7, "weight": 6.582955550725659e-06}, {"ticker": "MDRX", "market_cap": 1489757045.76, "weight": 0.00011651290896475629}, {"ticker": "CCO", "market_cap": 654348684.09, "weight": 5.11761759258486e-05}, {"ticker": "MTN", "market_cap": 8077017221.28, "weight": 0.0006316981516470525}, {"ticker": "SWAG", "market_cap": 23117431.319999997, "weight": 1.8079989475814737e-06}, {"ticker": "UIS", "market_cap": 229831158.94500002, "weight": 1.7974942273733142e-05}, {"ticker": "FA", "market_cap": 2036997110.25, "weight": 0.00015931219089952524}, {"ticker": "MXCT", "market_cap": 334319764.33, "weight": 2.614692669342497e-05}, {"ticker": "CSGP", "market_cap": 31066248528.0, "weight": 0.0024296706613478767}, {"ticker": "ID", "market_cap": 5072318.9085, "weight": 3.967026925016343e-07}, {"ticker": "PCOR", "market_cap": 9236463637.83, "weight": 0.0007223776857130161}, {"ticker": "PGNY", "market_cap": 3153180892.0499997, "weight": 0.0002466081830392743}, {"ticker": "FORR", "market_cap": 550615920.0, "weight": 4.3063305351764535e-05}, {"ticker": "QNST", "market_cap": 493123931.36, "weight": 3.856689510978588e-05}, {"ticker": "CLVT", "market_cap": 4348186632.59, "weight": 0.0003400687882139041}, {"ticker": "NATI", "market_cap": 7925354620.96, "weight": 0.0006198367204192326}, {"ticker": "CCLD", "market_cap": 17347187.67, "weight": 1.356712024649732e-06}, {"ticker": "VRME", "market_cap": 11483729.719999999, "weight": 8.981348732334027e-07}, {"ticker": "RMBL", "market_cap": 88626568.2, "weight": 6.931425027949763e-06}, {"ticker": "EA", "market_cap": 32632663643.935, "weight": 0.002552178947060227}, {"ticker": "H", "market_cap": 10864558332.495, "weight": 0.0008497098903066405}, {"ticker": "BFAM", "market_cap": 4677297267.37, "weight": 0.0003658083123454334}, {"ticker": "NOW", "market_cap": 111265679999.99998, "weight": 0.008702014923599956}, {"ticker": "ABNB", "market_cap": 81598134860.16, "weight": 0.006381735925139129}, {"ticker": "LZ", "market_cap": 1970251111.5, "weight": 0.00015409203067390055}, {"ticker": "HCKT", "market_cap": 648845150.56, "weight": 5.074574822423753e-05}, {"ticker": "DXC", "market_cap": 4315842599.495, "weight": 0.00033753918287035073}, {"ticker": "MVLA", "market_cap": 25962789.81, "weight": 2.0305325450301375e-06}, {"ticker": "IBEX", "market_cap": 282794528.84999996, "weight": 2.2117172252622e-05}, {"ticker": "MCRI", "market_cap": 1195742921.94, "weight": 9.351825964224458e-05}, {"ticker": "CELC", "market_cap": 198921737.715, "weight": 1.555753697118794e-05}, {"ticker": "ACVA", "market_cap": 2335810223.74, "weight": 0.00018268216601635684}, {"ticker": "OOMA", "market_cap": 326144000.0, "weight": 2.5507505595998555e-05}, {"ticker": "MRDB", "market_cap": 39255549.30555499, "weight": 3.070150435345863e-06}, {"ticker": "JKHY", "market_cap": 10685463476.338402, "weight": 0.0008357030005719558}, {"ticker": "STGW", "market_cap": 484436526.08000004, "weight": 3.788745891352195e-05}, {"ticker": "NRDS", "market_cap": 627665447.2800001, "weight": 4.9089297699511686e-05}, {"ticker": "MYSZ", "market_cap": 3953174.504, "weight": 3.091751520271378e-07}, {"ticker": "VRNT", "market_cap": 1388899076.08, "weight": 0.00010862487415187101}, {"ticker": "BACK", "market_cap": 2079990.0, "weight": 1.6267463624847012e-07}, {"ticker": "SHCR", "market_cap": 323948405.8921, "weight": 2.5335789639262263e-05}, {"ticker": "BRLI", "market_cap": 20916186.096, "weight": 1.635841020808806e-06}, {"ticker": "MCW", "market_cap": 1698454897.435, "weight": 0.0001328350293148867}, {"ticker": "WORX", "market_cap": 3361058.9958, "weight": 2.6286619144871525e-07}, {"ticker": "SKIL", "market_cap": 124361833.75, "weight": 9.72625640915291e-06}, {"ticker": "BR", "market_cap": 20905884377.56, "weight": 0.0016350353302526201}, {"ticker": "AMST", "market_cap": 6536066.22, "weight": 5.111813974271092e-07}, {"ticker": "PSNL", "market_cap": 55311547.13999999, "weight": 4.325879360640968e-06}, {"ticker": "NRDY", "market_cap": 366219038.15999997, "weight": 2.864174771029793e-05}, {"ticker": "STRA", "market_cap": 1878881914.8675, "weight": 0.00014694610649805987}, {"ticker": "BGSF", "market_cap": 98930728.07000001, "weight": 7.737306526754244e-06}, {"ticker": "ATXG", "market_cap": 5329639.4410999995, "weight": 4.168275604288684e-07}, {"ticker": "EWCZ", "market_cap": 762041286.9200001, "weight": 5.959874285743059e-05}, {"ticker": "BOWL", "market_cap": 1633853214.5, "weight": 0.00012778257460477268}, {"ticker": "AEYE", "market_cap": 62219222.08, "weight": 4.8661240292149385e-06}, {"ticker": "SGRP", "market_cap": 21139469.2161, "weight": 1.6533038453140635e-06}, {"ticker": "RCMT", "market_cap": 151538281.0, "weight": 1.185170829638289e-05}, {"ticker": "VERB", "market_cap": 2978761.7449999996, "weight": 2.3296697740793612e-07}, {"ticker": "FOXO", "market_cap": 6520657.9382, "weight": 5.099763259426171e-07}, {"ticker": "WEAV", "market_cap": 517420437.6, "weight": 4.046710872364974e-05}, {"ticker": "TWLO", "market_cap": 10185992578.640001, "weight": 0.0007966397134408715}, {"ticker": "NXGN", "market_cap": 1594220165.905, "weight": 0.0001246829002007565}, {"ticker": "MRAI", "market_cap": 4920195.15, "weight": 3.84805194398885e-07}, {"ticker": "PAYC", "market_cap": 14993168055.7, "weight": 0.0011726057142934243}, {"ticker": "APLD", "market_cap": 578804834.025, "weight": 4.5267941592927366e-05}, {"ticker": "LPSN", "market_cap": 261724566.565, "weight": 2.0469304498218683e-05}, {"ticker": "SHAP", "market_cap": 110785632.64, "weight": 8.664470738450011e-06}, {"ticker": "TZOO", "market_cap": 81260034.10000001, "weight": 6.3552932892734e-06}, {"ticker": "DOCS", "market_cap": 4107455377.8399997, "weight": 0.00032124135668774574}, {"ticker": "STRM", "market_cap": 51857110.015499994, "weight": 4.055710127773863e-06}, {"ticker": "RBA", "market_cap": 11249022169.279999, "weight": 0.0008797785515981326}, {"ticker": "PIII", "market_cap": 206791182.32, "weight": 1.6173001006397655e-05}, {"ticker": "UPBD", "market_cap": 1606036534.54, "weight": 0.00012560705054257375}, {"ticker": "LOPE", "market_cap": 3580913516.08, "weight": 0.00028006086743952814}, {"ticker": "UHAL", "market_cap": 10343108170.0, "weight": 0.0008089276194757327}, {"ticker": "PSQH", "market_cap": 228420612.36999997, "weight": 1.7864624363070272e-05}, {"ticker": "IDN", "market_cap": 43419426.75, "weight": 3.395804524383936e-06}, {"ticker": "MELI", "market_cap": 61413111267.31, "weight": 0.004803078638020603}, {"ticker": "UHAL.B", "market_cap": 9921540728.0, "weight": 0.0007759571098667692}, {"ticker": "OMC", "market_cap": 14367384717.84, "weight": 0.0011236636151214432}, {"ticker": "TRUE", "market_cap": 185525004.92000002, "weight": 1.4509787398187794e-05}, {"ticker": "HGV", "market_cap": 4254408437.4799995, "weight": 0.0003327344578673364}, {"ticker": "HSTM", "market_cap": 675104496.0, "weight": 5.27994741881003e-05}, {"ticker": "HOLO", "market_cap": 62244742.87500001, "weight": 4.868119993639478e-06}, {"ticker": "RMNI", "market_cap": 189309875.0, "weight": 1.4805799573011575e-05}, {"ticker": "PATH", "market_cap": 9356845915.43, "weight": 0.0007317927036791324}, {"ticker": "OSPN", "market_cap": 433767126.45, "weight": 3.3924638826051034e-05}, {"ticker": "DFIN", "market_cap": 1594530345.0, "weight": 0.0001247071591017373}, {"ticker": "HRI", "market_cap": 3021127813.21, "weight": 0.0002362803994606093}, {"ticker": "GPN", "market_cap": 28867121939.79, "weight": 0.002257678431673022}, {"ticker": "SMRT", "market_cap": 525616092.75, "weight": 4.110808546889571e-05}, {"ticker": "TBLA", "market_cap": 1154521672.46, "weight": 9.029437310198888e-05}, {"ticker": "UDMY", "market_cap": 1428672291.5, "weight": 0.00011173551091016339}, {"ticker": "RDIB", "market_cap": 387557577.59999996, "weight": 3.0310620705589076e-05}, {"ticker": "MANH", "market_cap": 12224606620.46, "weight": 0.0009560783634844254}, {"ticker": "THC", "market_cap": 6100231211.2, "weight": 0.00047709503089607365}, {"ticker": "LTRY", "market_cap": 7435090.88, "weight": 5.814935189007243e-07}, {"ticker": "CARS", "market_cap": 1116664634.4, "weight": 8.733359930218456e-05}, {"ticker": "BLKB", "market_cap": 3732676326.62, "weight": 0.0002919301360420887}, {"ticker": "PODC", "market_cap": 41035021.12, "weight": 3.2093217439239072e-06}, {"ticker": "HRT", "market_cap": 731102186.44, "weight": 5.7179016360457594e-05}, {"ticker": "SLGC", "market_cap": 375202734.27000004, "weight": 2.9344356615562407e-05}, {"ticker": "IMAQ", "market_cap": 96148403.13, "weight": 7.519702741380494e-06}, {"ticker": "EEX", "market_cap": 291119880.32, "weight": 2.276829246090325e-05}, {"ticker": "THRY", "market_cap": 650552756.0, "weight": 5.0879298911408095e-05}, {"ticker": "DLHC", "market_cap": 167195777.1165, "weight": 1.3076270667025764e-05}, {"ticker": "WWAC", "market_cap": 111170733.47999999, "weight": 8.694589219339812e-06}, {"ticker": "FLL", "market_cap": 141422743.92, "weight": 1.1060578860689973e-05}, {"ticker": "ACIW", "market_cap": 2264214944.8500004, "weight": 0.00017708274681215949}, {"ticker": "DWAC", "market_cap": 589045159.38, "weight": 4.606883063671633e-05}, {"ticker": "GAN", "market_cap": 42900354.721499994, "weight": 3.3552082458330804e-06}, {"ticker": "GETR", "market_cap": 30465008.970000003, "weight": 2.3826481148953262e-06}, {"ticker": "DDD", "market_cap": 557649760.875, "weight": 4.361341737430803e-05}, {"ticker": "CHDN", "market_cap": 8462458442.08, "weight": 0.0006618432534931221}, {"ticker": "CPSI", "market_cap": 246793311.10720003, "weight": 1.9301540927081034e-05}, {"ticker": "AUID", "market_cap": 64573900.903799996, "weight": 5.050281895908355e-06}, {"ticker": "LPTV", "market_cap": 29480420.868, "weight": 2.305644133459155e-06}, {"ticker": "PLYA", "market_cap": 1045093996.95, "weight": 8.173610728864129e-05}, {"ticker": "LRN", "market_cap": 1948435282.2, "weight": 0.00015238582915570278}, {"ticker": "MOBQ", "market_cap": 1781523.5364, "weight": 1.393317723892702e-07}, {"ticker": "RELY", "market_cap": 4469264603.59, "weight": 0.00034953821589871404}, {"ticker": "TTD", "market_cap": 38720772010.95, "weight": 0.0030283258583652965}, {"ticker": "NABL", "market_cap": 2401020843.39, "weight": 0.0001877822452624595}, {"ticker": "URI", "market_cap": 28764086111.25, "weight": 0.002249620067965358}, {"ticker": "BIOC", "market_cap": 2967409.38, "weight": 2.3207911648219375e-07}, {"ticker": "NSP", "market_cap": 3708932455.7999997, "weight": 0.00029007314367733014}, {"ticker": "HLT", "market_cap": 39276722477.54, "weight": 0.003071806375062346}, {"ticker": "BXRX", "market_cap": 2844975.4, "weight": 2.2250363623423465e-07}, {"ticker": "FIVN", "market_cap": 4471386359.04, "weight": 0.0003497041569830639}, {"ticker": "DBX", "market_cap": 9146500888.815, "weight": 0.000715341758871095}, {"ticker": "SSNT", "market_cap": 18186372.419999998, "weight": 1.4223441065114298e-06}, {"ticker": "EXLS", "market_cap": 4570614001.099999, "weight": 0.0003574646849557483}, {"ticker": "ENFN", "market_cap": 761945221.68, "weight": 5.9591229658822354e-05}, {"ticker": "TSRI", "market_cap": 17793023.9712, "weight": 1.3915805856159256e-06}, {"ticker": "NUTX", "market_cap": 130724834.46000001, "weight": 1.0223902468003197e-05}, {"ticker": "RSSS", "market_cap": 71474547.69, "weight": 5.58997689724214e-06}, {"ticker": "EVH", "market_cap": 2974932542.14, "weight": 0.00023266749799583696}, {"ticker": "INUV", "market_cap": 29307125.89525, "weight": 2.292090848753077e-06}, {"ticker": "PFMT", "market_cap": 167394011.4, "weight": 1.3091774438659445e-05}, {"ticker": "GHC", "market_cap": 2718458589.6, "weight": 0.0002126088405327473}, {"ticker": "EVRI", "market_cap": 1116190963.9850001, "weight": 8.729655385366714e-05}, {"ticker": "EHAB", "market_cap": 414343002.45, "weight": 3.24054909906551e-05}, {"ticker": "WYNN", "market_cap": 9978544131.72, "weight": 0.0007804153082067014}, {"ticker": "CARG", "market_cap": 1952736427.7699997, "weight": 0.00015272221889365891}, {"ticker": "MSTR", "market_cap": 4475185932.36, "weight": 0.00035000131908852135}, {"ticker": "MNRO", "market_cap": 846872405.64, "weight": 6.623332830271002e-05}, {"ticker": "ANSS", "market_cap": 25022734256.63, "weight": 0.0019570114246411844}, {"ticker": "SOUN", "market_cap": 465764053.095, "weight": 3.642709720471841e-05}, {"ticker": "MGNI", "market_cap": 1012124497.4, "weight": 7.91575846291139e-05}, {"ticker": "OLO", "market_cap": 973871883.54, "weight": 7.616587310875626e-05}, {"ticker": "USPH", "market_cap": 1362946517.04, "weight": 0.0001065951417485667}, {"ticker": "SNDA", "market_cap": 70000614.0, "weight": 5.474701522420571e-06}, {"ticker": "FLYW", "market_cap": 3572966096.2799997, "weight": 0.00027943930501611315}, {"ticker": "OTEX", "market_cap": 9361362122.400002, "weight": 0.0007321459132263263}, {"ticker": "CDNA", "market_cap": 363202125.84000003, "weight": 2.84057970017611e-05}, {"ticker": "BBAI", "market_cap": 218158220.0, "weight": 1.7062009472696367e-05}, {"ticker": "GRND", "market_cap": 1020029021.96, "weight": 7.977579224430201e-05}, {"ticker": "EBET", "market_cap": 9073033.155000001, "weight": 7.095958962110079e-07}, {"ticker": "MCOM", "market_cap": 10639292.9265, "weight": 8.320920325382856e-07}, {"ticker": "XPOF", "market_cap": 517548896.41, "weight": 4.0477155401849957e-05}, {"ticker": "HCA", "market_cap": 65379115500.0, "weight": 0.005113257194606327}, {"ticker": "XPER", "market_cap": 399632002.25, "weight": 3.125495343692351e-05}, {"ticker": "PRFT", "market_cap": 2004641826.84, "weight": 0.00015678170567630883}, {"ticker": "VVX", "market_cap": 1606672941.44, "weight": 0.00012565682350348391}, {"ticker": "OLB", "market_cap": 9282922.049999999, "weight": 7.260111672684255e-07}, {"ticker": "SEMR", "market_cap": 1144784560.34, "weight": 8.953284003104547e-05}, {"ticker": "ALIT", "market_cap": 3318918746.375, "weight": 0.00025957043053321486}, {"ticker": "ONFO", "market_cap": 4088667.0195000004, "weight": 3.1977193166230557e-07}, {"ticker": "AMWL", "market_cap": 304600684.59000003, "weight": 2.3822617208117938e-05}, {"ticker": "LDWY", "market_cap": 9221990.67, "weight": 7.212457645128271e-07}, {"ticker": "NOGN", "market_cap": 5891258.0849, "weight": 4.607513815003756e-07}, {"ticker": "MCO", "market_cap": 57304806565.200005, "weight": 0.004481770856245872}, {"ticker": "CTM", "market_cap": 10474457.5448, "weight": 8.19200366828871e-07}, {"ticker": "PAY", "market_cap": 1884824509.82, "weight": 0.00014741087290187426}, {"ticker": "PUBM", "market_cap": 614635942.1999999, "weight": 4.8070268762167455e-05}, {"ticker": "WK", "market_cap": 5247057340.525001, "weight": 0.0004103688691987795}, {"ticker": "RSVR", "market_cap": 382409168.13, "weight": 2.990796702081635e-05}, {"ticker": "EGHT", "market_cap": 290268625.46, "weight": 2.2701716383756127e-05}, {"ticker": "CNTY", "market_cap": 153494750.85999998, "weight": 1.2004722504531291e-05}, {"ticker": "NCMI", "market_cap": 397780164.45000005, "weight": 3.1110122432684954e-05}, {"ticker": "AVDX", "market_cap": 1809214504.3999999, "weight": 0.00014149746460258276}, {"ticker": "UNF", "market_cap": 2942674485.2999997, "weight": 0.00023014461679807664}, {"ticker": "GOOGL", "market_cap": 1694397420000.0, "weight": 0.1325176966999102}, {"ticker": "ENG", "market_cap": 12801683.411, "weight": 1.001211155944259e-06}, {"ticker": "ASST", "market_cap": 5160375.0, "weight": 4.0358950092582127e-07}, {"ticker": "RPAY", "market_cap": 593735744.3000001, "weight": 4.643567816754752e-05}, {"ticker": "AUR", "market_cap": 3341410368.75, "weight": 0.0002613294853789069}, {"ticker": "RHI", "market_cap": 7833604120.245, "weight": 0.0006126609747043842}, {"ticker": "UTI", "market_cap": 286593601.44100004, "weight": 2.2414295196396955e-05}, {"ticker": "FLGT", "market_cap": 795754835.14, "weight": 6.223545706919783e-05}, {"ticker": "FLNT", "market_cap": 35145194.9021, "weight": 2.7486823477904715e-06}, {"ticker": "MEG", "market_cap": 831670597.52, "weight": 6.504440498757868e-05}, {"ticker": "CWAN", "market_cap": 3855618322.185, "weight": 0.0003015453478499327}, {"ticker": "BFH", "market_cap": 1563476201.87, "weight": 0.00012227843519552588}, {"ticker": "MYPS", "market_cap": 406799141.76, "weight": 3.181549065716557e-05}, {"ticker": "UBER", "market_cap": 91784820004.41, "weight": 0.007178429803676316}, {"ticker": "LNW", "market_cap": 6286266018.27, "weight": 0.0004916446895817725}, {"ticker": "TWOU", "market_cap": 181159428.8, "weight": 1.4168358589714673e-05}, {"ticker": "VEEV", "market_cap": 32107005672.0, "weight": 0.002511067586248091}, {"ticker": "LUNA", "market_cap": 207276689.4973, "weight": 1.6210972200231905e-05}, {"ticker": "YEXT", "market_cap": 767439532.17, "weight": 6.002093603260151e-05}, {"ticker": "SSTI", "market_cap": 216336883.08, "weight": 1.691956392202213e-05}, {"ticker": "NTCT", "market_cap": 1893895211.25, "weight": 0.00014812028643542192}, {"ticker": "ESMT", "market_cap": 3117925425.69, "weight": 0.0002438508764340103}, {"ticker": "OTRK", "market_cap": 3825526.143, "weight": 2.9919185850486677e-07}, {"ticker": "DH", "market_cap": 849745020.0, "weight": 6.645799356364644e-05}, {"ticker": "DIS", "market_cap": 144314653088.43002, "weight": 0.011286753155776954}, {"ticker": "CCRN", "market_cap": 906163173.25, "weight": 7.087041985307774e-05}, {"ticker": "TASK", "market_cap": 870352470.0, "weight": 6.806968853946774e-05}, {"ticker": "PK", "market_cap": 2561833935.0, "weight": 0.00020035933033577653}, {"ticker": "GEG", "market_cap": 63890577.855, "weight": 4.996839654165012e-06}, {"ticker": "HCP", "market_cap": 4391557311.0, "weight": 0.00034346078016299814}, {"ticker": "BAND", "market_cap": 277704144.2, "weight": 2.1719056650477976e-05}, {"ticker": "VMD", "market_cap": 256322816.85, "weight": 2.0046837241167973e-05}, {"ticker": "IPDN", "market_cap": 28996809.6, "weight": 2.267821217431885e-06}, {"ticker": "AVID", "market_cap": 1184061991.7050002, "weight": 9.26047018477252e-05}, {"ticker": "PCYG", "market_cap": 166122069.652, "weight": 1.2992296719446785e-05}, {"ticker": "DUOL", "market_cap": 6755233541.94, "weight": 0.0005283223280922282}, {"ticker": "AMPL", "market_cap": 1255161463.92, "weight": 9.816534434121474e-05}, {"ticker": "ANGI", "market_cap": 954344444.625, "weight": 7.463864508248602e-05}, {"ticker": "APAC", "market_cap": 82205476.83, "weight": 6.429235737168105e-06}, {"ticker": "IIIV", "market_cap": 454938584.38, "weight": 3.558044448743043e-05}, {"ticker": "FIS", "market_cap": 32019796596.375, "weight": 0.00250424702237285}, {"ticker": "ABSI", "market_cap": 126086897.44000001, "weight": 9.861172494459184e-06}, {"ticker": "DNB", "market_cap": 4273669203.79, "weight": 0.00033424082960630924}, {"ticker": "HUBS", "market_cap": 23623238776.32, "weight": 0.0018475578127532392}, {"ticker": "ZUO", "market_cap": 1104330000.0, "weight": 8.636891573914922e-05}, {"ticker": "APP", "market_cap": 13915303276.33, "weight": 0.0010883066258799933}, {"ticker": "RVYL", "market_cap": 14726246.17, "weight": 1.1517299309180218e-06}, {"ticker": "HOFV", "market_cap": 30463706.1312, "weight": 2.3825462207382002e-06}, {"ticker": "CNK", "market_cap": 2243531567.55, "weight": 0.00017546511361264056}, {"ticker": "IOAC", "market_cap": 134274072.3495, "weight": 1.0501486005728715e-05}, {"ticker": "MAN", "market_cap": 3595377599.855, "weight": 0.00028119209382367684}, {"ticker": "PIXY", "market_cap": 16805741.2991, "weight": 1.3143658636421253e-06}, {"ticker": "WYY", "market_cap": 15029541.799999999, "weight": 1.1754504806735495e-06}, {"ticker": "IAC", "market_cap": 4153228028.6000004, "weight": 0.00032482120529880225}, {"ticker": "NFLX", "market_cap": 165945163846.97, "weight": 0.012978461033946615}, {"ticker": "CCSI", "market_cap": 463502571.35, "weight": 3.625022821965097e-05}, {"ticker": "EVTC", "market_cap": 2385515852.0099998, "weight": 0.00018656961018595567}, {"ticker": "PAYX", "market_cap": 41442385598.575, "weight": 0.003241181449197844}, {"ticker": "FAZE", "market_cap": 12701260.249599999, "weight": 9.93357127198127e-07}, {"ticker": "Z", "market_cap": 10183812126.84, "weight": 0.0007964691817539776}, {"ticker": "TRHC", "market_cap": 280652350.875, "weight": 2.1949633936157687e-05}, {"ticker": "RBT", "market_cap": 69104773.6174, "weight": 5.404638441167227e-06}, {"ticker": "RAMP", "market_cap": 1912545677.898, "weight": 0.00014957892704322656}, {"ticker": "AMS", "market_cap": 15172920.000000002, "weight": 1.186663994455328e-06}, {"ticker": "ALTR", "market_cap": 5182943887.0, "weight": 0.0004053545985865109}, {"ticker": "ACCD", "market_cap": 752150563.515, "weight": 5.882519594992497e-05}, {"ticker": "SNOW", "market_cap": 49857234000.0, "weight": 0.0038993011530367243}, {"ticker": "RNG", "market_cap": 2779938887.12, "weight": 0.00021741717376296175}, {"ticker": "WAVS", "market_cap": 38835997.2, "weight": 3.037337543861559e-06}, {"ticker": "QLYS", "market_cap": 5676421036.5, "weight": 0.0004439491186523979}, {"ticker": "BDSX", "market_cap": 136395487.79000002, "weight": 1.0667400498161481e-05}, {"ticker": "NVTA", "market_cap": 169410495.1248, "weight": 1.3249482291309121e-05}, {"ticker": "TNL", "market_cap": 2551867284.76, "weight": 0.00019957984524094066}, {"ticker": "CYH", "market_cap": 390546016.355, "weight": 3.0544344515521076e-05}, {"ticker": "V", "market_cap": 478467914856.645, "weight": 0.0374206577944455}, {"ticker": "MD", "market_cap": 1076050472.598, "weight": 8.415719268596195e-05}, {"ticker": "MRT", "market_cap": 35406023.0244, "weight": 2.769081541978196e-06}, {"ticker": "DMRC", "market_cap": 632455602.3000001, "weight": 4.946393254172356e-05}, {"ticker": "ORCL", "market_cap": 291387431608.57, "weight": 0.02278921746945903}, {"ticker": "FTFT", "market_cap": 15802659.587, "weight": 1.2359155092445752e-06}, {"ticker": "HCSG", "market_cap": 759014850.0, "weight": 5.936204723625455e-05}, {"ticker": "MULN", "market_cap": 82452335.94399999, "weight": 6.448542424495722e-06}, {"ticker": "AHCO", "market_cap": 1141248893.85, "weight": 8.925631790345993e-05}, {"ticker": "APPF", "market_cap": 6569638716.55, "weight": 0.0005138070800814606}, {"ticker": "FTDR", "market_cap": 2343457680.63, "weight": 0.0001832802685398337}, {"ticker": "CSPI", "market_cap": 80085086.62, "weight": 6.263401427331728e-06}, {"ticker": "RBBN", "market_cap": 441559825.02000004, "weight": 3.4534100604842624e-05}, {"ticker": "HCAT", "market_cap": 555963633.12, "weight": 4.348154644261457e-05}, {"ticker": "CMAX", "market_cap": 251054345.92000002, "weight": 1.963479362936052e-05}, {"ticker": "SNAL", "market_cap": 49293880.125, "weight": 3.855241620685708e-06}, {"ticker": "KD", "market_cap": 3443681132.97, "weight": 0.0002693280139143045}, {"ticker": "AZPN", "market_cap": 12943525982.4682, "weight": 0.0010123045692386195}, {"ticker": "ROVR", "market_cap": 1128563085.535, "weight": 8.82641692618028e-05}, {"ticker": "VMEO", "market_cap": 578179075.3199999, "weight": 4.5219001420275e-05}, {"ticker": "AINC", "market_cap": 18000959.2, "weight": 1.4078430617375812e-06}, {"ticker": "CNET", "market_cap": 6051785.04, "weight": 4.7330608802731416e-07}, {"ticker": "ISSC", "market_cap": 131550304.6, "weight": 1.0288461939326845e-05}, {"ticker": "FI", "market_cap": 68289061434.06, "weight": 0.005340842133152149}, {"ticker": "RGP", "market_cap": 490639516.64000005, "weight": 3.8372590684828874e-05}, {"ticker": "CFFE", "market_cap": 180984958.0, "weight": 1.4154713344340425e-05}, {"ticker": "HCTI", "market_cap": 17422452.640100002, "weight": 1.3625984479658391e-06}, {"ticker": "INFA", "market_cap": 5981746187.95, "weight": 0.000467828395932403}, {"ticker": "PINC", "market_cap": 2479883742.9345, "weight": 0.00019395006025046485}, {"ticker": "MTTR", "market_cap": 643138050.8349999, "weight": 5.029939974573613e-05}, {"ticker": "APEI", "market_cap": 85761475.175, "weight": 6.707348005627587e-06}, {"ticker": "CRL", "market_cap": 9721818357.555, "weight": 0.0007603369559415953}, {"ticker": "ENV", "market_cap": 2195546127.06, "weight": 0.00017171220418666573}, {"ticker": "CSV", "market_cap": 372647274.59999996, "weight": 2.9144495812258113e-05}, {"ticker": "MBLY", "market_cap": 32681682680.85, "weight": 0.0025560126933760253}, {"ticker": "DTSS", "market_cap": 7294831.6344, "weight": 5.705239364707776e-07}, {"ticker": "ISPC", "market_cap": 5248914.657, "weight": 4.105141286865505e-07}, {"ticker": "PRAA", "market_cap": 702424729.5, "weight": 5.493617150243151e-05}, {"ticker": "CDAY", "market_cap": 10601883167.76, "weight": 0.0008291662401569892}, {"ticker": "CVEO", "market_cap": 303235768.53, "weight": 2.3715868029722752e-05}, {"ticker": "ADTH", "market_cap": 104963871.46, "weight": 8.209154663717938e-06}, {"ticker": "INOD", "market_cap": 234030257.26999998, "weight": 1.8303350964443638e-05}, {"ticker": "AMEH", "market_cap": 1474131067.41, "weight": 0.00011529081157769544}, {"ticker": "MAX", "market_cap": 375373828.47999996, "weight": 2.9357737780075673e-05}, {"ticker": "HSII", "market_cap": 502195052.1, "weight": 3.9276341437290084e-05}, {"ticker": "CPHC", "market_cap": 97196726.8, "weight": 7.601691439253038e-06}, {"ticker": "S", "market_cap": 4899167559.324, "weight": 0.0003831606404998759}, {"ticker": "TYL", "market_cap": 16124025927.9, "weight": 0.0012610493572959645}, {"ticker": "SKLZ", "market_cap": 87864999.35000001, "weight": 6.871863234070026e-06}, {"ticker": "VRSN", "market_cap": 20838692887.075, "weight": 0.0016297803284143228}, {"ticker": "GVP", "market_cap": 5044787.0064, "weight": 3.945494407266999e-07}, {"ticker": "JAMF", "market_cap": 2152025372.64, "weight": 0.00016830847489251888}, {"ticker": "ASUR", "market_cap": 231262589.9984, "weight": 1.8086893545578972e-05}, {"ticker": "MKTW", "market_cap": 56595837.37, "weight": 4.426322846428262e-06}, {"ticker": "PALT", "market_cap": 17798763.009999998, "weight": 1.3920294320282668e-06}, {"ticker": "CCEL", "market_cap": 41433925.0, "weight": 3.24051975140332e-06}, {"ticker": "DOCU", "market_cap": 8388305743.68, "weight": 0.0006560438202078359}, {"ticker": "FC", "market_cap": 555241992.4, "weight": 4.342510740125953e-05}, {"ticker": "AVPT", "market_cap": 1255144304.29, "weight": 9.816400229795087e-05}, {"ticker": "LIFW", "market_cap": 68863932.7992, "weight": 5.385802440756422e-06}, {"ticker": "GEN", "market_cap": 10972007680.5564, "weight": 0.0008581134324443544}, {"ticker": "COUR", "market_cap": 2709410575.2000003, "weight": 0.00021190120133674596}, {"ticker": "ZIP", "market_cap": 1167056115.84, "weight": 9.127468359262515e-05}, {"ticker": "ZETA", "market_cap": 1706911579.78, "weight": 0.00013349642082366404}, {"ticker": "DSP", "market_cap": 83003265.83, "weight": 6.491630284919792e-06}, {"ticker": "EVER", "market_cap": 243907565.28, "weight": 1.90758486628176e-05}, {"ticker": "PSN", "market_cap": 5675345422.74, "weight": 0.00044386499561471413}, {"ticker": "BIAF", "market_cap": 11501800.3397, "weight": 8.995481643965728e-07}, {"ticker": "FCN", "market_cap": 6298153393.56, "weight": 0.0004925743933069104}, {"ticker": "HGBL", "market_cap": 115170964.4, "weight": 9.007444622404677e-06}, {"ticker": "ATGE", "market_cap": 1784718640.8, "weight": 0.00013958165938201817}, {"ticker": "BLIN", "market_cap": 8184073.630399999, "weight": 6.400709622911726e-07}, {"ticker": "CHGG", "market_cap": 961779541.92, "weight": 7.522013910309963e-05}, {"ticker": "DKNG", "market_cap": 13218641681.63, "weight": 0.001033821185322057}, {"ticker": "EBAY", "market_cap": 22776336292.0, "weight": 0.0017813221320169465}, {"ticker": "AGL", "market_cap": 7379774784.2, "weight": 0.0005771672837924062}, {"ticker": "RGS", "market_cap": 31851088.349999998, "weight": 2.491052462489788e-06}, {"ticker": "AFAR", "market_cap": 155912400.0, "weight": 1.219380523782613e-05}, {"ticker": "INNV", "market_cap": 806436113.9849999, "weight": 6.307083279253248e-05}, {"ticker": "IAS", "market_cap": 1861787175.37, "weight": 0.00014560913827729044}, {"ticker": "PCTY", "market_cap": 10400773386.57, "weight": 0.0008134375777590485}, {"ticker": "MSGE", "market_cap": 1572923577.48, "weight": 0.0001230173081664822}, {"ticker": "LTH", "market_cap": 2898409124.02, "weight": 0.00022668265229602085}, {"ticker": "EPAM", "market_cap": 13894356983.0, "weight": 0.0010866684301924123}, {"ticker": "ENSG", "market_cap": 5117649674.18, "weight": 0.00040024798157411003}, {"ticker": "MCHX", "market_cap": 56807590.63, "weight": 4.442883928233909e-06}, {"ticker": "DKDCA", "market_cap": 73769777.4, "weight": 5.769485288234853e-06}, {"ticker": "TNET", "market_cap": 5816440561.13, "weight": 0.0004548999526645177}, {"ticker": "EFX", "market_cap": 21941739206.73, "weight": 0.0017160488483663854}, {"ticker": "DGX", "market_cap": 13690425178.02, "weight": 0.0010707190591884097}, {"ticker": "CZR", "market_cap": 9485671804.380001, "weight": 0.0007418680908801897}, {"ticker": "IPG", "market_cap": 10885953259.44, "weight": 0.0008513831733312418}, {"ticker": "WSC", "market_cap": 7941514336.0, "weight": 0.0006211005609982792}, {"ticker": "MCS", "market_cap": 493735715.32, "weight": 3.8614742326914646e-05}, {"ticker": "AONC", "market_cap": 249421716.0, "weight": 1.9507106727806007e-05}, {"ticker": "ADSK", "market_cap": 44064166282.32, "weight": 0.003446229174932816}, {"ticker": "SSTK", "market_cap": 1348622553.6000001, "weight": 0.00010547487408274218}, {"ticker": "NEO", "market_cap": 1522967799.48, "weight": 0.00011911029995266418}, {"ticker": "MGAM", "market_cap": 8270745.165000001, "weight": 6.468494854399146e-07}, {"ticker": "WU", "market_cap": 4908278619.525001, "weight": 0.00038387321046609476}, {"ticker": "LVOX", "market_cap": 340072909.42, "weight": 2.659687634933698e-05}, {"ticker": "LYFT", "market_cap": 3931902483.7, "weight": 0.0003075114814496001}, {"ticker": "SEM", "market_cap": 3095306486.865, "weight": 0.00024208186425333475}, {"ticker": "DCGO", "market_cap": 583795158.75, "weight": 4.565823157480282e-05}, {"ticker": "PFSW", "market_cap": 169565948.5, "weight": 1.326164019652225e-05}, {"ticker": "WULF", "market_cap": 250985857.39000002, "weight": 1.9629437186923326e-05}, {"ticker": "NCNO", "market_cap": 3359108051.25, "weight": 0.0002627136093713917}, {"ticker": "TBI", "market_cap": 459646189.65, "weight": 3.59486231685292e-05}, {"ticker": "BRQS", "market_cap": 17415544.809, "weight": 1.362058191084095e-06}, {"ticker": "AGIL", "market_cap": 8096475.0105, "weight": 6.332199324169422e-07}, {"ticker": "III", "market_cap": 213411073.92, "weight": 1.6690738331112826e-05}, {"ticker": "HRYU", "market_cap": 252034271.86139998, "weight": 1.9711432986313045e-05}, {"ticker": "COMP", "market_cap": 1144205444.1200001, "weight": 8.94875477361623e-05}, {"ticker": "U", "market_cap": 11212292212.24, "weight": 0.0008769059260562292}, {"ticker": "WGS", "market_cap": 89433448.16000001, "weight": 6.994530573644301e-06}, {"ticker": "CNDT", "market_cap": 755570718.8100001, "weight": 5.909268402367889e-05}, {"ticker": "KELYB", "market_cap": 643121390.11, "weight": 5.029809672150092e-05}, {"ticker": "UPWK", "market_cap": 1453370757.675, "weight": 0.0001136671615435382}, {"ticker": "ASPS", "market_cap": 103972948.53, "weight": 8.131655239591852e-06}, {"ticker": "VCSA", "market_cap": 114892335.03, "weight": 8.985653204458968e-06}, {"ticker": "FTAI", "market_cap": 3329222595.48, "weight": 0.0002603762877272951}, {"ticker": "ACHC", "market_cap": 6301783094.46, "weight": 0.0004928582698032389}, {"ticker": "SDIG", "market_cap": 30921988.9, "weight": 2.418388211667715e-06}, {"ticker": "HTZ", "market_cap": 3347573777.9550004, "weight": 0.0002618115215187316}, {"ticker": "CTG", "market_cap": 166464955.625, "weight": 1.3019113603630111e-05}, {"ticker": "TALK", "market_cap": 342190743.735, "weight": 2.6762510764323183e-05}, {"ticker": "FNGR", "market_cap": 275412100.226, "weight": 2.1539797413781675e-05}, {"ticker": "BOX", "market_cap": 3565125085.5, "weight": 0.0002788260647714693}, {"ticker": "PLTR", "market_cap": 33514680262.35, "weight": 0.002621160880899219}, {"ticker": "RDNT", "market_cap": 1923387154.26, "weight": 0.00015042683170795319}, {"ticker": "WLDN", "market_cap": 258984407.10000002, "weight": 2.02549984466359e-05}, {"ticker": "RCAT", "market_cap": 52286737.396193996, "weight": 4.0893109998342e-06}, {"ticker": "PRTH", "market_cap": 248091361.92000002, "weight": 1.940306061890853e-05}, {"ticker": "NRC", "market_cap": 1128396941.22, "weight": 8.825117522528946e-05}, {"ticker": "DPSI", "market_cap": 37756946.7, "weight": 2.9529457210252813e-06}, {"ticker": "APCX", "market_cap": 54954186.622499995, "weight": 4.297930431947139e-06}, {"ticker": "MA", "market_cap": 368421703271.47107, "weight": 0.02881401668552654}, {"ticker": "CXAI", "market_cap": 25474829.63, "weight": 1.9923695034841507e-06}, {"ticker": "VRSK", "market_cap": 34583157019.880005, "weight": 0.00270472573836062}, {"ticker": "SABR", "market_cap": 1277815182.7150002, "weight": 9.993707664024107e-05}, {"ticker": "MAPS", "market_cap": 123355357.902, "weight": 9.647540601641205e-06}, {"ticker": "SPGI", "market_cap": 114276757000.0, "weight": 0.008937509255635754}, {"ticker": "ROL", "market_cap": 17178170015.585, "weight": 0.0013434932661693883}, {"ticker": "PET", "market_cap": 73280783.56639999, "weight": 5.731241405327422e-06}, {"ticker": "EXFY", "market_cap": 251444153.46, "weight": 1.9665280218130857e-05}, {"ticker": "MARA", "market_cap": 1294382351.935, "weight": 0.00010123278394005035}, {"ticker": "EGIO", "market_cap": 176433157.0716, "weight": 1.3798720017303794e-05}, {"ticker": "CRNC", "market_cap": 767017263.114, "weight": 5.9987910650227664e-05}, {"ticker": "CREG", "market_cap": 10124407.8, "weight": 7.918232088116643e-07}, {"ticker": "LTBR", "market_cap": 52165424.2752, "weight": 4.07982318122456e-06}, {"ticker": "MGM", "market_cap": 12226733999.775, "weight": 0.0009562447444075213}, {"ticker": "CBZ", "market_cap": 2596238698.14, "weight": 0.00020305010400729142}, {"ticker": "NOTE", "market_cap": 271238179.41, "weight": 2.1213357839325684e-05}, {"ticker": "WEX", "market_cap": 7792285684.23, "weight": 0.0006094294872697831}, {"ticker": "ETWO", "market_cap": 1253746224.3999999, "weight": 9.805465939844074e-05}, {"ticker": "ATIP", "market_cap": 37420904.945599996, "weight": 2.926664118632328e-06}, {"ticker": "MLNK", "market_cap": 1351378012.4, "weight": 0.00010569037668515259}, {"ticker": "TETE", "market_cap": 74155996.8, "weight": 5.799691250959242e-06}, {"ticker": "GETY", "market_cap": 2254874034.402, "weight": 0.00017635220041080276}, {"ticker": "ZI", "market_cap": 6680452330.24, "weight": 0.0005224737391992444}, {"ticker": "KLR", "market_cap": 96546290.4, "weight": 7.5508212404670994e-06}, {"ticker": "SPT", "market_cap": 2647939443.6, "weight": 0.00020709358496704615}, {"ticker": "ABM", "market_cap": 2614077623.06, "weight": 0.00020444527447562288}, {"ticker": "DLPN", "market_cap": 26342246.56, "weight": 2.060209605390176e-06}, {"ticker": "ALLE", "market_cap": 9081079661.2432, "weight": 0.0007102252081193264}, {"ticker": "ZG", "market_cap": 9888123023.02, "weight": 0.0007733435333582859}, {"ticker": "SOPA", "market_cap": 9846204.694, "weight": 7.70065128690248e-07}, {"ticker": "SEAS", "market_cap": 2849924979.0, "weight": 0.00022289073952002356}, {"ticker": "MHH", "market_cap": 102103052.955, "weight": 7.985411948765573e-06}, {"ticker": "TTWO", "market_cap": 23611571814.07, "weight": 0.0018466453473855483}, {"ticker": "MSCI", "market_cap": 39375070310.4, "weight": 0.0030794980937419196}, {"ticker": "SIX", "market_cap": 1846620390.12, "weight": 0.00014442295407755755}, {"ticker": "QBTS", "market_cap": 126412798.16849999, "weight": 9.88666097395276e-06}, {"ticker": "SAI", "market_cap": 22658889.5299, "weight": 1.7721366987681433e-06}, {"ticker": "TDC", "market_cap": 4448547000.0, "weight": 0.0003479179058837893}, {"ticker": "WH", "market_cap": 5662909475.08, "weight": 0.00044289238840891247}, {"ticker": "SCPL", "market_cap": 484957868.08, "weight": 3.792823272503596e-05}, {"ticker": "BLBX", "market_cap": 7993293.289999999, "weight": 6.251501585959965e-07}, {"ticker": "EHC", "market_cap": 6601199565.96, "weight": 0.0005162754331492468}, {"ticker": "RRR", "market_cap": 2358698102.985, "weight": 0.00018447221184863456}, {"ticker": "BASE", "market_cap": 787792242.8149999, "weight": 6.16127080126811e-05}, {"ticker": "KLTR", "market_cap": 248591926.57999998, "weight": 1.9442209448462678e-05}, {"ticker": "FUN", "market_cap": 1890924248.71, "weight": 0.00014788792942865633}, {"ticker": "DVA", "market_cap": 8435207000.0, "weight": 0.0006597119363100538}, {"ticker": "FDS", "market_cap": 16951803149.699999, "weight": 0.0013257892639546907}, {"ticker": "AGYS", "market_cap": 1680964763.3999999, "weight": 0.0001314671375499837}, {"ticker": "WETG", "market_cap": 10355484.6, "weight": 8.09895571844881e-07}, {"ticker": "INTU", "market_cap": 144257968831.89, "weight": 0.011282319917725972}, {"ticker": "SGRY", "market_cap": 3444565591.6, "weight": 0.0002693971868362474}, {"ticker": "NEWR", "market_cap": 6104580916.255, "weight": 0.00047743521843909565}, {"ticker": "WDAY", "market_cap": 54629620000.0, "weight": 0.004272546291997629}, {"ticker": "NVRI", "market_cap": 553500158.0400001, "weight": 4.328887969299263e-05}, {"ticker": "AMC", "market_cap": 1658263667.28, "weight": 0.00012969169990183994}, {"ticker": "GDEN", "market_cap": 956827577.55, "weight": 7.483284925910753e-05}, {"ticker": "GMGI", "market_cap": 100816460.28, "weight": 7.884788390284249e-06}, {"ticker": "IQV", "market_cap": 35714333392.65, "weight": 0.0027931942910811728}, {"ticker": "PRG", "market_cap": 1404221399.04, "weight": 0.00010982322285258573}, {"ticker": "NET", "market_cap": 19762339077.18, "weight": 0.0015455994119198569}, {"ticker": "RPD", "market_cap": 2787996307.2599998, "weight": 0.0002180473392398994}, {"ticker": "KFY", "market_cap": 2516382511.605, "weight": 0.00019680460470355868}, {"ticker": "OSW", "market_cap": 1079744288.22, "weight": 8.444608355210928e-05}, {"ticker": "ADEX", "market_cap": 95052277.67999999, "weight": 7.4339754980469e-06}, {"ticker": "MSGM", "market_cap": 9548351.28, "weight": 7.467702110330405e-07}, {"ticker": "INSE", "market_cap": 284435128.8, "weight": 2.2245482484928652e-05}, {"ticker": "ADBE", "market_cap": 234456735000.00003, "weight": 0.018336705504415386}, {"ticker": "CSTL", "market_cap": 412869811.2, "weight": 3.229027368157276e-05}, {"ticker": "PRVA", "market_cap": 2639850637.5439997, "weight": 0.00020646096481846647}, {"ticker": "GMBL", "market_cap": 5590889.504199999, "weight": 4.372597543262825e-07}, {"ticker": "CURI", "market_cap": 33621771.924, "weight": 2.629536448620294e-06}, {"ticker": "SST", "market_cap": 106711818.11999999, "weight": 8.345860410907697e-06}, {"ticker": "CRWD", "market_cap": 39090607535.324104, "weight": 0.0030572504490601173}, {"ticker": "HURN", "market_cap": 1923307863.914, "weight": 0.00015042063046266185}, {"ticker": "RCRT", "market_cap": 1675955.54, "weight": 1.3107536951529013e-07}, {"ticker": "GDYN", "market_cap": 887463322.0999999, "weight": 6.940791691617573e-05}, {"ticker": "LYV", "market_cap": 19249757569.4644, "weight": 0.0015055107526881647}, {"ticker": "RDVT", "market_cap": 267834701.75, "weight": 2.0947174112326852e-05}, {"ticker": "SCOR", "market_cap": 56005850.725999996, "weight": 4.380180382904805e-06}, {"ticker": "CTOS", "market_cap": 1477575486.0, "weight": 0.00011556019726763419}, {"ticker": "GWRE", "market_cap": 7188772354.4, "weight": 0.000562229110632781}, {"ticker": "PHUN", "market_cap": 21697076.1774, "weight": 1.696913915362041e-06}, {"ticker": "EDR", "market_cap": 6055365792.825, "weight": 0.00047358613632721104}, {"ticker": "ADV", "market_cap": 941193399.1999999, "weight": 7.361011055549359e-05}, {"ticker": "TLS", "market_cap": 172565366.32, "weight": 1.3496222671834958e-05}, {"ticker": "AIRS", "market_cap": 395768512.9728, "weight": 3.095279250691021e-05}, {"ticker": "SMSI", "market_cap": 81104271.705, "weight": 6.34311121582698e-06}, {"ticker": "GAIA", "market_cap": 55426708.942499995, "weight": 4.334886088717259e-06}, {"ticker": "BLZE", "market_cap": 192593500.0, "weight": 1.506260970308498e-05}, {"ticker": "OPRX", "market_cap": 119543246.835, "weight": 9.349397927319218e-06}, {"ticker": "BTTX", "market_cap": 13796515.58, "weight": 1.079016319055789e-06}, {"ticker": "PLNT", "market_cap": 4003962071.55, "weight": 0.0003131472139491378}, {"ticker": "MQ", "market_cap": 3000539143.29, "weight": 0.00023467017326236995}, {"ticker": "AGAE", "market_cap": 32193717.51, "weight": 2.517849261498975e-06}, {"ticker": "AAN", "market_cap": 301281498.56, "weight": 2.3563025873509957e-05}, {"ticker": "DRVN", "market_cap": 1992797683.8899999, "weight": 0.00015585538312376475}, {"ticker": "RSI", "market_cap": 281275314.98, "weight": 2.1998355545000388e-05}, {"ticker": "FICO", "market_cap": 21211406422.620003, "weight": 0.001658930006451075}, {"ticker": "MRIN", "market_cap": 7384094.585, "weight": 5.775051325435088e-07}, {"ticker": "ICCT", "market_cap": 26716496.4, "weight": 2.0894794367778503e-06}, {"ticker": "FTRE", "market_cap": 2425128000.0, "weight": 0.00018966764996753823}]}, "Manufacturing": {"sic_description": "Manufacturing", "companies": [{"ticker": "ELEV", "market_cap": 26145426.1888, "weight": 1.3710501969132687e-06}, {"ticker": "WRAP", "market_cap": 64395399.61, "weight": 3.376855465198724e-06}, {"ticker": "CVI", "market_cap": 3068193881.48, "weight": 0.0001608942151102993}, {"ticker": "SGC", "market_cap": 124937641.84, "weight": 6.551653708364102e-06}, {"ticker": "ADN", "market_cap": 22583727.1335, "weight": 1.1842768715961724e-06}, {"ticker": "HUBB", "market_cap": 16565816377.16, "weight": 0.0008687013033149073}, {"ticker": "ENTX", "market_cap": 20521296.614400003, "weight": 1.0761242735504272e-06}, {"ticker": "PPIH", "market_cap": 63980844.771199994, "weight": 3.355116462389446e-06}, {"ticker": "GEF.B", "market_cap": 2518759927.62, "weight": 0.00013208223380271276}, {"ticker": "BPT", "market_cap": 114704000.0, "weight": 6.015007774251072e-06}, {"ticker": "HOOK", "market_cap": 47327124.671570994, "weight": 2.4818055415020332e-06}, {"ticker": "ASXC", "market_cap": 68871341.331, "weight": 3.6115711180871126e-06}, {"ticker": "PCVX", "market_cap": 4480251913.06, "weight": 0.00023494167673018498}, {"ticker": "NVVE", "market_cap": 10633178.2291, "weight": 5.575973785834299e-07}, {"ticker": "RGNX", "market_cap": 690628723.9000001, "weight": 3.621614889959894e-05}, {"ticker": "WALD", "market_cap": 1162888106.24, "weight": 6.098114276413818e-05}, {"ticker": "RMD", "market_cap": 21581257822.960003, "weight": 0.0011317079926002683}, {"ticker": "MDXG", "market_cap": 843532793.125, "weight": 4.423434499653539e-05}, {"ticker": "ENVX", "market_cap": 1638899220.665, "weight": 8.594287517012482e-05}, {"ticker": "NSYS", "market_cap": 24224025.3, "weight": 1.2702931066323289e-06}, {"ticker": "ITRI", "market_cap": 2654422712.92, "weight": 0.00013919630749025685}, {"ticker": "ATKR", "market_cap": 5406975004.275, "weight": 0.0002835384702006499}, {"ticker": "APLS", "market_cap": 4448114778.42, "weight": 0.00023325642499788486}, {"ticker": "VKTX", "market_cap": 1069308171.3199999, "weight": 5.6073868073999134e-05}, {"ticker": "ITRM", "market_cap": 9389549.52, "weight": 4.923822478685609e-07}, {"ticker": "IEP", "market_cap": 7172746887.22, "weight": 0.00037613447037037484}, {"ticker": "ACCO", "market_cap": 510655472.12, "weight": 2.6778461385528416e-05}, {"ticker": "SGHT", "market_cap": 170765269.73999998, "weight": 8.954826554071185e-06}, {"ticker": "AAC", "market_cap": 758642773.6999999, "weight": 3.978276417287014e-05}, {"ticker": "TXG", "market_cap": 4596923117.25, "weight": 0.00024105984349188537}, {"ticker": "AIRI", "market_cap": 8783838.09, "weight": 4.60619110049455e-07}, {"ticker": "LPTH", "market_cap": 54310385.1, "weight": 2.8480034575870902e-06}, {"ticker": "SANM", "market_cap": 3035889644.45, "weight": 0.0001592002006306238}, {"ticker": "EDSA", "market_cap": 13708765.7346, "weight": 7.188793108261761e-07}, {"ticker": "AIM", "market_cap": 21299649.8, "weight": 1.1169406396971797e-06}, {"ticker": "AEON", "market_cap": 222925188.0, "weight": 1.1690060842659207e-05}, {"ticker": "PKOH", "market_cap": 258641387.63, "weight": 1.3562996559296405e-05}, {"ticker": "VAXX", "market_cap": 145756800.6, "weight": 7.643397691091533e-06}, {"ticker": "OFLX", "market_cap": 788266614.4122001, "weight": 4.133622030506308e-05}, {"ticker": "THRD", "market_cap": 271350125.76, "weight": 1.4229435032696384e-05}, {"ticker": "SKIN", "market_cap": 748146868.21, "weight": 3.9232365292969226e-05}, {"ticker": "DXYN", "market_cap": 9567224.745, "weight": 5.016994282604113e-07}, {"ticker": "TNGX", "market_cap": 1079444890.84, "weight": 5.6605431460787756e-05}, {"ticker": "LFVN", "market_cap": 82211727.88, "weight": 4.3111328491841045e-06}, {"ticker": "DAN", "market_cap": 1997621422.72, "weight": 0.00010475404857434167}, {"ticker": "GNPX", "market_cap": 21696466.994400002, "weight": 1.1377494912566065e-06}, {"ticker": "DERM", "market_cap": 52225603.199999996, "weight": 2.738678766764469e-06}, {"ticker": "ECVT", "market_cap": 1136109472.42, "weight": 5.957688754539148e-05}, {"ticker": "NAPA", "market_cap": 1124910584.5400002, "weight": 5.898962469787818e-05}, {"ticker": "ZIMV", "market_cap": 231338478.24, "weight": 1.2131248649541537e-05}, {"ticker": "AVRO", "market_cap": 65682847.400000006, "weight": 3.4443684417801197e-06}, {"ticker": "PBF", "market_cap": 5648303244.900001, "weight": 0.00029619357589448546}, {"ticker": "BTAI", "market_cap": 75772773.03299999, "weight": 3.97347798568539e-06}, {"ticker": "HELE", "market_cap": 2524891623.52, "weight": 0.00013240377619450246}, {"ticker": "GTHX", "market_cap": 60283598.370000005, "weight": 3.1612351169565075e-06}, {"ticker": "JJSF", "market_cap": 3088103921.91, "weight": 0.00016193828548249296}, {"ticker": "VLCN", "market_cap": 11429397.483, "weight": 5.993506304509923e-07}, {"ticker": "RDW", "market_cap": 178429032.39499998, "weight": 9.35670959171451e-06}, {"ticker": "SSKN", "market_cap": 21437156.09, "weight": 1.1241513856463917e-06}, {"ticker": "ENVB", "market_cap": 5542056.48, "weight": 2.9062206036876246e-07}, {"ticker": "SLNO", "market_cap": 822994926.3, "weight": 4.315735179125129e-05}, {"ticker": "ANVS", "market_cap": 78814129.83960001, "weight": 4.132964880963414e-06}, {"ticker": "FRTX", "market_cap": 5807967.06, "weight": 3.0456624894070074e-07}, {"ticker": "XPEL", "market_cap": 2076416700.48, "weight": 0.00010888602486375331}, {"ticker": "VERA", "market_cap": 577025945.5799999, "weight": 3.0258888518345264e-05}, {"ticker": "TSHA", "market_cap": 450574065.13000005, "weight": 2.362782906117362e-05}, {"ticker": "GBIO", "market_cap": 208999947.3603, "weight": 1.0959829719890058e-05}, {"ticker": "NDSN", "market_cap": 12673467465.645, "weight": 0.0006645889012813215}, {"ticker": "JANX", "market_cap": 451006867.75, "weight": 2.365052496649528e-05}, {"ticker": "LIFE", "market_cap": 82146487.67999999, "weight": 4.307711692901903e-06}, {"ticker": "FDMT", "market_cap": 503374170.6, "weight": 2.6396634376448818e-05}, {"ticker": "EL", "market_cap": 50601948365.63, "weight": 0.0026535352979104106}, {"ticker": "PFE", "market_cap": 186683653182.05, "weight": 0.009789576869295068}, {"ticker": "NNBR", "market_cap": 80166726.64, "weight": 4.2038942319000255e-06}, {"ticker": "BPMC", "market_cap": 2800284813.8399997, "weight": 0.00014684522706588098}, {"ticker": "SHOT", "market_cap": 42187832.0325, "weight": 2.212304171208379e-06}, {"ticker": "RBC", "market_cap": 6825570800.099999, "weight": 0.0003579287681885776}, {"ticker": "SPGC", "market_cap": 16326940.182, "weight": 8.5617478138916e-07}, {"ticker": "TCMD", "market_cap": 314376877.40000004, "weight": 1.6485731636261824e-05}, {"ticker": "CELU", "market_cap": 42008601.8, "weight": 2.202905447172004e-06}, {"ticker": "BDX", "market_cap": 74803828556.1798, "weight": 0.003922667128514836}, {"ticker": "VYGR", "market_cap": 303791591.48, "weight": 1.593064570114648e-05}, {"ticker": "NEPH", "market_cap": 15412850.04, "weight": 8.082404520676344e-07}, {"ticker": "PBLA", "market_cap": 3578860.56, "weight": 1.8767326415260621e-07}, {"ticker": "DTC", "market_cap": 280875511.41, "weight": 1.4728940444342793e-05}, {"ticker": "AMRX", "market_cap": 646076882.4000001, "weight": 3.387987751429677e-05}, {"ticker": "KLIC", "market_cap": 2694058633.3849998, "weight": 0.0001412747909758944}, {"ticker": "RCKT", "market_cap": 1706000873.04, "weight": 8.946164487912118e-05}, {"ticker": "BELFA", "market_cap": 599862642.06, "weight": 3.145643094812463e-05}, {"ticker": "TRVN", "market_cap": 8020230.1011, "weight": 4.2057597302098405e-07}, {"ticker": "CMPR", "market_cap": 1789741570.8600001, "weight": 9.385295597906983e-05}, {"ticker": "CTHR", "market_cap": 16788037.75, "weight": 8.803544565200034e-07}, {"ticker": "OPTN", "market_cap": 140279146.25, "weight": 7.356152839125515e-06}, {"ticker": "ST", "market_cap": 5740229090.4, "weight": 0.00030101411114466937}, {"ticker": "ELYM", "market_cap": 72328270.8, "weight": 3.7928503902229805e-06}, {"ticker": "VERU", "market_cap": 63909522.7681, "weight": 3.351376380063445e-06}, {"ticker": "SPRB", "market_cap": 85696006.66, "weight": 4.493846302501845e-06}, {"ticker": "PACK", "market_cap": 399249780.15999997, "weight": 2.0936414872458074e-05}, {"ticker": "SNAX", "market_cap": 5671587.600000001, "weight": 2.974145932691622e-07}, {"ticker": "DAWN", "market_cap": 1000746853.5597, "weight": 5.2478554402801073e-05}, {"ticker": "ANNX", "market_cap": 104082215.675, "weight": 5.458007885046744e-06}, {"ticker": "CORT", "market_cap": 2654931629.34, "weight": 0.00013922299475681028}, {"ticker": "PXLW", "market_cap": 65771414.279999994, "weight": 3.4490128349289293e-06}, {"ticker": "NPO", "market_cap": 2518407231.45, "weight": 0.00013206373863075278}, {"ticker": "BEAT", "market_cap": 52623808.0, "weight": 2.759560383514923e-06}, {"ticker": "ACRS", "market_cap": 427507604.64540005, "weight": 2.2418237947181745e-05}, {"ticker": "GRMN", "market_cap": 19801834643.940002, "weight": 0.001038396126793602}, {"ticker": "FTV", "market_cap": 25916034487.5, "weight": 0.00135902103605865}, {"ticker": "APVO", "market_cap": 3691046.2347999997, "weight": 1.9355621248990572e-07}, {"ticker": "QS", "market_cap": 3097758514.41, "weight": 0.00016244456642251884}, {"ticker": "CCCC", "market_cap": 76245825.25, "weight": 3.998284555315757e-06}, {"ticker": "SRI", "market_cap": 505576072.21000004, "weight": 2.6512100753404165e-05}, {"ticker": "BOLT", "market_cap": 36880768.1948, "weight": 1.9340049816229044e-06}, {"ticker": "CELZ", "market_cap": 6909602.953, "weight": 3.623353630150924e-07}, {"ticker": "SXT", "market_cap": 2364727126.88, "weight": 0.00012400484771381645}, {"ticker": "AGS", "market_cap": 247225303.0, "weight": 1.2964344046734e-05}, {"ticker": "SCHL", "market_cap": 1183266580.3, "weight": 6.204977751007794e-05}, {"ticker": "SUNW", "market_cap": 23991098.6776, "weight": 1.2580785766720307e-06}, {"ticker": "JOBY", "market_cap": 4318900959.974999, "weight": 0.00022648053119743024}, {"ticker": "AME", "market_cap": 34413019371.72, "weight": 0.0018045977390182429}, {"ticker": "ATAK", "market_cap": 115877374.03999999, "weight": 6.076538792983673e-06}, {"ticker": "FUSN", "market_cap": 227629863.3924, "weight": 1.193677114971575e-05}, {"ticker": "KTCC", "market_cap": 45317162.593899995, "weight": 2.3764043565116155e-06}, {"ticker": "SNSE", "market_cap": 19100473.951500002, "weight": 1.0016172000117922e-06}, {"ticker": "NX", "market_cap": 907453993.32, "weight": 4.758633373374059e-05}, {"ticker": "DALN", "market_cap": 24032680.1, "weight": 1.260259081092107e-06}, {"ticker": "MIDD", "market_cap": 6675184827.78, "weight": 0.0003500426195569422}, {"ticker": "SDPI", "market_cap": 23117621.202, "weight": 1.21227395079702e-06}, {"ticker": "CSBR", "market_cap": 86806144.60000001, "weight": 4.552061258733459e-06}, {"ticker": "YETI", "market_cap": 3826812879.9199996, "weight": 0.00020067573252304131}, {"ticker": "SWIM", "market_cap": 283083957.33, "weight": 1.4844750000921577e-05}, {"ticker": "LANC", "market_cap": 4530282960.0, "weight": 0.0002375652743056664}, {"ticker": "AGCO", "market_cap": 8604431383.039999, "weight": 0.0004512111318000723}, {"ticker": "EKSO", "market_cap": 9526795.5, "weight": 4.995793433201992e-07}, {"ticker": "INAB", "market_cap": 32549179.35, "weight": 1.7068591054866652e-06}, {"ticker": "JSPR", "market_cap": 83100309.75, "weight": 4.3577295402856236e-06}, {"ticker": "EVA", "market_cap": 527976957.91499996, "weight": 2.7686789532049062e-05}, {"ticker": "BLNK", "market_cap": 199332943.11, "weight": 1.0452897915251402e-05}, {"ticker": "CUTR", "market_cap": 90246034.375, "weight": 4.732446979712603e-06}, {"ticker": "JRSH", "market_cap": 37989826.116000004, "weight": 1.9921633023276123e-06}, {"ticker": "PDSB", "market_cap": 129492048.66000001, "weight": 6.7904840231691845e-06}, {"ticker": "ACLX", "market_cap": 1610595862.205, "weight": 8.445866432155532e-05}, {"ticker": "OM", "market_cap": 493421000.92, "weight": 2.587469623127829e-05}, {"ticker": "DZSI", "market_cap": 60686783.6328, "weight": 3.182377906137403e-06}, {"ticker": "ZYNE", "market_cap": 65536408.66500001, "weight": 3.436689283865169e-06}, {"ticker": "TMDX", "market_cap": 1703469301.1299999, "weight": 8.932889079277958e-05}, {"ticker": "ATNF", "market_cap": 3297465.561, "weight": 1.7291708209600514e-07}, {"ticker": "OSIS", "market_cap": 1979457512.78, "weight": 0.00010380154421965573}, {"ticker": "SIEN", "market_cap": 26021803.5, "weight": 1.3645674985400139e-06}, {"ticker": "AKTS", "market_cap": 54266120.25, "weight": 2.8456822358609422e-06}, {"ticker": "SANA", "market_cap": 706037303.025, "weight": 3.702416538748984e-05}, {"ticker": "LXRX", "market_cap": 244924695.0, "weight": 1.2843701566911987e-05}, {"ticker": "TLF", "market_cap": 36563642.72, "weight": 1.917375115216022e-06}, {"ticker": "AMKR", "market_cap": 5465762759.36, "weight": 0.0002866212642084181}, {"ticker": "ENS", "market_cap": 3812608103.5, "weight": 0.00019993084271450982}, {"ticker": "NVNO", "market_cap": 52560128.0, "weight": 2.7562210431687774e-06}, {"ticker": "CMC", "market_cap": 5538008527.320001, "weight": 0.00029040978820005}, {"ticker": "ADNT", "market_cap": 3336987650.92, "weight": 0.0001749895963773157}, {"ticker": "ISDR", "market_cap": 68564682.0, "weight": 3.595490089875266e-06}, {"ticker": "IDEX", "market_cap": 25667594.42, "weight": 1.3459929905027152e-06}, {"ticker": "LEVI", "market_cap": 5345084078.95, "weight": 0.00028029294783887116}, {"ticker": "NVFY", "market_cap": 3629679.8200000003, "weight": 1.90338195140032e-07}, {"ticker": "TMO", "market_cap": 193079092938.71, "weight": 0.010124949828006746}, {"ticker": "NTIC", "market_cap": 119988422.9611, "weight": 6.292119690081796e-06}, {"ticker": "WLY", "market_cap": 1959354136.74, "weight": 0.00010274733544603585}, {"ticker": "SNOA", "market_cap": 3829048.9155, "weight": 2.007929888645569e-07}, {"ticker": "SNTI", "market_cap": 16991761.1997, "weight": 8.910375899220012e-07}, {"ticker": "AEVA", "market_cap": 160919455.525, "weight": 8.438518063983161e-06}, {"ticker": "GOEV", "market_cap": 272592411.1638, "weight": 1.4294579721300928e-05}, {"ticker": "SILO", "market_cap": 5098427.08, "weight": 2.673584053097729e-07}, {"ticker": "CLAY", "market_cap": 30706977.6, "weight": 1.610255169721662e-06}, {"ticker": "PTPI", "market_cap": 3101452.6180000002, "weight": 1.6263828296085003e-07}, {"ticker": "SXI", "market_cap": 1763520907.71, "weight": 9.247796040181648e-05}, {"ticker": "ATAI", "market_cap": 216975692.132, "weight": 1.1378072909379682e-05}, {"ticker": "FLS", "market_cap": 5012117637.6, "weight": 0.0002628323908113485}, {"ticker": "KZR", "market_cap": 71380855.01785, "weight": 3.7431684846653677e-06}, {"ticker": "OCX", "market_cap": 25876513.92, "weight": 1.3569486016121154e-06}, {"ticker": "CRKN", "market_cap": 1267783.8599999999, "weight": 6.648181208998842e-08}, {"ticker": "HLIO", "market_cap": 1773643190.4099998, "weight": 9.30087667305728e-05}, {"ticker": "TFFP", "market_cap": 20543003.6076, "weight": 1.077262575029483e-06}, {"ticker": "MSI", "market_cap": 45746677204.799995, "weight": 0.0023989278406422294}, {"ticker": "AGE", "market_cap": 28087728.2661, "weight": 1.4729033327664517e-06}, {"ticker": "HPQ", "market_cap": 25640633263.595, "weight": 0.0013445791639109758}, {"ticker": "REYN", "market_cap": 5363635759.74, "weight": 0.0002812657866603358}, {"ticker": "ICVX", "market_cap": 369343553.76, "weight": 1.936815060709233e-05}, {"ticker": "INFN", "market_cap": 897483510.35, "weight": 4.706348769020603e-05}, {"ticker": "AXTI", "market_cap": 107836812.3561, "weight": 5.6548966441658134e-06}, {"ticker": "RARE", "market_cap": 2440620735.7200003, "weight": 0.0001279846622554939}, {"ticker": "PHAT", "market_cap": 568599861.83, "weight": 2.9817029827604402e-05}, {"ticker": "IMUX", "market_cap": 58419951.730000004, "weight": 3.0635066242443363e-06}, {"ticker": "MDGL", "market_cap": 2496202427.62, "weight": 0.00013089933226599507}, {"ticker": "PLSE", "market_cap": 213023414.96, "weight": 1.1170817905931024e-05}, {"ticker": "VRA", "market_cap": 206976397.995, "weight": 1.0853716025826552e-05}, {"ticker": "LMT", "market_cap": 100589040866.66, "weight": 0.005274827929430697}, {"ticker": "FOSL", "market_cap": 96534751.76, "weight": 5.0622234823702515e-06}, {"ticker": "ADVM", "market_cap": 120181681.89999999, "weight": 6.30225407092228e-06}, {"ticker": "HUN", "market_cap": 4222343521.4, "weight": 0.0002214171180323236}, {"ticker": "BWXT", "market_cap": 6654169251.0, "weight": 0.0003489405755330889}, {"ticker": "AMLX", "market_cap": 1183826944.51, "weight": 6.207916266734849e-05}, {"ticker": "FORD", "market_cap": 7777296.005, "weight": 4.0783665724583975e-07}, {"ticker": "AUVI", "market_cap": 2954859.3, "weight": 1.54951018807697e-07}, {"ticker": "STX", "market_cap": 13677453038.37, "weight": 0.0007172372921410718}, {"ticker": "HSDT", "market_cap": 5232374.159999999, "weight": 2.743825084582091e-07}, {"ticker": "CNXA", "market_cap": 1998350.4012999998, "weight": 1.0479227576629628e-07}, {"ticker": "KO", "market_cap": 237601125695.34, "weight": 0.012459658060994177}, {"ticker": "BSET", "market_cap": 133093679.28, "weight": 6.979351335375216e-06}, {"ticker": "SMR", "market_cap": 347836609.38, "weight": 1.8240339566099118e-05}, {"ticker": "TWST", "market_cap": 1066994075.29, "weight": 5.5952518290113534e-05}, {"ticker": "OGEN", "market_cap": 7567367.3, "weight": 3.96828124041998e-07}, {"ticker": "RPM", "market_cap": 12617959142.75, "weight": 0.000661678078696677}, {"ticker": "ACNT", "market_cap": 86941718.845, "weight": 4.559170689421693e-06}, {"ticker": "VICR", "market_cap": 2516424362.56, "weight": 0.00013195975819599315}, {"ticker": "EGRX", "market_cap": 186103294.43, "weight": 9.759143210438922e-06}, {"ticker": "IBRX", "market_cap": 904717757.944, "weight": 4.744284722011577e-05}, {"ticker": "XBIT", "market_cap": 118090570.32, "weight": 6.192597455542464e-06}, {"ticker": "BA", "market_cap": 111972012205.1106, "weight": 0.005871744001188068}, {"ticker": "OMIC", "market_cap": 27056427.97, "weight": 1.4188225744787814e-06}, {"ticker": "NXU", "market_cap": 10381431.6355, "weight": 5.443959408162621e-07}, {"ticker": "VVOS", "market_cap": 11399874.5874, "weight": 5.978024678188924e-07}, {"ticker": "GANX", "market_cap": 40892138.84, "weight": 2.1443588107507516e-06}, {"ticker": "HRTX", "market_cap": 134157665.9556, "weight": 7.035146147460527e-06}, {"ticker": "WLYB", "market_cap": 2066458871.18, "weight": 0.00010836384237095301}, {"ticker": "WNC", "market_cap": 1003436997.85, "weight": 5.2619623928013894e-05}, {"ticker": "LASE", "market_cap": 10977872.6119, "weight": 5.756729417048788e-07}, {"ticker": "PLRX", "market_cap": 997135243.17, "weight": 5.2289163757561046e-05}, {"ticker": "ENR", "market_cap": 2169933397.775, "weight": 0.0001137899834114213}, {"ticker": "HSTO", "market_cap": 2733925.7600000002, "weight": 1.4336539877096936e-07}, {"ticker": "FUL", "market_cap": 3770700560.3999996, "weight": 0.00019773323672390563}, {"ticker": "MAS", "market_cap": 11681534302.880001, "weight": 0.00061257253144619}, {"ticker": "SCTL", "market_cap": 47071938.904, "weight": 2.4684237555502117e-06}, {"ticker": "VRTX", "market_cap": 90511270672.35, "weight": 0.004746355809313784}, {"ticker": "NKE", "market_cap": 146425932743.63998, "weight": 0.007678486572438268}, {"ticker": "TGLS", "market_cap": 1532700870.95, "weight": 8.037389850716312e-05}, {"ticker": "ICAD", "market_cap": 51784180.8, "weight": 2.7155308454388953e-06}, {"ticker": "IVAC", "market_cap": 83384711.7532, "weight": 4.372643407807772e-06}, {"ticker": "CLVR", "market_cap": 4667366.72, "weight": 2.4475386303948185e-07}, {"ticker": "BALL", "market_cap": 15472527453.119999, "weight": 0.00081136989919994}, {"ticker": "AXLA", "market_cap": 28298006.4, "weight": 1.483930189808608e-06}, {"ticker": "INFU", "market_cap": 204546954.54, "weight": 1.0726317493352284e-05}, {"ticker": "SPRY", "market_cap": 380839703.395, "weight": 1.9971001679665896e-05}, {"ticker": "OSK", "market_cap": 5999210678.950001, "weight": 0.0003145949476326397}, {"ticker": "MLSS", "market_cap": 66013234.575, "weight": 3.461693743653967e-06}, {"ticker": "NEGG", "market_cap": 291868500.0, "weight": 1.5305406058716338e-05}, {"ticker": "IRBT", "market_cap": 1067550530.085, "weight": 5.59816984400468e-05}, {"ticker": "CRUS", "market_cap": 3891501956.8199997, "weight": 0.00020406798824614274}, {"ticker": "SGH", "market_cap": 1195120701.39, "weight": 6.267140038733823e-05}, {"ticker": "KOPN", "market_cap": 132582375.16, "weight": 6.9525388592906276e-06}, {"ticker": "STEM", "market_cap": 571794848.37, "weight": 2.998457297236594e-05}, {"ticker": "WFRD", "market_cap": 6119138549.1, "weight": 0.00032088389197025324}, {"ticker": "SNA", "market_cap": 13459323983.8, "weight": 0.0007057987376091583}, {"ticker": "UTRS", "market_cap": 27521362.900000002, "weight": 1.4432034785315686e-06}, {"ticker": "MDAI", "market_cap": 60076800.0, "weight": 3.1503907366101164e-06}, {"ticker": "CGC", "market_cap": 566898153.0388, "weight": 2.972779325687819e-05}, {"ticker": "TALS", "market_cap": 119572755.84, "weight": 6.270322359867356e-06}, {"ticker": "TEX", "market_cap": 3591409000.0, "weight": 0.00018833129668987365}, {"ticker": "BEEM", "market_cap": 97828305.11999999, "weight": 5.13005663131718e-06}, {"ticker": "ZYME", "market_cap": 418490671.13, "weight": 2.1945395455245662e-05}, {"ticker": "WAT", "market_cap": 15681778294.259998, "weight": 0.0008223428856365567}, {"ticker": "FTEK", "market_cap": 35550797.489999995, "weight": 1.8642621293344211e-06}, {"ticker": "AMPH", "market_cap": 2254686032.2999997, "weight": 0.00011823435985475486}, {"ticker": "ALPP", "market_cap": 18717480.599999998, "weight": 9.815332623395313e-07}, {"ticker": "CPRI", "market_cap": 5988142024.251, "weight": 0.00031401451413367725}, {"ticker": "GLW", "market_cap": 25448715613.035, "weight": 0.0013345151194126634}, {"ticker": "HRL", "market_cap": 20721909089.3508, "weight": 0.0010866442693347137}, {"ticker": "LIXT", "market_cap": 5735689.5, "weight": 3.00776057793889e-07}, {"ticker": "RVTY", "market_cap": 13270626517.8, "weight": 0.0006959035576244022}, {"ticker": "LIDR", "market_cap": 37368334.305, "weight": 1.959572650957142e-06}, {"ticker": "CECO", "market_cap": 542685240.3, "weight": 2.8458082886174945e-05}, {"ticker": "CYCN", "market_cap": 8437786.0, "weight": 4.424723495908325e-07}, {"ticker": "MED", "market_cap": 796067247.64, "weight": 4.174528075203352e-05}, {"ticker": "STZ", "market_cap": 45482406661.08, "weight": 0.002385069654572159}, {"ticker": "EWTX", "market_cap": 374092632.45, "weight": 1.961718939598269e-05}, {"ticker": "TR", "market_cap": 2159466466.6400003, "weight": 0.00011324110392901812}, {"ticker": "PEPG", "market_cap": 110256722.61, "weight": 5.7817952613910056e-06}, {"ticker": "NVAC", "market_cap": 66613125.6, "weight": 3.4931516629861476e-06}, {"ticker": "HAE", "market_cap": 4392674306.2, "weight": 0.00023034916046123875}, {"ticker": "BLUE", "market_cap": 314441052.65999997, "weight": 1.6489096947740188e-05}, {"ticker": "DXCM", "market_cap": 33647878303.0, "weight": 0.001764474208219408}, {"ticker": "VUZI", "market_cap": 222250451.67, "weight": 1.1654678081199104e-05}, {"ticker": "MACK", "market_cap": 173713159.89000002, "weight": 9.109412114905056e-06}, {"ticker": "DNMR", "market_cap": 187234714.945, "weight": 9.81847421191814e-06}, {"ticker": "ATRO", "market_cap": 511795983.27000004, "weight": 2.6838269094360455e-05}, {"ticker": "SYBX", "market_cap": 13039390.62, "weight": 6.837776882305455e-07}, {"ticker": "EMR", "market_cap": 53858160000.0, "weight": 0.0028242890492646998}, {"ticker": "PBH", "market_cap": 2826718449.3, "weight": 0.00014823139078112737}, {"ticker": "RYTM", "market_cap": 1259720931.3999999, "weight": 6.605899703373727e-05}, {"ticker": "CF", "market_cap": 15649981458.2, "weight": 0.0008206754789541614}, {"ticker": "SOI", "market_cap": 295629198.9, "weight": 1.55026148144713e-05}, {"ticker": "ELUT", "market_cap": 31419614.880000003, "weight": 1.6476254338747965e-06}, {"ticker": "TPB", "market_cap": 399614743.62, "weight": 2.0955553333620875e-05}, {"ticker": "MIR", "market_cap": 1614959919.69, "weight": 8.468751283337318e-05}, {"ticker": "TWI", "market_cap": 801651481.74, "weight": 4.203811458106074e-05}, {"ticker": "LYEL", "market_cap": 341396715.92, "weight": 1.790263548230737e-05}, {"ticker": "WEST", "market_cap": 776505602.88, "weight": 4.0719480036203754e-05}, {"ticker": "FUV", "market_cap": 7573071.42, "weight": 3.9712724461447377e-07}, {"ticker": "OIS", "market_cap": 484383724.28000003, "weight": 2.540078695830039e-05}, {"ticker": "LODE", "market_cap": 44977868.3942, "weight": 2.358611975697051e-06}, {"ticker": "ALLO", "market_cap": 490307117.625, "weight": 2.5711406091200043e-05}, {"ticker": "IONM", "market_cap": 1733878.68, "weight": 9.092354006667759e-08}, {"ticker": "AMPE", "market_cap": 2763622.08, "weight": 1.4492265567279186e-07}, {"ticker": "SONX", "market_cap": 17282847.096, "weight": 9.06301956720189e-07}, {"ticker": "CLFD", "market_cap": 426109707.28000003, "weight": 2.234493306225632e-05}, {"ticker": "VWE", "market_cap": 33823322.91, "weight": 1.7736744163643322e-06}, {"ticker": "SCPH", "market_cap": 225182242.6, "weight": 1.1808419408758987e-05}, {"ticker": "DNA", "market_cap": 3431624625.57, "weight": 0.00017995230158595143}, {"ticker": "SCX", "market_cap": 77634084.55, "weight": 4.071084025972198e-06}, {"ticker": "HWM", "market_cap": 18763708433.120003, "weight": 0.0009839574217027933}, {"ticker": "THAR", "market_cap": 3411396.477, "weight": 1.7889154981698736e-07}, {"ticker": "TTC", "market_cap": 8555713751.2, "weight": 0.00044865640891106497}, {"ticker": "BRID", "market_cap": 101569750.08, "weight": 5.326255722206187e-06}, {"ticker": "ETNB", "market_cap": 1086924729.6000001, "weight": 5.699766964159702e-05}, {"ticker": "PGEN", "market_cap": 329572751.37, "weight": 1.728259399560491e-05}, {"ticker": "ASNS", "market_cap": 3330617.37, "weight": 1.74655542732648e-07}, {"ticker": "OLMA", "market_cap": 617661785.84, "weight": 3.23898071879394e-05}, {"ticker": "TGAN", "market_cap": 128264720.86400001, "weight": 6.726123702391404e-06}, {"ticker": "OESX", "market_cap": 40303171.92, "weight": 2.113473744819514e-06}, {"ticker": "BW", "market_cap": 310447835.63, "weight": 1.6279695083117143e-05}, {"ticker": "NRIX", "market_cap": 307275452.625, "weight": 1.6113337253939636e-05}, {"ticker": "CGA", "market_cap": 28451837.4382, "weight": 1.4919969955930106e-06}, {"ticker": "COYA", "market_cap": 34658535.86, "weight": 1.81747247386368e-06}, {"ticker": "FTNT", "market_cap": 45525982237.89, "weight": 0.002387354731232778}, {"ticker": "GALT", "market_cap": 116668009.5993, "weight": 6.11799923931326e-06}, {"ticker": "VIR", "market_cap": 1190809208.3999999, "weight": 6.244530832556636e-05}, {"ticker": "GWH", "market_cap": 325234802.34, "weight": 1.7055114595237398e-05}, {"ticker": "PACB", "market_cap": 1995696803.745, "weight": 0.00010465312272958388}, {"ticker": "ADTN", "market_cap": 631028268.5799999, "weight": 3.309073738737004e-05}, {"ticker": "STAA", "market_cap": 1839115904.64, "weight": 9.644211591712924e-05}, {"ticker": "NKLA", "market_cap": 1389128479.23, "weight": 7.284504988493879e-05}, {"ticker": "POLA", "market_cap": 13985514.0, "weight": 7.333918210079614e-07}, {"ticker": "UFAB", "market_cap": 2499160.3109999998, "weight": 1.3105444186571282e-07}, {"ticker": "ONTO", "market_cap": 6287291740.139999, "weight": 0.00032970174271103575}, {"ticker": "SHYF", "market_cap": 513228801.2, "weight": 2.6913405192386992e-05}, {"ticker": "HLMN", "market_cap": 1553485371.8999999, "weight": 8.146382505548033e-05}, {"ticker": "LYTS", "market_cap": 467588362.752, "weight": 2.452004844733061e-05}, {"ticker": "IGMS", "market_cap": 352528828.0, "weight": 1.848639664761141e-05}, {"ticker": "SCL", "market_cap": 1571398866.2400002, "weight": 8.240319776889142e-05}, {"ticker": "AVNW", "market_cap": 354146656.79, "weight": 1.8571234602253418e-05}, {"ticker": "ALXO", "market_cap": 266458028.02499998, "weight": 1.3972896412348172e-05}, {"ticker": "PSTX", "market_cap": 205815614.15600002, "weight": 1.0792845229552579e-05}, {"ticker": "ONTX", "market_cap": 14936069.0, "weight": 7.832383452342589e-07}, {"ticker": "CRSR", "market_cap": 1457960825.95, "weight": 7.645457614941732e-05}, {"ticker": "VHAQ", "market_cap": 75595321.05, "weight": 3.96417251196781e-06}, {"ticker": "IRTC", "market_cap": 2593585161.58, "weight": 0.0001360060234175436}, {"ticker": "PM", "market_cap": 141247889111.06998, "weight": 0.0074069531236891405}, {"ticker": "AXGN", "market_cap": 202452680.64, "weight": 1.0616495047841133e-05}, {"ticker": "AWI", "market_cap": 3165786989.38, "weight": 0.00016601193814290343}, {"ticker": "LHX", "market_cap": 30860781516.809998, "weight": 0.0016183205532769207}, {"ticker": "CENN", "market_cap": 70419074.7483, "weight": 3.692733314152879e-06}, {"ticker": "GFF", "market_cap": 2117205154.2600002, "weight": 0.00011102494649322029}, {"ticker": "TRT", "market_cap": 30438332.4, "weight": 1.5961675793454305e-06}, {"ticker": "ONVO", "market_cap": 10810571.72, "weight": 5.668997850109741e-07}, {"ticker": "GMDA", "market_cap": 121900922.40685, "weight": 6.392409994120339e-06}, {"ticker": "CTAS", "market_cap": 49053100724.81, "weight": 0.00257231467264309}, {"ticker": "GE", "market_cap": 117947544775.41, "weight": 0.006185097283250083}, {"ticker": "ORGN", "market_cap": 160019909.60999998, "weight": 8.391346425051468e-06}, {"ticker": "KNW", "market_cap": 12649804.6608, "weight": 6.633480382329251e-07}, {"ticker": "SCLX", "market_cap": 207182712.60000002, "weight": 1.086453503783151e-05}, {"ticker": "DYNT", "market_cap": 3110254.4739, "weight": 1.6309984691386244e-07}, {"ticker": "AGIO", "market_cap": 1323808517.5, "weight": 6.941971094628162e-05}, {"ticker": "CVRX", "market_cap": 303981153.895, "weight": 1.594058623852905e-05}, {"ticker": "CRON", "market_cap": 760273267.215, "weight": 3.986826625796387e-05}, {"ticker": "TILE", "market_cap": 570029424.75, "weight": 2.989199523489256e-05}, {"ticker": "FOLD", "market_cap": 3126124025.9550004, "weight": 0.00016393203654094352}, {"ticker": "EXP", "market_cap": 5887732282.7699995, "weight": 0.0003087490885546324}, {"ticker": "NYT", "market_cap": 6869377473.2, "weight": 0.00036022596339764247}, {"ticker": "AFIB", "market_cap": 20441889.692986, "weight": 1.0719602230409893e-06}, {"ticker": "SELB", "market_cap": 155728984.565, "weight": 8.166332933766042e-06}, {"ticker": "SGMO", "market_cap": 96623297.7549, "weight": 5.06686678031716e-06}, {"ticker": "SYK", "market_cap": 100069677625.105, "weight": 0.005247592837928974}, {"ticker": "RAPT", "market_cap": 513310790.88, "weight": 2.6917704681180832e-05}, {"ticker": "IOBT", "market_cap": 97404931.34899999, "weight": 5.107855169084138e-06}, {"ticker": "VREX", "market_cap": 757904000.0000001, "weight": 3.974402333079914e-05}, {"ticker": "WTS", "market_cap": 5678109172.26, "weight": 0.00029775658053939026}, {"ticker": "SOBR", "market_cap": 15799973.639999999, "weight": 8.285409774511961e-07}, {"ticker": "TCON", "market_cap": 4614201.7335, "weight": 2.4196592358562277e-07}, {"ticker": "MKSI", "market_cap": 5706738955.799999, "weight": 0.00029925790891998917}, {"ticker": "ACAD", "market_cap": 3519351824.2050004, "weight": 0.0001845526623563064}, {"ticker": "KEQU", "market_cap": 50473153.72, "weight": 2.6467813852766197e-06}, {"ticker": "CHD", "market_cap": 22498536765.6, "weight": 0.0011798095406817335}, {"ticker": "FLEX", "market_cap": 11893675944.8, "weight": 0.0006236971097119102}, {"ticker": "LUNR", "market_cap": 81786845.4624, "weight": 4.288852274443847e-06}, {"ticker": "BWEN", "market_cap": 63771591.74, "weight": 3.3441433611074194e-06}, {"ticker": "AAOI", "market_cap": 297031892.871, "weight": 1.557617123046778e-05}, {"ticker": "NVST", "market_cap": 4382288041.0, "weight": 0.0002298045110512493}, {"ticker": "CLRB", "market_cap": 27176014.53, "weight": 1.4250936207203768e-06}, {"ticker": "MBC", "market_cap": 1479206535.5200002, "weight": 7.756868819636452e-05}, {"ticker": "HON", "market_cap": 120757985626.875, "weight": 0.006332475086732392}, {"ticker": "COHR", "market_cap": 4618046449.5, "weight": 0.00024216753814683935}, {"ticker": "STOK", "market_cap": 149932194.27499998, "weight": 7.862352787824722e-06}, {"ticker": "RCUS", "market_cap": 1179393001.1200001, "weight": 6.18466493813128e-05}, {"ticker": "FNKO", "market_cap": 367270032.96999997, "weight": 1.9259416442007228e-05}, {"ticker": "DORM", "market_cap": 2399398096.8, "weight": 0.00012582297222219998}, {"ticker": "ATER", "market_cap": 26074553.860799998, "weight": 1.3673336952751455e-06}, {"ticker": "FSS", "market_cap": 3616256234.36, "weight": 0.00018963427049936625}, {"ticker": "SPI", "market_cap": 22525176.38, "weight": 1.181206505806917e-06}, {"ticker": "CRCT", "market_cap": 2015844135.27, "weight": 0.00010570963650201806}, {"ticker": "FTK", "market_cap": 112777096.68, "weight": 5.91396213983527e-06}, {"ticker": "ACU", "market_cap": 102710404.719, "weight": 5.386070955513835e-06}, {"ticker": "TRN", "market_cap": 1728746997.1200001, "weight": 9.06544377475066e-05}, {"ticker": "SCYX", "market_cap": 81972341.325, "weight": 4.29857956429974e-06}, {"ticker": "ATHX", "market_cap": 11802205.438000001, "weight": 6.18900452145333e-07}, {"ticker": "QDEL", "market_cap": 4941169993.62, "weight": 0.00025911193964918763}, {"ticker": "SONN", "market_cap": 4524851.21, "weight": 2.3728043664980618e-07}, {"ticker": "KULR", "market_cap": 45820499.9208, "weight": 2.402799058826916e-06}, {"ticker": "FREQ", "market_cap": 11317780.425, "weight": 5.934975000317478e-07}, {"ticker": "ALOT", "market_cap": 91843044.19999999, "weight": 4.816193200532542e-06}, {"ticker": "BHIL", "market_cap": 67841260.697, "weight": 3.5575543181357986e-06}, {"ticker": "RPHM", "market_cap": 243703681.48, "weight": 1.2779672362915041e-05}, {"ticker": "GOSS", "market_cap": 154233006.199, "weight": 8.087884741012509e-06}, {"ticker": "ITCI", "market_cap": 4904513426.559999, "weight": 0.00025718969163827905}, {"ticker": "FFIE", "market_cap": 25373238.96, "weight": 1.330557169778998e-06}, {"ticker": "OTIS", "market_cap": 32750197220.460003, "weight": 0.0017174003599641054}, {"ticker": "SGEN", "market_cap": 40157973193.25, "weight": 0.0021058596121806116}, {"ticker": "BPTH", "market_cap": 4068358.2199999997, "weight": 2.1334222277983548e-07}, {"ticker": "BIVI", "market_cap": 130653376.39999999, "weight": 6.851383341279741e-06}, {"ticker": "EML", "market_cap": 111010833.22000001, "weight": 5.821340361664712e-06}, {"ticker": "TSE", "market_cap": 227318280.2667, "weight": 1.1920431920714051e-05}, {"ticker": "BVS", "market_cap": 189006478.5, "weight": 9.911384411714658e-06}, {"ticker": "BRC", "market_cap": 2689995167.8199997, "weight": 0.00014106170532095753}, {"ticker": "ASTE", "market_cap": 1032353960.85, "weight": 5.4136011824274976e-05}, {"ticker": "VFC", "market_cap": 6379386331.67, "weight": 0.0003345311269000739}, {"ticker": "INGR", "market_cap": 6346584712.9908, "weight": 0.00033281103003018783}, {"ticker": "RWOD", "market_cap": 94045630.25, "weight": 4.931695469103883e-06}, {"ticker": "PMTS", "market_cap": 202669803.81, "weight": 1.0627880854399929e-05}, {"ticker": "HY", "market_cap": 754426181.52, "weight": 3.956164865167169e-05}, {"ticker": "SYNA", "market_cap": 3499738320.06, "weight": 0.0001835241421659688}, {"ticker": "NPCE", "market_cap": 213510142.4295, "weight": 1.1196341597458644e-05}, {"ticker": "TPST", "market_cap": 3986560.248, "weight": 2.0905278703654869e-07}, {"ticker": "ALRN", "market_cap": 6630103.82, "weight": 3.4767859901478353e-07}, {"ticker": "RPID", "market_cap": 46141886.54000001, "weight": 2.4196523770462313e-06}, {"ticker": "IDXX", "market_cap": 35660885290.68, "weight": 0.0018700350664328698}, {"ticker": "CIX", "market_cap": 229651568.04999998, "weight": 1.2042788108433e-05}, {"ticker": "COOK", "market_cap": 342772042.58500004, "weight": 1.797475677347516e-05}, {"ticker": "ENTG", "market_cap": 14147705861.25, "weight": 0.0007418970632518152}, {"ticker": "SLGN", "market_cap": 4679869792.95, "weight": 0.0002454095165563276}, {"ticker": "ALSN", "market_cap": 5241369123.82, "weight": 0.0002748541988727231}, {"ticker": "LOOP", "market_cap": 167274578.24, "weight": 8.771776821629317e-06}, {"ticker": "TRNR", "market_cap": 18106179.025, "weight": 9.494769807274086e-07}, {"ticker": "TGTX", "market_cap": 1179889662.66, "weight": 6.187269400943624e-05}, {"ticker": "SMTC", "market_cap": 1579332131.6599998, "weight": 8.281921336709632e-05}, {"ticker": "GHM", "market_cap": 173895692.7, "weight": 9.118984024090488e-06}, {"ticker": "OMER", "market_cap": 166882212.72, "weight": 8.751201413159271e-06}, {"ticker": "SWTX", "market_cap": 1447865519.1000001, "weight": 7.592518441777588e-05}, {"ticker": "ALGN", "market_cap": 22067728211.359997, "weight": 0.0011572182029518593}, {"ticker": "TTNP", "market_cap": 6749824.6025, "weight": 3.5395668380238395e-07}, {"ticker": "OCUP", "market_cap": 68366771.4624, "weight": 3.58511178203709e-06}, {"ticker": "OLIT", "market_cap": 65080989.6, "weight": 3.412807385966951e-06}, {"ticker": "NURO", "market_cap": 5837812.920000001, "weight": 3.0613134762888265e-07}, {"ticker": "CGTX", "market_cap": 42587772.71, "weight": 2.233276816315801e-06}, {"ticker": "VRCA", "market_cap": 161527883.51999998, "weight": 8.470423656813375e-06}, {"ticker": "CLDX", "market_cap": 1207986150.24, "weight": 6.334605667527917e-05}, {"ticker": "BOF", "market_cap": 7846621.2, "weight": 4.1147202817341397e-07}, {"ticker": "ALTO", "market_cap": 311619868.35, "weight": 1.634115576384734e-05}, {"ticker": "BMRN", "market_cap": 16154804262.05, "weight": 0.0008471480787743678}, {"ticker": "PIRS", "market_cap": 30050985.808, "weight": 1.5758553603974457e-06}, {"ticker": "LLY", "market_cap": 501920836820.29004, "weight": 0.026320422439781072}, {"ticker": "PNR", "market_cap": 10502858539.64, "weight": 0.0005507634935816873}, {"ticker": "XTNT", "market_cap": 145653664.23999998, "weight": 7.637989283300976e-06}, {"ticker": "VSH", "market_cap": 3369723899.855, "weight": 0.00017670626529770074}, {"ticker": "KMT", "market_cap": 1953611794.8600001, "weight": 0.00010244621054149368}, {"ticker": "MDLZ", "market_cap": 93113804465.95499, "weight": 0.0048828310935347796}, {"ticker": "TGI", "market_cap": 571897509.855, "weight": 2.9989956478001237e-05}, {"ticker": "TBIO", "market_cap": 28453452.285, "weight": 1.4920816771739166e-06}, {"ticker": "FORM", "market_cap": 2664389986.0800004, "weight": 0.00013971898521331346}, {"ticker": "OUST", "market_cap": 184472247.84, "weight": 9.673612122429649e-06}, {"ticker": "ASPI", "market_cap": 33691978.4208, "weight": 1.7667867914894978e-06}, {"ticker": "SPR", "market_cap": 1699370157.42, "weight": 8.911393419768769e-05}, {"ticker": "MGTX", "market_cap": 258383262.76, "weight": 1.3549460648606477e-05}, {"ticker": "ATR", "market_cap": 8139985700.59, "weight": 0.0004268558835902968}, {"ticker": "KRON", "market_cap": 72604067.4, "weight": 3.8073129956518416e-06}, {"ticker": "ARCT", "market_cap": 652728147.06, "weight": 3.4228665774850017e-05}, {"ticker": "OSUR", "market_cap": 432045480.075, "weight": 2.2656201365960745e-05}, {"ticker": "GOLF", "market_cap": 3428272227.52, "weight": 0.0001797765038776489}, {"ticker": "XOS", "market_cap": 54301790.545, "weight": 2.8475527643667905e-06}, {"ticker": "VERV", "market_cap": 755096966.55, "weight": 3.959682420937065e-05}, {"ticker": "ATRA", "market_cap": 135982394.44, "weight": 7.1308337958386425e-06}, {"ticker": "ARAV", "market_cap": 9084987.027999999, "weight": 4.7641117661450456e-07}, {"ticker": "CRVO", "market_cap": 7052590.334999999, "weight": 3.69833534084539e-07}, {"ticker": "TNON", "market_cap": 3371576.8296000003, "weight": 1.7680343180297794e-07}, {"ticker": "FEIM", "market_cap": 66012023.38, "weight": 3.4616302293271685e-06}, {"ticker": "GRPH", "market_cap": 143211279.25, "weight": 7.509912104627486e-06}, {"ticker": "XLO", "market_cap": 57557805.8, "weight": 3.0182962177067356e-06}, {"ticker": "SOTK", "market_cap": 82574573.58, "weight": 4.330160256304637e-06}, {"ticker": "TKR", "market_cap": 5102166271.86, "weight": 0.0002675544862494726}, {"ticker": "TROX", "market_cap": 1867330680.81, "weight": 9.792168156445892e-05}, {"ticker": "FREE", "market_cap": 155244605.67, "weight": 8.140932400052237e-06}, {"ticker": "VZIO", "market_cap": 1010127949.6349999, "weight": 5.297049335718736e-05}, {"ticker": "AXTA", "market_cap": 6001464098.62, "weight": 0.00031471311558522807}, {"ticker": "REGN", "market_cap": 88028093251.84, "weight": 0.004616139500473531}, {"ticker": "AAPL", "market_cap": 2701751631920.0, "weight": 0.1416782071252469}, {"ticker": "LUNG", "market_cap": 363925299.54, "weight": 1.9084020661700987e-05}, {"ticker": "MXL", "market_cap": 1756423367.84, "weight": 9.210576974154214e-05}, {"ticker": "FIGS", "market_cap": 1001533300.885, "weight": 5.251979522069512e-05}, {"ticker": "RMBS", "market_cap": 6188846003.96, "weight": 0.00032453930837165296}, {"ticker": "WLKP", "market_cap": 755509068.6, "weight": 3.961843458943181e-05}, {"ticker": "DUNE", "market_cap": 55604886.48, "weight": 2.915886320124392e-06}, {"ticker": "PRPO", "market_cap": 8316527.705999999, "weight": 4.3611363863827265e-07}, {"ticker": "ASMB", "market_cap": 41880898.424, "weight": 2.1962087600517807e-06}, {"ticker": "F", "market_cap": 47746551431.86, "weight": 0.00250380002490163}, {"ticker": "MPC", "market_cap": 56457979577.6, "weight": 0.0029606220016544517}, {"ticker": "SMTI", "market_cap": 255570941.28, "weight": 1.3401984226111243e-05}, {"ticker": "FCUV", "market_cap": 126402543.14999999, "weight": 6.628472239262419e-06}, {"ticker": "ROIV", "market_cap": 7750106138.97, "weight": 0.0004064108372609108}, {"ticker": "OPK", "market_cap": 1151854234.17, "weight": 6.040253324501818e-05}, {"ticker": "ICU", "market_cap": 10500824.34, "weight": 5.506568213937166e-07}, {"ticker": "ISRG", "market_cap": 101053118076.75, "weight": 0.005299163855174735}, {"ticker": "FARO", "market_cap": 268230568.83999997, "weight": 1.406584737118485e-05}, {"ticker": "ONDS", "market_cap": 31107571.985099997, "weight": 1.6312620948567733e-06}, {"ticker": "FIZZ", "market_cap": 4433388393.54, "weight": 0.00023248418235996624}, {"ticker": "FSLR", "market_cap": 16166794854.02, "weight": 0.0008477768581013088}, {"ticker": "GLT", "market_cap": 84010622.15, "weight": 4.4054657671216284e-06}, {"ticker": "RPTX", "market_cap": 386427014.28, "weight": 2.026399685342124e-05}, {"ticker": "AORT", "market_cap": 605131275.9449999, "weight": 3.173271489443825e-05}, {"ticker": "SENS", "market_cap": 287433527.7666, "weight": 1.5072838820760482e-05}, {"ticker": "MRNA", "market_cap": 39397041746.82, "weight": 0.002065956831406196}, {"ticker": "AP", "market_cap": 50161016.225, "weight": 2.6304130854870725e-06}, {"ticker": "CBT", "market_cap": 3800079008.04, "weight": 0.00019927382459311707}, {"ticker": "RIGL", "market_cap": 176107928.86, "weight": 9.23499233854229e-06}, {"ticker": "CVM", "market_cap": 55294313.489999995, "weight": 2.899600062022474e-06}, {"ticker": "GIS", "market_cap": 36600246653.985, "weight": 0.0019192946031805914}, {"ticker": "CRS", "market_cap": 3188306740.8199997, "weight": 0.0001671928601681667}, {"ticker": "XCUR", "market_cap": 6313264.109999999, "weight": 3.310637179396557e-07}, {"ticker": "EVLV", "market_cap": 688476200.85, "weight": 3.610327190420205e-05}, {"ticker": "ACST", "market_cap": 25096408.68, "weight": 1.3160403588016293e-06}, {"ticker": "ELF", "market_cap": 5378749397.63, "weight": 0.00028205833660981935}, {"ticker": "CRNX", "market_cap": 1707099431.3700001, "weight": 8.951925260766961e-05}, {"ticker": "ADTX", "market_cap": 2782637.45, "weight": 1.459198100735125e-07}, {"ticker": "TRS", "market_cap": 996701692.38, "weight": 5.2266428618661075e-05}, {"ticker": "PHIO", "market_cap": 3243909.76, "weight": 1.7010864856821842e-07}, {"ticker": "ATEN", "market_cap": 814845409.29, "weight": 4.2729996091610986e-05}, {"ticker": "BSFC", "market_cap": 795922.493429, "weight": 4.1737689929529334e-08}, {"ticker": "ICCC", "market_cap": 41873349.2928, "weight": 2.1958128882176963e-06}, {"ticker": "COKE", "market_cap": 6044154667.2, "weight": 0.00031695178295424657}, {"ticker": "AXL", "market_cap": 828769924.92, "weight": 4.346018919531382e-05}, {"ticker": "IRWD", "market_cap": 1494759601.88, "weight": 7.838428150670105e-05}, {"ticker": "SLVM", "market_cap": 1753077947.5, "weight": 9.19303379400946e-05}, {"ticker": "ERII", "market_cap": 1136593030.3, "weight": 5.960224502557961e-05}, {"ticker": "IMRX", "market_cap": 214505229.95, "weight": 1.124852337988879e-05}, {"ticker": "FSR", "market_cap": 2150398524.8199997, "weight": 0.0001127655865927111}, {"ticker": "LWLG", "market_cap": 486821297.18390006, "weight": 2.5528611794114853e-05}, {"ticker": "ARAY", "market_cap": 274798643.885, "weight": 1.4410273219085007e-05}, {"ticker": "VATE", "market_cap": 122814236.05, "weight": 6.440303604315946e-06}, {"ticker": "OWLT", "market_cap": 37638874.56, "weight": 1.9737596168613204e-06}, {"ticker": "BELFB", "market_cap": 601396163.94, "weight": 3.1536847899845446e-05}, {"ticker": "RGEN", "market_cap": 8531135438.415, "weight": 0.000447367537184885}, {"ticker": "COMM", "market_cap": 618804650.92, "weight": 3.24497383354244e-05}, {"ticker": "GM", "market_cap": 42210435350.2419, "weight": 0.0022134894753995265}, {"ticker": "CING", "market_cap": 11275364.1424, "weight": 5.912732160521671e-07}, {"ticker": "NOC", "market_cap": 63709275991.68, "weight": 0.0033408755612869853}, {"ticker": "DARE", "market_cap": 46325181.7272, "weight": 2.4292642648268733e-06}, {"ticker": "PRPL", "market_cap": 157568821.63, "weight": 8.262812866892439e-06}, {"ticker": "THMO", "market_cap": 2880210.3694, "weight": 1.510364744334945e-07}, {"ticker": "DLX", "market_cap": 788587332.4799999, "weight": 4.135303856485488e-05}, {"ticker": "OC", "market_cap": 11840108810.800001, "weight": 0.0006208880818885184}, {"ticker": "PEGY", "market_cap": 8940143.421, "weight": 4.688156662386192e-07}, {"ticker": "BSGM", "market_cap": 39147946.0554, "weight": 2.0528944053319202e-06}, {"ticker": "GTBP", "market_cap": 9371512.0528, "weight": 4.914363740940126e-07}, {"ticker": "KAMN", "market_cap": 534336895.22499996, "weight": 2.802030076411943e-05}, {"ticker": "GILD", "market_cap": 92510335638.485, "weight": 0.0048511855564240414}, {"ticker": "KODK", "market_cap": 309946872.3, "weight": 1.6253424871750803e-05}, {"ticker": "XFOR", "market_cap": 148459239.5013, "weight": 7.785111938203736e-06}, {"ticker": "GRTX", "market_cap": 7485444.6864, "weight": 3.925321521692563e-07}, {"ticker": "BMI", "market_cap": 4179559966.56, "weight": 0.00021917357452056553}, {"ticker": "NPK", "market_cap": 502919936.64000005, "weight": 2.6372814624733722e-05}, {"ticker": "VANI", "market_cap": 53359738.95, "weight": 2.798152153510407e-06}, {"ticker": "CLSD", "market_cap": 52080802.7624, "weight": 2.73108552016558e-06}, {"ticker": "RBOT", "market_cap": 88685062.8419, "weight": 4.650590584931418e-06}, {"ticker": "INZY", "market_cap": 225621929.23, "weight": 1.1831476307364827e-05}, {"ticker": "AMPX", "market_cap": 390711059.99999994, "weight": 2.048864959710103e-05}, {"ticker": "MNOV", "market_cap": 98337723.22999999, "weight": 5.156770206188103e-06}, {"ticker": "ASTI", "market_cap": 831432.3661, "weight": 4.359980598632535e-08}, {"ticker": "DCI", "market_cap": 7213910126.5, "weight": 0.00037829304552278935}, {"ticker": "LASR", "market_cap": 467430203.40000004, "weight": 2.4511754667411424e-05}, {"ticker": "KRO", "market_cap": 786669762.424, "weight": 4.125248236110863e-05}, {"ticker": "INBS", "market_cap": 1008462.629, "weight": 5.288316495917033e-08}, {"ticker": "AXSM", "market_cap": 3044289474.7000003, "weight": 0.00015964068260384303}, {"ticker": "AVGR", "market_cap": 5752531.0378, "weight": 3.0165921776038834e-07}, {"ticker": "NARI", "market_cap": 3738801065.49, "weight": 0.0001960604466740527}, {"ticker": "PPSI", "market_cap": 59277913.6, "weight": 3.108497621228408e-06}, {"ticker": "HUMA", "market_cap": 284444894.25, "weight": 1.4916116702641355e-05}, {"ticker": "ALIM", "market_cap": 156208146.18, "weight": 8.19145987649993e-06}, {"ticker": "MIST", "market_cap": 97811513.17, "weight": 5.129176071704658e-06}, {"ticker": "LXU", "market_cap": 731548266.24, "weight": 3.836194473316966e-05}, {"ticker": "IPWR", "market_cap": 52555353.3, "weight": 2.755970660814023e-06}, {"ticker": "LMAT", "market_cap": 1224695496.43, "weight": 6.422228459440583e-05}, {"ticker": "NDRA", "market_cap": 7696325.0061, "weight": 4.0359058746734576e-07}, {"ticker": "UPXI", "market_cap": 33758324.245, "weight": 1.7702659260301595e-06}, {"ticker": "DCTH", "market_cap": 56675766.769999996, "weight": 2.9720426291427547e-06}, {"ticker": "UTHR", "market_cap": 10381969294.4, "weight": 0.0005444241353209297}, {"ticker": "ALGM", "market_cap": 5846319403.8, "weight": 0.00030657742244919004}, {"ticker": "CTCX", "market_cap": 71783906.61999999, "weight": 3.764304264763329e-06}, {"ticker": "YHGJ", "market_cap": 52050595.449999996, "weight": 2.729501467134079e-06}, {"ticker": "ATNM", "market_cap": 156046052.86, "weight": 8.182959801699102e-06}, {"ticker": "UBX", "market_cap": 27304352.46, "weight": 1.4318235834651919e-06}, {"ticker": "BRLT", "market_cap": 37563364.800000004, "weight": 1.9697999311186105e-06}, {"ticker": "ELAN", "market_cap": 5069631718.2, "weight": 0.0002658483941062458}, {"ticker": "INGN", "market_cap": 112609166.415, "weight": 5.905155979200008e-06}, {"ticker": "TSVT", "market_cap": 207409415.58, "weight": 1.0876423203781659e-05}, {"ticker": "SAVA", "market_cap": 794915883.3594, "weight": 4.168490391165478e-05}, {"ticker": "MERC", "market_cap": 546169149.86, "weight": 2.8640776977821163e-05}, {"ticker": "GRI", "market_cap": 5025801.8, "weight": 2.6354997993831973e-07}, {"ticker": "KRT", "market_cap": 428911319.76, "weight": 2.2491847911325562e-05}, {"ticker": "SUN", "market_cap": 3938449888.15, "weight": 0.00020652990912017465}, {"ticker": "VNT", "market_cap": 4773678066.650001, "weight": 0.00025032876519277077}, {"ticker": "SLRX", "market_cap": 2294102.79, "weight": 1.203013505787163e-07}, {"ticker": "LUMO", "market_cap": 30789495.56, "weight": 1.6145823611963736e-06}, {"ticker": "IOVA", "market_cap": 1012167627.505, "weight": 5.307745282019666e-05}, {"ticker": "PYXS", "market_cap": 83357271.2, "weight": 4.371204441940603e-06}, {"ticker": "FLXS", "market_cap": 105206853.78, "weight": 5.516983221083796e-06}, {"ticker": "EPC", "market_cap": 1843963524.3899999, "weight": 9.669632213908194e-05}, {"ticker": "LGVN", "market_cap": 52283142.080000006, "weight": 2.7416960705247715e-06}, {"ticker": "XERS", "market_cap": 228499218.415, "weight": 1.1982359596670723e-05}, {"ticker": "MIRA", "market_cap": 70357012.6, "weight": 3.689478812962761e-06}, {"ticker": "SAM", "market_cap": 4607848288.44, "weight": 0.00024163275280318115}, {"ticker": "IOSP", "market_cap": 2501766851.46, "weight": 0.00013119112725707495}, {"ticker": "VGR", "market_cap": 1620144077.8000002, "weight": 8.495936692158804e-05}, {"ticker": "AMPG", "market_cap": 19182829.87, "weight": 1.0059358941291121e-06}, {"ticker": "ME", "market_cap": 413476551.1881, "weight": 2.168245806481851e-05}, {"ticker": "APRE", "market_cap": 17076595.61, "weight": 8.954862546370808e-07}, {"ticker": "REVB", "market_cap": 4282166.04, "weight": 2.2455417440746553e-07}, {"ticker": "AXON", "market_cap": 14471291070.73, "weight": 0.0007588656742039603}, {"ticker": "CNTX", "market_cap": 19318924.13, "weight": 1.0130725940866631e-06}, {"ticker": "OBIO", "market_cap": 323480865.1, "weight": 1.6963139196522896e-05}, {"ticker": "BIIB", "market_cap": 37012499725.95, "weight": 0.0019409129027414466}, {"ticker": "SWKS", "market_cap": 15488973378.449999, "weight": 0.0008122323134898925}, {"ticker": "NHWK", "market_cap": 12780126.1, "weight": 6.701820149899657e-07}, {"ticker": "CVGI", "market_cap": 252372488.94, "weight": 1.3234259336912336e-05}, {"ticker": "MYMD", "market_cap": 24729686.1056, "weight": 1.2968096507530052e-06}, {"ticker": "ATXS", "market_cap": 190676848.4, "weight": 9.998977590107521e-06}, {"ticker": "PKG", "market_cap": 13720591785.195, "weight": 0.0007194994617038056}, {"ticker": "MVST", "market_cap": 539920718.73, "weight": 2.831311306179537e-05}, {"ticker": "TG", "market_cap": 180175707.48000002, "weight": 9.448304167451763e-06}, {"ticker": "BTMD", "market_cap": 140833530.88, "weight": 7.385224430869267e-06}, {"ticker": "AZTA", "market_cap": 2902922358.64, "weight": 0.00015222747729169738}, {"ticker": "RRX", "market_cap": 9094936089.505, "weight": 0.0004769328993294847}, {"ticker": "PCSA", "market_cap": 5639785.872599999, "weight": 2.957469300878815e-07}, {"ticker": "GPRO", "market_cap": 458943081.41499996, "weight": 2.406669516886915e-05}, {"ticker": "DECK", "market_cap": 13291723994.22, "weight": 0.0006970098964154066}, {"ticker": "CW", "market_cap": 7375329802.679999, "weight": 0.00038675779485271495}, {"ticker": "HNI", "market_cap": 1611053345.02, "weight": 8.448265444124437e-05}, {"ticker": "AULT", "market_cap": 2208777.3836, "weight": 1.1582693832772999e-07}, {"ticker": "ESI", "market_cap": 4599191181.39, "weight": 0.0002411787793915454}, {"ticker": "LOGI", "market_cap": 11024425975.8, "weight": 0.0005781141717036237}, {"ticker": "MTX", "market_cap": 1694065114.47, "weight": 8.883574098222016e-05}, {"ticker": "MRK", "market_cap": 257964402040.53998, "weight": 0.013527495848042588}, {"ticker": "ZVSA", "market_cap": 6266261.259400999, "weight": 3.28598917132666e-07}, {"ticker": "NRXS", "market_cap": 17733602.44, "weight": 9.299392919346996e-07}, {"ticker": "SJM", "market_cap": 12213897115.75, "weight": 0.0006404893125360841}, {"ticker": "PLUG", "market_cap": 3864662018.34, "weight": 0.00020266051824843021}, {"ticker": "KLAC", "market_cap": 62427452379.6, "weight": 0.0032736575131641667}, {"ticker": "SKYX", "market_cap": 118489606.32000001, "weight": 6.213522659913769e-06}, {"ticker": "RIBT", "market_cap": 2845308.3456, "weight": 1.4920623360061946e-07}, {"ticker": "MNTX", "market_cap": 96400057.88, "weight": 5.055160217485469e-06}, {"ticker": "RNAZ", "market_cap": 1488045.762, "weight": 7.803221183979077e-08}, {"ticker": "CRSP", "market_cap": 3263413537.75, "weight": 0.0001711314147733509}, {"ticker": "CELH", "market_cap": 12025787902.800001, "weight": 0.0006306249801823519}, {"ticker": "PFIN", "market_cap": 21116960.39, "weight": 1.107360518503295e-06}, {"ticker": "SNES", "market_cap": 1327493.418515, "weight": 6.961294490719466e-08}, {"ticker": "MTSI", "market_cap": 5729858893.41, "weight": 0.00030047030434180843}, {"ticker": "XNCR", "market_cap": 1167410925.3600001, "weight": 6.121831663922826e-05}, {"ticker": "WDFC", "market_cap": 2733862868.22, "weight": 0.0001433621007643991}, {"ticker": "JVA", "market_cap": 4852309.149999999, "weight": 2.544521312275039e-07}, {"ticker": "DAR", "market_cap": 7710597229.5, "weight": 0.0004043390141543562}, {"ticker": "NVRO", "market_cap": 642576970.38, "weight": 3.369634426341192e-05}, {"ticker": "WINT", "market_cap": 4892352.5157, "weight": 2.565519808926654e-07}, {"ticker": "ZVRA", "market_cap": 167298100.20000002, "weight": 8.773010298859978e-06}, {"ticker": "PCRX", "market_cap": 1332864872.875, "weight": 6.989462069648217e-05}, {"ticker": "GEOS", "market_cap": 154964745.75, "weight": 8.126256716601781e-06}, {"ticker": "EMN", "market_cap": 8999565767.94, "weight": 0.00047193173785607234}, {"ticker": "FIXX", "market_cap": 61857858.81, "weight": 3.2437883739074063e-06}, {"ticker": "AMGN", "market_cap": 141722388846.6586, "weight": 0.007431835600311104}, {"ticker": "ROK", "market_cap": 33015384557.04, "weight": 0.0017313066220923802}, {"ticker": "PPG", "market_cap": 31193696982.449997, "weight": 0.0016357784371693134}, {"ticker": "RMGC", "market_cap": 134098707.9, "weight": 7.03205442299766e-06}, {"ticker": "LGL", "market_cap": 23552922.8, "weight": 1.235100901000273e-06}, {"ticker": "CNHI", "market_cap": 15380346033.8846, "weight": 0.000806535961819008}, {"ticker": "ITT", "market_cap": 7887346999.999999, "weight": 0.00041360766427688537}, {"ticker": "PTIX", "market_cap": 4893983.67, "weight": 2.566375176289213e-07}, {"ticker": "NEU", "market_cap": 4348671940.305, "weight": 0.00022804170324140457}, {"ticker": "NRGV", "market_cap": 315713169.98, "weight": 1.6555806003828553e-05}, {"ticker": "MICS", "market_cap": 4599660.284100001, "weight": 2.4120337885143846e-07}, {"ticker": "XOM", "market_cap": 440728822407.5028, "weight": 0.02311155053980375}, {"ticker": "CDMO", "market_cap": 594208273.6099999, "weight": 3.115991931657534e-05}, {"ticker": "GERN", "market_cap": 942067215.0, "weight": 4.940142995965316e-05}, {"ticker": "WHD", "market_cap": 3029539361.2200003, "weight": 0.00015886719565261827}, {"ticker": "DXR", "market_cap": 44089334.8, "weight": 2.31201781614903e-06}, {"ticker": "RSLS", "market_cap": 1021924.3119999999, "weight": 5.3589087402149686e-08}, {"ticker": "COLM", "market_cap": 4331142537.4800005, "weight": 0.00022712247205268967}, {"ticker": "PLXS", "market_cap": 2555746485.0, "weight": 0.00013402178630466112}, {"ticker": "AEHR", "market_cap": 1287696945.92, "weight": 6.752604216581952e-05}, {"ticker": "USNA", "market_cap": 1122974651.4, "weight": 5.888810554521104e-05}, {"ticker": "SOFO", "market_cap": 7441427.68, "weight": 3.9022392721027266e-07}, {"ticker": "CFRX", "market_cap": 3010600.5288, "weight": 1.5787405483589403e-07}, {"ticker": "AKLI", "market_cap": 43758558.2235, "weight": 2.294672094298112e-06}, {"ticker": "EQRX", "market_cap": 1065164060.205, "weight": 5.5856553415625536e-05}, {"ticker": "MOV", "market_cap": 621200601.45, "weight": 3.257538051934712e-05}, {"ticker": "NBY", "market_cap": 1894499.5590000001, "weight": 9.93464009598639e-08}, {"ticker": "TOVX", "market_cap": 8843490.7585, "weight": 4.6374725958898565e-07}, {"ticker": "HPCO", "market_cap": 9996832.865600001, "weight": 5.24227815982639e-07}, {"ticker": "RKLB", "market_cap": 2071054540.99, "weight": 0.0001086048364917774}, {"ticker": "BMY", "market_cap": 117846295773.60999, "weight": 0.006179787847371977}, {"ticker": "CYCC", "market_cap": 4613365.7478, "weight": 2.419220850055849e-07}, {"ticker": "PROK", "market_cap": 284854818.375, "weight": 1.4937612873644354e-05}, {"ticker": "SEER", "market_cap": 134273939.1, "weight": 7.041243440209713e-06}, {"ticker": "RVPH", "market_cap": 125935478.96, "weight": 6.603979678114383e-06}, {"ticker": "ALG", "market_cap": 2097639413.8, "weight": 0.00010999893100138147}, {"ticker": "FGI", "market_cap": 13775000.0, "weight": 7.223525952914329e-07}, {"ticker": "CABA", "market_cap": 571998309.8399999, "weight": 2.999524236771231e-05}, {"ticker": "QUAD", "market_cap": 256281687.325, "weight": 1.34392553150549e-05}, {"ticker": "STXS", "market_cap": 121706761.39999999, "weight": 6.3822283093869456e-06}, {"ticker": "WIRE", "market_cap": 2931044290.0299997, "weight": 0.0001537021742154124}, {"ticker": "PRME", "market_cap": 840674678.4000001, "weight": 4.4084467204212756e-05}, {"ticker": "POWL", "market_cap": 980158579.12, "weight": 5.139891785295791e-05}, {"ticker": "OLED", "market_cap": 7360473520.440001, "weight": 0.0003859787404764939}, {"ticker": "WWW", "market_cap": 642081194.425, "weight": 3.3670346074825536e-05}, {"ticker": "NOVT", "market_cap": 5037157640.429999, "weight": 0.00026414547328179166}, {"ticker": "MNST", "market_cap": 54389770229.8125, "weight": 0.0028521663653582412}, {"ticker": "MKC.V", "market_cap": 18260156202.936, "weight": 0.0009575514499904011}, {"ticker": "FGEN", "market_cap": 73156754.1432, "weight": 3.836295551247753e-06}, {"ticker": "SWBI", "market_cap": 608467326.4350001, "weight": 3.190765534666873e-05}, {"ticker": "CLDI", "market_cap": 98742938.25, "weight": 5.178019434598127e-06}, {"ticker": "ERAS", "market_cap": 280940199.48, "weight": 1.4732332647264672e-05}, {"ticker": "BBIO", "market_cap": 3866843096.2000003, "weight": 0.000202774892640641}, {"ticker": "MX", "market_cap": 332543461.74, "weight": 1.7438376234852e-05}, {"ticker": "TRDA", "market_cap": 515707661.0, "weight": 2.7043395087842066e-05}, {"ticker": "AXDX", "market_cap": 91523975.27, "weight": 4.799461420520756e-06}, {"ticker": "GPK", "market_cap": 6695664071.925, "weight": 0.0003511165386246553}, {"ticker": "AVY", "market_cap": 14725707450.640001, "weight": 0.0007722071139362755}, {"ticker": "LFCR", "market_cap": 209542300.0, "weight": 1.0988270361403703e-05}, {"ticker": "BF.B", "market_cap": 27516963097.399998, "weight": 0.0014429727555677293}, {"ticker": "SITM", "market_cap": 2514195319.2000003, "weight": 0.00013184286852222814}, {"ticker": "VSTM", "market_cap": 187360275.62, "weight": 9.825058537105276e-06}, {"ticker": "FGH", "market_cap": 32010344.24, "weight": 1.6786029210842953e-06}, {"ticker": "EVOK", "market_cap": 4446283.100000001, "weight": 2.3316037289912434e-07}, {"ticker": "SPRU", "market_cap": 91245830.5161, "weight": 4.784875679334088e-06}, {"ticker": "LAZR", "market_cap": 1666921874.1, "weight": 8.741236601845328e-05}, {"ticker": "MLKN", "market_cap": 1763286346.2985, "weight": 9.246566014451322e-05}, {"ticker": "XAIR", "market_cap": 68655001.305, "weight": 3.6002263791218486e-06}, {"ticker": "SBEV", "market_cap": 25985984.426, "weight": 1.3626891681541818e-06}, {"ticker": "FRPT", "market_cap": 2914839033.6, "weight": 0.0001528523804557337}, {"ticker": "BCTX", "market_cap": 92134650.39, "weight": 4.831484851214905e-06}, {"ticker": "AURA", "market_cap": 327731100.84, "weight": 1.718601896548038e-05}, {"ticker": "TMBR", "market_cap": 9817622.1, "weight": 5.148301127786226e-07}, {"ticker": "NWL", "market_cap": 3274251000.0, "weight": 0.00017169972468134804}, {"ticker": "BCAB", "market_cap": 75046410.08940001, "weight": 3.935387956107678e-06}, {"ticker": "MIRM", "market_cap": 1106045518.0, "weight": 5.8000352118893444e-05}, {"ticker": "AIP", "market_cap": 226543451.44, "weight": 1.1879800369797654e-05}, {"ticker": "PEN", "market_cap": 8757793664.55, "weight": 0.0004592533562696595}, {"ticker": "MTW", "market_cap": 499047151.04, "weight": 2.6169728110819578e-05}, {"ticker": "ASTC", "market_cap": 16806037.14, "weight": 8.812983335494163e-07}, {"ticker": "JBL", "market_cap": 17006731324.98, "weight": 0.0008918226141577793}, {"ticker": "AVGO", "market_cap": 338762983295.6, "weight": 0.017764524150435206}, {"ticker": "VINC", "market_cap": 21380570.0, "weight": 1.121184045612352e-06}, {"ticker": "PANW", "market_cap": 72575834439.0072, "weight": 0.0038058324764034994}, {"ticker": "WHR", "market_cap": 6998036773.5199995, "weight": 0.0003669727786059569}, {"ticker": "CLIR", "market_cap": 38947706.86, "weight": 2.0423939840995237e-06}, {"ticker": "AMTI", "market_cap": 6933908.902547, "weight": 3.63609952179252e-07}, {"ticker": "IBIO", "market_cap": 7589045.8749, "weight": 3.9796493528274103e-07}, {"ticker": "OPXS", "market_cap": 26071634.85, "weight": 1.3671806241298053e-06}, {"ticker": "BTTR", "market_cap": 5094486.302399999, "weight": 2.6715175333686353e-07}, {"ticker": "MIMO", "market_cap": 12507567.758399999, "weight": 6.558892218558031e-07}, {"ticker": "PETV", "market_cap": 26419526.9513, "weight": 1.3854238736583312e-06}, {"ticker": "SNBR", "market_cap": 463161900.00000006, "weight": 2.4287927441387377e-05}, {"ticker": "CROX", "market_cap": 5229590627.429999, "weight": 0.0002742365417085889}, {"ticker": "AMD", "market_cap": 165976305196.02, "weight": 0.008703696175334154}, {"ticker": "POCI", "market_cap": 36399108.0, "weight": 1.908747014888795e-06}, {"ticker": "SMP", "market_cap": 723474701.0999999, "weight": 3.793857190325071e-05}, {"ticker": "KE", "market_cap": 671812801.92, "weight": 3.522945343135545e-05}, {"ticker": "NSSC", "market_cap": 820340864.0699999, "weight": 4.3018174387265405e-05}, {"ticker": "CASA", "market_cap": 77737066.4, "weight": 4.076484331352627e-06}, {"ticker": "TIO", "market_cap": 198631516.5592, "weight": 1.0416115534897374e-05}, {"ticker": "CSWI", "market_cap": 2717605121.625, "weight": 0.00014250955445249428}, {"ticker": "ARWR", "market_cap": 2549047185.78, "weight": 0.0001336704791410894}, {"ticker": "CODA", "market_cap": 67593362.06099999, "weight": 3.5445546649173733e-06}, {"ticker": "HBB", "market_cap": 167208003.45, "weight": 8.768285680261804e-06}, {"ticker": "FLNC", "market_cap": 2431765302.12, "weight": 0.00012752028872058346}, {"ticker": "CCK", "market_cap": 10525450951.56, "weight": 0.0005519482258781886}, {"ticker": "WVVI", "market_cap": 28670154.975, "weight": 1.5034454340180644e-06}, {"ticker": "ENOV", "market_cap": 2711985389.1, "weight": 0.00014221485910771915}, {"ticker": "PH", "market_cap": 49117361319.3739, "weight": 0.002575684459013922}, {"ticker": "MKUL", "market_cap": 4539734.129, "weight": 2.380608878414695e-07}, {"ticker": "GGG", "market_cap": 12518984994.24, "weight": 0.0006564879347371156}, {"ticker": "CBUS", "market_cap": 328836138.8, "weight": 1.724396648187251e-05}, {"ticker": "RXST", "market_cap": 935111656.215, "weight": 4.903668470084758e-05}, {"ticker": "COEP", "market_cap": 33803601.76, "weight": 1.7726402512910377e-06}, {"ticker": "RZLT", "market_cap": 41246875.04000001, "weight": 2.1629609606392326e-06}, {"ticker": "B", "market_cap": 1673719462.38, "weight": 8.776882740036115e-05}, {"ticker": "VIEW", "market_cap": 27483471.599999998, "weight": 1.4412164818786487e-06}, {"ticker": "IFF", "market_cap": 16639917319.949999, "weight": 0.0008725871115427039}, {"ticker": "HOLX", "market_cap": 16905902430.619999, "weight": 0.0008865352084575026}, {"ticker": "CRWS", "market_cap": 47115984.48, "weight": 2.4707334786815875e-06}, {"ticker": "UG", "market_cap": 33584471.89, "weight": 1.7611492146086152e-06}, {"ticker": "NBIX", "market_cap": 10796454872.0, "weight": 0.0005661595061151386}, {"ticker": "MEIP", "market_cap": 45567945.3087, "weight": 2.389555249062615e-06}, {"ticker": "SWAV", "market_cap": 7032923473.89, "weight": 0.00036880221588751224}, {"ticker": "CPRX", "market_cap": 1283257598.28, "weight": 6.729324548421117e-05}, {"ticker": "KTB", "market_cap": 2432428288.84, "weight": 0.00012755505533966412}, {"ticker": "MIND", "market_cap": 6480706.859999999, "weight": 3.3984431358577075e-07}, {"ticker": "ASRT", "market_cap": 233031390.67000002, "weight": 1.2220023944453452e-05}, {"ticker": "ELSE", "market_cap": 13163600.639999999, "weight": 6.902911858935728e-07}, {"ticker": "MAMA", "market_cap": 160257696.36, "weight": 8.403815817137744e-06}, {"ticker": "LTRN", "market_cap": 35684145.224, "weight": 1.871254803144304e-06}, {"ticker": "FMC", "market_cap": 8085689252.7795, "weight": 0.0004240086109956674}, {"ticker": "PRSO", "market_cap": 4835128.228800001, "weight": 2.535511742025807e-07}, {"ticker": "AGLE", "market_cap": 41650997.63999999, "weight": 2.1841529032109863e-06}, {"ticker": "AIMD", "market_cap": 13393131.84, "weight": 7.023276619749055e-07}, {"ticker": "SOLO", "market_cap": 68045412.69, "weight": 3.568259924086976e-06}, {"ticker": "PLAG", "market_cap": 49131043.488, "weight": 2.576401943588606e-06}, {"ticker": "OTLK", "market_cap": 61300713.75435, "weight": 3.2145720271268207e-06}, {"ticker": "ELOX", "market_cap": 14802481.76, "weight": 7.76233111875869e-07}, {"ticker": "INMB", "market_cap": 119483817.96, "weight": 6.265658511704908e-06}, {"ticker": "ELMD", "market_cap": 89320615.12, "weight": 4.6839185586177275e-06}, {"ticker": "NSTG", "market_cap": 63758582.55, "weight": 3.343461167121275e-06}, {"ticker": "JOUT", "market_cap": 543402806.49, "weight": 2.8495711619361146e-05}, {"ticker": "LIPO", "market_cap": 6318339.500000001, "weight": 3.3132986829454627e-07}, {"ticker": "TACT", "market_cap": 62337818.68, "weight": 3.2689571766464437e-06}, {"ticker": "BRKR", "market_cap": 9137200006.44, "weight": 0.0004791491933465576}, {"ticker": "SPRO", "market_cap": 60887313.795, "weight": 3.1928935854912603e-06}, {"ticker": "FFIV", "market_cap": 9190716372.31, "weight": 0.0004819555589201881}, {"ticker": "APD", "market_cap": 63119127462.93, "weight": 0.0033099285325138466}, {"ticker": "CUE", "market_cap": 98686207.86, "weight": 5.175044527560131e-06}, {"ticker": "SLS", "market_cap": 41164014.632, "weight": 2.1586158114003423e-06}, {"ticker": "SMAP", "market_cap": 55427051.36, "weight": 2.9065607549363005e-06}, {"ticker": "DSS", "market_cap": 25584199.2, "weight": 1.3416197960488567e-06}, {"ticker": "TTOO", "market_cap": 69210513.31478, "weight": 3.629357089973401e-06}, {"ticker": "LEXX", "market_cap": 8068993.38, "weight": 4.2313308961396663e-07}, {"ticker": "BTCY", "market_cap": 18073827.45, "weight": 9.477804838734693e-07}, {"ticker": "CVU", "market_cap": 38549694.199999996, "weight": 2.021522443053437e-06}, {"ticker": "EOLS", "market_cap": 479130844.83, "weight": 2.512532916494572e-05}, {"ticker": "FBRX", "market_cap": 23220334.080000002, "weight": 1.2176601514498808e-06}, {"ticker": "SMPL", "market_cap": 3347832500.07, "weight": 0.00017555829364984178}, {"ticker": "ORGS", "market_cap": 19803424.55, "weight": 1.0384795004973196e-06}, {"ticker": "SABS", "market_cap": 35681664.392000005, "weight": 1.8711247098278844e-06}, {"ticker": "ARDX", "market_cap": 859469223.3449999, "weight": 4.507004167378387e-05}, {"ticker": "HRMY", "market_cap": 1925104652.325, "weight": 0.00010095131338036844}, {"ticker": "TPX", "market_cap": 7113523025.36, "weight": 0.00037302880718941277}, {"ticker": "UAA", "market_cap": 2948146768.42, "weight": 0.0001545990177472405}, {"ticker": "ETN", "market_cap": 83167560000.0, "weight": 0.0043612561023634085}, {"ticker": "RMTI", "market_cap": 57121774.315, "weight": 2.9954309926745376e-06}, {"ticker": "CSLR", "market_cap": 80617184.34, "weight": 4.227515958844781e-06}, {"ticker": "EVTV", "market_cap": 21903827.599999998, "weight": 1.1486233548948178e-06}, {"ticker": "MHK", "market_cap": 5188185249.32, "weight": 0.0002720652689436683}, {"ticker": "EMKR", "market_cap": 35002777.968, "weight": 1.835524319970569e-06}, {"ticker": "SVRA", "market_cap": 487300254.805, "weight": 2.5553728039533087e-05}, {"ticker": "EAR", "market_cap": 43989107.480000004, "weight": 2.3067619566411456e-06}, {"ticker": "TELA", "market_cap": 177044270.73000002, "weight": 9.284093534903418e-06}, {"ticker": "FN", "market_cap": 6094900543.2699995, "weight": 0.00031961286573315773}, {"ticker": "INTT", "market_cap": 176404686.56, "weight": 9.250554131265899e-06}, {"ticker": "WRK", "market_cap": 9242043143.265001, "weight": 0.0004846471034724403}, {"ticker": "RGR", "market_cap": 921047783.54, "weight": 4.829918379873255e-05}, {"ticker": "CMCO", "market_cap": 991281977.3499999, "weight": 5.198222206928463e-05}, {"ticker": "MOG.B", "market_cap": 3595596440.16, "weight": 0.00018855088349693016}, {"ticker": "VLO", "market_cap": 45366981093.6, "weight": 0.0023790168082395155}, {"ticker": "IPGP", "market_cap": 4669797365.8875, "weight": 0.0002448813246267827}, {"ticker": "LIN", "market_cap": 183577432683.40002, "weight": 0.009626688561582018}, {"ticker": "WMS", "market_cap": 9019310629.14, "weight": 0.00047296714633022753}, {"ticker": "IDYA", "market_cap": 1465170301.4699998, "weight": 7.683263664688098e-05}, {"ticker": "COTY", "market_cap": 9190589617.98, "weight": 0.00048194891200046105}, {"ticker": "CVV", "market_cap": 46642151.714999996, "weight": 2.445885977590345e-06}, {"ticker": "STRR", "market_cap": 15291377.867999999, "weight": 8.018705254832505e-07}, {"ticker": "AMTX", "market_cap": 153254330.355, "weight": 8.036563576884563e-06}, {"ticker": "BIOL", "market_cap": 1910066.1600000001, "weight": 1.0016270401846397e-07}, {"ticker": "CRMD", "market_cap": 188553424.48, "weight": 9.887626535333225e-06}, {"ticker": "SIBN", "market_cap": 826654081.2750001, "weight": 4.334923564553549e-05}, {"ticker": "TRVI", "market_cap": 130894031.35, "weight": 6.864003140024005e-06}, {"ticker": "BLCO", "market_cap": 5814623011.079999, "weight": 0.00030491528295425936}, {"ticker": "ELTX", "market_cap": 62913427.5, "weight": 3.299141751964022e-06}, {"ticker": "AVIR", "market_cap": 251032124.76999998, "weight": 1.3163971457650255e-05}, {"ticker": "SBFM", "market_cap": 8117809.0206, "weight": 4.256929520225492e-07}, {"ticker": "ADI", "market_cap": 86225755376.45999, "weight": 0.0045216260019709685}, {"ticker": "UI", "market_cap": 8176041472.039999, "weight": 0.00042874662624598766}, {"ticker": "ITP", "market_cap": 4026368.0, "weight": 2.1114028126303998e-07}, {"ticker": "BCPC", "market_cap": 3954852463.23, "weight": 0.0002073900501494669}, {"ticker": "SHPH", "market_cap": 7866582.5, "weight": 4.125187865661828e-07}, {"ticker": "PRLD", "market_cap": 145243094.75, "weight": 7.616459269751142e-06}, {"ticker": "AADI", "market_cap": 99795830.2, "weight": 5.233232446042334e-06}, {"ticker": "AGRX", "market_cap": 3891550.2, "weight": 2.0407051808906676e-07}, {"ticker": "SCKT", "market_cap": 8202255.040000001, "weight": 4.301212497558066e-07}, {"ticker": "TREX", "market_cap": 6421503993.45, "weight": 0.000336739751386055}, {"ticker": "SYM", "market_cap": 2534923317.3, "weight": 0.00013292983209556612}, {"ticker": "DOW", "market_cap": 35744310477.880005, "weight": 0.0018744098323484123}, {"ticker": "APTV", "market_cap": 27096037189.282, "weight": 0.001420899657770674}, {"ticker": "XRX", "market_cap": 2429861233.02, "weight": 0.00012742044049873235}, {"ticker": "NAUT", "market_cap": 389909335.779, "weight": 2.044660766811756e-05}, {"ticker": "WLK", "market_cap": 15742566723.84, "weight": 0.0008255305937941469}, {"ticker": "BLFS", "market_cap": 591465224.0, "weight": 3.1016075468677215e-05}, {"ticker": "LQDA", "market_cap": 413048192.48, "weight": 2.1659995195525466e-05}, {"ticker": "LHC", "market_cap": 153042075.08, "weight": 8.02543303976946e-06}, {"ticker": "ULBI", "market_cap": 164333301.275, "weight": 8.617538052181865e-06}, {"ticker": "KITT", "market_cap": 93165116.66000001, "weight": 4.885521873682767e-06}, {"ticker": "JNPR", "market_cap": 8696004847.199999, "weight": 0.0004560131883877894}, {"ticker": "EYPT", "market_cap": 279522511.56, "weight": 1.4657989957731074e-05}, {"ticker": "ATOS", "market_cap": 90980309.3748, "weight": 4.770951912689964e-06}, {"ticker": "ITGR", "market_cap": 2582042361.6, "weight": 0.00013540072602934158}, {"ticker": "VIGL", "market_cap": 195868878.66, "weight": 1.0271244489065244e-05}, {"ticker": "PAHC", "market_cap": 505079991.76000005, "weight": 2.6486086597285776e-05}, {"ticker": "EFOI", "market_cap": 6920163.36, "weight": 3.6288914431482267e-07}, {"ticker": "IRDM", "market_cap": 5576634271.889999, "weight": 0.0002924352986781046}, {"ticker": "TSN", "market_cap": 17130897229.38, "weight": 0.0008983337984256594}, {"ticker": "RGF", "market_cap": 37982115.96, "weight": 1.9917589864512634e-06}, {"ticker": "SUP", "market_cap": 76408716.80000001, "weight": 4.006826488810753e-06}, {"ticker": "MYGN", "market_cap": 1271649605.78, "weight": 6.668452944003706e-05}, {"ticker": "BBLG", "market_cap": 1770930.9149999998, "weight": 9.286653666294604e-08}, {"ticker": "ABBV", "market_cap": 259020600290.0, "weight": 0.013582882239813165}, {"ticker": "PG", "market_cap": 343093016054.57, "weight": 0.017991588426379955}, {"ticker": "ORGO", "market_cap": 374238778.2, "weight": 1.9624853189943005e-05}, {"ticker": "AEIS", "market_cap": 3733854033.48, "weight": 0.0001958010273338412}, {"ticker": "ALZN", "market_cap": 21753363.8256, "weight": 1.1407331263695775e-06}, {"ticker": "UAN", "market_cap": 845677713.3337, "weight": 4.4346823303573325e-05}, {"ticker": "DRS", "market_cap": 4244400000.0, "weight": 0.0002225737463125196}, {"ticker": "FSI", "market_cap": 31586251.28, "weight": 1.6563637450188997e-06}, {"ticker": "CPSH", "market_cap": 39630165.12, "weight": 2.0781816788573516e-06}, {"ticker": "ARTW", "market_cap": 11592903.63, "weight": 6.07924793037675e-07}, {"ticker": "INSP", "market_cap": 5408482045.815001, "weight": 0.00028361749853949794}, {"ticker": "DTIL", "market_cap": 37150631.483967, "weight": 1.9481564478518457e-06}, {"ticker": "SIF", "market_cap": 22718590.560000002, "weight": 1.1913490273959672e-06}, {"ticker": "NSPR", "market_cap": 69943839.89999999, "weight": 3.667812288668854e-06}, {"ticker": "BMRA", "market_cap": 13457316.8, "weight": 7.05693482115354e-07}, {"ticker": "MTEX", "market_cap": 19767738.599999998, "weight": 1.0366081510528229e-06}, {"ticker": "MATW", "market_cap": 1143756031.48, "weight": 5.997786843700964e-05}, {"ticker": "MINM", "market_cap": 2944554.6, "weight": 1.544106466270292e-07}, {"ticker": "MOS", "market_cap": 11084861100.24, "weight": 0.0005812833527552386}, {"ticker": "ZBRA", "market_cap": 11753918437.8, "weight": 0.0006163683113167807}, {"ticker": "GTX", "market_cap": 1920301624.36, "weight": 0.0001006994455244138}, {"ticker": "INBX", "market_cap": 778603167.9899999, "weight": 4.082947507075919e-05}, {"ticker": "VIRC", "market_cap": 110344369.5, "weight": 5.7863914108255405e-06}, {"ticker": "TDG", "market_cap": 45233084420.4, "weight": 0.002371995348392916}, {"ticker": "TPIC", "market_cap": 101313951.06, "weight": 5.312841777671159e-06}, {"ticker": "AVTE", "market_cap": 370499628.40000004, "weight": 1.9428774455844026e-05}, {"ticker": "BKSY", "market_cap": 157722985.28, "weight": 8.270897114636695e-06}, {"ticker": "DHR", "market_cap": 159092730003.58, "weight": 0.008342725692202194}, {"ticker": "MKC", "market_cap": 18281085671.34, "weight": 0.0009586489785435553}, {"ticker": "GEF", "market_cap": 3794806432.32, "weight": 0.00019899733393938113}, {"ticker": "FF", "market_cap": 301528744.27, "weight": 1.5811983374112613e-05}, {"ticker": "IKT", "market_cap": 5401809.26, "weight": 2.832675817227074e-07}, {"ticker": "UTSI", "market_cap": 32826358.4, "weight": 1.7213942057500345e-06}, {"ticker": "VTVT", "market_cap": 40725503.28, "weight": 2.1356205436557357e-06}, {"ticker": "IEX", "market_cap": 15616279096.16, "weight": 0.0008189081476520165}, {"ticker": "FARM", "market_cap": 49059890.410000004, "weight": 2.5726707195917806e-06}, {"ticker": "ALNT", "market_cap": 480712850.7, "weight": 2.5208288587520004e-05}, {"ticker": "BCEL", "market_cap": 9823915.25, "weight": 5.151601217249064e-07}, {"ticker": "INDP", "market_cap": 22514805.96, "weight": 1.1806626873095478e-06}, {"ticker": "AOS", "market_cap": 9882715731.9, "weight": 0.000518243583119088}, {"ticker": "PSTV", "market_cap": 3502769.7679999997, "weight": 1.8368310944632812e-07}, {"ticker": "BC", "market_cap": 5313329781.049999, "weight": 0.00027862777183163174}, {"ticker": "BHC", "market_cap": 2887349042.2, "weight": 0.00015141082207952106}, {"ticker": "GNSS", "market_cap": 84362142.0, "weight": 4.42389925357854e-06}, {"ticker": "NUBI", "market_cap": 77295888.28, "weight": 4.053349219921208e-06}, {"ticker": "IRMD", "market_cap": 540150564.78, "weight": 2.8325166048418597e-05}, {"ticker": "SONO", "market_cap": 1601944380.93, "weight": 8.4004985922128e-05}, {"ticker": "GKOS", "market_cap": 3350008839.32, "weight": 0.0001756724195522354}, {"ticker": "KA", "market_cap": 33410311.74, "weight": 1.752016362605069e-06}, {"ticker": "TXMD", "market_cap": 29187662.4, "weight": 1.5305832076319543e-06}, {"ticker": "LLAP", "market_cap": 157715773.8822, "weight": 8.27051895333604e-06}, {"ticker": "JELD", "market_cap": 1100629257.16, "weight": 5.771632670513306e-05}, {"ticker": "PRM", "market_cap": 622718956.99, "weight": 3.265500215745195e-05}, {"ticker": "MLR", "market_cap": 449012457.2, "weight": 2.354593929412729e-05}, {"ticker": "GLUE", "market_cap": 209562406.35999998, "weight": 1.0989324726654364e-05}, {"ticker": "TLIS", "market_cap": 10059280.14, "weight": 5.275025129504587e-07}, {"ticker": "NVDA", "market_cap": 1078994799999.9999, "weight": 0.056581828971757564}, {"ticker": "TPCS", "market_cap": 61729957.080000006, "weight": 3.2370812852244473e-06}, {"ticker": "LPCN", "market_cap": 15203273.799999999, "weight": 7.972504019133389e-07}, {"ticker": "CMTL", "market_cap": 230043742.5, "weight": 1.2063353497308827e-05}, {"ticker": "KIDS", "market_cap": 701715459.8000001, "weight": 3.67975305657097e-05}, {"ticker": "CIEN", "market_cap": 6685431293.099999, "weight": 0.00035057993794652227}, {"ticker": "IRON", "market_cap": 1019194941.5999999, "weight": 5.344596088367769e-05}, {"ticker": "MODD", "market_cap": 23204717.8, "weight": 1.216841243254832e-06}, {"ticker": "LYRA", "market_cap": 191741313.33, "weight": 1.0054797481561765e-05}, {"ticker": "COHU", "market_cap": 1625260001.65, "weight": 8.522764284684108e-05}, {"ticker": "HXL", "market_cap": 5589940092.18, "weight": 0.00029313304777567003}, {"ticker": "CTLT", "market_cap": 7758895732.639999, "weight": 0.00040687175819006363}, {"ticker": "DTI", "market_cap": 115502043.84, "weight": 6.056856706300461e-06}, {"ticker": "CYRX", "market_cap": 614653651.35, "weight": 3.223206245067354e-05}, {"ticker": "RYAM", "market_cap": 220860752.84, "weight": 1.1581803122467782e-05}, {"ticker": "AMCR", "market_cap": 13039634053.485, "weight": 0.00068379045373397}, {"ticker": "COGT", "market_cap": 798672751.9050001, "weight": 4.188191180596207e-05}, {"ticker": "NKTX", "market_cap": 64756868.88, "weight": 3.3958106931698745e-06}, {"ticker": "LINK", "market_cap": 63050442.654999994, "weight": 3.3063267430934956e-06}, {"ticker": "MMM", "market_cap": 48475975202.6, "weight": 0.002542050562387024}, {"ticker": "MODG", "market_cap": 2484444777.93, "weight": 0.0001302827682900895}, {"ticker": "HAYW", "market_cap": 2809959485.13, "weight": 0.00014735256092540355}, {"ticker": "EAF", "market_cap": 878283018.0, "weight": 4.6056625586402336e-05}, {"ticker": "XPON", "market_cap": 32747814.647899996, "weight": 1.7172754193127669e-06}, {"ticker": "NTRB", "market_cap": 18682062.75, "weight": 9.796759718954558e-07}, {"ticker": "LW", "market_cap": 13130587062.78, "weight": 0.0006885599740471322}, {"ticker": "MCFT", "market_cap": 382416376.68, "weight": 2.005368146473642e-05}, {"ticker": "VAPO", "market_cap": 14295603.16, "weight": 7.496527073598845e-07}, {"ticker": "TIL", "market_cap": 51693433.1478, "weight": 2.710772093926498e-06}, {"ticker": "NVTS", "market_cap": 1158711479.54, "weight": 6.0762123008326315e-05}, {"ticker": "AVTR", "market_cap": 13822531893.5, "weight": 0.0007248451387853596}, {"ticker": "GNRC", "market_cap": 6275296613.139999, "weight": 0.0003290727255698887}, {"ticker": "WOR", "market_cap": 2999227770.0, "weight": 0.0001572776743034219}, {"ticker": "ENTA", "market_cap": 213501674.88000003, "weight": 1.1195897564329273e-05}, {"ticker": "LAB", "market_cap": 163686071.733, "weight": 8.58359772990143e-06}, {"ticker": "AGEN", "market_cap": 381470047.93499994, "weight": 2.0004056562743703e-05}, {"ticker": "ZBH", "market_cap": 22797987019.399998, "weight": 0.0011955125292837738}, {"ticker": "PAVM", "market_cap": 31609479.232300002, "weight": 1.6575818046651583e-06}, {"ticker": "UFPT", "market_cap": 1248945762.0, "weight": 6.549395372478665e-05}, {"ticker": "CAG", "market_cap": 12641965797.175, "weight": 0.0006629369730072514}, {"ticker": "PCAR", "market_cap": 45039658934.25, "weight": 0.002361852233916258}, {"ticker": "KTRA", "market_cap": 6484238.2632, "weight": 3.4002949821492073e-07}, {"ticker": "MYO", "market_cap": 27577109.470200002, "weight": 1.4461267946595225e-06}, {"ticker": "KDP", "market_cap": 44139423940.56, "weight": 0.0023146444601184987}, {"ticker": "VIRI", "market_cap": 15782898.34, "weight": 8.27645559137557e-07}, {"ticker": "VITL", "market_cap": 458149113.84, "weight": 2.402505999366926e-05}, {"ticker": "SVFD", "market_cap": 4855263.6321, "weight": 2.5460706246617375e-07}, {"ticker": "ORMP", "market_cap": 94849245.24, "weight": 4.973836548860079e-06}, {"ticker": "LEG", "market_cap": 3237957808.7999997, "weight": 0.00016979653187882692}, {"ticker": "KTTA", "market_cap": 8457066.1272, "weight": 4.434833876975816e-07}, {"ticker": "NATR", "market_cap": 313886109.20170003, "weight": 1.645999605138135e-05}, {"ticker": "ARQT", "market_cap": 275285011.77, "weight": 1.4435778054220844e-05}, {"ticker": "MASS", "market_cap": 199825257.12, "weight": 1.0478714561554255e-05}, {"ticker": "WKSP", "market_cap": 35047978.05, "weight": 1.837894584692172e-06}, {"ticker": "TNYA", "market_cap": 143874134.96, "weight": 7.544671853623657e-06}, {"ticker": "MDT", "market_cap": 101013986437.5887, "weight": 0.00529711181589298}, {"ticker": "EVLO", "market_cap": 67052834.96, "weight": 3.516209753539319e-06}, {"ticker": "AIN", "market_cap": 2640144000.0, "weight": 0.00013844754049677712}, {"ticker": "PLX", "market_cap": 113097603.96000001, "weight": 5.930769346043458e-06}, {"ticker": "DRMA", "market_cap": 3080925.7473999998, "weight": 1.6156186639089564e-07}, {"ticker": "BURU", "market_cap": 12058100.9625, "weight": 6.323194573174591e-07}, {"ticker": "PKE", "market_cap": 316510797.93, "weight": 1.6597633126860093e-05}, {"ticker": "VTNR", "market_cap": 367798943.5175, "weight": 1.9287152188407493e-05}, {"ticker": "MBRX", "market_cap": 12845319.888700001, "weight": 6.736007374919132e-07}, {"ticker": "LCID", "market_cap": 12508923430.28, "weight": 0.0006559603124620378}, {"ticker": "LYB", "market_cap": 30140614334.79, "weight": 0.0015805554256561685}, {"ticker": "NMRD", "market_cap": 9537380.64804, "weight": 5.001344220249715e-07}, {"ticker": "IIIN", "market_cap": 626409828.765, "weight": 3.284854922137639e-05}, {"ticker": "PALI", "market_cap": 5066299.6496, "weight": 2.656736624618974e-07}, {"ticker": "HSCS", "market_cap": 4564969.64, "weight": 2.393842226410597e-07}, {"ticker": "EFHT", "market_cap": 69961552.32000001, "weight": 3.6687411171665602e-06}, {"ticker": "MLAB", "market_cap": 527418224.905, "weight": 2.765748991391124e-05}, {"ticker": "HEAR", "market_cap": 151456112.5, "weight": 7.94226612973693e-06}, {"ticker": "YMAB", "market_cap": 225516392.64, "weight": 1.1825942032977552e-05}, {"ticker": "TCRT", "market_cap": 25217715.364, "weight": 1.3224016072962642e-06}, {"ticker": "MITK", "market_cap": 491455618.5, "weight": 2.5771632776336213e-05}, {"ticker": "ADPT", "market_cap": 708761078.2, "weight": 3.716699849577671e-05}, {"ticker": "LQR", "market_cap": 5461429.6904, "weight": 2.8639404071594385e-07}, {"ticker": "GD", "market_cap": 59542393457.97, "weight": 0.0031223667836100372}, {"ticker": "SLRN", "market_cap": 894611854.8, "weight": 4.691289982528221e-05}, {"ticker": "EBS", "market_cap": 148945202.625, "weight": 7.810595547903962e-06}, {"ticker": "ITI", "market_cap": 177378237.60000002, "weight": 9.301606553798942e-06}, {"ticker": "PBAX", "market_cap": 67833808.02, "weight": 3.557163504301111e-06}, {"ticker": "IMNM", "market_cap": 93288234.82, "weight": 4.891978114873583e-06}, {"ticker": "LEGH", "market_cap": 458805920.76, "weight": 2.4059502547808456e-05}, {"ticker": "WATT", "market_cap": 7526691.435, "weight": 3.9469510649945905e-07}, {"ticker": "COCO", "market_cap": 1527996306.75, "weight": 8.012719403096819e-05}, {"ticker": "CLX", "market_cap": 16303549368.345, "weight": 0.0008549481813928139}, {"ticker": "SMLR", "market_cap": 184957704.36, "weight": 9.699069166140949e-06}, {"ticker": "VYNE", "market_cap": 12267091.540000001, "weight": 6.43278795687592e-07}, {"ticker": "CVCO", "market_cap": 2214590236.8778, "weight": 0.00011613176080695084}, {"ticker": "NUE", "market_cap": 38897710836.659996, "weight": 0.0020397722231402567}, {"ticker": "TDY", "market_cap": 18802541125.62, "weight": 0.0009859937844040295}, {"ticker": "AYI", "market_cap": 5599816687.150001, "weight": 0.00029365097038976963}, {"ticker": "USAP", "market_cap": 111229408.8, "weight": 5.83280233171773e-06}, {"ticker": "DJCO", "market_cap": 401003741.46, "weight": 2.10283915328643e-05}, {"ticker": "JCI", "market_cap": 35322216165.28, "weight": 0.001852275464133213}, {"ticker": "OMGA", "market_cap": 95941329.3, "weight": 5.031104770639926e-06}, {"ticker": "NLS", "market_cap": 27825373.038000003, "weight": 1.4591455846788792e-06}, {"ticker": "ANET", "market_cap": 57715116850.9, "weight": 0.0030265455132338238}, {"ticker": "CGRN", "market_cap": 6423578.784, "weight": 3.3684855213657977e-07}, {"ticker": "TLRY", "market_cap": 1576756024.4, "weight": 8.268412387417364e-05}, {"ticker": "BYND", "market_cap": 545946437.6263, "weight": 2.862909808417206e-05}, {"ticker": "RVLP", "market_cap": 13613818.4546, "weight": 7.139003333943168e-07}, {"ticker": "PWFL", "market_cap": 70948153.49599999, "weight": 3.7204778808690046e-06}, {"ticker": "AVNT", "market_cap": 3154123117.28, "weight": 0.00016540029180659983}, {"ticker": "TARS", "market_cap": 575308437.48, "weight": 3.016882344150541e-05}, {"ticker": "KEYS", "market_cap": 23061621353.940002, "weight": 0.0012093373529326234}, {"ticker": "UTZ", "market_cap": 1052452863.3402, "weight": 5.5189986007672824e-05}, {"ticker": "ACRV", "market_cap": 169740724.04000002, "weight": 8.901100002681737e-06}, {"ticker": "SNPX", "market_cap": 3862521.02, "weight": 2.02548245601794e-07}, {"ticker": "ALGS", "market_cap": 34802065.6, "weight": 1.8249990858557312e-06}, {"ticker": "APYX", "market_cap": 109821020.35, "weight": 5.758947300716933e-06}, {"ticker": "ECOR", "market_cap": 37083214.9314, "weight": 1.944621164968915e-06}, {"ticker": "PCTI", "market_cap": 88503174.6618, "weight": 4.6410524797446246e-06}, {"ticker": "WDC", "market_cap": 14523945760.32, "weight": 0.0007616268539992127}, {"ticker": "SHOO", "market_cap": 2355085947.23, "weight": 0.00012349927013546083}, {"ticker": "CWBR", "market_cap": 8685313.5028, "weight": 4.554525408106937e-07}, {"ticker": "FET", "market_cap": 228014347.47, "weight": 1.195693326015514e-05}, {"ticker": "QTRX", "market_cap": 975803947.21, "weight": 5.117056361254213e-05}, {"ticker": "ADIL", "market_cap": 3361627.5599999996, "weight": 1.7628169817562297e-07}, {"ticker": "ANIK", "market_cap": 273565216.62, "weight": 1.4345593045874411e-05}, {"ticker": "NXGL", "market_cap": 11306687.040000001, "weight": 5.929157696908899e-07}, {"ticker": "OXM", "market_cap": 1483152612.3, "weight": 7.77756180550398e-05}, {"ticker": "LGMK", "market_cap": 2265779.07, "weight": 1.1881607198341263e-07}, {"ticker": "TNDM", "market_cap": 1304807985.25, "weight": 6.842333462811784e-05}, {"ticker": "ENPH", "market_cap": 15840403681.41, "weight": 0.0008306611041546629}, {"ticker": "VNDA", "market_cap": 245849534.32500002, "weight": 1.2892199576831504e-05}, {"ticker": "DYN", "market_cap": 505859828.93999994, "weight": 2.652698078319341e-05}, {"ticker": "INO", "market_cap": 103570725.63815, "weight": 5.431185659595978e-06}, {"ticker": "MNPR", "market_cap": 7856241.460899999, "weight": 4.119765087852829e-07}, {"ticker": "MPX", "market_cap": 470946450.7188, "weight": 2.469614453139848e-05}, {"ticker": "TMPO", "market_cap": 4718333.3444, "weight": 2.474265217261304e-07}, {"ticker": "UFPI", "market_cap": 6210009302.28, "weight": 0.0003256490988229327}, {"ticker": "DYAI", "market_cap": 57622122.0, "weight": 3.0216689199927093e-06}, {"ticker": "HYLN", "market_cap": 200248516.585, "weight": 1.0500910029650402e-05}, {"ticker": "DNTH", "market_cap": 185166187.5, "weight": 9.71000189479819e-06}, {"ticker": "DMK", "market_cap": 5391796.521299999, "weight": 2.827425198144736e-07}, {"ticker": "TWIN", "market_cap": 190869124.76, "weight": 1.0009060445110002e-05}, {"ticker": "IMMR", "market_cap": 213599924.25, "weight": 1.1201049701345986e-05}, {"ticker": "ANAB", "market_cap": 478085859.78000003, "weight": 2.507053078651318e-05}, {"ticker": "MTEM", "market_cap": 34152837.64, "weight": 1.7909539677546958e-06}, {"ticker": "MOG.A", "market_cap": 3554128418.76, "weight": 0.00018637632575610328}, {"ticker": "CBAT", "market_cap": 69990182.737, "weight": 3.670242478765415e-06}, {"ticker": "PTGX", "market_cap": 920483872.0, "weight": 4.826961262164117e-05}, {"ticker": "ALB", "market_cap": 18480943594.75, "weight": 0.0009691294061054261}, {"ticker": "TXN", "market_cap": 142832182900.37, "weight": 0.007490032523355563}, {"ticker": "BG", "market_cap": 15730078050.54, "weight": 0.0008248756953861613}, {"ticker": "THRM", "market_cap": 1803923055.28, "weight": 9.459662436933277e-05}, {"ticker": "PRCT", "market_cap": 1541907299.985, "weight": 8.085667802852781e-05}, {"ticker": "OCUL", "market_cap": 224262608.05, "weight": 1.1760194334064819e-05}, {"ticker": "CDIO", "market_cap": 3420989.8765, "weight": 1.7939462183342963e-07}, {"ticker": "PBI", "market_cap": 611691225.7, "weight": 3.207671465708839e-05}, {"ticker": "VHI", "market_cap": 356152126.87, "weight": 1.8676400229626725e-05}, {"ticker": "NVOS", "market_cap": 72500525.685, "weight": 3.8018833312924095e-06}, {"ticker": "CDXC", "market_cap": 107296284.81, "weight": 5.626551709446987e-06}, {"ticker": "ESAB", "market_cap": 4125958995.43, "weight": 0.00021636277229872185}, {"ticker": "FLUX", "market_cap": 55058733.2881, "weight": 2.887246379972257e-06}, {"ticker": "SLDP", "market_cap": 331806223.98, "weight": 1.739971593653746e-05}, {"ticker": "AEMD", "market_cap": 5088757.2729, "weight": 2.668513265254061e-07}, {"ticker": "SNGX", "market_cap": 5726974.8426, "weight": 3.003190664770131e-07}, {"ticker": "EYE", "market_cap": 1205974668.84, "weight": 6.324057581795283e-05}, {"ticker": "ALVR", "market_cap": 227736224.0, "weight": 1.19423486350832e-05}, {"ticker": "XYL", "market_cap": 21926233331.760002, "weight": 0.0011497982977976304}, {"ticker": "LIQT", "market_cap": 21763778.0, "weight": 1.1412792393209865e-06}, {"ticker": "NTAP", "market_cap": 15663512448.099998, "weight": 0.0008213850358086896}, {"ticker": "NGVT", "market_cap": 1541893118.34, "weight": 8.085593435171683e-05}, {"ticker": "SGE", "market_cap": 16493568.607700001, "weight": 8.649126743658367e-07}, {"ticker": "KRTX", "market_cap": 6229131527.650001, "weight": 0.0003266518566540592}, {"ticker": "DAIO", "market_cap": 33562841.425, "weight": 1.760014926221674e-06}, {"ticker": "ILMN", "market_cap": 21679185000.0, "weight": 0.0011368432340147442}, {"ticker": "ETON", "market_cap": 104152787.75999999, "weight": 5.461708642125138e-06}, {"ticker": "DNOW", "market_cap": 1228869308.03, "weight": 6.44411567280913e-05}, {"ticker": "OPA", "market_cap": 125111312.42999999, "weight": 6.560760888139949e-06}, {"ticker": "ABUS", "market_cap": 311672145.1261, "weight": 1.6343897126089758e-05}, {"ticker": "TYRA", "market_cap": 615913109.44, "weight": 3.229810766446463e-05}, {"ticker": "ATEC", "market_cap": 1336145049.15, "weight": 7.006663113896927e-05}, {"ticker": "BWA", "market_cap": 9143951478.0, "weight": 0.0004795032363958064}, {"ticker": "TBLT", "market_cap": 6208400.9508, "weight": 3.255647578526446e-07}, {"ticker": "AVTX", "market_cap": 19739615.823400002, "weight": 1.0351334098068112e-06}, {"ticker": "SMG", "market_cap": 2682197471.4431996, "weight": 0.00014065279888066164}, {"ticker": "ZWS", "market_cap": 4679101592.69, "weight": 0.0002453692326034046}, {"ticker": "COP", "market_cap": 133819582707.75, "weight": 0.007017417268222124}, {"ticker": "IPSC", "market_cap": 102204588.227, "weight": 5.359546247293333e-06}, {"ticker": "TENX", "market_cap": 6860449.774999999, "weight": 3.597578003511997e-07}, {"ticker": "VEEE", "market_cap": 12852000.0, "weight": 6.739510384526675e-07}, {"ticker": "BKR", "market_cap": 33384207658.359997, "weight": 0.0017506474804910687}, {"ticker": "FNA", "market_cap": 966602863.3800001, "weight": 5.068806439046631e-05}, {"ticker": "CAL", "market_cap": 960983834.72, "weight": 5.0393405955942314e-05}, {"ticker": "CLRO", "market_cap": 18443622.0342, "weight": 9.671722862416427e-07}, {"ticker": "KOSS", "market_cap": 26365339.725, "weight": 1.3825823285730717e-06}, {"ticker": "LTRX", "market_cap": 159524669.15670002, "weight": 8.36537631784751e-06}, {"ticker": "BAX", "market_cap": 18605313343.98, "weight": 0.000975651279871817}, {"ticker": "MIRO", "market_cap": 33045769.13, "weight": 1.7328999705594929e-06}, {"ticker": "WTMA", "market_cap": 63394842.56, "weight": 3.3243868639787866e-06}, {"ticker": "MOTS", "market_cap": 2805283.628, "weight": 1.4710736183044403e-07}, {"ticker": "ECL", "market_cap": 47942704671.2, "weight": 0.0025140861810912535}, {"ticker": "CERE", "market_cap": 3168651236.32, "weight": 0.00016616213750483917}, {"ticker": "IRIX", "market_cap": 46090652.519999996, "weight": 2.4169656962974678e-06}, {"ticker": "GRTS", "market_cap": 223846401.93499997, "weight": 1.1738368739339125e-05}, {"ticker": "PMCB", "market_cap": 18258450.080000002, "weight": 9.57461981944615e-07}, {"ticker": "SRTS", "market_cap": 42618760.6, "weight": 2.234901802360382e-06}, {"ticker": "RLAY", "market_cap": 1025678946.9679999, "weight": 5.378597816901043e-05}, {"ticker": "FOXF", "market_cap": 4061781428.52, "weight": 0.0002129973398474022}, {"ticker": "PNT", "market_cap": 1310968999.83, "weight": 6.874641447359814e-05}, {"ticker": "CRBU", "market_cap": 399930035.28000003, "weight": 2.0972087035898533e-05}, {"ticker": "TFX", "market_cap": 9115304042.025, "weight": 0.0004780009823322865}, {"ticker": "HEI", "market_cap": 22098249584.879997, "weight": 0.0011588187251568708}, {"ticker": "CPS", "market_cap": 220299705.99, "weight": 1.1552382167972133e-05}, {"ticker": "VINE", "market_cap": 6958479.4662, "weight": 3.6489841754567797e-07}, {"ticker": "GLTO", "market_cap": 16950858.1644, "weight": 8.888926597075364e-07}, {"ticker": "TMCI", "market_cap": 721303555.84, "weight": 3.7824718370523626e-05}, {"ticker": "OVID", "market_cap": 254876082.73, "weight": 1.3365546267711756e-05}, {"ticker": "IMPL", "market_cap": 9739490.699505, "weight": 5.10732949807928e-07}, {"ticker": "CDTX", "market_cap": 83925098.6054, "weight": 4.400980964624327e-06}, {"ticker": "NMTC", "market_cap": 21277334.046384, "weight": 1.115770415193339e-06}, {"ticker": "RL", "market_cap": 7399572264.990001, "weight": 0.0003880290547849026}, {"ticker": "FEMY", "market_cap": 36175567.199999996, "weight": 1.8970246717284668e-06}, {"ticker": "AOUT", "market_cap": 125651281.14, "weight": 6.589076517834662e-06}, {"ticker": "ATI", "market_cap": 5142746156.365, "weight": 0.00026968247063341547}, {"ticker": "CYT", "market_cap": 108354052.24, "weight": 5.6820203880876576e-06}, {"ticker": "KNTE", "market_cap": 60752383.59, "weight": 3.1858179278676705e-06}, {"ticker": "KOP", "market_cap": 795232496.4, "weight": 4.1701506906324864e-05}, {"ticker": "GCTK", "market_cap": 4959806.6182, "weight": 2.600892328711721e-07}, {"ticker": "NBSE", "market_cap": 2803244.1502, "weight": 1.4700041285898346e-07}, {"ticker": "MTNB", "market_cap": 26441092.8142, "weight": 1.3865547743505643e-06}, {"ticker": "JBI", "market_cap": 1529938027.72, "weight": 8.022901669390912e-05}, {"ticker": "EVEX", "market_cap": 2207144152.2, "weight": 0.00011574129266961736}, {"ticker": "RGLS", "market_cap": 27473090.009999998, "weight": 1.4406720776332948e-06}, {"ticker": "CKPT", "market_cap": 37356729.05, "weight": 1.9589640784657975e-06}, {"ticker": "MAIA", "market_cap": 28866751.75, "weight": 1.5137548489470789e-06}, {"ticker": "ACRX", "market_cap": 9036085.254, "weight": 4.7384679742297977e-07}, {"ticker": "HLVX", "market_cap": 621189224.73, "weight": 3.257478393109173e-05}, {"ticker": "ONCT", "market_cap": 18156524.9258, "weight": 9.521170890472028e-07}, {"ticker": "LUCD", "market_cap": 55968899.84, "weight": 2.9349749586228867e-06}, {"ticker": "CTSO", "market_cap": 75416056.2, "weight": 3.9547719726108575e-06}, {"ticker": "OLPX", "market_cap": 1289755666.76, "weight": 6.763400023055669e-05}, {"ticker": "BF.A", "market_cap": 27799802961.99, "weight": 0.001457804705494297}, {"ticker": "EPAC", "market_cap": 1522094032.12, "weight": 7.981768235059771e-05}, {"ticker": "QRVO", "market_cap": 9163438547.550001, "weight": 0.0004805251264331253}, {"ticker": "PBYI", "market_cap": 117349119.55000001, "weight": 6.1537162295540565e-06}, {"ticker": "CRIS", "market_cap": 30044083.835, "weight": 1.5754934251445108e-06}, {"ticker": "LWAY", "market_cap": 167122246.63, "weight": 8.763788644944858e-06}, {"ticker": "PI", "market_cap": 1364197204.77, "weight": 7.15376690638786e-05}, {"ticker": "OSA", "market_cap": 14852504.868500002, "weight": 7.788562931644005e-07}, {"ticker": "EFTR", "market_cap": 31111340.779200003, "weight": 1.6314597281198774e-06}, {"ticker": "HROW", "market_cap": 482132437.42, "weight": 2.5282730848967065e-05}, {"ticker": "JILL", "market_cap": 302919281.85, "weight": 1.588490231638218e-05}, {"ticker": "WISA", "market_cap": 3224507.92785, "weight": 1.6909122832814866e-07}, {"ticker": "FNCH", "market_cap": 7462138.65, "weight": 3.913099978404362e-07}, {"ticker": "CETY", "market_cap": 71698168.95, "weight": 3.759808233660699e-06}, {"ticker": "DM", "market_cap": 415145434.445, "weight": 2.1769973284554274e-05}, {"ticker": "AOSL", "market_cap": 803760865.38, "weight": 4.2148729372118404e-05}, {"ticker": "LPX", "market_cap": 3869235111.9599996, "weight": 0.00020290032848762566}, {"ticker": "DOMH", "market_cap": 12684393.6, "weight": 6.651618611004022e-07}, {"ticker": "CNSP", "market_cap": 4554892.12, "weight": 2.388557636409798e-07}, {"ticker": "WRBY", "market_cap": 1545719432.3999999, "weight": 8.105658392642761e-05}, {"ticker": "NCR", "market_cap": 3692989000.0, "weight": 0.00019365808991163072}, {"ticker": "SNPO", "market_cap": 692488542.84, "weight": 3.631367667005856e-05}, {"ticker": "VGAS", "market_cap": 35673776.8, "weight": 1.8707110893159567e-06}, {"ticker": "EDIT", "market_cap": 574285474.665, "weight": 3.0115179895639572e-05}, {"ticker": "EAST", "market_cap": 2029792.08, "weight": 1.0644105821342982e-07}, {"ticker": "AZEK", "market_cap": 4277666762.7200003, "weight": 0.0002243182350521012}, {"ticker": "VNRX", "market_cap": 53374950.2484, "weight": 2.7989498247174482e-06}, {"ticker": "OI", "market_cap": 2522515022.58, "weight": 0.00013227914869127334}, {"ticker": "DBD", "market_cap": 1457470783.5600002, "weight": 7.642887862548126e-05}, {"ticker": "CPTN", "market_cap": 61161375.57, "weight": 3.2072652177556107e-06}, {"ticker": "HOG", "market_cap": 4431962196.88, "weight": 0.0002324093934772986}, {"ticker": "KALU", "market_cap": 1102106012.3, "weight": 5.7793766843644046e-05}, {"ticker": "ESP", "market_cap": 38356043.88, "weight": 2.011367538426866e-06}, {"ticker": "FTI", "market_cap": 8406535666.400001, "weight": 0.0004408336011639953}, {"ticker": "WVE", "market_cap": 571133415.9699999, "weight": 2.9949887860877742e-05}, {"ticker": "MRSN", "market_cap": 150634113.75, "weight": 7.899161016823042e-06}, {"ticker": "CMI", "market_cap": 31902474629.024998, "weight": 0.001672946304500566}, {"ticker": "OLN", "market_cap": 5972971233.04, "weight": 0.00031321896709891206}, {"ticker": "CAT", "market_cap": 134315576009.13, "weight": 0.007043426854320056}, {"ticker": "FCEL", "market_cap": 552017257.9250001, "weight": 2.8947448196572347e-05}, {"ticker": "FRD", "market_cap": 93194063.352, "weight": 4.887039820549648e-06}, {"ticker": "PTVE", "market_cap": 1409247851.6000001, "weight": 7.390009749634382e-05}, {"ticker": "CARA", "market_cap": 77060695.425, "weight": 4.0410158501060905e-06}, {"ticker": "SMFL", "market_cap": 1431730.4622, "weight": 7.50790718786187e-08}, {"ticker": "LVWR", "market_cap": 1500848431.68, "weight": 7.870357602636114e-05}, {"ticker": "HLIT", "market_cap": 1043047604.2800001, "weight": 5.469677996110123e-05}, {"ticker": "MBOT", "market_cap": 15570731.610000001, "weight": 8.165196652682288e-07}, {"ticker": "KRMD", "market_cap": 124594691.13, "weight": 6.533669582380396e-06}, {"ticker": "PASG", "market_cap": 34794216.414000005, "weight": 1.8245874793310108e-06}, {"ticker": "CERS", "market_cap": 270302056.245, "weight": 1.4174474906801205e-05}, {"ticker": "K", "market_cap": 18106715852.31, "weight": 0.0009495051316240042}, {"ticker": "SYRS", "market_cap": 62130138.0, "weight": 3.258066528501987e-06}, {"ticker": "MGOL", "market_cap": 12791752.1262, "weight": 6.707916767103647e-07}, {"ticker": "CYTK", "market_cap": 2571786366.42, "weight": 0.00013486290789971767}, {"ticker": "GT", "market_cap": 3415901669.8500004, "weight": 0.00017912779938123317}, {"ticker": "CODX", "market_cap": 32411444.5017, "weight": 1.6996363740796542e-06}, {"ticker": "DSGN", "market_cap": 124570311.825, "weight": 6.53239114650104e-06}, {"ticker": "PGTI", "market_cap": 1550103320.535, "weight": 8.128647234543195e-05}, {"ticker": "PRMW", "market_cap": 2191522999.035, "weight": 0.00011492212892876925}, {"ticker": "FATE", "market_cap": 172484256.0, "weight": 9.044969144719558e-06}, {"ticker": "EW", "market_cap": 42937128269.0, "weight": 0.0022515968086731977}, {"ticker": "IART", "market_cap": 3044503279.4, "weight": 0.00015965189439185977}, {"ticker": "CETX", "market_cap": 4680688.959000001, "weight": 2.454524731241819e-07}, {"ticker": "NPWR", "market_cap": 1054070338.72, "weight": 5.527480542969958e-05}, {"ticker": "CC", "market_cap": 3969205459.275, "weight": 0.00020814271250469836}, {"ticker": "BGS", "market_cap": 611586707.58, "weight": 3.207123379064651e-05}, {"ticker": "EMBC", "market_cap": 744086674.66, "weight": 3.901945122050258e-05}, {"ticker": "VERO", "market_cap": 11108226.809999999, "weight": 5.825086363186478e-07}, {"ticker": "MGNX", "market_cap": 287755306.72999996, "weight": 1.5089712713270256e-05}, {"ticker": "LABP", "market_cap": 11625399.17, "weight": 6.096288393283753e-07}, {"ticker": "QNCX", "market_cap": 42204267.239999995, "weight": 2.2131660234618654e-06}, {"ticker": "GURE", "market_cap": 19299059.400000002, "weight": 1.012030899765773e-06}, {"ticker": "ENSC", "market_cap": 3579326.131, "weight": 1.8769767841178172e-07}, {"ticker": "UCTT", "market_cap": 1314403447.896, "weight": 6.892651483467755e-05}, {"ticker": "GSIT", "market_cap": 60450374.63, "weight": 3.1699807622736764e-06}, {"ticker": "ODC", "market_cap": 434118307.92, "weight": 2.2764899193432842e-05}, {"ticker": "CLPT", "market_cap": 114560552.7, "weight": 6.00748548536232e-06}, {"ticker": "FBIO", "market_cap": 42574625.9904, "weight": 2.2325874103613454e-06}, {"ticker": "IGC", "market_cap": 18337037.0204, "weight": 9.615830331499835e-07}, {"ticker": "MRTX", "market_cap": 2941433564.055, "weight": 0.00015424698140634904}, {"ticker": "AIRG", "market_cap": 37371995.7328, "weight": 1.9597646539969826e-06}, {"ticker": "SKX", "market_cap": 7499380342.26, "weight": 0.00039326292945982325}, {"ticker": "BRCC", "market_cap": 198860073.775, "weight": 1.0428100935841529e-05}, {"ticker": "INM", "market_cap": 2263169.8800000004, "weight": 1.1867924765178953e-07}, {"ticker": "SILK", "market_cap": 573174961.92, "weight": 3.0056945284862442e-05}, {"ticker": "KNDI", "market_cap": 263992123.72, "weight": 1.3843585895146209e-05}, {"ticker": "NOV", "market_cap": 7546732486.99, "weight": 0.00039574604703792346}, {"ticker": "HYPR", "market_cap": 124989000.6694, "weight": 6.55434693404165e-06}, {"ticker": "LTHM", "market_cap": 3043480112.7149997, "weight": 0.0001595982401551755}, {"ticker": "BIRD", "market_cap": 158004015.52, "weight": 8.28563416895389e-06}, {"ticker": "SKYT", "market_cap": 270758779.2, "weight": 1.4198425179895464e-05}, {"ticker": "FRZA", "market_cap": 11364480.0, "weight": 5.959463972513671e-07}, {"ticker": "CHX", "market_cap": 6548143188.93, "weight": 0.00034338063352911107}, {"ticker": "OCC", "market_cap": 24549347.91, "weight": 1.2873528258076815e-06}, {"ticker": "RNA", "market_cap": 429387519.565, "weight": 2.2516819538550175e-05}, {"ticker": "CL", "market_cap": 58189990034.781, "weight": 0.0030514475732563826}, {"ticker": "SSD", "market_cap": 6228848940.44, "weight": 0.00032663703795318515}, {"ticker": "UFI", "market_cap": 123517285.26, "weight": 6.4771710759283665e-06}, {"ticker": "ITW", "market_cap": 69953707052.12761, "weight": 0.003668329716106061}, {"ticker": "ATXI", "market_cap": 5994423.3, "weight": 3.143439004014835e-07}, {"ticker": "ALBT", "market_cap": 8157290.25, "weight": 4.2776332360312165e-07}, {"ticker": "LNSR", "market_cap": 33401228.85, "weight": 1.7515400613953234e-06}, {"ticker": "BLBD", "market_cap": 667910897.125, "weight": 3.5024839924622355e-05}, {"ticker": "AMAT", "market_cap": 115943591887.2, "weight": 0.0060800112164885395}, {"ticker": "SEE", "market_cap": 4601575000.0, "weight": 0.00024130378538498548}, {"ticker": "NAII", "market_cap": 38694406.615, "weight": 2.0291110738008883e-06}, {"ticker": "LBPH", "market_cap": 100875692.0859, "weight": 5.289859744469641e-06}, {"ticker": "KWR", "market_cap": 2807718210.3999996, "weight": 0.00014723502984605858}, {"ticker": "KNSA", "market_cap": 1136563413.8040001, "weight": 5.9600691954599656e-05}, {"ticker": "HYZN", "market_cap": 288926545.9, "weight": 1.5151131780722634e-05}, {"ticker": "KTOS", "market_cap": 1883110330.13, "weight": 9.874915674697004e-05}, {"ticker": "CBIO", "market_cap": 16705154.9908, "weight": 8.76008135197823e-07}, {"ticker": "FTCI", "market_cap": 132282165.12000002, "weight": 6.936796027963838e-06}, {"ticker": "CTLP", "market_cap": 494691278.325, "weight": 2.594130880334666e-05}, {"ticker": "QURE", "market_cap": 286223892.0, "weight": 1.5009406259209785e-05}, {"ticker": "YCBD", "market_cap": 2715238.5345, "weight": 1.4238545206761391e-07}, {"ticker": "SRM", "market_cap": 18333000.0, "weight": 9.61371334263364e-07}, {"ticker": "OSS", "market_cap": 39237175.839999996, "weight": 2.0575735607934884e-06}, {"ticker": "CAMP", "market_cap": 16062386.535, "weight": 8.423017495558196e-07}, {"ticker": "CLW", "market_cap": 604326965.1199999, "weight": 3.169053732551921e-05}, {"ticker": "MRNS", "market_cap": 417144000.0, "weight": 2.1874776842849327e-05}, {"ticker": "ALPN", "market_cap": 576150115.37, "weight": 3.0212960516513824e-05}, {"ticker": "AQMS", "market_cap": 108807617.14, "weight": 5.70580505470458e-06}, {"ticker": "MATV", "market_cap": 744570082.14, "weight": 3.904480081380648e-05}, {"ticker": "SAGE", "market_cap": 1174204354.344, "weight": 6.157455991019163e-05}, {"ticker": "CAAS", "market_cap": 105951814.02, "weight": 5.556048481537729e-06}, {"ticker": "UEIC", "market_cap": 114500302.05, "weight": 6.004325978037783e-06}, {"ticker": "PLUR", "market_cap": 22747663.687000003, "weight": 1.192873604437106e-06}, {"ticker": "PRTA", "market_cap": 2464229859.0, "weight": 0.00012922271027537507}, {"ticker": "SES", "market_cap": 825579606.85, "weight": 4.3292890862270656e-05}, {"ticker": "MYE", "market_cap": 644719163.16, "weight": 3.380867954575294e-05}, {"ticker": "GTES", "market_cap": 3027748615.485, "weight": 0.0001587732900388844}, {"ticker": "COO", "market_cap": 15530030264.164999, "weight": 0.0008143853115262493}, {"ticker": "GBX", "market_cap": 1180202672.6650002, "weight": 6.188910806311784e-05}, {"ticker": "LPTX", "market_cap": 44992572.0986, "weight": 2.359383028984437e-06}, {"ticker": "MAT", "market_cap": 7527234881.205, "weight": 0.00039472360448686983}, {"ticker": "VMI", "market_cap": 4879797434.94, "weight": 0.0002558936001179953}, {"ticker": "PMVP", "market_cap": 274785934.522, "weight": 1.4409606747843807e-05}, {"ticker": "DE", "market_cap": 108221976819.29, "weight": 0.005675094433610411}, {"ticker": "NWSA", "market_cap": 11234419888.12, "weight": 0.0005891261243395405}, {"ticker": "OEC", "market_cap": 1199340811.5500002, "weight": 6.28927003892614e-05}, {"ticker": "THRX", "market_cap": 108140715.45690002, "weight": 5.670833137347666e-06}, {"ticker": "RVNC", "market_cap": 913856159.23, "weight": 4.7922059407829506e-05}, {"ticker": "RPRX", "market_cap": 11999808124.92, "weight": 0.0006292626164816831}, {"ticker": "TNC", "market_cap": 1395615893.3999999, "weight": 7.318524592576853e-05}, {"ticker": "CSL", "market_cap": 12655469950.4, "weight": 0.0006636451225629169}, {"ticker": "TBPH", "market_cap": 459474004.79999995, "weight": 2.40945364672398e-05}, {"ticker": "GEHC", "market_cap": 30586732728.717503, "weight": 0.001603949602038076}, {"ticker": "MBUU", "market_cap": 1003318963.35, "weight": 5.261343427085173e-05}, {"ticker": "SLDB", "market_cap": 49147095.550000004, "weight": 2.5772437039258463e-06}, {"ticker": "CRDF", "market_cap": 54635709.97010001, "weight": 2.865063295280708e-06}, {"ticker": "PLOW", "market_cap": 681001092.571, "weight": 3.571128178693017e-05}, {"ticker": "NEOG", "market_cap": 3725949774.9500003, "weight": 0.00019538653283924956}, {"ticker": "ARVN", "market_cap": 962730414.0, "weight": 5.0484995507723815e-05}, {"ticker": "VCNX", "market_cap": 4803857.8328, "weight": 2.519113737157283e-07}, {"ticker": "OGN", "market_cap": 4164485790.6950006, "weight": 0.00021838309393559552}, {"ticker": "RLYB", "market_cap": 139107150.08, "weight": 7.294694075055017e-06}, {"ticker": "RCKY", "market_cap": 102795334.955, "weight": 5.390524645270156e-06}, {"ticker": "TCRX", "market_cap": 127197917.56, "weight": 6.670181188031341e-06}, {"ticker": "TPR", "market_cap": 6346303358.04, "weight": 0.0003327962759482344}, {"ticker": "GOVX", "market_cap": 14649781.546000002, "weight": 7.682256058225511e-07}, {"ticker": "STRO", "market_cap": 190962820.665, "weight": 1.0013973801200378e-05}, {"ticker": "LECO", "market_cap": 10335698454.325, "weight": 0.000541997720699188}, {"ticker": "CMRA", "market_cap": 8606582.88, "weight": 4.5132395498793576e-07}, {"ticker": "CTKB", "market_cap": 743163133.6, "weight": 3.897102129080754e-05}, {"ticker": "RANI", "market_cap": 51063544.0, "weight": 2.6777410913378055e-06}, {"ticker": "BIO", "market_cap": 10301416463.83, "weight": 0.0005401999940345186}, {"ticker": "INSM", "market_cap": 3461985000.0, "weight": 0.0001815443810969155}, {"ticker": "REVG", "market_cap": 945090620.0450001, "weight": 4.9559975475506006e-05}, {"ticker": "GPRE", "market_cap": 1691967269.78, "weight": 8.87257312866601e-05}, {"ticker": "WKHS", "market_cap": 83393620.2009, "weight": 4.373110561369741e-06}, {"ticker": "DRRX", "market_cap": 62100177.75, "weight": 3.2564954312719993e-06}, {"ticker": "ADM", "market_cap": 39258723316.89, "weight": 0.0020587034973345757}, {"ticker": "QSI", "market_cap": 215409061.76, "weight": 1.1295919768539276e-05}, {"ticker": "PCCT", "market_cap": 87706248.0, "weight": 4.599262131838406e-06}, {"ticker": "CPB", "market_cap": 11893973182.4, "weight": 0.0006237126966702971}, {"ticker": "TIVC", "market_cap": 2404251.48, "weight": 1.2607748067595415e-07}, {"ticker": "LFUS", "market_cap": 5983669848.509999, "weight": 0.0003137799959664822}, {"ticker": "BE", "market_cap": 2713920220.0, "weight": 0.0001423163204595932}, {"ticker": "ALV", "market_cap": 7860295692.12, "weight": 0.0004121891101968023}, {"ticker": "RXRX", "market_cap": 1501892325.2849998, "weight": 7.875831717008381e-05}, {"ticker": "VVV", "market_cap": 4344303362.23, "weight": 0.0002278126176726053}, {"ticker": "FLO", "market_cap": 4636356587.52, "weight": 0.00024312771061282059}, {"ticker": "ISPR", "market_cap": 498917420.94500005, "weight": 2.6162925143791583e-05}, {"ticker": "ELIQ", "market_cap": 65949221.01, "weight": 3.4583369113627433e-06}, {"ticker": "ESPR", "market_cap": 97364784.79, "weight": 5.105749908025287e-06}, {"ticker": "ORIC", "market_cap": 320106444.18, "weight": 1.678618662235464e-05}, {"ticker": "WOLF", "market_cap": 4321415835.0, "weight": 0.00022661240970930994}, {"ticker": "NTGR", "market_cap": 346333142.65999997, "weight": 1.8161498688630783e-05}, {"ticker": "MNMD", "market_cap": 118952019.66000001, "weight": 6.237771333325485e-06}, {"ticker": "LEE", "market_cap": 63760116.0, "weight": 3.3435415803036523e-06}, {"ticker": "JAKK", "market_cap": 180764722.48, "weight": 9.479191754668864e-06}, {"ticker": "CGEM", "market_cap": 346150616.4, "weight": 1.8151927122923355e-05}, {"ticker": "SPLP", "market_cap": 929277880.2240999, "weight": 4.8730765047317593e-05}, {"ticker": "PTCT", "market_cap": 1573956026.39, "weight": 8.253729368692614e-05}, {"ticker": "NEOV", "market_cap": 76588343.37, "weight": 4.016245996543805e-06}, {"ticker": "AVAV", "market_cap": 2811499653.6, "weight": 0.0001474333264202486}, {"ticker": "SRRK", "market_cap": 374788752.715, "weight": 1.9653693517946955e-05}, {"ticker": "EXEL", "market_cap": 6912046842.35, "weight": 0.00036246351908148644}, {"ticker": "ATRI", "market_cap": 724183957.5, "weight": 3.797576487611947e-05}, {"ticker": "INSG", "market_cap": 46760894.9019, "weight": 2.452112797861154e-06}, {"ticker": "WWD", "market_cap": 7511116032.0, "weight": 0.00039387834186934947}, {"ticker": "MRUS", "market_cap": 1211585928.0, "weight": 6.353482682463733e-05}, {"ticker": "REX", "market_cap": 672318845.4499999, "weight": 3.525599004531014e-05}, {"ticker": "SWK", "market_cap": 11947346764.59, "weight": 0.0006265115747548668}, {"ticker": "SRZN", "market_cap": 14367403.955, "weight": 7.534178972409907e-07}, {"ticker": "PRAX", "market_cap": 203093552.34, "weight": 1.0650101968766275e-05}, {"ticker": "KMB", "market_cap": 40703965977.96, "weight": 0.0021344911406775747}, {"ticker": "NVAX", "market_cap": 720385247.9705, "weight": 3.7776562866145415e-05}, {"ticker": "ANIP", "market_cap": 1167362732.88, "weight": 6.121578945498133e-05}, {"ticker": "ROP", "market_cap": 51918053690.46999, "weight": 0.0027225510581336443}, {"ticker": "SDGR", "market_cap": 1970240201.63, "weight": 0.00010331819404682008}, {"ticker": "ICHR", "market_cap": 877572990.0, "weight": 4.601939215130037e-05}, {"ticker": "QMCO", "market_cap": 56012182.32480001, "weight": 2.937244665717329e-06}, {"ticker": "GNTX", "market_cap": 7415088472.885, "weight": 0.0003888427152598234}, {"ticker": "HII", "market_cap": 7988670890.28, "weight": 0.00041892102726118907}, {"ticker": "ROCK", "market_cap": 1972669919.88, "weight": 0.00010344560698937648}, {"ticker": "EOSE", "market_cap": 284068352.72, "weight": 1.4896371094552027e-05}, {"ticker": "LCUT", "market_cap": 111361674.78000002, "weight": 5.839738279007877e-06}, {"ticker": "VIAV", "market_cap": 1891286396.285, "weight": 9.91779046675754e-05}, {"ticker": "NAOV", "market_cap": 7255145.6546, "weight": 3.8045541145681825e-07}, {"ticker": "CE", "market_cap": 13140096461.59, "weight": 0.0006890586411186432}, {"ticker": "DD", "market_cap": 33708850478.31, "weight": 0.0017676715518909682}, {"ticker": "CARM", "market_cap": 163153622.25, "weight": 8.5556764038828e-06}, {"ticker": "THS", "market_cap": 2450774438.2799997, "weight": 0.00012851711622253803}, {"ticker": "VSAT", "market_cap": 2102107823.4750001, "weight": 0.00011023325167837325}, {"ticker": "BCRX", "market_cap": 1190968124.4750001, "weight": 6.245364178757798e-05}, {"ticker": "MOD", "market_cap": 2373136989.84, "weight": 0.0001244458557962267}, {"ticker": "GENC", "market_cap": 203742057.8, "weight": 1.068410919940814e-05}, {"ticker": "FLGC", "market_cap": 8791221.65, "weight": 4.610062994308336e-07}, {"ticker": "ZNTL", "market_cap": 1378295624.6399999, "weight": 7.227698159982072e-05}, {"ticker": "VISL", "market_cap": 8320301.5, "weight": 4.363115340930818e-07}, {"ticker": "HOTH", "market_cap": 5545998.72, "weight": 2.908287890290355e-07}, {"ticker": "TSLA", "market_cap": 819303191766.71, "weight": 0.042963759484808524}, {"ticker": "AKBA", "market_cap": 214677739.98, "weight": 1.1257569700606344e-05}, {"ticker": "MLI", "market_cap": 4113401548.2, "weight": 0.00021570426742780892}, {"ticker": "JBT", "market_cap": 3282487799.2999997, "weight": 0.00017213165741102133}, {"ticker": "ON", "market_cap": 38664994278.399994, "weight": 0.002027568708815291}, {"ticker": "QUIK", "market_cap": 120154512.84, "weight": 6.30082934199287e-06}, {"ticker": "UTMD", "market_cap": 312175445.25, "weight": 1.6370289877502438e-05}, {"ticker": "RENB", "market_cap": 293013722.24, "weight": 1.5365460814233542e-05}, {"ticker": "MPAA", "market_cap": 148238860.57500002, "weight": 7.773555401771044e-06}, {"ticker": "VTYX", "market_cap": 1719542331.2, "weight": 9.017175068281674e-05}, {"ticker": "XOMA", "market_cap": 154882908.0, "weight": 8.121965194924445e-06}, {"ticker": "PEP", "market_cap": 231912535535.17, "weight": 0.012161351863843681}, {"ticker": "TECH", "market_cap": 10528383440.3391, "weight": 0.0005521020038005294}, {"ticker": "BDTX", "market_cap": 132806456.72500001, "weight": 6.964289559837613e-06}, {"ticker": "VTAK", "market_cap": 2551538.1473999997, "weight": 1.338011036486014e-07}, {"ticker": "MU", "market_cap": 74179301401.79999, "weight": 0.0038899173055895204}, {"ticker": "NEXI", "market_cap": 4957513.5351, "weight": 2.5996898499251476e-07}, {"ticker": "PSX", "market_cap": 48946049045.76, "weight": 0.0025667009479104536}, {"ticker": "THR", "market_cap": 901806584.93, "weight": 4.729018708349106e-05}, {"ticker": "NXPI", "market_cap": 50725792391.174995, "weight": 0.0026600296030475264}, {"ticker": "AWH", "market_cap": 49431358.82700001, "weight": 2.59215029673071e-06}, {"ticker": "IMGN", "market_cap": 3747843278.43, "weight": 0.00019653461480359074}, {"ticker": "DELL", "market_cap": 48610653276.384995, "weight": 0.002549112998403535}, {"ticker": "NUWE", "market_cap": 1845808.7765, "weight": 9.67930860338642e-08}, {"ticker": "CMPX", "market_cap": 253644098.54, "weight": 1.330094176847368e-05}, {"ticker": "SUPN", "market_cap": 1469681274.92, "weight": 7.70691893422638e-05}, {"ticker": "DBVT", "market_cap": 238311215.1636, "weight": 1.2496894719454194e-05}, {"ticker": "ISUN", "market_cap": 7159332.848, "weight": 3.754310463381492e-07}, {"ticker": "PRPH", "market_cap": 73449379.9487, "weight": 3.851640669944825e-06}, {"ticker": "KALA", "market_cap": 22553890.919999998, "weight": 1.1827122787645647e-06}, {"ticker": "EIGR", "market_cap": 13630007.510899998, "weight": 7.147492776290625e-07}, {"ticker": "BKTI", "market_cap": 41701670.5, "weight": 2.1868101570717376e-06}, {"ticker": "BJDX", "market_cap": 4684724.1, "weight": 2.456640734562121e-07}, {"ticker": "ALKS", "market_cap": 4668641342.05, "weight": 0.00024482070344208315}, {"ticker": "IMVT", "market_cap": 4709327704.29, "weight": 0.00024695427145348287}, {"ticker": "BERY", "market_cap": 7054113000.0, "weight": 0.0003699133817080969}, {"ticker": "PRLB", "market_cap": 674045060.2199999, "weight": 3.5346511694612494e-05}, {"ticker": "BMEA", "market_cap": 435596016.59999996, "weight": 2.284238933499964e-05}, {"ticker": "SHLS", "market_cap": 2754719311.21, "weight": 0.00014445579990939904}, {"ticker": "DAKT", "market_cap": 403447441.79999995, "weight": 2.115653768768924e-05}, {"ticker": "LCTX", "market_cap": 204716906.40289998, "weight": 1.0735229665347959e-05}, {"ticker": "JEWL", "market_cap": 14616884.6187, "weight": 7.665005110267419e-07}, {"ticker": "THO", "market_cap": 4964095404.1, "weight": 0.00026031413418699885}, {"ticker": "LITE", "market_cap": 2884677034.825, "weight": 0.00015127070364308047}, {"ticker": "IMO", "market_cap": 33419376996.78, "weight": 0.0017524917391395166}, {"ticker": "TRNS", "market_cap": 812342545.7700001, "weight": 4.2598747455724804e-05}, {"ticker": "PODD", "market_cap": 10539497762.099998, "weight": 0.0005526848320523544}, {"ticker": "BOOM", "market_cap": 438570859.93, "weight": 2.2998388304147438e-05}, {"ticker": "DCO", "market_cap": 627657894.12, "weight": 3.291399700709527e-05}, {"ticker": "SGMT", "market_cap": 155782080.09, "weight": 8.169117230701223e-06}, {"ticker": "GLSI", "market_cap": 108935736.5855, "weight": 5.712523560255522e-06}, {"ticker": "CVKD", "market_cap": 9117230.075399999, "weight": 4.781019823473172e-07}, {"ticker": "AYTU", "market_cap": 16349435.68, "weight": 8.573544315788277e-07}, {"ticker": "ACXP", "market_cap": 20418050.96, "weight": 1.0707101344282201e-06}, {"ticker": "VBIV", "market_cap": 13952026.75, "weight": 7.316357700499452e-07}, {"ticker": "ARLO", "market_cap": 893992233.215, "weight": 4.688040724742208e-05}, {"ticker": "PRGO", "market_cap": 4065964492.59, "weight": 0.0002132166971749692}, {"ticker": "FBIN", "market_cap": 7599473242.8, "weight": 0.00039851174009324}, {"ticker": "DGLY", "market_cap": 6128045.376, "weight": 3.213509605384584e-07}, {"ticker": "CTS", "market_cap": 1309086989.75, "weight": 6.864772301329669e-05}, {"ticker": "UNCY", "market_cap": 30581954.48, "weight": 1.6036990335907413e-06}, {"ticker": "ZTS", "market_cap": 78424006978.088, "weight": 0.004112507076136138}, {"ticker": "ADMA", "market_cap": 742191205.8, "weight": 3.8920053989989684e-05}, {"ticker": "MLTX", "market_cap": 3108385963.15, "weight": 0.00016300186335018967}, {"ticker": "FWBI", "market_cap": 3971726.3049999997, "weight": 2.0827490411644302e-07}, {"ticker": "HAS", "market_cap": 8603460337.614, "weight": 0.0004511602107704087}, {"ticker": "GES", "market_cap": 1121045939.44, "weight": 5.8786965066817166e-05}, {"ticker": "BWV", "market_cap": 7792218.1068, "weight": 4.0861916315962796e-07}, {"ticker": "BGXX", "market_cap": 67761491.0052, "weight": 3.553371244168661e-06}, {"ticker": "PHGE", "market_cap": 16460743.34, "weight": 8.631913373557291e-07}, {"ticker": "BYRN", "market_cap": 57140270.2, "weight": 2.9964009055988184e-06}, {"ticker": "HLTH", "market_cap": 69064717.6736, "weight": 3.621711655505993e-06}, {"ticker": "SCWO", "market_cap": 169813896.96, "weight": 8.904937145960651e-06}, {"ticker": "IONS", "market_cap": 6266221813.76, "weight": 0.00032859684862731947}, {"ticker": "MORF", "market_cap": 1014519748.4000001, "weight": 5.320079660480229e-05}, {"ticker": "PCT", "market_cap": 835538868.0649999, "weight": 4.381514844381988e-05}, {"ticker": "NVCT", "market_cap": 188683140.14999998, "weight": 9.894428745923022e-06}, {"ticker": "ACHV", "market_cap": 87377846.39999999, "weight": 4.582040952306074e-06}, {"ticker": "AA", "market_cap": 4812768001.8895, "weight": 0.0002523786175463117}, {"ticker": "XRAY", "market_cap": 6987686778.030001, "weight": 0.0003664300311574302}, {"ticker": "BLPH", "market_cap": 4484488.7568, "weight": 2.3516385423083347e-07}, {"ticker": "LEDS", "market_cap": 9137509.238, "weight": 4.791654092608888e-07}, {"ticker": "PFIE", "market_cap": 95582048.496, "weight": 5.012264304490541e-06}, {"ticker": "SXC", "market_cap": 800709434.5200001, "weight": 4.198871419962669e-05}, {"ticker": "SMCI", "market_cap": 14583836435.637299, "weight": 0.0007647674844710245}, {"ticker": "ATMU", "market_cap": 1759249451.52, "weight": 9.225396784540847e-05}, {"ticker": "ADOC", "market_cap": 41605872.879999995, "weight": 2.1817865883291062e-06}, {"ticker": "GEVO", "market_cap": 252834327.05999997, "weight": 1.3258477846138217e-05}, {"ticker": "VIRX", "market_cap": 35972322.0696, "weight": 1.8863666210987185e-06}, {"ticker": "KOD", "market_cap": 85236389.875, "weight": 4.469744278728033e-06}, {"ticker": "RUN", "market_cap": 2227215326.0350003, "weight": 0.00011679381277925497}, {"ticker": "BCLI", "market_cap": 8922131.559999999, "weight": 4.678711352375753e-07}, {"ticker": "SMID", "market_cap": 100712873.08, "weight": 5.281321615142989e-06}, {"ticker": "APTO", "market_cap": 19120802.58, "weight": 1.002683220886978e-06}, {"ticker": "INTS", "market_cap": 62263915.349999994, "weight": 3.2650817311127826e-06}, {"ticker": "IPAR", "market_cap": 4198565349.3500004, "weight": 0.00022017020519808742}, {"ticker": "FREY", "market_cap": 655217547.46, "weight": 3.435920841293783e-05}, {"ticker": "VRT", "market_cap": 14395364971.65, "weight": 0.000754884155893921}, {"ticker": "LSF", "market_cap": 8596151.56, "weight": 4.507769429317241e-07}, {"ticker": "CRDO", "market_cap": 2380205912.505, "weight": 0.0001248165457877314}, {"ticker": "RLMD", "market_cap": 89996616.97000001, "weight": 4.7193676831744836e-06}, {"ticker": "RIVN", "market_cap": 22029949044.885, "weight": 0.0011552370865125735}, {"ticker": "LNN", "market_cap": 1256946295.375, "weight": 6.591349681350877e-05}, {"ticker": "MITQ", "market_cap": 9265638.1038, "weight": 4.858844088066149e-07}, {"ticker": "PLAB", "market_cap": 1259019871.1778, "weight": 6.602223386343152e-05}, {"ticker": "HEPA", "market_cap": 17661119.1757, "weight": 9.261383137799047e-07}, {"ticker": "NXT", "market_cap": 2193053924.48, "weight": 0.00011500240972502287}, {"ticker": "OCGN", "market_cap": 102646863.3828, "weight": 5.382738886612756e-06}, {"ticker": "CR", "market_cap": 4946257762.1173, "weight": 0.00025937873912492386}, {"ticker": "ACA", "market_cap": 3456233052.64, "weight": 0.00018124275248686283}, {"ticker": "NNVC", "market_cap": 14974076.16, "weight": 7.852314175148873e-07}, {"ticker": "SINT", "market_cap": 3155600.9471, "weight": 1.654777883006743e-07}, {"ticker": "MWA", "market_cap": 1982670714.85, "weight": 0.0001039700425756964}, {"ticker": "MRVI", "market_cap": 1259870007.5500002, "weight": 6.606681449608564e-05}, {"ticker": "OCEA", "market_cap": 78659265.726, "weight": 4.124843901335357e-06}, {"ticker": "BSX", "market_cap": 74843772088.24501, "weight": 0.003924761742965102}, {"ticker": "SONM", "market_cap": 28670218.29, "weight": 1.503448754218033e-06}, {"ticker": "ATRC", "market_cap": 1939925362.03, "weight": 0.00010172850235455846}, {"ticker": "MNTS", "market_cap": 2794987.22, "weight": 1.465674244771969e-07}, {"ticker": "NTLA", "market_cap": 2525089258.25, "weight": 0.00013241414003915838}, {"ticker": "SKY", "market_cap": 3440001532.32, "weight": 0.00018039158146481728}, {"ticker": "NVEC", "market_cap": 386768748.02, "weight": 2.028191716224067e-05}, {"ticker": "KURA", "market_cap": 595375551.06, "weight": 3.1221130633848124e-05}, {"ticker": "RNXT", "market_cap": 10906941.6, "weight": 5.719533627188452e-07}, {"ticker": "EMAN", "market_cap": 164296134.1, "weight": 8.615589028202126e-06}, {"ticker": "PL", "market_cap": 734145670.5799999, "weight": 3.84981510319733e-05}, {"ticker": "SPWR", "market_cap": 941655425.125, "weight": 4.937983594985853e-05}, {"ticker": "ERNA", "market_cap": 11469901.72, "weight": 6.014746479259289e-07}, {"ticker": "SYPR", "market_cap": 43372270.35, "weight": 2.2744153939022985e-06}, {"ticker": "INKT", "market_cap": 38649336.32, "weight": 2.0267476150303763e-06}, {"ticker": "IMMX", "market_cap": 85219124.03, "weight": 4.468838868350854e-06}, {"ticker": "ARMP", "market_cap": 98627545.38, "weight": 5.171968302901384e-06}, {"ticker": "DOOR", "market_cap": 1974807752.75, "weight": 0.00010355771364069726}, {"ticker": "ZVIA", "market_cap": 102700539.19999999, "weight": 5.385553613716844e-06}, {"ticker": "MCRB", "market_cap": 255768204.93, "weight": 1.3412328611558371e-05}, {"ticker": "MRAM", "market_cap": 209037815.6661, "weight": 1.0961815510741158e-05}, {"ticker": "A", "market_cap": 32474261430.269997, "weight": 0.0017029304554866068}, {"ticker": "CYTH", "market_cap": 22499769.1674, "weight": 1.1798741670801851e-06}, {"ticker": "ABCL", "market_cap": 1283293270.145, "weight": 6.729511609504686e-05}, {"ticker": "HOWL", "market_cap": 71316100.0, "weight": 3.739772771039082e-06}, {"ticker": "AIR", "market_cap": 2075345823.6, "weight": 0.00010882986873355326}, {"ticker": "LSDI", "market_cap": 8117296.16, "weight": 4.2566605792560305e-07}, {"ticker": "SOVO", "market_cap": 2277371634.875, "weight": 0.0001194239790123448}, {"ticker": "VPG", "market_cap": 448936587.0, "weight": 2.3541960707130897e-05}, {"ticker": "NERV", "market_cap": 44268259.980000004, "weight": 2.3214005434184303e-06}, {"ticker": "DMAC", "market_cap": 87663164.82000001, "weight": 4.597002876166072e-06}, {"ticker": "INTC", "market_cap": 150076980000.0, "weight": 0.007869945262903844}, {"ticker": "DNLI", "market_cap": 2839828337.115, "weight": 0.00014891886529925038}, {"ticker": "TSBX", "market_cap": 47740080.95999999, "weight": 2.5034607173051986e-06}, {"ticker": "BNGO", "market_cap": 95794272.4, "weight": 5.023393196529545e-06}, {"ticker": "ICPT", "market_cap": 778469335.7, "weight": 4.0822456987128325e-05}, {"ticker": "ICUI", "market_cap": 2845377596.41, "weight": 0.000149209865070843}, {"ticker": "EQ", "market_cap": 25317969.400000002, "weight": 1.327658867774888e-06}, {"ticker": "UAMY", "market_cap": 38817622.510199994, "weight": 2.035572440165961e-06}, {"ticker": "URGN", "market_cap": 421131539.63, "weight": 2.208388098808039e-05}, {"ticker": "OMCL", "market_cap": 1992494690.94, "weight": 0.00010448520588783379}, {"ticker": "NBN", "market_cap": 335202401.82, "weight": 1.7577809430315696e-05}, {"ticker": "AZTR", "market_cap": 17541582.349999998, "weight": 9.198698755746562e-07}, {"ticker": "GHSI", "market_cap": 9142265.28, "weight": 4.794148132015069e-07}, {"ticker": "KN", "market_cap": 1336628461.1399999, "weight": 7.00919809687748e-05}, {"ticker": "AKYA", "market_cap": 190869381.29999998, "weight": 1.0009073897911076e-05}, {"ticker": "ANIX", "market_cap": 110298578.1, "weight": 5.783990137748805e-06}, {"ticker": "MSA", "market_cap": 6177713972.65, "weight": 0.0003239555514418784}, {"ticker": "ALEC", "market_cap": 506754163.5, "weight": 2.657387914184857e-05}, {"ticker": "FATH", "market_cap": 20096988.450000003, "weight": 1.0538738122976009e-06}, {"ticker": "CAPR", "market_cap": 74495145.63000001, "weight": 3.906479984206443e-06}, {"ticker": "SLAB", "market_cap": 3614534130.34, "weight": 0.00018954396441528575}, {"ticker": "AVXL", "market_cap": 519111142.85599995, "weight": 2.7221871599762852e-05}, {"ticker": "PSTG", "market_cap": 10684494061.75, "weight": 0.0005602883495376417}, {"ticker": "XENE", "market_cap": 2148554292.8849998, "weight": 0.0001126688761952834}, {"ticker": "SCS", "market_cap": 1251827508.7, "weight": 6.564507076345944e-05}, {"ticker": "PDEX", "market_cap": 53888696.8, "weight": 2.8258903804249096e-06}, {"ticker": "LULU", "market_cap": 46681697617.82, "weight": 0.0024479597406056024}, {"ticker": "CLAR", "market_cap": 287697361.995, "weight": 1.5086674126721385e-05}, {"ticker": "STIM", "market_cap": 33493130.08, "weight": 1.7563593058237062e-06}, {"ticker": "CRVS", "market_cap": 70016286.0738, "weight": 3.67161132182046e-06}, {"ticker": "RVMD", "market_cap": 2694630219.2200003, "weight": 0.00014130476458833319}, {"ticker": "KSCP", "market_cap": 58554830.204, "weight": 3.07057956912585e-06}, {"ticker": "BNTC", "market_cap": 7667776.34, "weight": 4.0209351283580717e-07}, {"ticker": "VOR", "market_cap": 139805067.6, "weight": 7.331292443974897e-06}, {"ticker": "MPTI", "market_cap": 50233642.50000001, "weight": 2.6342215630357186e-06}, {"ticker": "CATX", "market_cap": 83441823.1324, "weight": 4.375638293686959e-06}, {"ticker": "AMWD", "market_cap": 1232038968.54, "weight": 6.460737179129212e-05}, {"ticker": "LEA", "market_cap": 7738743627.299999, "weight": 0.00040581499408168356}, {"ticker": "VBLT", "market_cap": 19355768.4231, "weight": 1.0150046863365697e-06}, {"ticker": "ALDX", "market_cap": 327550801.5, "weight": 1.7176564178099017e-05}, {"ticker": "GIA", "market_cap": 103386850.81, "weight": 5.421543375797581e-06}, {"ticker": "BFRG", "market_cap": 18680083.86, "weight": 9.7957220011126e-07}, {"ticker": "OXUS", "market_cap": 72444126.72, "weight": 3.7989258039791966e-06}, {"ticker": "ITAQ", "market_cap": 60633454.77, "weight": 3.17958137311036e-06}, {"ticker": "PHIN", "market_cap": 1212952453.8, "weight": 6.360648660381428e-05}, {"ticker": "ESCA", "market_cap": 217453544.0, "weight": 1.140313116978002e-05}, {"ticker": "PEV", "market_cap": 22356520.2, "weight": 1.1723622786319668e-06}, {"ticker": "MEC", "market_cap": 227479386.07, "weight": 1.1928880210741656e-05}, {"ticker": "ALNY", "market_cap": 21010109588.16, "weight": 0.0011017573276489868}, {"ticker": "NKTR", "market_cap": 99878844.86055, "weight": 5.2375856841908295e-06}, {"ticker": "GMED", "market_cap": 7023949723.5, "weight": 0.0003683316378923243}, {"ticker": "NEPT", "market_cap": 938410.0000000001, "weight": 4.920964783647431e-08}, {"ticker": "TRMB", "market_cap": 12899366978.3154, "weight": 0.0006764349338949355}, {"ticker": "HALO", "market_cap": 4886349395.2, "weight": 0.0002562371809164024}, {"ticker": "WGO", "market_cap": 1776081291.58, "weight": 9.313661926833924e-05}, {"ticker": "ARTL", "market_cap": 4039963.1999999997, "weight": 2.1185320525603497e-07}, {"ticker": "SGMA", "market_cap": 17673435.2, "weight": 9.267841585796706e-07}, {"ticker": "NWS", "market_cap": 11670901920.339998, "weight": 0.0006120149757930574}, {"ticker": "NEON", "market_cap": 23653600.740000002, "weight": 1.240380390746015e-06}, {"ticker": "CHPT", "market_cap": 1564434569.1699998, "weight": 8.203799427975201e-05}, {"ticker": "TERN", "market_cap": 300473733.24, "weight": 1.5756659239406147e-05}, {"ticker": "LAKE", "market_cap": 112607134.52999999, "weight": 5.905049428390345e-06}, {"ticker": "CMT", "market_cap": 241789338.56, "weight": 1.267928538821161e-05}, {"ticker": "ELVN", "market_cap": 546075242.97, "weight": 2.8635852557806117e-05}, {"ticker": "CBAY", "market_cap": 1568386500.48, "weight": 8.224523114640843e-05}, {"ticker": "MTD", "market_cap": 23674568985.86, "weight": 0.0012414799527653022}, {"ticker": "JBSS", "market_cap": 1138128002.8049998, "weight": 5.968273804719033e-05}, {"ticker": "OFIX", "market_cap": 450048842.25, "weight": 2.3600286693807052e-05}, {"ticker": "COMS", "market_cap": 3139778.07, "weight": 1.6464804627975507e-07}, {"ticker": "KAI", "market_cap": 2630900575.5, "weight": 0.00013796282095580032}, {"ticker": "HAIN", "market_cap": 903774260.0, "weight": 4.739337076360031e-05}, {"ticker": "IKNA", "market_cap": 166128904.36, "weight": 8.71169838238608e-06}, {"ticker": "RMCF", "market_cap": 30516549.012, "weight": 1.6002692107554563e-06}, {"ticker": "STRT", "market_cap": 92434320.64, "weight": 4.847199376283445e-06}, {"ticker": "SXTP", "market_cap": 4001679.15, "weight": 2.0984561303274882e-07}, {"ticker": "SPB", "market_cap": 2727258646.2000003, "weight": 0.00014301577939118475}, {"ticker": "MCHP", "market_cap": 42068875293.509995, "weight": 0.0022060661523962675}, {"ticker": "BFRI", "market_cap": 12103507.799999999, "weight": 6.347005641713321e-07}, {"ticker": "COCP", "market_cap": 19533676.8, "weight": 1.0243340930718004e-06}, {"ticker": "CLMT", "market_cap": 1418459567.8799999, "weight": 7.438315427761032e-05}, {"ticker": "SON", "market_cap": 5253392078.6, "weight": 0.00027548467528567443}, {"ticker": "KVHI", "market_cap": 98654386.1, "weight": 5.173375813881528e-06}, {"ticker": "AAON", "market_cap": 4539527491.875, "weight": 0.00023805005191671253}, {"ticker": "SRDX", "market_cap": 439707326.6, "weight": 2.3057983922915985e-05}, {"ticker": "XBIO", "market_cap": 6758766.0, "weight": 3.5442556523176016e-07}, {"ticker": "GIII", "market_cap": 1108277088.48, "weight": 5.811737431328936e-05}, {"ticker": "HURC", "market_cap": 136997325.6, "weight": 7.18405616661673e-06}, {"ticker": "DGII", "market_cap": 940241109.32, "weight": 4.9305670091978063e-05}, {"ticker": "NUVB", "market_cap": 271490625.71999997, "weight": 1.4236802764873829e-05}, {"ticker": "ADES", "market_cap": 55508719.365, "weight": 2.910843375289406e-06}, {"ticker": "APLT", "market_cap": 135565589.9052, "weight": 7.10897682034376e-06}, {"ticker": "LRCX", "market_cap": 83050187795.82, "weight": 0.004355101175589943}, {"ticker": "FULC", "market_cap": 243580862.76, "weight": 1.2773231824175123e-05}, {"ticker": "TT", "market_cap": 45419297525.132, "weight": 0.002381760249988592}, {"ticker": "CDT", "market_cap": 310871363.75, "weight": 1.6301904639317573e-05}, {"ticker": "HLLY", "market_cap": 562213049.93, "weight": 2.9482109308431752e-05}, {"ticker": "FHTX", "market_cap": 174146643.84, "weight": 9.132143748756212e-06}, {"ticker": "LZB", "market_cap": 1316516062.62, "weight": 6.903729906180875e-05}, {"ticker": "HES", "market_cap": 43519759923.63, "weight": 0.002282149657153845}, {"ticker": "MLYS", "market_cap": 369139859.855, "weight": 1.9357469022996376e-05}, {"ticker": "VC", "market_cap": 3730494657.2999997, "weight": 0.0001956248636966591}, {"ticker": "CHRS", "market_cap": 337788532.575, "weight": 1.7713424549200433e-05}, {"ticker": "MRCY", "market_cap": 2116458971.4399998, "weight": 0.00011098581712141709}, {"ticker": "MBIO", "market_cap": 16193424.9411, "weight": 8.491733236196445e-07}, {"ticker": "ANEB", "market_cap": 81385463.975, "weight": 4.267804074144367e-06}, {"ticker": "CXT", "market_cap": 3032956168.7999997, "weight": 0.00015904637095737501}, {"ticker": "DRQ", "market_cap": 876429389.605, "weight": 4.595942244434541e-05}, {"ticker": "LCII", "market_cap": 2975114388.84, "weight": 0.00015601318330798252}, {"ticker": "CRBP", "market_cap": 27644922.1719, "weight": 1.4496828513612805e-06}, {"ticker": "KALV", "market_cap": 312039364.06, "weight": 1.6363153862927715e-05}, {"ticker": "ELDN", "market_cap": 38967190.15, "weight": 2.0434156759395467e-06}, {"ticker": "REPL", "market_cap": 945711105.7800001, "weight": 4.959251336886489e-05}, {"ticker": "ETD", "market_cap": 751523236.86, "weight": 3.940942000491029e-05}, {"ticker": "EBF", "market_cap": 553254777.8, "weight": 2.901234298375426e-05}, {"ticker": "PMN", "market_cap": 36620720.130399995, "weight": 1.920368219792062e-06}, {"ticker": "RVP", "market_cap": 34727104.44, "weight": 1.821068168362297e-06}, {"ticker": "KROS", "market_cap": 905023987.9200001, "weight": 4.745890573321339e-05}, {"ticker": "TUP", "market_cap": 55975595.721, "weight": 2.935326086537087e-06}, {"ticker": "MMSI", "market_cap": 3848890743.18, "weight": 0.00020183348220176005}, {"ticker": "CRI", "market_cap": 2456626472.045, "weight": 0.00012882399330260198}, {"ticker": "TKNO", "market_cap": 90822949.4, "weight": 4.762700051623411e-06}, {"ticker": "VCEL", "market_cap": 1603636250.0399997, "weight": 8.409370650597568e-05}, {"ticker": "BHVN", "market_cap": 1538610381.56, "weight": 8.068378963790981e-05}, {"ticker": "NR", "market_cap": 569058572.61, "weight": 2.9841084341028805e-05}, {"ticker": "VECO", "market_cap": 1517666715.875, "weight": 7.958551658800232e-05}, {"ticker": "GTLS", "market_cap": 6485450647.555, "weight": 0.0003400930749107701}, {"ticker": "POAI", "market_cap": 13535299.68, "weight": 7.097828567619092e-07}, {"ticker": "ABT", "market_cap": 164727988572.50998, "weight": 0.008638235213247919}, {"ticker": "IR", "market_cap": 25392242281.77, "weight": 0.0013315536923778886}, {"ticker": "LXFR", "market_cap": 347028988.38, "weight": 1.8197988413622758e-05}, {"ticker": "SPXC", "market_cap": 3694195054.83, "weight": 0.000193721334691051}, {"ticker": "CGNX", "market_cap": 7160501859.400001, "weight": 0.00037549234858270204}, {"ticker": "AMBA", "market_cap": 2090018086.7099998, "weight": 0.000109599273258875}, {"ticker": "HSY", "market_cap": 40475442154.725006, "weight": 0.0021225074908191558}, {"ticker": "GCI", "market_cap": 371191451.28000003, "weight": 1.9465053225560905e-05}, {"ticker": "VRPX", "market_cap": 9145353.233084, "weight": 4.795767435771415e-07}, {"ticker": "VSTO", "market_cap": 1800465329.28, "weight": 9.441530332759725e-05}, {"ticker": "MSN", "market_cap": 12204738.159999998, "weight": 6.400090224848192e-07}, {"ticker": "PTON", "market_cap": 1833229481.5249999, "weight": 9.613343548053368e-05}, {"ticker": "POWW", "market_cap": 230607735.555, "weight": 1.2092928948997073e-05}, {"ticker": "LNZA", "market_cap": 746498225.13, "weight": 3.914591145576071e-05}, {"ticker": "CLNN", "market_cap": 62586233.6892, "weight": 3.2819839081604155e-06}, {"ticker": "KRYS", "market_cap": 3106513821.69, "weight": 0.00016290368939429975}, {"ticker": "HEI.A", "market_cap": 17665886420.48, "weight": 0.0009263883051874707}, {"ticker": "CNMD", "market_cap": 2973763511.74, "weight": 0.0001559423441370856}, {"ticker": "DMAQ", "market_cap": 50639977.4764, "weight": 2.6555295212760252e-06}, {"ticker": "PAR", "market_cap": 1126619548.8, "weight": 5.9079241740961384e-05}, {"ticker": "PPC", "market_cap": 5516021396.055, "weight": 0.0002892567964517896}, {"ticker": "QCOM", "market_cap": 122123880000.0, "weight": 0.006404101754269293}, {"ticker": "GIFI", "market_cap": 52934274.25, "weight": 2.7758410442363675e-06}, {"ticker": "X", "market_cap": 7275308598.22, "weight": 0.00038151274391798865}, {"ticker": "FELE", "market_cap": 4119988362.02, "weight": 0.00021604967592563676}, {"ticker": "IMAX", "market_cap": 1024126556.25, "weight": 5.3704571746937575e-05}, {"ticker": "CIR", "market_cap": 1134903848.04, "weight": 5.951366533850656e-05}, {"ticker": "APT", "market_cap": 49320672.839999996, "weight": 2.586345991106619e-06}, {"ticker": "AKRO", "market_cap": 2549915745.5, "weight": 0.00013371602588286126}, {"ticker": "POWI", "market_cap": 4336113375.8, "weight": 0.0002273831397812723}, {"ticker": "VLD", "market_cap": 302991093.02, "weight": 1.5888668050321955e-05}, {"ticker": "ASYS", "market_cap": 104271703.36, "weight": 5.4679445036337144e-06}, {"ticker": "MNKD", "market_cap": 1038534554.34, "weight": 5.446011837584977e-05}, {"ticker": "STRC", "market_cap": 19520947.045, "weight": 1.023666552486561e-06}, {"ticker": "HBIO", "market_cap": 182278810.42, "weight": 9.558589602433544e-06}, {"ticker": "ASIX", "market_cap": 778837719.96, "weight": 4.084177483295595e-05}, {"ticker": "CENX", "market_cap": 594496657.755, "weight": 3.117504200518381e-05}, {"ticker": "NL", "market_cap": 230005709.64, "weight": 1.2061359077335879e-05}, {"ticker": "HZNP", "market_cap": 26618328584.32, "weight": 0.0013958489099966376}, {"ticker": "XXII", "market_cap": 15151337.9328, "weight": 7.945269167256344e-07}, {"ticker": "ABIO", "market_cap": 29050848.288, "weight": 1.5234087590747352e-06}, {"ticker": "CDRE", "market_cap": 1008433211.7299999, "weight": 5.2881622335480245e-05}, {"ticker": "ATHA", "market_cap": 68498249.4, "weight": 3.592006404864598e-06}, {"ticker": "VTSI", "market_cap": 57310929.63, "weight": 3.005350181981501e-06}, {"ticker": "INVO", "market_cap": 1875114.56, "weight": 9.832986343990949e-08}, {"ticker": "BRBR", "market_cap": 5432678885.4, "weight": 0.00028488636604382273}, {"ticker": "ZIVO", "market_cap": 14317079.166000001, "weight": 7.507788960111073e-07}, {"ticker": "ACOR", "market_cap": 15414436.18, "weight": 8.083236282814635e-07}, {"ticker": "STLD", "market_cap": 17636157883.89, "weight": 0.0009248293588673252}, {"ticker": "SENEA", "market_cap": 417460139.1, "weight": 2.1891354984363527e-05}, {"ticker": "ACHR", "market_cap": 1388274807.4673002, "weight": 7.280028385856395e-05}, {"ticker": "NLTX", "market_cap": 35217140.0, "weight": 1.8467653341373308e-06}, {"ticker": "AMSC", "market_cap": 210178580.12, "weight": 1.1021636502675162e-05}, {"ticker": "IBM", "market_cap": 128078367281.6, "weight": 0.00671635143423253}, {"ticker": "STSS", "market_cap": 5365810.1376, "weight": 2.8137980970863453e-07}, {"ticker": "MASI", "market_cap": 4386805302.18, "weight": 0.00023004139347135693}, {"ticker": "CYAN", "market_cap": 5044652.34, "weight": 2.6453849075441015e-07}, {"ticker": "ACLS", "market_cap": 5243410310.6, "weight": 0.00027496123746205214}, {"ticker": "NVCR", "market_cap": 1562988712.84, "weight": 8.196217445598476e-05}, {"ticker": "VXRT", "market_cap": 105374826.84740001, "weight": 5.525791626250798e-06}, {"ticker": "CADL", "market_cap": 28968973.677, "weight": 1.5191153044290491e-06}, {"ticker": "AQST", "market_cap": 91082754.945, "weight": 4.776324095884888e-06}, {"ticker": "SIGA", "market_cap": 375317944.32, "weight": 1.9681444002831033e-05}, {"ticker": "ANGO", "market_cap": 292950315.52000004, "weight": 1.536213580452386e-05}, {"ticker": "CULP", "market_cap": 70072571.25, "weight": 3.6745628821184277e-06}, {"ticker": "CALC", "market_cap": 14183142.165, "weight": 7.437553213992814e-07}, {"ticker": "EPIX", "market_cap": 123482346.39999999, "weight": 6.475338903427638e-06}, {"ticker": "UA", "market_cap": 2734383860.74, "weight": 0.00014338942129426836}, {"ticker": "FENC", "market_cap": 174940185.195, "weight": 9.173756573239357e-06}, {"ticker": "CPHI", "market_cap": 1640606.9434999998, "weight": 8.603242711363847e-08}, {"ticker": "HAYN", "market_cap": 571150252.68, "weight": 2.9950770767677357e-05}, {"ticker": "SMMT", "market_cap": 1256132354.4, "weight": 6.587081424539949e-05}, {"ticker": "KPTI", "market_cap": 142943175.0, "weight": 7.495852881339199e-06}, {"ticker": "IMNN", "market_cap": 9461533.55, "weight": 4.961570464812679e-07}, {"ticker": "NN", "market_cap": 548760541.6347, "weight": 2.8776667981368993e-05}, {"ticker": "WST", "market_cap": 27342312764.22, "weight": 0.001433814198657306}, {"ticker": "MEI", "market_cap": 832180284.52, "weight": 4.3639026371933574e-05}, {"ticker": "DK", "market_cap": 1612669700.32, "weight": 8.456741512696982e-05}, {"ticker": "ESE", "market_cap": 2747905564.54, "weight": 0.0001440984911913785}, {"ticker": "MO", "market_cap": 73353503729.975, "weight": 0.003846612979533012}, {"ticker": "NXTC", "market_cap": 37411348.9984, "weight": 1.9618283152339593e-06}, {"ticker": "RWLK", "market_cap": 43951994.377151005, "weight": 2.3048157681720137e-06}, {"ticker": "PVH", "market_cap": 4378693132.17, "weight": 0.00022961599622560962}, {"ticker": "SDC", "market_cap": 10048812.0, "weight": 5.269535700759124e-07}, {"ticker": "BCDA", "market_cap": 8621829.4816, "weight": 4.521234774732449e-07}, {"ticker": "CMBM", "market_cap": 216979269.3, "weight": 1.1378260493887022e-05}, {"ticker": "ZYXI", "market_cap": 285401610.0, "weight": 1.4966286292838718e-05}, {"ticker": "BEAM", "market_cap": 1672685541.1699002, "weight": 8.771460920294245e-05}, {"ticker": "NVT", "market_cap": 8609499228.785, "weight": 0.0004514768865388337}, {"ticker": "HCWB", "market_cap": 65745899.43, "weight": 3.447674851762616e-06}, {"ticker": "DCPH", "market_cap": 992358416.99, "weight": 5.2038669907225e-05}, {"ticker": "ABOS", "market_cap": 238707612.0, "weight": 1.251768152769658e-05}, {"ticker": "ARRY", "market_cap": 2992688776.0, "weight": 0.00015693477344777798}, {"ticker": "DFLI", "market_cap": 84193673.0788, "weight": 4.4150648461408066e-06}, {"ticker": "TER", "market_cap": 15360991198.4208, "weight": 0.0008055210060564879}, {"ticker": "TXT", "market_cap": 15005827746.880001, "weight": 0.0007868964513578921}, {"ticker": "GTEC", "market_cap": 37275561.3384, "weight": 1.954707693193338e-06}, {"ticker": "TWNK", "market_cap": 4418571529.9062, "weight": 0.00023170719507140334}, {"ticker": "CMRX", "market_cap": 84854198.8293, "weight": 4.449702413482404e-06}, {"ticker": "HI", "market_cap": 2930156753.5189, "weight": 0.00015365563234229375}, {"ticker": "AXNX", "market_cap": 2789220775.275, "weight": 0.00014626503563416906}, {"ticker": "ROG", "market_cap": 2424553831.04, "weight": 0.00012714212357717097}, {"ticker": "APH", "market_cap": 49362529315.8, "weight": 0.00258854091915917}, {"ticker": "NRXP", "market_cap": 23541368.6984, "weight": 1.2344950109620138e-06}, {"ticker": "FKWL", "market_cap": 37474010.4, "weight": 1.9651142409014985e-06}, {"ticker": "UAVS", "market_cap": 18124298.0625, "weight": 9.504271319987196e-07}, {"ticker": "SEEL", "market_cap": 27209495.768, "weight": 1.426849356412781e-06}, {"ticker": "INTZ", "market_cap": 7939865.67, "weight": 4.163617112878295e-07}, {"ticker": "CDXS", "market_cap": 139957007.97, "weight": 7.339260104272468e-06}, {"ticker": "JAGX", "market_cap": 4492546.465, "weight": 2.355863955324938e-07}, {"ticker": "IVVD", "market_cap": 184938226.44, "weight": 9.698047755900448e-06}, {"ticker": "QLGN", "market_cap": 5052463.0, "weight": 2.6494807699919697e-07}, {"ticker": "RAIN", "market_cap": 30650140.384600002, "weight": 1.6072746608248687e-06}, {"ticker": "MOVE", "market_cap": 48874027.865, "weight": 2.5629242011345597e-06}, {"ticker": "TMST", "market_cap": 913855747.86, "weight": 4.79220378358377e-05}, {"ticker": "DVAX", "market_cap": 1841802205.1000001, "weight": 9.658298387422643e-05}, {"ticker": "INVA", "market_cap": 853109552.1, "weight": 4.473654439399977e-05}, {"ticker": "MGRM", "market_cap": 78106180.17, "weight": 4.095840432239546e-06}, {"ticker": "MRVL", "market_cap": 45512700000.0, "weight": 0.00238665821878188}, {"ticker": "AWIN", "market_cap": 10982975.268, "weight": 5.759405218774171e-07}, {"ticker": "COLL", "market_cap": 802009353.04, "weight": 4.205688113368036e-05}, {"ticker": "DOV", "market_cap": 19270416870.25, "weight": 0.0010105289029816986}, {"ticker": "NVIV", "market_cap": 3509153.9799999995, "weight": 1.8401789362833106e-07}, {"ticker": "FONR", "market_cap": 97033347.0, "weight": 5.088369512541864e-06}, {"ticker": "STTK", "market_cap": 59884582.349999994, "weight": 3.1403109603242126e-06}, {"ticker": "LRMR", "market_cap": 148225437.5, "weight": 7.772851503908027e-06}, {"ticker": "LGND", "market_cap": 1003047078.315, "weight": 5.259917678550486e-05}, {"ticker": "PII", "market_cap": 5548671652.44, "weight": 0.0002909689559753203}, {"ticker": "GLYC", "market_cap": 89515381.8024, "weight": 4.694132004607414e-06}, {"ticker": "RAIL", "market_cap": 47442049.0, "weight": 2.4878321031646698e-06}, {"ticker": "KVSA", "market_cap": 73692206.4, "weight": 3.864374340892337e-06}, {"ticker": "TNXP", "market_cap": 10144961.062150002, "weight": 5.319955682304598e-07}, {"ticker": "MVIS", "market_cap": 400917289.98999995, "weight": 2.102385807052519e-05}, {"ticker": "PTN", "market_cap": 20764465.4126, "weight": 1.0888758969604937e-06}, {"ticker": "BRFH", "market_cap": 24641721.72, "weight": 1.2921968520429233e-06}, {"ticker": "ATOM", "market_cap": 165983791.545, "weight": 8.704088754906927e-06}, {"ticker": "TVTX", "market_cap": 590335507.55, "weight": 3.095683382732687e-05}, {"ticker": "ZURA", "market_cap": 302976062.1, "weight": 1.5887879838048154e-05}, {"ticker": "APOG", "market_cap": 1004972352.0000001, "weight": 5.270013696285557e-05}, {"ticker": "CVX", "market_cap": 308897349969.48004, "weight": 0.01619838856109618}, {"ticker": "ANTX", "market_cap": 447078761.5, "weight": 2.3444537471448605e-05}, {"ticker": "TARA", "market_cap": 18126528.0, "weight": 9.505440685606407e-07}, {"ticker": "REKR", "market_cap": 188482554.75, "weight": 9.883910169932637e-06}, {"ticker": "ACET", "market_cap": 54909351.449999996, "weight": 2.8794128875264536e-06}, {"ticker": "KVUE", "market_cap": 37780867380.12, "weight": 0.001981205633712604}, {"ticker": "MKFG", "market_cap": 275262860.565, "weight": 1.4434616458546029e-05}, {"ticker": "SNDX", "market_cap": 845620925.01, "weight": 4.434384535852745e-05}, {"ticker": "JAZZ", "market_cap": 8015911405.58, "weight": 0.0004203495032629336}, {"ticker": "INVE", "market_cap": 188739298.56, "weight": 9.897373658678809e-06}, {"ticker": "STE", "market_cap": 21753443666.508, "weight": 0.001140737313178079}, {"ticker": "ABEO", "market_cap": 103231990.41, "weight": 5.413422590908443e-06}, {"ticker": "CODI", "market_cap": 1312819663.5400002, "weight": 6.884346214938256e-05}, {"ticker": "KYMR", "market_cap": 848916497.28, "weight": 4.451666315759859e-05}, {"ticker": "CTXR", "market_cap": 107991531.08039999, "weight": 5.663009999667685e-06}, {"ticker": "PATK", "market_cap": 1638133820.0, "weight": 8.590273802625546e-05}, {"ticker": "ZOM", "market_cap": 156987936.8136, "weight": 8.232351621542753e-06}, {"ticker": "ALLR", "market_cap": 1855599.6400000001, "weight": 9.730651294198538e-08}, {"ticker": "THRN", "market_cap": 550634696.49, "weight": 2.8874947518479996e-05}, {"ticker": "NRBO", "market_cap": 17312347.8425, "weight": 9.078489578669991e-07}, {"ticker": "RFIL", "market_cap": 30425149.7088, "weight": 1.5954762870622187e-06}, {"ticker": "EXTR", "market_cap": 3139804242.72, "weight": 0.00016464941876122278}, {"ticker": "MRKR", "market_cap": 31889521.2, "weight": 1.6722670345859286e-06}, {"ticker": "TAP", "market_cap": 13564488697.7, "weight": 0.0007113135110406463}, {"ticker": "SHPW", "market_cap": 19131038.19, "weight": 1.0032199700302008e-06}, {"ticker": "BIO.B", "market_cap": 10323805158.62, "weight": 0.0005413740435290192}, {"ticker": "BDC", "market_cap": 3988204590.9300003, "weight": 0.00020913901537651493}, {"ticker": "AGRI", "market_cap": 4312873.963500001, "weight": 2.261644791796061e-07}, {"ticker": "AREB", "market_cap": 2040529.0542, "weight": 1.0700409858939693e-07}, {"ticker": "KPRX", "market_cap": 4203289.0, "weight": 2.2041791055607488e-07}, {"ticker": "PULM", "market_cap": 7187696.88, "weight": 3.769184388701368e-07}, {"ticker": "TTMI", "market_cap": 1335264597.375, "weight": 7.002046078508902e-05}, {"ticker": "SVT", "market_cap": 26734419.810000002, "weight": 1.401936663039143e-06}, {"ticker": "LIVN", "market_cap": 2761502520.0, "weight": 0.00014481150723962482}, {"ticker": "CVR", "market_cap": 16086097.799999999, "weight": 8.435451538251766e-07}, {"ticker": "DRIO", "market_cap": 88223722.56, "weight": 4.626398182031748e-06}, {"ticker": "MPWR", "market_cap": 21596133780.0, "weight": 0.0011324880787109968}, {"ticker": "BFLY", "market_cap": 222131688.67499998, "weight": 1.1648450222203617e-05}, {"ticker": "NAVB", "market_cap": 7886649.538, "weight": 4.135710897951564e-07}, {"ticker": "ESTA", "market_cap": 1045718769.62, "weight": 5.483685424174018e-05}, {"ticker": "NUVL", "market_cap": 3166586810.82, "weight": 0.00016605388029121223}, {"ticker": "GNLX", "market_cap": 645408287.8, "weight": 3.384481682141052e-05}, {"ticker": "MMAT", "market_cap": 104000267.8425, "weight": 5.453710590710274e-06}, {"ticker": "VTGN", "market_cap": 35015540.56, "weight": 1.8361935825080532e-06}, {"ticker": "ITOS", "market_cap": 354240998.1, "weight": 1.8576181802988208e-05}, {"ticker": "WAB", "market_cap": 18679711229.52, "weight": 0.0009795526595962464}, {"ticker": "RTX", "market_cap": 101442114022.07999, "weight": 0.005319562565205004}, {"ticker": "TAYD", "market_cap": 75005682.2377, "weight": 3.93325221241431e-06}, {"ticker": "LNTH", "market_cap": 4900322212.17, "weight": 0.00025696990691290416}, {"ticker": "NXL", "market_cap": 3048239.327238, "weight": 1.598478104609641e-07}, {"ticker": "DIOD", "market_cap": 3613544906.7599998, "weight": 0.00018949209013431758}, {"ticker": "BIOR", "market_cap": 50855251.46, "weight": 2.6668183576282706e-06}, {"ticker": "CARR", "market_cap": 45382681030.68, "weight": 0.0023798401033607967}, {"ticker": "CPIX", "market_cap": 26443033.76, "weight": 1.3866565563640636e-06}, {"ticker": "LUCY", "market_cap": 6587791.89, "weight": 3.4545978722187683e-07}, {"ticker": "HOFT", "market_cap": 209337507.718, "weight": 1.0977531179088033e-05}, {"ticker": "JNJ", "market_cap": 373145873923.68, "weight": 0.019567541956519784}, {"ticker": "IP", "market_cap": 12180899336.445, "weight": 0.0006387589291226669}, {"ticker": "TOMZ", "market_cap": 17684950.2555, "weight": 9.273880010642696e-07}, {"ticker": "ALT", "market_cap": 130662336.48, "weight": 6.851853202408019e-06}, {"ticker": "POST", "market_cap": 5210618840.8949995, "weight": 0.0002732416727981808}, {"ticker": "ALLK", "market_cap": 194261072.91, "weight": 1.0186932136525355e-05}, {"ticker": "GRC", "market_cap": 835064656.24, "weight": 4.379028106505352e-05}, {"ticker": "CCF", "market_cap": 1209383952.77, "weight": 6.341935658709409e-05}, {"ticker": "MTRN", "market_cap": 1993098087.6399999, "weight": 0.00010451684764262399}, {"ticker": "CTMX", "market_cap": 79453657.00999999, "weight": 4.166501295576685e-06}, {"ticker": "EYEN", "market_cap": 59610420.480000004, "weight": 3.125934079139135e-06}, {"ticker": "ACMR", "market_cap": 1071702023.1800001, "weight": 5.619940020494754e-05}, {"ticker": "NGM", "market_cap": 99672185.935, "weight": 5.226748616226316e-06}, {"ticker": "AZZ", "market_cap": 1101205821.825, "weight": 5.7746561404379235e-05}, {"ticker": "AVNS", "market_cap": 935583802.5600001, "weight": 4.9061443767102976e-05}, {"ticker": "PXMD", "market_cap": 4021184.5233, "weight": 2.1086846290754979e-07}, {"ticker": "SASI", "market_cap": 1881390.0318, "weight": 9.865894535217143e-08}, {"ticker": "BIOS", "market_cap": 208975076.82999998, "weight": 1.0958525524455684e-05}, {"ticker": "NWPX", "market_cap": 293415942.8, "weight": 1.538655301498821e-05}, {"ticker": "ACER", "market_cap": 19054796.1814, "weight": 9.992218856176825e-07}, {"ticker": "AUPH", "market_cap": 1029056179.1999999, "weight": 5.396307816666466e-05}, {"ticker": "HARP", "market_cap": 15298203.399999999, "weight": 8.022284522167855e-07}, {"ticker": "CSCO", "market_cap": 216691599923.52, "weight": 0.01136317528730363}, {"ticker": "ABVC", "market_cap": 3437707.56, "weight": 1.8027128695600574e-07}, {"ticker": "LSCC", "market_cap": 10944250098.2, "weight": 0.0005739097976009647}, {"ticker": "VTRS", "market_cap": 11545500264.375, "weight": 0.0006054389894670929}, {"ticker": "INDI", "market_cap": 872768786.7, "weight": 4.5767462661495464e-05}, {"ticker": "BHE", "market_cap": 864121108.6500001, "weight": 4.5313983700866625e-05}, {"ticker": "APGE", "market_cap": 1042623640.1999999, "weight": 5.46745475434244e-05}, {"ticker": "KHC", "market_cap": 40699538323.77, "weight": 0.0021342589571933493}, {"ticker": "SEDG", "market_cap": 7005816667.92, "weight": 0.0003673807515214512}, {"ticker": "LII", "market_cap": 13170319867.44, "weight": 0.0006906435380808424}, {"ticker": "SRPT", "market_cap": 10955607039.9, "weight": 0.0005745053486943634}, {"ticker": "AVD", "market_cap": 296339377.53000003, "weight": 1.5539856148518567e-05}, {"ticker": "TYGO", "market_cap": 402650960.275, "weight": 2.1114770682485218e-05}, {"ticker": "FTLF", "market_cap": 84521520.61000001, "weight": 4.432256970643328e-06}]}, "Transportation and Public Utilities": {"sic_description": "Transportation and Public Utilities", "companies": [{"ticker": "HUBG", "market_cap": 2550422840.7, "weight": 0.0007508523195749102}, {"ticker": "NWE", "market_cap": 2932256378.52, "weight": 0.0008632652861577189}, {"ticker": "OTTR", "market_cap": 3105352459.5021005, "weight": 0.0009142253041753841}, {"ticker": "NEXT", "market_cap": 1171257004.94, "weight": 0.00034482166052754844}, {"ticker": "CVLG", "market_cap": 561370429.6, "weight": 0.0001652691790864904}, {"ticker": "RSG", "market_cap": 45218797840.35, "weight": 0.013312553002974578}, {"ticker": "OGS", "market_cap": 3676913835.77, "weight": 0.0010824947292689862}, {"ticker": "SPIR", "market_cap": 91730584.0, "weight": 2.700576573940073e-05}, {"ticker": "KORE", "market_cap": 50936202.1575, "weight": 1.4995774398647708e-05}, {"ticker": "LSTR", "market_cap": 6292429923.6, "weight": 0.0018525107007749658}, {"ticker": "KEX", "market_cap": 4856390000.0, "weight": 0.0014297361355419729}, {"ticker": "NI", "market_cap": 9899518686.09, "weight": 0.002914448713957459}, {"ticker": "ATEX", "market_cap": 594271360.8, "weight": 0.00017495531430825392}, {"ticker": "RXO", "market_cap": 2265948855.56, "weight": 0.0006671023044039112}, {"ticker": "AVA", "market_cap": 2422786122.36, "weight": 0.0007132756775769055}, {"ticker": "KNX", "market_cap": 7816307240.0, "weight": 0.002301144864297625}, {"ticker": "ULCC", "market_cap": 1029468757.23, "weight": 0.0003030787648074429}, {"ticker": "MESA", "market_cap": 34640675.9496, "weight": 1.0198321420796696e-05}, {"ticker": "ETRN", "market_cap": 4001165334.9999995, "weight": 0.0011779553667904353}, {"ticker": "EXPE", "market_cap": 14289869694.6, "weight": 0.004206981538664678}, {"ticker": "CMS", "market_cap": 15247094512.08, "weight": 0.004488791465665748}, {"ticker": "LSXMB", "market_cap": 7997843276.709999, "weight": 0.0023545896312103646}, {"ticker": "JBLU", "market_cap": 1562944005.4900002, "weight": 0.00046013551680935114}, {"ticker": "MODV", "market_cap": 379561290.075, "weight": 0.00011174400986600257}, {"ticker": "WOW", "market_cap": 613072197.5655999, "weight": 0.0001804903384109731}, {"ticker": "LILAK", "market_cap": 1596005921.28, "weight": 0.0004698690463889789}, {"ticker": "CWCO", "market_cap": 465042902.8, "weight": 0.00013691005926428753}, {"ticker": "AM", "market_cap": 5547479227.245, "weight": 0.0016331949271703129}, {"ticker": "WEC", "market_cap": 24898824704.485, "weight": 0.0073302904858397674}, {"ticker": "NWN", "market_cap": 1361822782.72, "weight": 0.0004009248109519846}, {"ticker": "JBHT", "market_cap": 19258784051.129997, "weight": 0.0056698451904604}, {"ticker": "TDS", "market_cap": 1876288128.0, "weight": 0.0005523849891153722}, {"ticker": "DTM", "market_cap": 4997250424.89, "weight": 0.0014712058773734627}, {"ticker": "SWX", "market_cap": 4203539257.67, "weight": 0.0012375348713468397}, {"ticker": "SLNG", "market_cap": 77426293.51, "weight": 2.2794538674267497e-05}, {"ticker": "GOGO", "market_cap": 1483877355.4599998, "weight": 0.00043685805213617985}, {"ticker": "CLH", "market_cap": 8765665606.25, "weight": 0.0025806388838896916}, {"ticker": "SMLP", "market_cap": 184851807.03500003, "weight": 5.4420939882952436e-05}, {"ticker": "ATUS", "market_cap": 1366461636.6499999, "weight": 0.0004022905038002158}, {"ticker": "LNG", "market_cap": 37900562122.119995, "weight": 0.011158041924834767}, {"ticker": "MSEX", "market_cap": 1145617778.8999999, "weight": 0.00033727339361391156}, {"ticker": "VIA", "market_cap": 23102608.1, "weight": 6.801478799238669e-06}, {"ticker": "CWT", "market_cap": 2699299560.0, "weight": 0.0007946820831079356}, {"ticker": "PTSI", "market_cap": 474840673.5, "weight": 0.00013979455305855536}, {"ticker": "AMCX", "market_cap": 486599823.43, "weight": 0.0001432564829237797}, {"ticker": "FOXA", "market_cap": 14634361240.625, "weight": 0.004308400908142966}, {"ticker": "FE", "market_cap": 19236307849.0, "weight": 0.005663228127503141}, {"ticker": "ORA", "market_cap": 4147116185.8799996, "weight": 0.001220923745671916}, {"ticker": "LBRDK", "market_cap": 13071451318.800001, "weight": 0.003848275425669301}, {"ticker": "SRFM", "market_cap": 125435833.16499999, "weight": 3.692869464104298e-05}, {"ticker": "WTRG", "market_cap": 8691659832.22, "weight": 0.002558851356658673}, {"ticker": "TRGP", "market_cap": 17603919627.96, "weight": 0.0051826480202930595}, {"ticker": "CQP", "market_cap": 24734245885.3, "weight": 0.007281837975861445}, {"ticker": "ARCB", "market_cap": 2360812203.075, "weight": 0.0006950303653464366}, {"ticker": "WBD", "market_cap": 24861320880.0, "weight": 0.007319249244694136}, {"ticker": "GBTG", "market_cap": 2539081293.84, "weight": 0.0007475133333364318}, {"ticker": "ATO", "market_cap": 15719207488.279999, "weight": 0.004627782976259297}, {"ticker": "BKH", "market_cap": 3215285710.3199997, "weight": 0.0009465899909472351}, {"ticker": "EVRG", "market_cap": 11170875153.328, "weight": 0.00328873996370576}, {"ticker": "SO", "market_cap": 70291179749.44499, "weight": 0.020693939263044702}, {"ticker": "GEL", "market_cap": 1215985842.56, "weight": 0.0003579899677364223}, {"ticker": "SRE", "market_cap": 41760821146.8, "weight": 0.012294514040982156}, {"ticker": "MNTK", "market_cap": 1366222947.69, "weight": 0.00040222023303710443}, {"ticker": "NXST", "market_cap": 4726467394.056, "weight": 0.0013914865212107685}, {"ticker": "EGGF", "market_cap": 105566638.59, "weight": 3.107914271708464e-05}, {"ticker": "EPD", "market_cap": 58148668689.299995, "weight": 0.01711914670336408}, {"ticker": "LUMN", "market_cap": 1320461791.0, "weight": 0.00038874800792258697}, {"ticker": "MRTN", "market_cap": 1562614214.9599998, "weight": 0.00046003842546415416}, {"ticker": "TTGT", "market_cap": 818486406.1600001, "weight": 0.00024096491248372476}, {"ticker": "SRCL", "market_cap": 3871105794.1600003, "weight": 0.0011396654384051648}, {"ticker": "TDW", "market_cap": 3358044668.24, "weight": 0.0009886186667353288}, {"ticker": "DUK", "market_cap": 66408015614.925, "weight": 0.019550723812192566}, {"ticker": "LBTYA", "market_cap": 6916592105.200001, "weight": 0.002036265964555723}, {"ticker": "PARAA", "market_cap": 9473539177.95, "weight": 0.0027890390380895503}, {"ticker": "ARTNA", "market_cap": 423950130.88, "weight": 0.00012481222096802044}, {"ticker": "MPLX", "market_cap": 34947474742.635, "weight": 0.010288643927997065}, {"ticker": "UONEK", "market_cap": 240369596.28, "weight": 7.076554759546728e-05}, {"ticker": "FDX", "market_cap": 65085211114.89, "weight": 0.01916128610353293}, {"ticker": "EXPD", "market_cap": 16974158889.519999, "weight": 0.004997244524179019}, {"ticker": "FOX", "market_cap": 13568979742.307499, "weight": 0.0039947493220301574}, {"ticker": "HEP", "market_cap": 2578115698.39, "weight": 0.0007590051819553645}, {"ticker": "KMI", "market_cap": 35450110988.97, "weight": 0.01043662158309032}, {"ticker": "DSKE", "market_cap": 212794588.47759998, "weight": 6.264738058397456e-05}, {"ticker": "CP", "market_cap": 67875543540.840004, "weight": 0.019982768542042853}, {"ticker": "NCLH", "market_cap": 6923769073.724999, "weight": 0.002038378886138182}, {"ticker": "IHRT", "market_cap": 388749557.15999997, "weight": 0.00011444906392352995}, {"ticker": "FWRD", "market_cap": 1815362974.29, "weight": 0.000534448436692145}, {"ticker": "AWX", "market_cap": 7447913.21, "weight": 2.1926885301051624e-06}, {"ticker": "OKE", "market_cap": 35501704360.5, "weight": 0.010451810830171151}, {"ticker": "LPG", "market_cap": 1073020971.33, "weight": 0.0003159006704372689}, {"ticker": "EE", "market_cap": 411402796.89, "weight": 0.00012111824729411512}, {"ticker": "LNT", "market_cap": 11938449906.08, "weight": 0.0035147163290181072}, {"ticker": "CCL", "market_cap": 17066291146.125, "weight": 0.00502436854356733}, {"ticker": "CABO", "market_cap": 3409017162.36, "weight": 0.0010036251255992308}, {"ticker": "SAIA", "market_cap": 10591465048.39, "weight": 0.0031181598487792354}, {"ticker": "PCYO", "market_cap": 229002105.35999998, "weight": 6.741892334602083e-05}, {"ticker": "IDA", "market_cap": 4699077010.76, "weight": 0.0013834227082211536}, {"ticker": "CEQP", "market_cap": 2915365924.96, "weight": 0.0008582926847397057}, {"ticker": "ENB", "market_cap": 66297718903.669, "weight": 0.019518252121551134}, {"ticker": "SALM", "market_cap": 19321197.0913, "weight": 5.688219781228457e-06}, {"ticker": "BBGI", "market_cap": 25184151.5598, "weight": 7.414291588610428e-06}, {"ticker": "AMPS", "market_cap": 700748217.8475, "weight": 0.0002063024281355511}, {"ticker": "MDIA", "market_cap": 19263858.9052, "weight": 5.671339243089305e-06}, {"ticker": "FYBR", "market_cap": 3446769975.0, "weight": 0.0010147396696226214}, {"ticker": "KNTK", "market_cap": 1745638438.5600002, "weight": 0.0005139213191692385}, {"ticker": "UONE", "market_cap": 244273159.4391, "weight": 7.191476858182457e-05}, {"ticker": "NSC", "market_cap": 43640281774.095, "weight": 0.012847833023636358}, {"ticker": "ALGT", "market_cap": 1399951405.57, "weight": 0.0004121499946557432}, {"ticker": "SJW", "market_cap": 1873731668.34, "weight": 0.0005516323595376494}, {"ticker": "LBTYB", "market_cap": 7056663703.600399, "weight": 0.0020775034734452835}, {"ticker": "ALE", "market_cap": 2962318934.38, "weight": 0.0008721157949594815}, {"ticker": "GNK", "market_cap": 588171768.87, "weight": 0.0001731595757052214}, {"ticker": "OPAL", "market_cap": 210476923.2, "weight": 6.196505280604164e-05}, {"ticker": "OGE", "market_cap": 6458266052.179999, "weight": 0.001901333366501814}, {"ticker": "SAVE", "market_cap": 1798972736.16, "weight": 0.0005296231002334589}, {"ticker": "LIND", "market_cap": 372770213.28000003, "weight": 0.00010974469599437117}, {"ticker": "FWONA", "market_cap": 14169568797.16, "weight": 0.00417156458487635}, {"ticker": "ATNI", "market_cap": 492626866.575, "weight": 0.00014503086294162773}, {"ticker": "WERN", "market_cap": 2417073092.25, "weight": 0.0007115937439612554}, {"ticker": "ADEA", "market_cap": 969854520.8950001, "weight": 0.0002855281504867461}, {"ticker": "ET", "market_cap": 41719100785.425, "weight": 0.01228223143842229}, {"ticker": "YORW", "market_cap": 525046704.80999994, "weight": 0.00015457536291650718}, {"ticker": "BKNG", "market_cap": 108556800170.09999, "weight": 0.03195945547248078}, {"ticker": "UPS", "market_cap": 130910267493.69, "weight": 0.03854038492567407}, {"ticker": "ASTS", "market_cap": 339987428.8, "weight": 0.00010009334352993965}, {"ticker": "POR", "market_cap": 4015474096.08, "weight": 0.0011821679100109989}, {"ticker": "INSW", "market_cap": 2005451761.18, "weight": 0.0005904111595331793}, {"ticker": "PCG", "market_cap": 37856287650.63, "weight": 0.011145007384410445}, {"ticker": "ASTR", "market_cap": 30013972.4, "weight": 8.836205681882928e-06}, {"ticker": "VZ", "market_cap": 132595841530.8985, "weight": 0.039036623100558776}, {"ticker": "LILA", "market_cap": 1602240319.41, "weight": 0.0004717044723514359}, {"ticker": "AIRT", "market_cap": 63399465.0, "weight": 1.8664997268450135e-05}, {"ticker": "NEE", "market_cap": 102835026757.555, "weight": 0.030274947801700862}, {"ticker": "GNE", "market_cap": 419032671.96, "weight": 0.00012336450595481778}, {"ticker": "ZD", "market_cap": 2825690445.43, "weight": 0.0008318919480698551}, {"ticker": "CRGE", "market_cap": 94851181.254, "weight": 2.792447915791054e-05}, {"ticker": "DATS", "market_cap": 5088038.49, "weight": 1.497934162656091e-06}, {"ticker": "CPK", "market_cap": 1672893654.0, "weight": 0.0004925050311121327}, {"ticker": "ENLC", "market_cap": 5327991292.85, "weight": 0.001568577004985316}, {"ticker": "ALK", "market_cap": 4602980130.66, "weight": 0.001355131491496011}, {"ticker": "OSG", "market_cap": 317484460.345, "weight": 9.346840048436988e-05}, {"ticker": "QRHC", "market_cap": 147376347.0, "weight": 4.3388049318541715e-05}, {"ticker": "CALX", "market_cap": 2921489420.6682, "weight": 0.0008600954606884763}, {"ticker": "VRRM", "market_cap": 3204232963.5750003, "weight": 0.0009433360283498491}, {"ticker": "CWEN", "market_cap": 2262189914.895, "weight": 0.0006659956607241184}, {"ticker": "AAL", "market_cap": 8294436125.02, "weight": 0.0024419074769295363}, {"ticker": "SIDU", "market_cap": 9864333.7954, "weight": 2.9040901740451807e-06}, {"ticker": "NFG", "market_cap": 4632743084.23, "weight": 0.0013638937964631753}, {"ticker": "PNW", "market_cap": 8100689392.469999, "weight": 0.0023848678436484525}, {"ticker": "KGS", "market_cap": 1320444000.0, "weight": 0.0003887427701975304}, {"ticker": "HCCI", "market_cap": 1103820502.365, "weight": 0.00032496814699464706}, {"ticker": "NRG", "market_cap": 8550662487.6, "weight": 0.002517341305238034}, {"ticker": "XPO", "market_cap": 8547940100.699999, "weight": 0.002516539826171102}, {"ticker": "SKYW", "market_cap": 1764113664.24, "weight": 0.000519360482368032}, {"ticker": "T", "market_cap": 104000077500.0, "weight": 0.030617942319483334}, {"ticker": "AWR", "market_cap": 2856086796.16, "weight": 0.0008408407271068123}, {"ticker": "GXO", "market_cap": 6593802470.639999, "weight": 0.0019412357044841838}, {"ticker": "AREN", "market_cap": 107058901.5, "weight": 3.1518469502239053e-05}, {"ticker": "WMB", "market_cap": 39655339693.8, "weight": 0.011674653832871293}, {"ticker": "GWRS", "market_cap": 232520373.54, "weight": 6.845471230684841e-05}, {"ticker": "CHRW", "market_cap": 9896083783.18, "weight": 0.00291343746798823}, {"ticker": "CXDO", "market_cap": 52730882.12, "weight": 1.5524133693127633e-05}, {"ticker": "ROKU", "market_cap": 9875828733.890001, "weight": 0.0029074743192507736}, {"ticker": "TGNA", "market_cap": 2790072159.225, "weight": 0.0008214058151865066}, {"ticker": "PAGP", "market_cap": 2929086615.265, "weight": 0.0008623320981174696}, {"ticker": "LSXMK", "market_cap": 8059892693.72, "weight": 0.002372857170203014}, {"ticker": "AGR", "market_cap": 11157876772.652, "weight": 0.0032849132005018152}, {"ticker": "USDP", "market_cap": 18810295.8204, "weight": 5.537808877511901e-06}, {"ticker": "EIX", "market_cap": 23365283358.24, "weight": 0.0068788112022414236}, {"ticker": "D", "market_cap": 35295081470.34, "weight": 0.010390980416532239}, {"ticker": "PAA", "market_cap": 10090787210.24, "weight": 0.0029707587550721628}, {"ticker": "RLGT", "market_cap": 272880442.66999996, "weight": 8.033684065076911e-05}, {"ticker": "PESI", "market_cap": 142441036.5, "weight": 4.1935078745344396e-05}, {"ticker": "UTL", "market_cap": 697930380.53, "weight": 0.0002054728481724698}, {"ticker": "MARK", "market_cap": 8254047.36, "weight": 2.4300169004274415e-06}, {"ticker": "MBAC", "market_cap": 151620711.82999998, "weight": 4.4637603363804645e-05}, {"ticker": "CMCSA", "market_cap": 178659506938.44, "weight": 0.05259790771087155}, {"ticker": "MOND", "market_cap": 381707240.18, "weight": 0.00011237578416958787}, {"ticker": "CWEN.A", "market_cap": 2127640217.3449998, "weight": 0.000626383816409004}, {"ticker": "PEG", "market_cap": 27960201357.120003, "weight": 0.008231569177373353}, {"ticker": "GTN.A", "market_cap": 677729278.8, "weight": 0.00019952558176241205}, {"ticker": "SGLY", "market_cap": 9057278.4946, "weight": 2.6664906140974717e-06}, {"ticker": "SGA", "market_cap": 131758136.4343, "weight": 3.879000014656733e-05}, {"ticker": "AES", "market_cap": 8842451407.175, "weight": 0.002603244859579248}, {"ticker": "USM", "market_cap": 3347794424.0, "weight": 0.00098560096334082}, {"ticker": "WES", "market_cap": 10002107572.905, "weight": 0.002944651197403894}, {"ticker": "AROC", "market_cap": 1867822439.5600002, "weight": 0.0005498926644308004}, {"ticker": "DISH", "market_cap": 2650681525.335, "weight": 0.0007803687843408303}, {"ticker": "OMEX", "market_cap": 72736117.8301, "weight": 2.141373654519772e-05}, {"ticker": "AEP", "market_cap": 37690279379.04, "weight": 0.011096134039252605}, {"ticker": "TMUS", "market_cap": 162139335300.78, "weight": 0.0477343184283555}, {"ticker": "PARA", "market_cap": 7666730159.475, "weight": 0.0022571089122683475}, {"ticker": "CLIN", "market_cap": 176730753.4, "weight": 5.203007674374121e-05}, {"ticker": "BLDE", "market_cap": 186398945.835, "weight": 5.487642229870962e-05}, {"ticker": "VIVK", "market_cap": 18401777.82, "weight": 5.417539923166959e-06}, {"ticker": "PATI", "market_cap": 28564560.9, "weight": 8.40949448347833e-06}, {"ticker": "CWST", "market_cap": 4348327919.98, "weight": 0.0012801610983428986}, {"ticker": "NEP", "market_cap": 2139605097.3, "weight": 0.0006299063138256212}, {"ticker": "DINO", "market_cap": 9368743410.0, "weight": 0.002758186842057109}, {"ticker": "SIRI", "market_cap": 17002633491.824999, "weight": 0.005005627534575763}, {"ticker": "ED", "market_cap": 28908045658.850002, "weight": 0.008510617451719302}, {"ticker": "JTAI", "market_cap": 24968598.195, "weight": 7.350832015801774e-06}, {"ticker": "WCN", "market_cap": 34339593203.91, "weight": 0.01010968173549523}, {"ticker": "SNDR", "market_cap": 4722477488.650001, "weight": 0.001390311880801668}, {"ticker": "BATRA", "market_cap": 2476177914.7999997, "weight": 0.0007289943852986544}, {"ticker": "UGI", "market_cap": 4482845763.599999, "weight": 0.001319763564763161}, {"ticker": "OPTT", "market_cap": 22010069.2032, "weight": 6.479831991581104e-06}, {"ticker": "CMLS", "market_cap": 87765698.8, "weight": 2.5838491355812187e-05}, {"ticker": "HA", "market_cap": 288366423.425, "weight": 8.489596096024407e-05}, {"ticker": "GSAT", "market_cap": 2444392931.26, "weight": 0.0007196367884963498}, {"ticker": "SR", "market_cap": 2933677006.26, "weight": 0.0008636835233287517}, {"ticker": "ULH", "market_cap": 627493915.51, "weight": 0.00018473613647943608}, {"ticker": "SBGI", "market_cap": 636780122.5999999, "weight": 0.0001874700243753215}, {"ticker": "VST", "market_cap": 11609706283.08, "weight": 0.0034179331964583073}, {"ticker": "USAC", "market_cap": 2323794092.12, "weight": 0.0006841321197562214}, {"ticker": "EXC", "market_cap": 37012301383.9695, "weight": 0.010896535234656064}, {"ticker": "SSP", "market_cap": 417323661.56000006, "weight": 0.00012286136804272733}, {"ticker": "NOVA", "market_cap": 1127292898.02, "weight": 0.0003318784923861193}, {"ticker": "CCOI", "market_cap": 3000761466.415, "weight": 0.0008834333944916791}, {"ticker": "EVC", "market_cap": 310628495.72999996, "weight": 9.144998343918555e-05}, {"ticker": "NXPL", "market_cap": 33659272.800000004, "weight": 9.909393318540117e-06}, {"ticker": "LSXMA", "market_cap": 8056626934.93, "weight": 0.002371895720782348}, {"ticker": "CNSL", "market_cap": 399391048.125, "weight": 0.00011758195155584612}, {"ticker": "AYRO", "market_cap": 8961477.299999999, "weight": 2.638286448091918e-06}, {"ticker": "LBRDA", "market_cap": 13045132960.44, "weight": 0.003840527220114262}, {"ticker": "UP", "market_cap": 336928460.04749995, "weight": 9.919277373160322e-05}, {"ticker": "ETR", "market_cap": 19213912003.62, "weight": 0.005656634721819948}, {"ticker": "CSX", "market_cap": 61644491001.325005, "weight": 0.018148327531702833}, {"ticker": "SPCE", "market_cap": 592925605.77, "weight": 0.00017455911989306522}, {"ticker": "SATS", "market_cap": 1196529810.67, "weight": 0.0003522620521762244}, {"ticker": "SPOK", "market_cap": 287537688.0, "weight": 8.465197870512736e-05}, {"ticker": "EAC", "market_cap": 93176154.39999999, "weight": 2.7431346106164903e-05}, {"ticker": "CHTR", "market_cap": 64840445493.240005, "weight": 0.019089226352563302}, {"ticker": "GATX", "market_cap": 3738385627.5, "weight": 0.0011005922136046533}, {"ticker": "PANL", "market_cap": 274385402.91, "weight": 8.07799055688836e-05}, {"ticker": "XEL", "market_cap": 31100931321.38, "weight": 0.009156209727634342}, {"ticker": "LBTYK", "market_cap": 7489438690.599999, "weight": 0.002204913759166166}, {"ticker": "MATX", "market_cap": 3156432565.6049995, "weight": 0.0009292634443376514}, {"ticker": "BCO", "market_cap": 3348729379.6499996, "weight": 0.0009858762171565006}, {"ticker": "SHEN", "market_cap": 1093994937.045, "weight": 0.0003220754703788621}, {"ticker": "PNM", "market_cap": 3711499951.76, "weight": 0.0010926769880700606}, {"ticker": "DAL", "market_cap": 23227403337.5, "weight": 0.0068382189005479314}, {"ticker": "NGL", "market_cap": 498936018.4917, "weight": 0.00014688829664854375}, {"ticker": "HLGN", "market_cap": 15692641.98, "weight": 4.619962009008529e-06}, {"ticker": "LUV", "market_cap": 16320364010.199999, "weight": 0.004804765303153503}, {"ticker": "HTLD", "market_cap": 1141156450.2, "weight": 0.0003359599647387759}, {"ticker": "SURG", "market_cap": 63008784.86, "weight": 1.8549979835007478e-05}, {"ticker": "UNP", "market_cap": 123153853440.6155, "weight": 0.03625687279960796}, {"ticker": "ES", "market_cap": 19618622803.0, "weight": 0.005775782824488322}, {"ticker": "SMHI", "market_cap": 353616494.7, "weight": 0.00010410578240138796}, {"ticker": "NFE", "market_cap": 5734728425.82, "weight": 0.0016883216664877795}, {"ticker": "DTE", "market_cap": 20066039004.775, "weight": 0.005907503528819041}, {"ticker": "BZFD", "market_cap": 44644483.223, "weight": 1.3143473015248045e-05}, {"ticker": "PPL", "market_cap": 16860900352.5, "weight": 0.0049639008629335036}, {"ticker": "IDT", "market_cap": 709053131.9699999, "weight": 0.00020874742036712868}, {"ticker": "UAL", "market_cap": 13579999685.525, "weight": 0.0039979936271682705}, {"ticker": "RCL", "market_cap": 22694397873.81, "weight": 0.006681300454566679}, {"ticker": "CLNE", "market_cap": 787072871.0699999, "weight": 0.00023171667124624403}, {"ticker": "NJR", "market_cap": 3925891902.2400002, "weight": 0.001155794636934872}, {"ticker": "DKL", "market_cap": 1776572533.76, "weight": 0.0005230284118301935}, {"ticker": "WM", "market_cap": 62261689135.47, "weight": 0.018330032558518262}, {"ticker": "CDZI", "market_cap": 203116598.29999998, "weight": 5.9798150543484606e-05}, {"ticker": "ATSG", "market_cap": 1473602885.475, "weight": 0.00043383321660791797}, {"ticker": "TSQ", "market_cap": 147430048.6, "weight": 4.34038592345609e-05}, {"ticker": "HE", "market_cap": 1282455708.3, "weight": 0.0003775589004154496}, {"ticker": "VTOL", "market_cap": 753992409.24, "weight": 0.00022197768165546408}, {"ticker": "TRKA", "market_cap": 17356392.900000002, "weight": 5.109775391143243e-06}, {"ticker": "SNCY", "market_cap": 819178849.125, "weight": 0.00024116876981990703}, {"ticker": "CEG", "market_cap": 34201274317.199997, "weight": 0.010068960230311908}, {"ticker": "AEE", "market_cap": 19096636203.800003, "weight": 0.005622108366064494}, {"ticker": "RGCO", "market_cap": 161699353.096, "weight": 4.760478631557843e-05}, {"ticker": "EGLE", "market_cap": 413561373.9, "weight": 0.00012175373899732411}, {"ticker": "ODFL", "market_cap": 43874412563.93, "weight": 0.01291676184744789}, {"ticker": "AWK", "market_cap": 23099380941.059998, "weight": 0.006800528713732427}, {"ticker": "GTN", "market_cap": 597308586.21, "weight": 0.00017584948279975965}, {"ticker": "CNP", "market_cap": 16669571790.49, "weight": 0.00490757314648837}, {"ticker": "MGEE", "market_cap": 2504675006.2000003, "weight": 0.0007373840165540566}]}, "Retail Trade": {"sic_description": "Retail Trade", "companies": [{"ticker": "MCD", "market_cap": 185809173539.18, "weight": 0.04762466155602507}, {"ticker": "NDLS", "market_cap": 104929933.24, "weight": 2.689454165511143e-05}, {"ticker": "CRMT", "market_cap": 585164571.41, "weight": 0.0001499832550630304}, {"ticker": "GPS", "market_cap": 3859704530.5750003, "weight": 0.0009892790462045248}, {"ticker": "KR", "market_cap": 32218153696.62, "weight": 0.008257819764953553}, {"ticker": "CHUY", "market_cap": 624855510.5600001, "weight": 0.0001601564209399076}, {"ticker": "CNXN", "market_cap": 1387145898.72, "weight": 0.0003555387104794276}, {"ticker": "WSM", "market_cap": 9677227881.75, "weight": 0.0024803657101014577}, {"ticker": "OSTK", "market_cap": 672622901.76, "weight": 0.00017239965842911884}, {"ticker": "NGVC", "market_cap": 289794038.445, "weight": 7.427697319253546e-05}, {"ticker": "BH.A", "market_cap": 519739594.08, "weight": 0.00013321421000834772}, {"ticker": "KAVL", "market_cap": 24344352.349999998, "weight": 6.239689458738712e-06}, {"ticker": "ABG", "market_cap": 4398973911.6, "weight": 0.0011274989266854382}, {"ticker": "HBI", "market_cap": 1320822013.1499999, "weight": 0.00033853926667809254}, {"ticker": "BARK", "market_cap": 205712265.64999998, "weight": 5.2726013699418156e-05}, {"ticker": "JWN", "market_cap": 2361313251.0750003, "weight": 0.0006052270846923031}, {"ticker": "TTSH", "market_cap": 238408770.0554, "weight": 6.110643930872703e-05}, {"ticker": "DDS", "market_cap": 5135451962.71, "weight": 0.001316265268300745}, {"ticker": "GROV", "market_cap": 90354152.832, "weight": 2.315863025943662e-05}, {"ticker": "WOOF", "market_cap": 1005458119.475, "weight": 0.0002577084959621613}, {"ticker": "FND", "market_cap": 9237086918.84, "weight": 0.0023675533876726528}, {"ticker": "DLTH", "market_cap": 195702016.48000002, "weight": 5.016029146013268e-05}, {"ticker": "LVO", "market_cap": 83126840.832, "weight": 2.1306201332469673e-05}, {"ticker": "TSCO", "market_cap": 22309965254.719997, "weight": 0.005718256662708191}, {"ticker": "FCFS", "market_cap": 4520263861.5199995, "weight": 0.001158586696492827}, {"ticker": "FAT", "market_cap": 110190392.39999999, "weight": 2.824284745913819e-05}, {"ticker": "PSMT", "market_cap": 2312399727.6, "weight": 0.0005926900825807341}, {"ticker": "SGU", "market_cap": 405513067.28000003, "weight": 0.00010393686284645886}, {"ticker": "ARKR", "market_cap": 55828391.93, "weight": 1.4309348781010163e-05}, {"ticker": "M", "market_cap": 3122166347.51, "weight": 0.0008002409826682818}, {"ticker": "ANF", "market_cap": 2741438945.24, "weight": 0.0007026569219201184}, {"ticker": "HD", "market_cap": 291219213958.39996, "weight": 0.07464225925560111}, {"ticker": "PZZA", "market_cap": 2112509704.8600001, "weight": 0.0005414563652131075}, {"ticker": "LL", "market_cap": 86336241.21000001, "weight": 2.212880122831281e-05}, {"ticker": "SIG", "market_cap": 3138890287.6800003, "weight": 0.0008045274878784863}, {"ticker": "DG", "market_cap": 23356688810.74, "weight": 0.0059865418832312795}, {"ticker": "URBN", "market_cap": 2882036580.675, "weight": 0.000738693435487396}, {"ticker": "WING", "market_cap": 5494899643.9614, "weight": 0.0014083951338000188}, {"ticker": "BBY", "market_cap": 14869038749.599998, "weight": 0.0038110763027736313}, {"ticker": "CPNG", "market_cap": 30100675730.625, "weight": 0.007715089987074272}, {"ticker": "RH", "market_cap": 4567295658.24, "weight": 0.001170641394108117}, {"ticker": "DKS", "market_cap": 8925303701.6, "weight": 0.002287640378443468}, {"ticker": "AEO", "market_cap": 3237742507.14, "weight": 0.000829864253583715}, {"ticker": "SFT", "market_cap": 28556655.3779, "weight": 7.319342859343588e-06}, {"ticker": "GRWG", "market_cap": 163795027.54999998, "weight": 4.1982226189621834e-05}, {"ticker": "AN", "market_cap": 6242429840.16, "weight": 0.0015999942455056661}, {"ticker": "CATO", "market_cap": 152876473.2, "weight": 3.918369667842863e-05}, {"ticker": "KRUS", "market_cap": 742218726.15, "weight": 0.0001902377313248438}, {"ticker": "BH", "market_cap": 503889674.4, "weight": 0.00012915172457734174}, {"ticker": "MUSA", "market_cap": 7456209545.84, "weight": 0.0019110975488869316}, {"ticker": "BROS", "market_cap": 1650075101.3999999, "weight": 0.00042292997029895485}, {"ticker": "GME", "market_cap": 4517571151.2, "weight": 0.0011578965291818392}, {"ticker": "SG", "market_cap": 1265145918.615, "weight": 0.0003242689531705008}, {"ticker": "ARMK", "market_cap": 6433583534.474999, "weight": 0.001648988758658786}, {"ticker": "EZPW", "market_cap": 458196960.0, "weight": 0.00011744024651935846}, {"ticker": "BBWI", "market_cap": 7394424136.320001, "weight": 0.0018952613597395217}, {"ticker": "DBGI", "market_cap": 4805789.6646, "weight": 1.2317696802938393e-06}, {"ticker": "LE", "market_cap": 234977023.36, "weight": 6.0226849933232764e-05}, {"ticker": "JACK", "market_cap": 1291936687.0, "weight": 0.00033113568236830567}, {"ticker": "LIVE", "market_cap": 88822743.1, "weight": 2.276611535395094e-05}, {"ticker": "QRTEB", "market_cap": 3118082895.8199997, "weight": 0.000799194355093268}, {"ticker": "DXLG", "market_cap": 264204784.375, "weight": 6.77182035616167e-05}, {"ticker": "CASY", "market_cap": 10138760990.16, "weight": 0.002598661043244908}, {"ticker": "ONEW", "market_cap": 354191211.21000004, "weight": 9.078258214435243e-05}, {"ticker": "LVLU", "market_cap": 94771622.92310001, "weight": 2.429086993315833e-05}, {"ticker": "RUSHA", "market_cap": 3265728439.08, "weight": 0.0008370373145881084}, {"ticker": "KMX", "market_cap": 10886227191.69, "weight": 0.002790243752507256}, {"ticker": "LESL", "market_cap": 915424556.5999999, "weight": 0.00023463203596326438}, {"ticker": "CAVA", "market_cap": 3480766755.8849998, "weight": 0.0008921536840565725}, {"ticker": "BKE", "market_cap": 1651599617.24, "weight": 0.0004233207182342364}, {"ticker": "RENT", "market_cap": 50340785.6035, "weight": 1.2902822993965765e-05}, {"ticker": "HOUR", "market_cap": 46644132.080000006, "weight": 1.1955335474414141e-05}, {"ticker": "LOW", "market_cap": 115024834298.89, "weight": 0.029481960980077215}, {"ticker": "CDW", "market_cap": 27378603735.985, "weight": 0.007017396999120001}, {"ticker": "KAR", "market_cap": 1616101391.79, "weight": 0.00041422218482657744}, {"ticker": "YUMC", "market_cap": 22101120512.9463, "weight": 0.005664727765532237}, {"ticker": "WINA", "market_cap": 1317335861.73, "weight": 0.00033764573285331864}, {"ticker": "ZUMZ", "market_cap": 342090135.42, "weight": 8.76809611210985e-05}, {"ticker": "IPW", "market_cap": 22028613.1974, "weight": 5.646143449712651e-06}, {"ticker": "GTIM", "market_cap": 32484153.57, "weight": 8.325998066930645e-06}, {"ticker": "BODY", "market_cap": 109471061.9124, "weight": 2.8058476201431387e-05}, {"ticker": "BFI", "market_cap": 29748111.000000004, "weight": 7.624724287400859e-06}, {"ticker": "WEN", "market_cap": 4064375698.2200003, "weight": 0.0010417382165657462}, {"ticker": "SPH", "market_cap": 1006944281.466, "weight": 0.0002580894134405111}, {"ticker": "JAN", "market_cap": 1662190.566, "weight": 4.260352793113075e-07}, {"ticker": "BATRK", "market_cap": 2270961275.55, "weight": 0.0005820690124973959}, {"ticker": "STKS", "market_cap": 160957171.06, "weight": 4.125485653231953e-05}, {"ticker": "WISH", "market_cap": 102262600.0, "weight": 2.6210878731518748e-05}, {"ticker": "RVLV", "market_cap": 1015471722.94, "weight": 0.0002602750779392148}, {"ticker": "CMG", "market_cap": 51164814698.19, "weight": 0.013114029502231376}, {"ticker": "YUM", "market_cap": 34474393901.43, "weight": 0.008836115626758867}, {"ticker": "AMZN", "market_cap": 1301429496653.46, "weight": 0.3335687799293713}, {"ticker": "DNUT", "market_cap": 2135299000.0, "weight": 0.0005472974786924374}, {"ticker": "MDVL", "market_cap": 9683466.0, "weight": 2.4819645992453246e-06}, {"ticker": "GPI", "market_cap": 3603487402.4999995, "weight": 0.0009236081550584767}, {"ticker": "JOAN", "market_cap": 25357181.426999997, "weight": 6.499287201344543e-06}, {"ticker": "KIRK", "market_cap": 22282468.425, "weight": 5.711208963262919e-06}, {"ticker": "CVNA", "market_cap": 4173572369.7500005, "weight": 0.0010697263638977945}, {"ticker": "RICK", "market_cap": 550115444.0, "weight": 0.0001409998297620009}, {"ticker": "ASO", "market_cap": 3319779724.7599998, "weight": 0.0008508911741050887}, {"ticker": "BTBD", "market_cap": 13866381.96, "weight": 3.554085814349325e-06}, {"ticker": "HIBB", "market_cap": 574853709.7800001, "weight": 0.00014734048298603063}, {"ticker": "PBPB", "market_cap": 220176249.93, "weight": 5.643327068230021e-05}, {"ticker": "BNED", "market_cap": 52441850.115, "weight": 1.3441345847071634e-05}, {"ticker": "RUSHB", "market_cap": 3650929345.4700003, "weight": 0.0009357679770654892}, {"ticker": "BURL", "market_cap": 8164421169.66, "weight": 0.0020926189358670983}, {"ticker": "QSR", "market_cap": 20535484669.620003, "weight": 0.0052634403816094275}, {"ticker": "AKA", "market_cap": 53439323.1944, "weight": 1.369700770118162e-05}, {"ticker": "OLLI", "market_cap": 4642324139.025, "weight": 0.0011898719085998836}, {"ticker": "NATH", "market_cap": 282275826.8, "weight": 7.234998391488179e-05}, {"ticker": "TCS", "market_cap": 111007329.12, "weight": 2.8452236124195064e-05}, {"ticker": "PLBY", "market_cap": 49862311.554254, "weight": 1.2780185536273846e-05}, {"ticker": "BJRI", "market_cap": 543124431.36, "weight": 0.00013920796661244717}, {"ticker": "FATBB", "market_cap": 101675680.25999999, "weight": 2.6060445610022966e-05}, {"ticker": "GO", "market_cap": 2809230564.2400002, "weight": 0.0007200325597840328}, {"ticker": "DIBS", "market_cap": 141937523.04, "weight": 3.637993952680245e-05}, {"ticker": "FAST", "market_cap": 31309048619.199997, "weight": 0.008024807471715717}, {"ticker": "BLDR", "market_cap": 14878735452.78, "weight": 0.003813561660188234}, {"ticker": "NSIT", "market_cap": 5088712929.35, "weight": 0.0013042856087240534}, {"ticker": "VNCE", "market_cap": 20858101.1125, "weight": 5.3461300497884255e-06}, {"ticker": "BGFV", "market_cap": 156714904.16, "weight": 4.0167523105801565e-05}, {"ticker": "APRN", "market_cap": 82420628.0216, "weight": 2.1125192260413616e-05}, {"ticker": "CWH", "market_cap": 826429598.13, "weight": 0.0002118217801691254}, {"ticker": "PAG", "market_cap": 10624408038.07, "weight": 0.002723137008838283}, {"ticker": "W", "market_cap": 6623212683.36, "weight": 0.0016975925162924259}, {"ticker": "DLTR", "market_cap": 22969678090.485, "weight": 0.005887347348216508}, {"ticker": "AAP", "market_cap": 3110895299.9361, "weight": 0.0007973521057852701}, {"ticker": "QRTEA", "market_cap": 201664538.4117, "weight": 5.168854264175538e-05}, {"ticker": "BLMN", "market_cap": 2082060550.115, "weight": 0.0005336519567343631}, {"ticker": "CONN", "market_cap": 86161522.02, "weight": 2.208401903520253e-05}, {"ticker": "TDUP", "market_cap": 388653360.81, "weight": 9.961555943999186e-05}, {"ticker": "SCVL", "market_cap": 657453518.9100001, "weight": 0.0001685116010717533}, {"ticker": "CTRN", "market_cap": 184555428.35, "weight": 4.730331471843418e-05}, {"ticker": "BDL", "market_cap": 60406027.5, "weight": 1.5482640393020386e-05}, {"ticker": "TITN", "market_cap": 567482271.02, "weight": 0.0001454511129972451}, {"ticker": "BBW", "market_cap": 417532809.4272, "weight": 0.0001070176372821214}, {"ticker": "CURV", "market_cap": 206581852.07000002, "weight": 5.294889698422802e-05}, {"ticker": "CHWY", "market_cap": 7788977923.200001, "weight": 0.001996389254600137}, {"ticker": "CAKE", "market_cap": 1504936864.2, "weight": 0.00038572965723674443}, {"ticker": "VLGEA", "market_cap": 356572032.0, "weight": 9.139280919713779e-05}, {"ticker": "VSCO", "market_cap": 1101147546.0, "weight": 0.0002822346077032607}, {"ticker": "LAZY", "market_cap": 99908784.78, "weight": 2.560757346363173e-05}, {"ticker": "SBH", "market_cap": 856229098.585, "weight": 0.00021945967606347823}, {"ticker": "ODP", "market_cap": 1774245293.94, "weight": 0.0004547559737326176}, {"ticker": "FWRG", "market_cap": 1035716729.9999999, "weight": 0.0002654640661418265}, {"ticker": "CVS", "market_cap": 87615275602.12001, "weight": 0.022456629929571134}, {"ticker": "LAD", "market_cap": 7692142384.079999, "weight": 0.0019715693832808513}, {"ticker": "WBA", "market_cap": 19021965235.455, "weight": 0.004875510929916475}, {"ticker": "SDOT", "market_cap": 28258651.99, "weight": 7.242961751667579e-06}, {"ticker": "GCO", "market_cap": 343559694.38, "weight": 8.805762308441036e-05}, {"ticker": "PETS", "market_cap": 208835410.85500002, "weight": 5.352650557258763e-05}, {"ticker": "WEL", "market_cap": 90598341.12, "weight": 2.322121804426143e-05}, {"ticker": "ARHS", "market_cap": 1249914740.58, "weight": 0.00032036505711843913}, {"ticker": "RAD", "market_cap": 28333991.917000003, "weight": 7.26227209279169e-06}, {"ticker": "ELA", "market_cap": 124399596.25, "weight": 3.188480179027958e-05}, {"ticker": "DIN", "market_cap": 757347141.2, "weight": 0.0001941152882447308}, {"ticker": "TLYS", "market_cap": 239271368.8764, "weight": 6.132753160533577e-05}, {"ticker": "TAST", "market_cap": 325239413.91, "weight": 8.336196064548763e-05}, {"ticker": "BJ", "market_cap": 9358533799.02, "weight": 0.0023986813802009013}, {"ticker": "BOOT", "market_cap": 2293920528.45, "weight": 0.0005879536877699603}, {"ticker": "KSS", "market_cap": 2224844699.1000004, "weight": 0.000570248894557467}, {"ticker": "HVT", "market_cap": 454098054.84, "weight": 0.00011638965807274399}, {"ticker": "SHAK", "market_cap": 2291586387.81, "weight": 0.0005873554252843855}, {"ticker": "ACI", "market_cap": 13203207039.0, "weight": 0.003384107763408751}, {"ticker": "IMKTA", "market_cap": 1499795928.9599998, "weight": 0.00038441198655222986}, {"ticker": "EAT", "market_cap": 1352019892.4850001, "weight": 0.00034653558040305404}, {"ticker": "REAL", "market_cap": 173130622.20000002, "weight": 4.4375028047366175e-05}, {"ticker": "DRI", "market_cap": 16952340807.300001, "weight": 0.004345046469731035}, {"ticker": "REBN", "market_cap": 7089947.1618, "weight": 1.8172210101328867e-06}, {"ticker": "GENK", "market_cap": 45270900.0, "weight": 1.1603363008242623e-05}, {"ticker": "LOCO", "market_cap": 287943972.85499996, "weight": 7.380278375451173e-05}, {"ticker": "TGT", "market_cap": 49022500276.8, "weight": 0.012564933904194194}, {"ticker": "BIG", "market_cap": 120573863.2, "weight": 3.090422995822452e-05}, {"ticker": "HNST", "market_cap": 113023816.42999999, "weight": 2.8969081034710307e-05}, {"ticker": "VRM", "market_cap": 145250064.96, "weight": 3.7228975582586216e-05}, {"ticker": "CBRL", "market_cap": 1469717919.45, "weight": 0.0003767027061334642}, {"ticker": "DENN", "market_cap": 465343664.76000005, "weight": 0.00011927201504269279}, {"ticker": "TJX", "market_cap": 100278660558.1, "weight": 0.02570237614971154}, {"ticker": "POL", "market_cap": 7984069.7646, "weight": 2.0463931523735565e-06}, {"ticker": "WMK", "market_cap": 1726880040.6000001, "weight": 0.0004426158080084682}, {"ticker": "HZO", "market_cap": 726771251.83, "weight": 0.0001862783964740795}, {"ticker": "SFIX", "market_cap": 394219459.2, "weight": 0.00010104220349077867}, {"ticker": "ORLY", "market_cap": 53930010923.16, "weight": 0.013822775641304135}, {"ticker": "DBI", "market_cap": 729563138.5500001, "weight": 0.00018699398364133382}, {"ticker": "CPRT", "market_cap": 41558808028.53, "weight": 0.010651918467379742}, {"ticker": "NUZE", "market_cap": 4676046.4539, "weight": 1.1985152592064076e-06}, {"ticker": "PLCE", "market_cap": 296372853.75, "weight": 7.596318623773884e-05}, {"ticker": "SAH", "market_cap": 1591522336.425, "weight": 0.0004079223387488589}, {"ticker": "CNNE", "market_cap": 1335002048.01, "weight": 0.0003421737447191767}, {"ticker": "COST", "market_cap": 252459270256.69998, "weight": 0.06470771638258838}, {"ticker": "FL", "market_cap": 1724995628.0, "weight": 0.0004421328151045253}, {"ticker": "AZO", "market_cap": 44518929560.0, "weight": 0.011410625819744318}, {"ticker": "LOVE", "market_cap": 271166726.16, "weight": 6.950261557404871e-05}, {"ticker": "FRGI", "market_cap": 221297987.95, "weight": 5.6720782824674386e-05}, {"ticker": "SPWH", "market_cap": 160757585.5, "weight": 4.1203700851653065e-05}, {"ticker": "SFM", "market_cap": 4345462629.0, "weight": 0.0011137834751029766}, {"ticker": "KXIN", "market_cap": 33886782.72, "weight": 8.685505282236566e-06}, {"ticker": "SBUX", "market_cap": 104185584000.0, "weight": 0.026703757852787433}, {"ticker": "PLAY", "market_cap": 1530356727.645, "weight": 0.0003922450104365326}, {"ticker": "RRGB", "market_cap": 120741820.0, "weight": 3.094727888634618e-05}, {"ticker": "SHW", "market_cap": 65570323298.93, "weight": 0.01680629861136655}, {"ticker": "EXPR", "market_cap": 32171491.34, "weight": 8.245859758355895e-06}, {"ticker": "PRTS", "market_cap": 222935985.16, "weight": 5.714061711633015e-05}, {"ticker": "FIVE", "market_cap": 8901364420.05, "weight": 0.002281504512490258}, {"ticker": "TXRH", "market_cap": 6475265000.280001, "weight": 0.001659672115482951}, {"ticker": "YOSH", "market_cap": 5102371.4, "weight": 1.3077864048886841e-06}, {"ticker": "ARKO", "market_cap": 874501021.35, "weight": 0.00022414294396186035}, {"ticker": "CHS", "market_cap": 921001946.76, "weight": 0.00023606157420228948}, {"ticker": "FLWS", "market_cap": 443241644.4, "weight": 0.00011360705663778699}, {"ticker": "ULTA", "market_cap": 19481745555.260002, "weight": 0.004993357006640007}, {"ticker": "PTLO", "market_cap": 856827780.75, "weight": 0.00021961312400657312}, {"ticker": "ROST", "market_cap": 37855690507.880005, "weight": 0.009702774163770021}, {"ticker": "WMT", "market_cap": 432938045272.5, "weight": 0.1109661460093746}, {"ticker": "EZFL", "market_cap": 9588285.3, "weight": 2.4575688789596968e-06}, {"ticker": "PIK", "market_cap": 5898164.58, "weight": 1.511755779189256e-06}, {"ticker": "SVV", "market_cap": 2557616898.7599998, "weight": 0.0006555415799625808}]}, "Construction": {"sic_description": "Construction", "companies": [{"ticker": "TPC", "market_cap": 393976450.3, "weight": 0.0014068661147266387}, {"ticker": "LSEA", "market_cap": 314818305.62, "weight": 0.0011241971598433707}, {"ticker": "MYRG", "market_cap": 2115510552.0700002, "weight": 0.007554360441563498}, {"ticker": "SLND", "market_cap": 308671935.3, "weight": 0.0011022488425640384}, {"ticker": "GRBK", "market_cap": 1847353198.44, "weight": 0.006596786723770103}, {"ticker": "IBP", "market_cap": 3417223119.04, "weight": 0.012202697417515796}, {"ticker": "ORN", "market_cap": 161149263.03, "weight": 0.0005754542876799894}, {"ticker": "LMB", "market_cap": 320089604.16, "weight": 0.001143020648635371}, {"ticker": "PHM", "market_cap": 15811045176.849998, "weight": 0.05646028761562837}, {"ticker": "ROAD", "market_cap": 2010473684.73, "weight": 0.007179280130684106}, {"ticker": "PRIM", "market_cap": 1648928753.16, "weight": 0.005888225011045158}, {"ticker": "BZH", "market_cap": 736158136.8599999, "weight": 0.0026287762556365902}, {"ticker": "DFH", "market_cap": 1947825154.8400002, "weight": 0.006955566013323625}, {"ticker": "HCDI", "market_cap": 3097998.2600000002, "weight": 1.106276472148845e-05}, {"ticker": "AMRC", "market_cap": 1784743984.3999999, "weight": 0.006373213000935981}, {"ticker": "J", "market_cap": 16767180958.0, "weight": 0.05987459075621795}, {"ticker": "TPH", "market_cap": 2619393358.6800003, "weight": 0.009353695518249336}, {"ticker": "KBH", "market_cap": 3582102920.0625, "weight": 0.012791473231107683}, {"ticker": "KBR", "market_cap": 7717211044.400001, "weight": 0.027557694654828293}, {"ticker": "ESOA", "market_cap": 67014263.324999996, "weight": 0.00023930388784283794}, {"ticker": "BBCP", "market_cap": 457646991.83, "weight": 0.0016342297739419117}, {"ticker": "AGX", "market_cap": 608396069.04, "weight": 0.002172545626048209}, {"ticker": "LEN", "market_cap": 30920751717.26, "weight": 0.11041613730913047}, {"ticker": "MTZ", "market_cap": 5368028380.98, "weight": 0.019168905213347114}, {"ticker": "IESC", "market_cap": 1390594045.73, "weight": 0.0049657273697157394}, {"ticker": "HOV", "market_cap": 556152550.4739, "weight": 0.0019859871758444708}, {"ticker": "UHG", "market_cap": 265958951.5, "weight": 0.0009497233565322459}, {"ticker": "MDC", "market_cap": 2971420899.1, "weight": 0.010610764608775785}, {"ticker": "MTH", "market_cap": 4321021830.51, "weight": 0.015430108042522744}, {"ticker": "GVA", "market_cap": 1642614619.8, "weight": 0.005865677622079943}, {"ticker": "LEN.B", "market_cap": 28620320584.350002, "weight": 0.10220143663935978}, {"ticker": "MTRX", "market_cap": 288832430.37, "weight": 0.0010314031684185015}, {"ticker": "APG", "market_cap": 5998395687.360001, "weight": 0.02141990880125758}, {"ticker": "MHO", "market_cap": 2228508117.6400003, "weight": 0.007957867925135123}, {"ticker": "GEO", "market_cap": 1019541146.0850002, "weight": 0.003640719870196131}, {"ticker": "PWR", "market_cap": 24496519072.25, "weight": 0.08747559044521742}, {"ticker": "TMHC", "market_cap": 4514733671.25, "weight": 0.01612184132899433}, {"ticker": "FLR", "market_cap": 5036529924.72, "weight": 0.017985144242757996}, {"ticker": "FIX", "market_cap": 5895926079.370001, "weight": 0.021053996018499426}, {"ticker": "BLD", "market_cap": 7604919433.65, "weight": 0.027156708093291546}, {"ticker": "EME", "market_cap": 9632042563.1, "weight": 0.034395442385735185}, {"ticker": "GLDD", "market_cap": 494035344.53, "weight": 0.0017641703842128287}, {"ticker": "PLPC", "market_cap": 788692135.4499999, "weight": 0.002816371992465757}, {"ticker": "DHI", "market_cap": 35264033831.36, "weight": 0.12592573548022087}, {"ticker": "LGIH", "market_cap": 2329880756.9500003, "weight": 0.008319863498974742}, {"ticker": "CCS", "market_cap": 2009759025.17, "weight": 0.007176728124548298}, {"ticker": "STRL", "market_cap": 2235542797.8, "weight": 0.007982988343214701}, {"ticker": "DY", "market_cap": 2528610428.3863997, "weight": 0.009029515155873863}, {"ticker": "NVR", "market_cap": 19308485221.69, "weight": 0.06894943483147507}, {"ticker": "TOL", "market_cap": 7666477070.0, "weight": 0.0273765266956916}]}, "Wholesale Trade": {"sic_description": "Wholesale Trade", "companies": [{"ticker": "CNM", "market_cap": 5199891736.1, "weight": 0.010216551016621833}, {"ticker": "RELL", "market_cap": 154444756.41, "weight": 0.0003034472279793927}, {"ticker": "CENT", "market_cap": 2358506523.1, "weight": 0.004633904596321222}, {"ticker": "LKQ", "market_cap": 12976484284.5, "weight": 0.025495706533386207}, {"ticker": "COR", "market_cap": 36500192786.549995, "weight": 0.07171420111142653}, {"ticker": "SEB", "market_cap": 4231155532.9, "weight": 0.00831321468888045}, {"ticker": "NUS", "market_cap": 1017164934.6, "weight": 0.0019984872712857306}, {"ticker": "REZI", "market_cap": 2287878958.38, "weight": 0.004495138222949989}, {"ticker": "SGBX", "market_cap": 6859531.1389, "weight": 1.3477347873253908e-05}, {"ticker": "VOXX", "market_cap": 169907495.76000002, "weight": 0.0003338278346234236}, {"ticker": "UGRO", "market_cap": 14704930.8, "weight": 2.8891693007972376e-05}, {"ticker": "SNX", "market_cap": 8990823719.245, "weight": 0.017664831090889798}, {"ticker": "AVT", "market_cap": 4364949301.8, "weight": 0.008576087636058034}, {"ticker": "STKL", "market_cap": 381506185.5, "weight": 0.0007495689535722645}, {"ticker": "WEYS", "market_cap": 247161629.44, "weight": 0.0004856138405718106}, {"ticker": "OMI", "market_cap": 1197323176.98, "weight": 0.0023524553859604926}, {"ticker": "ARW", "market_cap": 6822288284.91, "weight": 0.0134041745194412}, {"ticker": "WTER", "market_cap": 3486657.6, "weight": 6.850453250899606e-06}, {"ticker": "BXC", "market_cap": 699750154.72, "weight": 0.0013748426923880126}, {"ticker": "BECN", "market_cap": 4733479774.759999, "weight": 0.009300162399391375}, {"ticker": "ZEUS", "market_cap": 573938202.81, "weight": 0.0011276521179639897}, {"ticker": "CHEF", "market_cap": 794900447.64, "weight": 0.0015617903965324813}, {"ticker": "HDSN", "market_cap": 589455178.725, "weight": 0.0011581392865638097}, {"ticker": "DXPE", "market_cap": 573405467.9200001, "weight": 0.0011266054205598434}, {"ticker": "UNFI", "market_cap": 770736683.1500001, "weight": 0.0015143143441078062}, {"ticker": "PDCO", "market_cap": 2833326000.0, "weight": 0.005566811982787865}, {"ticker": "VRTV", "market_cap": 2289184113.33, "weight": 0.0044977025421335404}, {"ticker": "UUU", "market_cap": 5527799.930000001, "weight": 1.086081265931909e-05}, {"ticker": "RS", "market_cap": 14994997090.9, "weight": 0.02946160430797278}, {"ticker": "SITE", "market_cap": 7103008698.24, "weight": 0.013955723391946024}, {"ticker": "PLUS", "market_cap": 1712711872.74, "weight": 0.0033650716423849836}, {"ticker": "GDC", "market_cap": 8000335.0600000005, "weight": 1.5718756358543235e-05}, {"ticker": "AEY", "market_cap": 5408691.164, "weight": 1.0626792251563725e-05}, {"ticker": "ASLE", "market_cap": 730922112.0, "weight": 0.0014360881774868877}, {"ticker": "BIMI", "market_cap": 6532445.244, "weight": 1.2834701852594722e-05}, {"ticker": "PFGC", "market_cap": 8856187609.5, "weight": 0.017400303144213553}, {"ticker": "CLMB", "market_cap": 193767642.73999998, "weight": 0.00038070735082429267}, {"ticker": "EDUC", "market_cap": 9535497.856, "weight": 1.8734986276421702e-05}, {"ticker": "CTNT", "market_cap": 35117151.6, "weight": 6.899685399006611e-05}, {"ticker": "NHTC", "market_cap": 61519146.3341, "weight": 0.00012087049671783197}, {"ticker": "SYY", "market_cap": 32754539694.890003, "weight": 0.06435488329412656}, {"ticker": "CUEN", "market_cap": 2965954.9864999996, "weight": 5.827396409469866e-06}, {"ticker": "HFFG", "market_cap": 225517773.46, "weight": 0.0004430888092753065}, {"ticker": "GWAV", "market_cap": 9164365.92, "weight": 1.8005800256697864e-05}, {"ticker": "CPTK", "market_cap": 116624057.35, "weight": 0.00022913854598352574}, {"ticker": "COSM", "market_cap": 16597273.13, "weight": 3.260969579274925e-05}, {"ticker": "HSIC", "market_cap": 9620166892.64, "weight": 0.018901340803835296}, {"ticker": "AIT", "market_cap": 5966670075.2, "weight": 0.011723088155745272}, {"ticker": "TAIT", "market_cap": 21346400.8, "weight": 4.1940602586088735e-05}, {"ticker": "ACAX", "market_cap": 48823981.6, "weight": 9.59275162188517e-05}, {"ticker": "TEL", "market_cap": 38526547691.84, "weight": 0.07569550674591735}, {"ticker": "RAVE", "market_cap": 32059836.045, "weight": 6.298995578395155e-05}, {"ticker": "CAPL", "market_cap": 760553521.6, "weight": 0.00149430685265105}, {"ticker": "BCC", "market_cap": 3940177333.125, "weight": 0.007741511704741841}, {"ticker": "RYI", "market_cap": 969770730.6, "weight": 0.001905368928129351}, {"ticker": "SPTN", "market_cap": 802754223.24, "weight": 0.0015772211983958063}, {"ticker": "GLP", "market_cap": 984511504.48, "weight": 0.0019343310442680342}, {"ticker": "GNLN", "market_cap": 1565833.728289, "weight": 3.07649100798588e-06}, {"ticker": "SCSC", "market_cap": 764953010.37, "weight": 0.001502950802130558}, {"ticker": "AMRK", "market_cap": 655155562.365, "weight": 0.0012872249205222429}, {"ticker": "POOL", "market_cap": 13136692524.689999, "weight": 0.025810477636757666}, {"ticker": "GMS", "market_cap": 2527751139.0, "weight": 0.004966430029615679}, {"ticker": "FSTR", "market_cap": 206182061.8, "weight": 0.00040509873281936075}, {"ticker": "AE", "market_cap": 80577636.14999999, "weight": 0.00015831589815804484}, {"ticker": "PETQ", "market_cap": 625814659.395, "weight": 0.0012295770218197241}, {"ticker": "DIT", "market_cap": 117799582.17, "weight": 0.00023144817278045648}, {"ticker": "RDUS", "market_cap": 735096298.0799999, "weight": 0.0014442894607449843}, {"ticker": "ASH", "market_cap": 4075710412.6400003, "weight": 0.00800780198376665}, {"ticker": "HPE", "market_cap": 21699656721.885, "weight": 0.04263466648799772}, {"ticker": "USFD", "market_cap": 9579820298.0, "weight": 0.018822069337542102}, {"ticker": "MCK", "market_cap": 59384027676.0, "weight": 0.11667549616703583}, {"ticker": "MEDS", "market_cap": 8050475.8950000005, "weight": 1.5817271178618648e-05}, {"ticker": "MRC", "market_cap": 848939764.46, "weight": 0.0016679648065422176}, {"ticker": "GLG", "market_cap": 23850665.5418, "weight": 4.6860887428964354e-05}, {"ticker": "MGPI", "market_cap": 2257658349.7999997, "weight": 0.004435761911868848}, {"ticker": "MMLP", "market_cap": 98065311.12, "weight": 0.00019267502187839876}, {"ticker": "DPZ", "market_cap": 12963112954.9376, "weight": 0.025469435049753974}, {"ticker": "DLA", "market_cap": 60356272.199999996, "weight": 0.0001185857255110658}, {"ticker": "MSM", "market_cap": 5517398192.88, "weight": 0.010840375718832387}, {"ticker": "GWW", "market_cap": 34718613119.88, "weight": 0.06821382062689713}, {"ticker": "WLFC", "market_cap": 258741143.68, "weight": 0.0005083648330894717}, {"ticker": "HYFM", "market_cap": 47140409.114999995, "weight": 9.261969654565137e-05}, {"ticker": "ANDE", "market_cap": 1703135305.56, "weight": 0.003346255964650901}, {"ticker": "WKC", "market_cap": 1278590928.12, "weight": 0.0025121271960029563}, {"ticker": "AENT", "market_cap": 57824984.65, "weight": 0.00011361234727459682}, {"ticker": "CENTA", "market_cap": 2136289476.9999998, "weight": 0.004197300931579076}, {"ticker": "HLF", "market_cap": 1278076405.77, "weight": 0.0025111162819099818}, {"ticker": "HWKN", "market_cap": 1240521852.21, "weight": 0.0024373305125470293}, {"ticker": "GIC", "market_cap": 1287235106.25, "weight": 0.002529110950924006}, {"ticker": "FIP", "market_cap": 290951367.525, "weight": 0.0005716502651465753}, {"ticker": "DSGR", "market_cap": 1291146946.56, "weight": 0.0025367967871152736}, {"ticker": "GPC", "market_cap": 20001874601.475002, "weight": 0.039298928259477124}, {"ticker": "CAH", "market_cap": 21717338897.565, "weight": 0.04266940775937179}, {"ticker": "FERG", "market_cap": 32796589468.5, "weight": 0.06443750110217464}, {"ticker": "ALTG", "market_cap": 365759665.6, "weight": 0.0007186307856147025}, {"ticker": "WSO", "market_cap": 14968367479.84, "weight": 0.029409283453279114}, {"ticker": "UVV", "market_cap": 1154717442.0, "weight": 0.002268745245997019}, {"ticker": "WCC", "market_cap": 7189536036.9, "weight": 0.01412572904102814}, {"ticker": "ASPN", "market_cap": 511812230.31, "weight": 0.001005589352099649}]}, "Mining": {"sic_description": "Mining", "companies": [{"ticker": "CRK", "market_cap": 2811260718.165, "weight": 0.003386892655836468}, {"ticker": "WTI", "market_cap": 553696807.86, "weight": 0.0006670714103404846}, {"ticker": "CHRD", "market_cap": 6328453856.44, "weight": 0.007624264000376007}, {"ticker": "USEG", "market_cap": 32418850.47, "weight": 3.905691345453476e-05}, {"ticker": "REPX", "market_cap": 549816999.8596, "weight": 0.0006623971753477273}, {"ticker": "CLF", "market_cap": 7688730258.915, "weight": 0.009263069724683725}, {"ticker": "EPM", "market_cap": 202734586.7277, "weight": 0.00024424639039536707}, {"ticker": "PUMP", "market_cap": 1053291385.98, "weight": 0.0012689626531544264}, {"ticker": "ICD", "market_cap": 38874186.0, "weight": 4.683403933839381e-05}, {"ticker": "IPI", "market_cap": 292004021.039, "weight": 0.0003517945766969808}, {"ticker": "EQT", "market_cap": 16080167350.7, "weight": 0.019372732081660553}, {"ticker": "PHX", "market_cap": 128391179.80000001, "weight": 0.00015468047525049125}, {"ticker": "MUX", "market_cap": 296001125.73, "weight": 0.00035661012597531106}, {"ticker": "CCLP", "market_cap": 186013486.68, "weight": 0.0002241014886496379}, {"ticker": "FLME", "market_cap": 239481322.5, "weight": 0.0002885173641648876}, {"ticker": "VMC", "market_cap": 27026971970.55, "weight": 0.03256099737924816}, {"ticker": "CNX", "market_cap": 3395607646.1400003, "weight": 0.0040908900851858755}, {"ticker": "VTLE", "market_cap": 1000247701.78, "weight": 0.001205057778272258}, {"ticker": "URG", "market_cap": 362959921.13000005, "weight": 0.0004372793612826449}, {"ticker": "PED", "market_cap": 83793665.0409, "weight": 0.00010095120203503953}, {"ticker": "METCB", "market_cap": 552939517.525, "weight": 0.0006661590577232496}, {"ticker": "NRP", "market_cap": 953157392.48, "weight": 0.0011483252875079928}, {"ticker": "BSM", "market_cap": 3567546540.0399995, "weight": 0.004298035076484535}, {"ticker": "ARIS", "market_cap": 300891550.59000003, "weight": 0.0003625019110862507}, {"ticker": "DC", "market_cap": 195314520.4, "weight": 0.00023530699605576617}, {"ticker": "CKX", "market_cap": 25193688.52, "weight": 3.0352331987733982e-05}, {"ticker": "MTDR", "market_cap": 6385154717.5, "weight": 0.007692574893301323}, {"ticker": "DWSN", "market_cap": 56078765.1084, "weight": 6.75614170065285e-05}, {"ticker": "XPL", "market_cap": 39972873.0, "weight": 4.815769278231626e-05}, {"ticker": "XPRO", "market_cap": 2298956946.44, "weight": 0.0027696898931039915}, {"ticker": "EP", "market_cap": 202241642.0, "weight": 0.00024365251062207085}, {"ticker": "CIVI", "market_cap": 6657007286.0, "weight": 0.008020091818990067}, {"ticker": "GBR", "market_cap": 5696446.74, "weight": 6.862847513005808e-06}, {"ticker": "TUSK", "market_cap": 212860934.88000003, "weight": 0.00025644620308646986}, {"ticker": "AMPY", "market_cap": 255076838.59, "weight": 0.00030730620810522405}, {"ticker": "KRP", "market_cap": 1127615211.45, "weight": 0.0013585049773549099}, {"ticker": "TELL", "market_cap": 583627458.0, "weight": 0.0007031306411647766}, {"ticker": "AR", "market_cap": 7099570971.190001, "weight": 0.008553274559895125}, {"ticker": "NE", "market_cap": 6743101889.51, "weight": 0.008123815098176177}, {"ticker": "MDU", "market_cap": 3843674290.375, "weight": 0.004630702567492877}, {"ticker": "PTEN", "market_cap": 5091427409.035, "weight": 0.0061339448127176645}, {"ticker": "GTE", "market_cap": 197392236.14999998, "weight": 0.00023781014354725316}, {"ticker": "ARCH", "market_cap": 2667432489.3, "weight": 0.0032136142512768223}, {"ticker": "EGY", "market_cap": 418449949.02000004, "weight": 0.0005041314916163535}, {"ticker": "CEI", "market_cap": 24254597.595799997, "weight": 2.9220953409509566e-05}, {"ticker": "PARR", "market_cap": 2006662671.52, "weight": 0.002417545630327902}, {"ticker": "SM", "market_cap": 4257719180.5200005, "weight": 0.005129527023210404}, {"ticker": "EOG", "market_cap": 68968803368.1, "weight": 0.08309081121501923}, {"ticker": "GPOR", "market_cap": 2097517654.21, "weight": 0.002527004020875103}, {"ticker": "ARLP", "market_cap": 2730654386.76, "weight": 0.003289781423823909}, {"ticker": "HPK", "market_cap": 1856638965.04, "weight": 0.0022368031661390447}, {"ticker": "USGO", "market_cap": 92951578.12910001, "weight": 0.00011198428352079335}, {"ticker": "THM", "market_cap": 70460025.5007, "weight": 8.488737503298499e-05}, {"ticker": "OVV", "market_cap": 11827068072.380001, "weight": 0.014248770928855112}, {"ticker": "SND", "market_cap": 83695420.13, "weight": 0.00010083284055933202}, {"ticker": "SWN", "market_cap": 6564719789.92, "weight": 0.0079089075945319}, {"ticker": "HLX", "market_cap": 1553423113.4, "weight": 0.0018715010316137756}, {"ticker": "MLM", "market_cap": 25726311849.805, "weight": 0.03099401492819822}, {"ticker": "NB", "market_cap": 114711923.89999999, "weight": 0.00013820026370495414}, {"ticker": "SBOW", "market_cap": 788049730.38, "weight": 0.0009494102866418233}, {"ticker": "WWR", "market_cap": 31655912.636, "weight": 3.8137756960034656e-05}, {"ticker": "NINE", "market_cap": 118247639.92500001, "weight": 0.00014245995067059867}, {"ticker": "NG", "market_cap": 1152757825.3500001, "weight": 0.0013887957767162817}, {"ticker": "EPSN", "market_cap": 114592238.31, "weight": 0.00013805607137047548}, {"ticker": "FEAM", "market_cap": 100371359.77939999, "weight": 0.0001209233348926328}, {"ticker": "PVL", "market_cap": 74910000.0, "weight": 9.02485234504738e-05}, {"ticker": "NGS", "market_cap": 166037848.2, "weight": 0.00020003565127411438}, {"ticker": "DEN", "market_cap": 4717599491.64, "weight": 0.005683572131240366}, {"ticker": "RCON", "market_cap": 13728288.6198, "weight": 1.6539284173526804e-05}, {"ticker": "CDE", "market_cap": 817885476.2625, "weight": 0.000985355180673851}, {"ticker": "SCCO", "market_cap": 56212687696.99, "weight": 0.06772276149827743}, {"ticker": "CRGY", "market_cap": 981342459.9999999, "weight": 0.001182281511337013}, {"ticker": "MUR", "market_cap": 6599124710.66, "weight": 0.007950357244728342}, {"ticker": "DMLP", "market_cap": 1122580771.48, "weight": 0.0013524396886926144}, {"ticker": "SNMP", "market_cap": 16143347.677199999, "weight": 1.944884917120459e-05}, {"ticker": "GRNT", "market_cap": 800961355.2600001, "weight": 0.0009649656875331116}, {"ticker": "AESI", "market_cap": 1220661969.1000001, "weight": 0.0014706039292941247}, {"ticker": "VTS", "market_cap": 603095778.6, "weight": 0.0007265852825772775}, {"ticker": "SLCA", "market_cap": 976298004.36, "weight": 0.0011762041562025662}, {"ticker": "VNOM", "market_cap": 1909010345.5800002, "weight": 0.002299898076895925}, {"ticker": "NEM", "market_cap": 27940860000.0, "weight": 0.033662012534193105}, {"ticker": "GATO", "market_cap": 318146225.79999995, "weight": 0.0003832896425015489}, {"ticker": "APA", "market_cap": 11553179190.4, "weight": 0.013918800735447073}, {"ticker": "OII", "market_cap": 2380413065.48, "weight": 0.0028678249147214793}, {"ticker": "AREC", "market_cap": 115748090.5746, "weight": 0.00013944859520183356}, {"ticker": "FANG", "market_cap": 25823168321.02, "weight": 0.031110703668203253}, {"ticker": "BNMV", "market_cap": 2003857.9539, "weight": 2.414166620530805e-06}, {"ticker": "MRO", "market_cap": 14584947222.16, "weight": 0.01757135164067587}, {"ticker": "KNF", "market_cap": 2747986676.12, "weight": 0.0033106626616126733}, {"ticker": "RIG", "market_cap": 5663769185.85, "weight": 0.006823478923872042}, {"ticker": "HYMC", "market_cap": 53598597.17340001, "weight": 6.457341147932305e-05}, {"ticker": "TMQ", "market_cap": 70001700.3, "weight": 8.433520345878506e-05}, {"ticker": "RES", "market_cap": 1777758158.0400002, "weight": 0.002141770775799547}, {"ticker": "CTGO", "market_cap": 173552708.95000002, "weight": 0.00020908925008099492}, {"ticker": "CRC", "market_cap": 3613620328.0, "weight": 0.004353542903652608}, {"ticker": "SD", "market_cap": 537484800.0888001, "weight": 0.0006475398422785649}, {"ticker": "ENSV", "market_cap": 8537694.2257, "weight": 1.0285867007623297e-05}, {"ticker": "CMP", "market_cap": 1083189703.68, "weight": 0.0013049829311690862}, {"ticker": "VAL", "market_cap": 5120316840.76, "weight": 0.00616874962591356}, {"ticker": "HAL", "market_cap": 34266062425.934998, "weight": 0.04128235934324381}, {"ticker": "METC", "market_cap": 510527291.54999995, "weight": 0.000615062531618703}, {"ticker": "FCX", "market_cap": 51023091964.93001, "weight": 0.06147054747981134}, {"ticker": "AMR", "market_cap": 3267473793.28, "weight": 0.0039365196269742185}, {"ticker": "MVO", "market_cap": 143750000.0, "weight": 0.00017318415760253115}, {"ticker": "CTRA", "market_cap": 19291413547.0, "weight": 0.02324151098503828}, {"ticker": "BRN", "market_cap": 25226714.45, "weight": 3.039212028593287e-05}, {"ticker": "PXD", "market_cap": 49677716881.240005, "weight": 0.059849694258744986}, {"ticker": "HUSA", "market_cap": 18431736.57, "weight": 2.2205807102798032e-05}, {"ticker": "STR", "market_cap": 1823571634.4999998, "weight": 0.0021969649902521967}, {"ticker": "TTI", "market_cap": 707379139.74, "weight": 0.0008522216377146092}, {"ticker": "TPET", "market_cap": 16371811.893199999, "weight": 1.9724093573223947e-05}, {"ticker": "CEIX", "market_cap": 3107670469.96, "weight": 0.003743995077887198}, {"ticker": "IDR", "market_cap": 57728223.33, "weight": 6.954861723336929e-05}, {"ticker": "NBR", "market_cap": 1035242240.1199999, "weight": 0.0012472177757894918}, {"ticker": "NC", "market_cap": 253665351.90999997, "weight": 0.00030560570631988146}, {"ticker": "IE", "market_cap": 1286068879.315, "weight": 0.0015494035164034753}, {"ticker": "PZG", "market_cap": 17658305.7354, "weight": 2.1274009067639604e-05}, {"ticker": "PNRG", "market_cap": 192798448.53, "weight": 0.0002322757349269079}, {"ticker": "TALO", "market_cap": 1842231080.25, "weight": 0.0022194451321203286}, {"ticker": "KOS", "market_cap": 3220765779.0, "weight": 0.003880247709712522}, {"ticker": "ACDC", "market_cap": 1522156765.65, "weight": 0.0018338326065953996}, {"ticker": "OXY", "market_cap": 52673959611.52, "weight": 0.06345944572459715}, {"ticker": "CLB", "market_cap": 1042482986.42, "weight": 0.0012559411326477816}, {"ticker": "REI", "market_cap": 336013649.56, "weight": 0.00040481558846609193}, {"ticker": "RRC", "market_cap": 7214013671.2, "weight": 0.00869115047359941}, {"ticker": "ATLX", "market_cap": 287875620.0, "weight": 0.0003468208469148269}, {"ticker": "TMC", "market_cap": 286253833.103, "weight": 0.000344866983975225}, {"ticker": "LBRT", "market_cap": 2818303958.04, "weight": 0.0033953780649811248}, {"ticker": "HCC", "market_cap": 2542905502.89, "weight": 0.003063589199171099}, {"ticker": "UUUU", "market_cap": 1167084870.5, "weight": 0.0014060564184222725}, {"ticker": "PR", "market_cap": 4406418991.8, "weight": 0.0053086745122690624}, {"ticker": "PLL", "market_cap": 681454059.5, "weight": 0.000820988154708401}, {"ticker": "BRY", "market_cap": 566702882.34, "weight": 0.0006827406002711599}, {"ticker": "ESTE", "market_cap": 1945858306.5, "weight": 0.0023442910026093243}, {"ticker": "VGZ", "market_cap": 47733084.3348, "weight": 5.750688000203766e-05}, {"ticker": "USAU", "market_cap": 28353232.4337, "weight": 3.415882208235895e-05}, {"ticker": "GORO", "market_cap": 34900839.819, "weight": 4.2047113347300105e-05}, {"ticker": "DO", "market_cap": 1373161266.84, "weight": 0.0016543288852181558}, {"ticker": "RNGR", "market_cap": 326873981.07, "weight": 0.0003938044873307385}, {"ticker": "MGY", "market_cap": 3958190892.8100004, "weight": 0.004768667515835204}, {"ticker": "DVN", "market_cap": 27540489500.0, "weight": 0.033179662427957245}, {"ticker": "CHK", "market_cap": 10804916591.605001, "weight": 0.01301732436787982}, {"ticker": "HP", "market_cap": 3842835229.9, "weight": 0.004629691701534335}, {"ticker": "WTTR", "market_cap": 764336584.605, "weight": 0.0009208416523799145}, {"ticker": "HNRA", "market_cap": 80943582.81, "weight": 9.751753879847354e-05}, {"ticker": "NCSM", "market_cap": 38194646.04, "weight": 4.601535721296871e-05}, {"ticker": "UEC", "market_cap": 1877152675.1950002, "weight": 0.0022615172503998877}, {"ticker": "NOG", "market_cap": 3458586142.44, "weight": 0.00416676401790789}, {"ticker": "VOC", "market_cap": 151980000.0, "weight": 0.0001830993271125752}, {"ticker": "HL", "market_cap": 2234707426.1853, "weight": 0.0026922846823792816}, {"ticker": "SUM", "market_cap": 3804576106.31, "weight": 0.004583598664389672}, {"ticker": "SLB", "market_cap": 78847400167.68, "weight": 0.09499214314566493}, {"ticker": "BATL", "market_cap": 87384349.52999999, "weight": 0.0001052771127721613}, {"ticker": "LEU", "market_cap": 799570357.0, "weight": 0.000963289869363479}, {"ticker": "MXC", "market_cap": 27034170.0, "weight": 3.2569669272581704e-05}, {"ticker": "BTU", "market_cap": 3139392000.0, "weight": 0.003782211888028699}, {"ticker": "AUMN", "market_cap": 5197105.3624, "weight": 6.261261315887592e-06}, {"ticker": "CPE", "market_cap": 2289408409.6000004, "weight": 0.0027581862039980985}, {"ticker": "HESM", "market_cap": 1901733275.26, "weight": 0.0022911309583346475}, {"ticker": "KLXE", "market_cap": 151850681.35500002, "weight": 0.0001829435292649465}, {"ticker": "PPTA", "market_cap": 202129174.4, "weight": 0.00024351701422858509}, {"ticker": "MP", "market_cap": 3077761111.4249997, "weight": 0.00370796149832326}, {"ticker": "HNRG", "market_cap": 442451080.05, "weight": 0.0005330470788089693}, {"ticker": "USLM", "market_cap": 1179750342.21, "weight": 0.00142131526397869}, {"ticker": "ABAT", "market_cap": 333040599.6708, "weight": 0.0004012337787925517}]}, "Agriculture, Forestry and Fishing": {"sic_description": "Agriculture, Forestry and Fishing", "companies": [{"ticker": "AGFY", "market_cap": 3925097.3194999998, "weight": 9.393867345242164e-05}, {"ticker": "YTEN", "market_cap": 3558014.1998, "weight": 8.515333680864459e-05}, {"ticker": "AQB", "market_cap": 18251299.34673, "weight": 0.0004368051821026616}, {"ticker": "NCRA", "market_cap": 15129135.45, "weight": 0.00036208297501169926}, {"ticker": "SANW", "market_cap": 39963542.3428, "weight": 0.0009564405283639019}, {"ticker": "CALM", "market_cap": 2172904954.8, "weight": 0.052003757455396836}, {"ticker": "LMNR", "market_cap": 265224880.32000002, "weight": 0.006347581065075831}, {"ticker": "VFF", "market_cap": 82568957.821, "weight": 0.0019761085483204657}, {"ticker": "LOCL", "market_cap": 20652031.509999998, "weight": 0.000494261488628298}, {"ticker": "EDBL", "market_cap": 3706254.9192000004, "weight": 8.870115623795815e-05}, {"ticker": "CEAD", "market_cap": 5646401.6508720005, "weight": 0.00013513435150444794}, {"ticker": "BV", "market_cap": 711889858.92, "weight": 0.017037536536723418}, {"ticker": "CVGW", "market_cap": 436211658.15999997, "weight": 0.010439777966384668}, {"ticker": "ALCO", "market_cap": 186154077.46, "weight": 0.004455193252782671}, {"ticker": "SISI", "market_cap": 6396349.6678, "weight": 0.00015308272733668456}, {"ticker": "CTVA", "market_cap": 35715324480.0, "weight": 0.8547686669846407}, {"ticker": "YOTA", "market_cap": 77198988.58, "weight": 0.0018475900057422381}, {"ticker": "RKDA", "market_cap": 3535898.08, "weight": 8.46240355488757e-05}, {"ticker": "AVO", "market_cap": 680531728.772, "weight": 0.016287047846056567}, {"ticker": "VCXA", "market_cap": 100076932.0, "weight": 0.002395123858092204}, {"ticker": "FDP", "market_cap": 1234763972.76, "weight": 0.0295513920257886}]}} \ No newline at end of file diff --git a/examples/tools/treemap/treemap_server.py b/examples/tools/treemap/treemap_server.py new file mode 100644 index 00000000..67267fc5 --- /dev/null +++ b/examples/tools/treemap/treemap_server.py @@ -0,0 +1,280 @@ +from polygon import RESTClient +from collections import defaultdict +import http.server +import socketserver +import traceback +import json + +# Connect to http://localhost:8889 in your browser to view D3 treemap. +PORT = 8889 + +# Inline html + js code to render D3.js Treemap +html = """ + + + + + Polygon.io Snapshot + D3.js Treemap + + + + +
+ + + +""" + + +class handler(http.server.SimpleHTTPRequestHandler): + def generate_data(self): + client = ( + RESTClient() + ) # Assuming you have POLYGON_API_KEY environment variable set up + snapshots = client.get_snapshot_all("stocks") + pct_changes = { + snapshot.ticker: round(snapshot.todays_change_percent, 2) + for snapshot in snapshots + } + + with open("sic_code_groups.json", "r") as file: + sic_code_groups = json.load(file) + + data = defaultdict(lambda: defaultdict(list)) + + for sic_code, group_data in sic_code_groups.items(): + parent = group_data["sic_description"] + for company in group_data["companies"]: + ticker = company["ticker"] + weight = company["weight"] + pct_change = pct_changes.get(ticker, 0.0) + data[parent][ticker].append( + {"name": ticker, "weight": weight, "change": pct_change} + ) + + data = dict(data) + output = {"name": "root", "children": []} + for parent, children in data.items(): + parent_dict = {"name": parent, "children": []} + for child, companies in children.items(): + total_change = sum(company["change"] for company in companies) + avg_change = total_change / len(companies) if companies else 0 + avg_change = round(avg_change, 2) + child_dict = { + "name": child, + "change": avg_change, + "children": companies, + } + parent_dict["children"].append(child_dict) + output["children"].append(parent_dict) + + return json.dumps(output) + + def do_GET(self): + if self.path == "/data": + self.send_response(200) + self.send_header("Content-type", "application/json") + self.end_headers() + json_data = self.generate_data() + self.wfile.write(json_data.encode()) + else: + self.send_response(200) + self.send_header("Content-type", "text/html") + self.end_headers() + self.wfile.write(html.encode()) + + +try: + with socketserver.TCPServer(("", PORT), handler) as httpd: + print("serving at port", PORT) + httpd.serve_forever() +except KeyboardInterrupt: + print("\nExiting gracefully...") diff --git a/examples/websocket/aggs.py b/examples/websocket/aggs.py new file mode 100644 index 00000000..8a733575 --- /dev/null +++ b/examples/websocket/aggs.py @@ -0,0 +1,25 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage, EquityTrade +from typing import List + +c = WebSocketClient(subscriptions=["T.*"]) + + +class MessageHandler: + count = 0 + + def handle_msg(self, msgs: List[WebSocketMessage]): + for m in msgs: + if type(m) == EquityTrade: + print(self.count, m) + self.count += 1 + + +h = MessageHandler() + + +def handle_msg(msgs: List[WebSocketMessage]): + h.handle_msg(msgs) + + +c.run(handle_msg) diff --git a/examples/websocket/async.py b/examples/websocket/async.py new file mode 100644 index 00000000..87cacee6 --- /dev/null +++ b/examples/websocket/async.py @@ -0,0 +1,27 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage +from typing import List +import asyncio + +c = WebSocketClient(subscriptions=["T.*"]) + + +async def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + print(m) + + +async def timeout(): + await asyncio.sleep(1) + print("unsubscribe_all") + c.unsubscribe_all() + await asyncio.sleep(1) + print("close") + await c.close() + + +async def main(): + await asyncio.gather(c.connect(handle_msg), timeout()) + + +asyncio.run(main()) diff --git a/examples/websocket/crypto.py b/examples/websocket/crypto.py new file mode 100644 index 00000000..4fcbc12e --- /dev/null +++ b/examples/websocket/crypto.py @@ -0,0 +1,43 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage, Market +from typing import List + +client = WebSocketClient(market=Market.Crypto) + +# Aggregates (per minute) +client.subscribe("XA.*") # all crypto pair +# client.subscribe("XA.BTC-USD") +# client.subscribe("XA.BTC-EUR") +# client.subscribe("XA.ETH-USD") + +# Aggregates (per second) +# client.subscribe("XAS.*") # all crypto pair +# client.subscribe("XAS.BTC-USD") +# client.subscribe("XAS.BTC-EUR") +# client.subscribe("XAS.ETH-USD") + +# Trades +# client.subscribe("XT.*") # all crypto pair +# client.subscribe("XT.BTC-USD") +# client.subscribe("XT.BTC-EUR") +# client.subscribe("XT.ETH-USD") + +# Quotes +# client.subscribe("XQ.*") # all crypto pair +# client.subscribe("XQ.BTC-USD") +# client.subscribe("XQ.BTC-EUR") +# client.subscribe("XQ.ETH-USD") + +# Level 2 Book +# client.subscribe("XL2.*") # all crypto pair +# client.subscribe("XL2.BTC-USD") +# client.subscribe("XL2.BTC-EUR") +# client.subscribe("XL2.ETH-USD") + + +def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + print(m) + + +client.run(handle_msg) diff --git a/examples/websocket/custom-json.py b/examples/websocket/custom-json.py new file mode 100644 index 00000000..a659e767 --- /dev/null +++ b/examples/websocket/custom-json.py @@ -0,0 +1,16 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage +from typing import List + +# type: ignore +import orjson + +c = WebSocketClient(subscriptions=["T.*"], custom_json=orjson) + + +def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + print(m) + + +c.run(handle_msg) diff --git a/examples/websocket/fmv.py b/examples/websocket/fmv.py new file mode 100644 index 00000000..5bb75f2d --- /dev/null +++ b/examples/websocket/fmv.py @@ -0,0 +1,19 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage, Feed, Market +from typing import List + +client = WebSocketClient(feed=Feed.Business, market=Market.Stocks, verbose=True) + +# FMV +client.subscribe("FMV.*") # all ticker symbols +# client.subscribe("FMV.TSLA") +# client.subscribe("FMV.AAPL") +# client.subscribe("FMV.NVDA") + + +def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + print(m) + + +client.run(handle_msg) diff --git a/examples/websocket/forex.py b/examples/websocket/forex.py new file mode 100644 index 00000000..d775beab --- /dev/null +++ b/examples/websocket/forex.py @@ -0,0 +1,31 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage, Market +from typing import List + +client = WebSocketClient(market=Market.Forex) + +# Aggregates (per minute) +# client.subscribe("CA.*") # all forex pair +client.subscribe("CA.USD/CAD") +client.subscribe("CA.USD/EUR") +client.subscribe("CA.USD/AUD") + +# Aggregates (per second) +# client.subscribe("CAS.*") # all forex pair +# client.subscribe("CAS.USD/CAD") +# client.subscribe("CAS.USD/EUR") +# client.subscribe("CAS.USD/AUD") + +# Quotes +# client.subscribe("C.*") # all forex pair +# client.subscribe("C.USD/CAD") +# client.subscribe("C.USD/EUR") +# client.subscribe("C.USD/AUD") + + +def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + print(m) + + +client.run(handle_msg) diff --git a/examples/websocket/indices.py b/examples/websocket/indices.py new file mode 100644 index 00000000..1ddcb466 --- /dev/null +++ b/examples/websocket/indices.py @@ -0,0 +1,34 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage, Market +from typing import List + +client = WebSocketClient(market=Market.Indices) + +# Aggregates (per minute) +# client.subscribe("AM.*") # all aggregates +client.subscribe("AM.I:SPX") # Standard & Poor's 500 +client.subscribe("AM.I:DJI") # Dow Jones Industrial Average +client.subscribe("AM.I:NDX") # Nasdaq-100 +client.subscribe("AM.I:VIX") # Volatility Index + +# Aggregates (per second) +# client.subscribe("A.*") # all aggregates +# client.subscribe("A.I:SPX") # Standard & Poor's 500 +# client.subscribe("A.I:DJI") # Dow Jones Industrial Average +# client.subscribe("A.I:NDX") # Nasdaq-100 +# client.subscribe("A.I:VIX") # Volatility Index + +# Single index +# client.subscribe("V.*") # all tickers +# client.subscribe("V.I:SPX") # Standard & Poor's 500 +# client.subscribe("V.I:DJI") # Dow Jones Industrial Average +# client.subscribe("V.I:NDX") # Nasdaq-100 +# client.subscribe("V.I:VIX") # Volatility Index + + +def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + print(m) + + +client.run(handle_msg) diff --git a/examples/websocket/latency.py b/examples/websocket/latency.py new file mode 100644 index 00000000..57a0a183 --- /dev/null +++ b/examples/websocket/latency.py @@ -0,0 +1,17 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage, EquityQuote +from typing import List, cast +import time + +c = WebSocketClient(subscriptions=["Q.SPY"]) + + +def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + q: EquityQuote = cast(EquityQuote, m) + if q.timestamp is not None: + now = time.time() * 1000 + print(now, q.timestamp, now - q.timestamp) + + +c.run(handle_msg) diff --git a/examples/websocket/launchpad-ws.py b/examples/websocket/launchpad-ws.py new file mode 100644 index 00000000..cfc08621 --- /dev/null +++ b/examples/websocket/launchpad-ws.py @@ -0,0 +1,21 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage, Feed, Market +from typing import List + +client = WebSocketClient( + api_key="", feed=Feed.Launchpad, market=Market.Stocks +) + +client.subscribe("AM.*") # all aggregates +# client.subscribe("LV.*") # all aggregates +# client.subscribe("AM.O:A230616C00070000") # all aggregates +# client.subscribe("LV.O:A230616C00070000") # all aggregates + + +def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + print(m) + + +# print messages +client.run(handle_msg) diff --git a/examples/websocket/options-ws.py b/examples/websocket/options-ws.py new file mode 100644 index 00000000..22fd12b1 --- /dev/null +++ b/examples/websocket/options-ws.py @@ -0,0 +1,32 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage, Market +from typing import List + +# docs +# https://polygon.io/docs/options/ws_getting-started +# https://polygon-api-client.readthedocs.io/en/latest/WebSocket.html + +# client = WebSocketClient("XXXXXX") # hardcoded api_key is used +client = WebSocketClient( + market=Market.Options +) # POLYGON_API_KEY environment variable is used + +# aggregates +# client.subscribe("AM.*") # aggregates (per minute) +client.subscribe("A.*") # aggregates (per second) + +# trades +# client.subscribe("T.*") # all trades +# client.subscribe("T.O:SPY241220P00720000", "T.O:SPY251219C00650000") # limited trades + +# quotes (1,000 option contracts per connection) +# client.subscribe("Q.O:SPY241220P00720000", "Q.O:SPY251219C00650000") # limited quotes + + +def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + print(m) + + +# print messages +client.run(handle_msg) diff --git a/examples/websocket/raw.py b/examples/websocket/raw.py new file mode 100644 index 00000000..064aca12 --- /dev/null +++ b/examples/websocket/raw.py @@ -0,0 +1,12 @@ +from polygon import WebSocketClient +from typing import Union +import json + +c = WebSocketClient(subscriptions=["T.*"], raw=True) + + +def handle_msg(msgs: Union[str, bytes]): + print(json.loads(msgs)) + + +c.run(handle_msg) diff --git a/examples/websocket/simple.py b/examples/websocket/simple.py new file mode 100644 index 00000000..d290b8c2 --- /dev/null +++ b/examples/websocket/simple.py @@ -0,0 +1,13 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage +from typing import List + +c = WebSocketClient(subscriptions=["T.*"]) + + +def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + print(m) + + +c.run(handle_msg) diff --git a/examples/websocket/stocks-ws.py b/examples/websocket/stocks-ws.py new file mode 100644 index 00000000..cf238953 --- /dev/null +++ b/examples/websocket/stocks-ws.py @@ -0,0 +1,35 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage +from typing import List + +# client = WebSocketClient("XXXXXX") # hardcoded api_key is used +client = WebSocketClient() # POLYGON_API_KEY environment variable is used + +# docs +# https://polygon.io/docs/stocks/ws_stocks_am +# https://polygon-api-client.readthedocs.io/en/latest/WebSocket.html# + +# aggregates (per minute) +# client.subscribe("AM.*") # all aggregates +# client.subscribe("AM.TSLA") # single ticker + +# aggregates (per second) +client.subscribe("A.*") # all aggregates +# client.subscribe("A.TSLA") # single ticker + +# trades +# client.subscribe("T.*") # all trades +# client.subscribe("T.TSLA", "T.UBER") # multiple tickers + +# quotes +# client.subscribe("Q.*") # all quotes +# client.subscribe("Q.TSLA", "Q.UBER") # multiple tickers + + +def handle_msg(msgs: List[WebSocketMessage]): + for m in msgs: + print(m) + + +# print messages +client.run(handle_msg) diff --git a/examples/websocket/stocks-ws_extra.py b/examples/websocket/stocks-ws_extra.py new file mode 100644 index 00000000..a32cfa18 --- /dev/null +++ b/examples/websocket/stocks-ws_extra.py @@ -0,0 +1,202 @@ +from polygon import WebSocketClient +from polygon.websocket.models import WebSocketMessage, EquityTrade +from typing import List +from typing import Dict +from datetime import datetime +import time +import threading +import os + +# docs +# https://polygon.io/docs/stocks/ws_stocks_am +# https://polygon-api-client.readthedocs.io/en/latest/WebSocket.html# + +# This program connects to the Polygon WebSocket API, authenticates the +# connection, and subscribes to receive trades. Every 5 seconds, it counts +# the number of trades per symbol and stores the results in a map. The +# program then prints the map, which gives a readout of the top stocks +# traded in the past 5 seconds. + +# Here's what the output looks like after running it for a couple hours: + +""" + --- Past 5 seconds --- + Tickers seen (5s): 1697 + Trades seen (5s): 12335 + Cash traded (5s): 88,849,414.33 + + --- Running Totals --- + Total Tickers seen: 13848 + Total Trades seen: 22775838 + Total Cash traded: 178,499,702,488.96 + +---------------------------------------------------------------------------------------------------- + +Ticker Trades (5s) Cash (5s) Total Trades Total Cash +NVDA 445 6,933,283.61 632550 18,291,747,596.36 +TSLA 279 8,144,556.76 639585 11,319,594,268.07 +NVDL 277 3,748,806.85 10451 99,902,192.88 +TELL 171 78,424.03 6154 3,710,200.38 +AFRM 163 968,984.99 224338 745,895,134.93 +AAPL 134 2,359,278.02 304572 2,932,389,741.58 +QQQ 132 5,788,859.71 246679 11,003,577,730.48 +NVDS 130 598,047.04 7846 48,854,967.44 +SOXL 127 786,026.38 189184 719,639,349.26 +AMD 116 1,549,180.08 304704 3,713,351,432.39 +SPY 113 6,628,554.14 278926 15,435,607,506.98 +MSFT 109 1,600,861.75 148047 2,396,824,971.18 +SQQQ 88 1,006,330.83 173406 2,065,760,858.90 +TQQQ 83 717,574.40 296021 2,580,097,288.27 +PLUG 82 106,542.65 31921 53,825,007.27 +ITB 75 455,902.33 23369 185,892,273.60 +AVGO 71 1,955,826.79 31586 633,629,812.65 +STX 71 273,681.77 8420 34,141,139.17 +XPEV 68 234,765.41 41284 127,781,104.54 +OIH 55 662.12 2964 65,848,514.45 +XEL 54 197,642.42 18524 103,054,857.37 +XLU 53 850,017.20 35963 291,891,266.17 +ARRY 52 164,056.54 11354 23,001,537.49 +META 52 1,457,535.82 150793 2,717,344,906.63 +PLTR 52 147,743.93 86456 396,851,801.06 + +Current Time: 2023-08-25 08:27:14.602075 | App Uptime: 04:49:40 | Time taken: 0.003417 seconds +""" + +app_start_time = time.time() +string_map: Dict[str, int] = {} +cash_map_5s: Dict[str, float] = {} +cash_traded = float(0) + +# totals +total_tickers_seen = 0 +total_trades_seen = 0 +total_cash_traded = 0.0 + +# These dictionaries will keep track of the running total of trades and cash per ticker. +total_string_map: Dict[str, int] = {} +total_cash_map: Dict[str, float] = {} + + +def print_centered(s: str): + term_width = os.get_terminal_size().columns + print(s.center(term_width)) + + +def run_websocket_client(): + # client = WebSocketClient("XXXXXX") # hardcoded api_key is used + client = WebSocketClient() # POLYGON_API_KEY environment variable is used + client.subscribe("T.*") # all trades + client.run(handle_msg) + + +def handle_msg(msgs: List[WebSocketMessage]): + global cash_traded + global total_tickers_seen, total_trades_seen, total_cash_traded + for m in msgs: + if isinstance(m, EquityTrade): + # Update total trades and cash for the past 5 seconds + if isinstance(m.symbol, str): + string_map[m.symbol] = string_map.get(m.symbol, 0) + 1 + total_string_map[m.symbol] = total_string_map.get(m.symbol, 0) + 1 + + # Update cash traded + if isinstance(m.price, float) and isinstance(m.size, int): + cash_value = m.price * m.size + cash_traded += cash_value + total_cash_map[m.symbol] = ( # type: ignore + total_cash_map.get(m.symbol, 0) + cash_value # type: ignore + ) + + # Update cash for the past 5 seconds + cash_map_5s[m.symbol] = ( # type: ignore + cash_map_5s.get(m.symbol, 0) + cash_value # type: ignore + ) # Okay! + + # Update totals + total_tickers_seen = len(total_string_map) + total_trades_seen += 1 + total_cash_traded += cash_value + + +def top_function(): + # start timer + start_time = time.time() + global cash_traded + + # Only sort the string_map once + sorted_trades_5s = sorted(string_map.items(), key=lambda x: x[1], reverse=True) + + # Clear screen + print("\033c", end="") + + # Print 5-second snapshot + print() + print_centered("--- Past 5 seconds ---") + print_centered(f"Tickers seen (5s): {len(string_map)}") + print_centered(f"Trades seen (5s): {sum(string_map.values())}") + print_centered(f"Cash traded (5s): {cash_traded:,.2f}") + print() + print_centered("--- Running Totals ---") + print_centered(f"Total Tickers seen: {total_tickers_seen}") + print_centered(f"Total Trades seen: {total_trades_seen}") + print_centered(f"Total Cash traded: {total_cash_traded:,.2f}") + + # Separator + print() + print_centered("-" * 100 + "\n") + + # Print table header + print_centered( + "{:<15}{:<20}{:<20}{:<20}{:<20}".format( + "Ticker", "Trades (5s)", "Cash (5s)", "Total Trades", "Total Cash" + ) + ) + + # Print table content + for ticker, trades in sorted(string_map.items(), key=lambda x: x[1], reverse=True)[ + :25 + ]: + cash_5s = cash_map_5s.get(ticker, 0) + total_trades = total_string_map[ticker] + total_cash = total_cash_map.get(ticker, 0.0) + print_centered( + "{:<15}{:<20}{:<20,.2f}{:<20}{:<20,.2f}".format( + ticker, trades, cash_5s, total_trades, total_cash + ) + ) + + # Print times + end_time = time.time() + current_time = datetime.now() + + # Print elapsed the since we started + elapsed_time = time.time() - app_start_time + hours, rem = divmod(elapsed_time, 3600) + minutes, seconds = divmod(rem, 60) + + # Print the time and quick stats + print() + print_centered( + f"Current Time: {current_time} | App Uptime: {int(hours):02}:{int(minutes):02}:{int(seconds):02} | Time taken: {end_time - start_time:.6f} seconds" + ) + + # clear map and cash for next loop + string_map.clear() + cash_map_5s.clear() + cash_traded = 0 + + +def run_function_periodically(): + while True: + top_function() + time.sleep(5) + + +thread1 = threading.Thread(target=run_function_periodically) +thread2 = threading.Thread(target=run_websocket_client) + +thread1.start() +thread2.start() + +thread1.join() +thread2.join() diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 00000000..66e31bcc --- /dev/null +++ b/poetry.lock @@ -0,0 +1,1071 @@ +# This file is automatically @generated by Poetry 2.1.1 and should not be changed by hand. + +[[package]] +name = "alabaster" +version = "0.7.12" +description = "A configurable sidebar-enabled Sphinx theme" +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "alabaster-0.7.12-py2.py3-none-any.whl", hash = "sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359"}, + {file = "alabaster-0.7.12.tar.gz", hash = "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"}, +] + +[[package]] +name = "attrs" +version = "22.1.0" +description = "Classes Without Boilerplate" +optional = false +python-versions = ">=3.5" +groups = ["dev"] +files = [ + {file = "attrs-22.1.0-py2.py3-none-any.whl", hash = "sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c"}, + {file = "attrs-22.1.0.tar.gz", hash = "sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"}, +] + +[package.extras] +dev = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.0.2)", "furo", "hypothesis", "mypy (>=0.900,!=0.940)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "sphinx", "sphinx-notfound-page", "zope.interface"] +docs = ["furo", "sphinx", "sphinx-notfound-page", "zope.interface"] +tests = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "zope.interface"] +tests-no-zope = ["cloudpickle ; platform_python_implementation == \"CPython\"", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy (>=0.900,!=0.940)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins"] + +[[package]] +name = "Babel" +version = "2.11.0" +description = "Internationalization utilities" +optional = false +python-versions = ">=3.6" +groups = ["dev"] +files = [ + {file = "Babel-2.11.0-py3-none-any.whl", hash = "sha256:1ad3eca1c885218f6dce2ab67291178944f810a10a9b5f3cb8382a5a232b64fe"}, + {file = "Babel-2.11.0.tar.gz", hash = "sha256:5ef4b3226b0180dedded4229651c8b0e1a3a6a2837d45a073272f313e4cf97f6"}, +] + +[package.dependencies] +pytz = ">=2015.7" + +[[package]] +name = "black" +version = "24.8.0" +description = "The uncompromising code formatter." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "black-24.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:09cdeb74d494ec023ded657f7092ba518e8cf78fa8386155e4a03fdcc44679e6"}, + {file = "black-24.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:81c6742da39f33b08e791da38410f32e27d632260e599df7245cccee2064afeb"}, + {file = "black-24.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:707a1ca89221bc8a1a64fb5e15ef39cd755633daa672a9db7498d1c19de66a42"}, + {file = "black-24.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d6417535d99c37cee4091a2f24eb2b6d5ec42b144d50f1f2e436d9fe1916fe1a"}, + {file = "black-24.8.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:fb6e2c0b86bbd43dee042e48059c9ad7830abd5c94b0bc518c0eeec57c3eddc1"}, + {file = "black-24.8.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:837fd281f1908d0076844bc2b801ad2d369c78c45cf800cad7b61686051041af"}, + {file = "black-24.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:62e8730977f0b77998029da7971fa896ceefa2c4c4933fcd593fa599ecbf97a4"}, + {file = "black-24.8.0-cp311-cp311-win_amd64.whl", hash = "sha256:72901b4913cbac8972ad911dc4098d5753704d1f3c56e44ae8dce99eecb0e3af"}, + {file = "black-24.8.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7c046c1d1eeb7aea9335da62472481d3bbf3fd986e093cffd35f4385c94ae368"}, + {file = "black-24.8.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:649f6d84ccbae73ab767e206772cc2d7a393a001070a4c814a546afd0d423aed"}, + {file = "black-24.8.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:2b59b250fdba5f9a9cd9d0ece6e6d993d91ce877d121d161e4698af3eb9c1018"}, + {file = "black-24.8.0-cp312-cp312-win_amd64.whl", hash = "sha256:6e55d30d44bed36593c3163b9bc63bf58b3b30e4611e4d88a0c3c239930ed5b2"}, + {file = "black-24.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:505289f17ceda596658ae81b61ebbe2d9b25aa78067035184ed0a9d855d18afd"}, + {file = "black-24.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b19c9ad992c7883ad84c9b22aaa73562a16b819c1d8db7a1a1a49fb7ec13c7d2"}, + {file = "black-24.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1f13f7f386f86f8121d76599114bb8c17b69d962137fc70efe56137727c7047e"}, + {file = "black-24.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:f490dbd59680d809ca31efdae20e634f3fae27fba3ce0ba3208333b713bc3920"}, + {file = "black-24.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:eab4dd44ce80dea27dc69db40dab62d4ca96112f87996bca68cd75639aeb2e4c"}, + {file = "black-24.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3c4285573d4897a7610054af5a890bde7c65cb466040c5f0c8b732812d7f0e5e"}, + {file = "black-24.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:9e84e33b37be070ba135176c123ae52a51f82306def9f7d063ee302ecab2cf47"}, + {file = "black-24.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:73bbf84ed136e45d451a260c6b73ed674652f90a2b3211d6a35e78054563a9bb"}, + {file = "black-24.8.0-py3-none-any.whl", hash = "sha256:972085c618ee94f402da1af548a4f218c754ea7e5dc70acb168bfaca4c2542ed"}, + {file = "black-24.8.0.tar.gz", hash = "sha256:2500945420b6784c38b9ee885af039f5e7471ef284ab03fa35ecdde4688cd83f"}, +] + +[package.dependencies] +click = ">=8.0.0" +mypy-extensions = ">=0.4.3" +packaging = ">=22.0" +pathspec = ">=0.9.0" +platformdirs = ">=2" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = {version = ">=4.0.1", markers = "python_version < \"3.11\""} + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.7.4) ; sys_platform != \"win32\" or implementation_name != \"pypy\"", "aiohttp (>=3.7.4,!=3.9.0) ; sys_platform == \"win32\" and implementation_name == \"pypy\""] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] + +[[package]] +name = "certifi" +version = "2025.4.26" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +groups = ["main", "dev"] +files = [ + {file = "certifi-2025.4.26-py3-none-any.whl", hash = "sha256:30350364dfe371162649852c63336a15c70c6510c2ad5015b21c2345311805f3"}, + {file = "certifi-2025.4.26.tar.gz", hash = "sha256:0a816057ea3cdefcef70270d2c515e4506bbc954f417fa5ade2021213bb8f0c6"}, +] + +[[package]] +name = "charset-normalizer" +version = "2.1.1" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.6.0" +groups = ["dev"] +files = [ + {file = "charset-normalizer-2.1.1.tar.gz", hash = "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"}, + {file = "charset_normalizer-2.1.1-py3-none-any.whl", hash = "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"}, +] + +[package.extras] +unicode-backport = ["unicodedata2"] + +[[package]] +name = "click" +version = "8.1.3" +description = "Composable command line interface toolkit" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "click-8.1.3-py3-none-any.whl", hash = "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48"}, + {file = "click-8.1.3.tar.gz", hash = "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +groups = ["dev"] +markers = "sys_platform == \"win32\" or platform_system == \"Windows\"" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "docutils" +version = "0.18.1" +description = "Docutils -- Python Documentation Utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +groups = ["dev"] +files = [ + {file = "docutils-0.18.1-py2.py3-none-any.whl", hash = "sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c"}, + {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, +] + +[[package]] +name = "furl" +version = "2.1.3" +description = "URL manipulation made simple." +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "furl-2.1.3-py2.py3-none-any.whl", hash = "sha256:9ab425062c4217f9802508e45feb4a83e54324273ac4b202f1850363309666c0"}, + {file = "furl-2.1.3.tar.gz", hash = "sha256:5a6188fe2666c484a12159c18be97a1977a71d632ef5bb867ef15f54af39cc4e"}, +] + +[package.dependencies] +orderedmultidict = ">=1.0.1" +six = ">=1.8.0" + +[[package]] +name = "idna" +version = "3.7" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.5" +groups = ["dev"] +files = [ + {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, + {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, +] + +[[package]] +name = "imagesize" +version = "1.4.1" +description = "Getting image size from png/jpeg/jpeg2000/gif file" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +groups = ["dev"] +files = [ + {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, + {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, +] + +[[package]] +name = "importlib-metadata" +version = "5.1.0" +description = "Read metadata from Python packages" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.10\"" +files = [ + {file = "importlib_metadata-5.1.0-py3-none-any.whl", hash = "sha256:d84d17e21670ec07990e1044a99efe8d615d860fd176fc29ef5c306068fda313"}, + {file = "importlib_metadata-5.1.0.tar.gz", hash = "sha256:d5059f9f1e8e41f80e9c56c2ee58811450c31984dfa625329ffd7c0dad88a73b"}, +] + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] +perf = ["ipython"] +testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3) ; python_version < \"3.9\"", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementation != \"PyPy\"", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8 ; python_version < \"3.12\"", "pytest-mypy (>=0.9.1) ; platform_python_implementation != \"PyPy\"", "pytest-perf (>=0.9.2)"] + +[[package]] +name = "importlib-resources" +version = "5.10.0" +description = "Read resources from Python packages" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.9\"" +files = [ + {file = "importlib_resources-5.10.0-py3-none-any.whl", hash = "sha256:ee17ec648f85480d523596ce49eae8ead87d5631ae1551f913c0100b5edd3437"}, + {file = "importlib_resources-5.10.0.tar.gz", hash = "sha256:c01b1b94210d9849f286b86bb51bcea7cd56dde0600d8db721d7b81330711668"}, +] + +[package.dependencies] +zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)"] +testing = ["flake8 (<5)", "pytest (>=6)", "pytest-black (>=0.3.7) ; platform_python_implementation != \"PyPy\"", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-flake8", "pytest-mypy (>=0.9.1) ; platform_python_implementation != \"PyPy\""] + +[[package]] +name = "jinja2" +version = "3.1.6" +description = "A very fast and expressive template engine." +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"}, + {file = "jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"}, +] + +[package.dependencies] +MarkupSafe = ">=2.0" + +[package.extras] +i18n = ["Babel (>=2.7)"] + +[[package]] +name = "jsonschema" +version = "4.17.1" +description = "An implementation of JSON Schema validation for Python" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "jsonschema-4.17.1-py3-none-any.whl", hash = "sha256:410ef23dcdbca4eaedc08b850079179883c2ed09378bd1f760d4af4aacfa28d7"}, + {file = "jsonschema-4.17.1.tar.gz", hash = "sha256:05b2d22c83640cde0b7e0aa329ca7754fbd98ea66ad8ae24aa61328dfe057fa3"}, +] + +[package.dependencies] +attrs = ">=17.4.0" +importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""} +pkgutil-resolve-name = {version = ">=1.3.10", markers = "python_version < \"3.9\""} +pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2" + +[package.extras] +format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] +format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3986-validator (>0.1.0)", "uri-template", "webcolors (>=1.11)"] + +[[package]] +name = "MarkupSafe" +version = "2.1.1" +description = "Safely add untrusted strings to HTML/XML markup." +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812"}, + {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a"}, + {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e"}, + {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5"}, + {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4"}, + {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f"}, + {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e"}, + {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933"}, + {file = "MarkupSafe-2.1.1-cp310-cp310-win32.whl", hash = "sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6"}, + {file = "MarkupSafe-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417"}, + {file = "MarkupSafe-2.1.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02"}, + {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a"}, + {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37"}, + {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980"}, + {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a"}, + {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3"}, + {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a"}, + {file = "MarkupSafe-2.1.1-cp37-cp37m-win32.whl", hash = "sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff"}, + {file = "MarkupSafe-2.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a"}, + {file = "MarkupSafe-2.1.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452"}, + {file = "MarkupSafe-2.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003"}, + {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1"}, + {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601"}, + {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925"}, + {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f"}, + {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88"}, + {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63"}, + {file = "MarkupSafe-2.1.1-cp38-cp38-win32.whl", hash = "sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1"}, + {file = "MarkupSafe-2.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7"}, + {file = "MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a"}, + {file = "MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f"}, + {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6"}, + {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77"}, + {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603"}, + {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7"}, + {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135"}, + {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96"}, + {file = "MarkupSafe-2.1.1-cp39-cp39-win32.whl", hash = "sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c"}, + {file = "MarkupSafe-2.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247"}, + {file = "MarkupSafe-2.1.1.tar.gz", hash = "sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b"}, +] + +[[package]] +name = "mypy" +version = "1.13.0" +description = "Optional static typing for Python" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "mypy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6607e0f1dd1fb7f0aca14d936d13fd19eba5e17e1cd2a14f808fa5f8f6d8f60a"}, + {file = "mypy-1.13.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8a21be69bd26fa81b1f80a61ee7ab05b076c674d9b18fb56239d72e21d9f4c80"}, + {file = "mypy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7b2353a44d2179846a096e25691d54d59904559f4232519d420d64da6828a3a7"}, + {file = "mypy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0730d1c6a2739d4511dc4253f8274cdd140c55c32dfb0a4cf8b7a43f40abfa6f"}, + {file = "mypy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:c5fc54dbb712ff5e5a0fca797e6e0aa25726c7e72c6a5850cfd2adbc1eb0a372"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:581665e6f3a8a9078f28d5502f4c334c0c8d802ef55ea0e7276a6e409bc0d82d"}, + {file = "mypy-1.13.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:3ddb5b9bf82e05cc9a627e84707b528e5c7caaa1c55c69e175abb15a761cec2d"}, + {file = "mypy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:20c7ee0bc0d5a9595c46f38beb04201f2620065a93755704e141fcac9f59db2b"}, + {file = "mypy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3790ded76f0b34bc9c8ba4def8f919dd6a46db0f5a6610fb994fe8efdd447f73"}, + {file = "mypy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:51f869f4b6b538229c1d1bcc1dd7d119817206e2bc54e8e374b3dfa202defcca"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:5c7051a3461ae84dfb5dd15eff5094640c61c5f22257c8b766794e6dd85e72d5"}, + {file = "mypy-1.13.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:39bb21c69a5d6342f4ce526e4584bc5c197fd20a60d14a8624d8743fffb9472e"}, + {file = "mypy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:164f28cb9d6367439031f4c81e84d3ccaa1e19232d9d05d37cb0bd880d3f93c2"}, + {file = "mypy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4c1bfcdbce96ff5d96fc9b08e3831acb30dc44ab02671eca5953eadad07d6d0"}, + {file = "mypy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:a0affb3a79a256b4183ba09811e3577c5163ed06685e4d4b46429a271ba174d2"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:a7b44178c9760ce1a43f544e595d35ed61ac2c3de306599fa59b38a6048e1aa7"}, + {file = "mypy-1.13.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5d5092efb8516d08440e36626f0153b5006d4088c1d663d88bf79625af3d1d62"}, + {file = "mypy-1.13.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:de2904956dac40ced10931ac967ae63c5089bd498542194b436eb097a9f77bc8"}, + {file = "mypy-1.13.0-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:7bfd8836970d33c2105562650656b6846149374dc8ed77d98424b40b09340ba7"}, + {file = "mypy-1.13.0-cp313-cp313-win_amd64.whl", hash = "sha256:9f73dba9ec77acb86457a8fc04b5239822df0c14a082564737833d2963677dbc"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:100fac22ce82925f676a734af0db922ecfea991e1d7ec0ceb1e115ebe501301a"}, + {file = "mypy-1.13.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7bcb0bb7f42a978bb323a7c88f1081d1b5dee77ca86f4100735a6f541299d8fb"}, + {file = "mypy-1.13.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bde31fc887c213e223bbfc34328070996061b0833b0a4cfec53745ed61f3519b"}, + {file = "mypy-1.13.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:07de989f89786f62b937851295ed62e51774722e5444a27cecca993fc3f9cd74"}, + {file = "mypy-1.13.0-cp38-cp38-win_amd64.whl", hash = "sha256:4bde84334fbe19bad704b3f5b78c4abd35ff1026f8ba72b29de70dda0916beb6"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:0246bcb1b5de7f08f2826451abd947bf656945209b140d16ed317f65a17dc7dc"}, + {file = "mypy-1.13.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:7f5b7deae912cf8b77e990b9280f170381fdfbddf61b4ef80927edd813163732"}, + {file = "mypy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7029881ec6ffb8bc233a4fa364736789582c738217b133f1b55967115288a2bc"}, + {file = "mypy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3e38b980e5681f28f033f3be86b099a247b13c491f14bb8b1e1e134d23bb599d"}, + {file = "mypy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:a6789be98a2017c912ae6ccb77ea553bbaf13d27605d2ca20a76dfbced631b24"}, + {file = "mypy-1.13.0-py3-none-any.whl", hash = "sha256:9c250883f9fd81d212e0952c92dbfcc96fc237f4b7c92f56ac81fd48460b3e5a"}, + {file = "mypy-1.13.0.tar.gz", hash = "sha256:0291a61b6fbf3e6673e3405cfcc0e7650bebc7939659fdca2702958038bd835e"}, +] + +[package.dependencies] +mypy-extensions = ">=1.0.0" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typing-extensions = ">=4.6.0" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +faster-cache = ["orjson"] +install-types = ["pip"] +mypyc = ["setuptools (>=50)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "1.0.0" +description = "Type system extensions for programs checked with the mypy type checker." +optional = false +python-versions = ">=3.5" +groups = ["dev"] +files = [ + {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, + {file = "mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782"}, +] + +[[package]] +name = "orderedmultidict" +version = "1.0.1" +description = "Ordered Multivalue Dictionary" +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "orderedmultidict-1.0.1-py2.py3-none-any.whl", hash = "sha256:43c839a17ee3cdd62234c47deca1a8508a3f2ca1d0678a3bf791c87cf84adbf3"}, + {file = "orderedmultidict-1.0.1.tar.gz", hash = "sha256:04070bbb5e87291cc9bfa51df413677faf2141c73c61d2a5f7b26bea3cd882ad"}, +] + +[package.dependencies] +six = ">=1.8.0" + +[[package]] +name = "orjson" +version = "3.10.15" +description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "orjson-3.10.15-cp310-cp310-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:552c883d03ad185f720d0c09583ebde257e41b9521b74ff40e08b7dec4559c04"}, + {file = "orjson-3.10.15-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:616e3e8d438d02e4854f70bfdc03a6bcdb697358dbaa6bcd19cbe24d24ece1f8"}, + {file = "orjson-3.10.15-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7c2c79fa308e6edb0ffab0a31fd75a7841bf2a79a20ef08a3c6e3b26814c8ca8"}, + {file = "orjson-3.10.15-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73cb85490aa6bf98abd20607ab5c8324c0acb48d6da7863a51be48505646c814"}, + {file = "orjson-3.10.15-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:763dadac05e4e9d2bc14938a45a2d0560549561287d41c465d3c58aec818b164"}, + {file = "orjson-3.10.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a330b9b4734f09a623f74a7490db713695e13b67c959713b78369f26b3dee6bf"}, + {file = "orjson-3.10.15-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a61a4622b7ff861f019974f73d8165be1bd9a0855e1cad18ee167acacabeb061"}, + {file = "orjson-3.10.15-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:acd271247691574416b3228db667b84775c497b245fa275c6ab90dc1ffbbd2b3"}, + {file = "orjson-3.10.15-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:e4759b109c37f635aa5c5cc93a1b26927bfde24b254bcc0e1149a9fada253d2d"}, + {file = "orjson-3.10.15-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:9e992fd5cfb8b9f00bfad2fd7a05a4299db2bbe92e6440d9dd2fab27655b3182"}, + {file = "orjson-3.10.15-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:f95fb363d79366af56c3f26b71df40b9a583b07bbaaf5b317407c4d58497852e"}, + {file = "orjson-3.10.15-cp310-cp310-win32.whl", hash = "sha256:f9875f5fea7492da8ec2444839dcc439b0ef298978f311103d0b7dfd775898ab"}, + {file = "orjson-3.10.15-cp310-cp310-win_amd64.whl", hash = "sha256:17085a6aa91e1cd70ca8533989a18b5433e15d29c574582f76f821737c8d5806"}, + {file = "orjson-3.10.15-cp311-cp311-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:c4cc83960ab79a4031f3119cc4b1a1c627a3dc09df125b27c4201dff2af7eaa6"}, + {file = "orjson-3.10.15-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ddbeef2481d895ab8be5185f2432c334d6dec1f5d1933a9c83014d188e102cef"}, + {file = "orjson-3.10.15-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9e590a0477b23ecd5b0ac865b1b907b01b3c5535f5e8a8f6ab0e503efb896334"}, + {file = "orjson-3.10.15-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a6be38bd103d2fd9bdfa31c2720b23b5d47c6796bcb1d1b598e3924441b4298d"}, + {file = "orjson-3.10.15-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ff4f6edb1578960ed628a3b998fa54d78d9bb3e2eb2cfc5c2a09732431c678d0"}, + {file = "orjson-3.10.15-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b0482b21d0462eddd67e7fce10b89e0b6ac56570424662b685a0d6fccf581e13"}, + {file = "orjson-3.10.15-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bb5cc3527036ae3d98b65e37b7986a918955f85332c1ee07f9d3f82f3a6899b5"}, + {file = "orjson-3.10.15-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d569c1c462912acdd119ccbf719cf7102ea2c67dd03b99edcb1a3048651ac96b"}, + {file = "orjson-3.10.15-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:1e6d33efab6b71d67f22bf2962895d3dc6f82a6273a965fab762e64fa90dc399"}, + {file = "orjson-3.10.15-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:c33be3795e299f565681d69852ac8c1bc5c84863c0b0030b2b3468843be90388"}, + {file = "orjson-3.10.15-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:eea80037b9fae5339b214f59308ef0589fc06dc870578b7cce6d71eb2096764c"}, + {file = "orjson-3.10.15-cp311-cp311-win32.whl", hash = "sha256:d5ac11b659fd798228a7adba3e37c010e0152b78b1982897020a8e019a94882e"}, + {file = "orjson-3.10.15-cp311-cp311-win_amd64.whl", hash = "sha256:cf45e0214c593660339ef63e875f32ddd5aa3b4adc15e662cdb80dc49e194f8e"}, + {file = "orjson-3.10.15-cp312-cp312-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:9d11c0714fc85bfcf36ada1179400862da3288fc785c30e8297844c867d7505a"}, + {file = "orjson-3.10.15-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dba5a1e85d554e3897fa9fe6fbcff2ed32d55008973ec9a2b992bd9a65d2352d"}, + {file = "orjson-3.10.15-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7723ad949a0ea502df656948ddd8b392780a5beaa4c3b5f97e525191b102fff0"}, + {file = "orjson-3.10.15-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6fd9bc64421e9fe9bd88039e7ce8e58d4fead67ca88e3a4014b143cec7684fd4"}, + {file = "orjson-3.10.15-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dadba0e7b6594216c214ef7894c4bd5f08d7c0135f4dd0145600be4fbcc16767"}, + {file = "orjson-3.10.15-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b48f59114fe318f33bbaee8ebeda696d8ccc94c9e90bc27dbe72153094e26f41"}, + {file = "orjson-3.10.15-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:035fb83585e0f15e076759b6fedaf0abb460d1765b6a36f48018a52858443514"}, + {file = "orjson-3.10.15-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:d13b7fe322d75bf84464b075eafd8e7dd9eae05649aa2a5354cfa32f43c59f17"}, + {file = "orjson-3.10.15-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:7066b74f9f259849629e0d04db6609db4cf5b973248f455ba5d3bd58a4daaa5b"}, + {file = "orjson-3.10.15-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:88dc3f65a026bd3175eb157fea994fca6ac7c4c8579fc5a86fc2114ad05705b7"}, + {file = "orjson-3.10.15-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b342567e5465bd99faa559507fe45e33fc76b9fb868a63f1642c6bc0735ad02a"}, + {file = "orjson-3.10.15-cp312-cp312-win32.whl", hash = "sha256:0a4f27ea5617828e6b58922fdbec67b0aa4bb844e2d363b9244c47fa2180e665"}, + {file = "orjson-3.10.15-cp312-cp312-win_amd64.whl", hash = "sha256:ef5b87e7aa9545ddadd2309efe6824bd3dd64ac101c15dae0f2f597911d46eaa"}, + {file = "orjson-3.10.15-cp313-cp313-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:bae0e6ec2b7ba6895198cd981b7cca95d1487d0147c8ed751e5632ad16f031a6"}, + {file = "orjson-3.10.15-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f93ce145b2db1252dd86af37d4165b6faa83072b46e3995ecc95d4b2301b725a"}, + {file = "orjson-3.10.15-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7c203f6f969210128af3acae0ef9ea6aab9782939f45f6fe02d05958fe761ef9"}, + {file = "orjson-3.10.15-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8918719572d662e18b8af66aef699d8c21072e54b6c82a3f8f6404c1f5ccd5e0"}, + {file = "orjson-3.10.15-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f71eae9651465dff70aa80db92586ad5b92df46a9373ee55252109bb6b703307"}, + {file = "orjson-3.10.15-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e117eb299a35f2634e25ed120c37c641398826c2f5a3d3cc39f5993b96171b9e"}, + {file = "orjson-3.10.15-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:13242f12d295e83c2955756a574ddd6741c81e5b99f2bef8ed8d53e47a01e4b7"}, + {file = "orjson-3.10.15-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:7946922ada8f3e0b7b958cc3eb22cfcf6c0df83d1fe5521b4a100103e3fa84c8"}, + {file = "orjson-3.10.15-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:b7155eb1623347f0f22c38c9abdd738b287e39b9982e1da227503387b81b34ca"}, + {file = "orjson-3.10.15-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:208beedfa807c922da4e81061dafa9c8489c6328934ca2a562efa707e049e561"}, + {file = "orjson-3.10.15-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:eca81f83b1b8c07449e1d6ff7074e82e3fd6777e588f1a6632127f286a968825"}, + {file = "orjson-3.10.15-cp313-cp313-win32.whl", hash = "sha256:c03cd6eea1bd3b949d0d007c8d57049aa2b39bd49f58b4b2af571a5d3833d890"}, + {file = "orjson-3.10.15-cp313-cp313-win_amd64.whl", hash = "sha256:fd56a26a04f6ba5fb2045b0acc487a63162a958ed837648c5781e1fe3316cfbf"}, + {file = "orjson-3.10.15-cp38-cp38-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:5e8afd6200e12771467a1a44e5ad780614b86abb4b11862ec54861a82d677746"}, + {file = "orjson-3.10.15-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da9a18c500f19273e9e104cca8c1f0b40a6470bcccfc33afcc088045d0bf5ea6"}, + {file = "orjson-3.10.15-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bb00b7bfbdf5d34a13180e4805d76b4567025da19a197645ca746fc2fb536586"}, + {file = "orjson-3.10.15-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:33aedc3d903378e257047fee506f11e0833146ca3e57a1a1fb0ddb789876c1e1"}, + {file = "orjson-3.10.15-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dd0099ae6aed5eb1fc84c9eb72b95505a3df4267e6962eb93cdd5af03be71c98"}, + {file = "orjson-3.10.15-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7c864a80a2d467d7786274fce0e4f93ef2a7ca4ff31f7fc5634225aaa4e9e98c"}, + {file = "orjson-3.10.15-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c25774c9e88a3e0013d7d1a6c8056926b607a61edd423b50eb5c88fd7f2823ae"}, + {file = "orjson-3.10.15-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:e78c211d0074e783d824ce7bb85bf459f93a233eb67a5b5003498232ddfb0e8a"}, + {file = "orjson-3.10.15-cp38-cp38-musllinux_1_2_armv7l.whl", hash = "sha256:43e17289ffdbbac8f39243916c893d2ae41a2ea1a9cbb060a56a4d75286351ae"}, + {file = "orjson-3.10.15-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:781d54657063f361e89714293c095f506c533582ee40a426cb6489c48a637b81"}, + {file = "orjson-3.10.15-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6875210307d36c94873f553786a808af2788e362bd0cf4c8e66d976791e7b528"}, + {file = "orjson-3.10.15-cp38-cp38-win32.whl", hash = "sha256:305b38b2b8f8083cc3d618927d7f424349afce5975b316d33075ef0f73576b60"}, + {file = "orjson-3.10.15-cp38-cp38-win_amd64.whl", hash = "sha256:5dd9ef1639878cc3efffed349543cbf9372bdbd79f478615a1c633fe4e4180d1"}, + {file = "orjson-3.10.15-cp39-cp39-macosx_10_15_x86_64.macosx_11_0_arm64.macosx_10_15_universal2.whl", hash = "sha256:ffe19f3e8d68111e8644d4f4e267a069ca427926855582ff01fc012496d19969"}, + {file = "orjson-3.10.15-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d433bf32a363823863a96561a555227c18a522a8217a6f9400f00ddc70139ae2"}, + {file = "orjson-3.10.15-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:da03392674f59a95d03fa5fb9fe3a160b0511ad84b7a3914699ea5a1b3a38da2"}, + {file = "orjson-3.10.15-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3a63bb41559b05360ded9132032239e47983a39b151af1201f07ec9370715c82"}, + {file = "orjson-3.10.15-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3766ac4702f8f795ff3fa067968e806b4344af257011858cc3d6d8721588b53f"}, + {file = "orjson-3.10.15-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7a1c73dcc8fadbd7c55802d9aa093b36878d34a3b3222c41052ce6b0fc65f8e8"}, + {file = "orjson-3.10.15-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:b299383825eafe642cbab34be762ccff9fd3408d72726a6b2a4506d410a71ab3"}, + {file = "orjson-3.10.15-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:abc7abecdbf67a173ef1316036ebbf54ce400ef2300b4e26a7b843bd446c2480"}, + {file = "orjson-3.10.15-cp39-cp39-musllinux_1_2_armv7l.whl", hash = "sha256:3614ea508d522a621384c1d6639016a5a2e4f027f3e4a1c93a51867615d28829"}, + {file = "orjson-3.10.15-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:295c70f9dc154307777ba30fe29ff15c1bcc9dfc5c48632f37d20a607e9ba85a"}, + {file = "orjson-3.10.15-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:63309e3ff924c62404923c80b9e2048c1f74ba4b615e7584584389ada50ed428"}, + {file = "orjson-3.10.15-cp39-cp39-win32.whl", hash = "sha256:a2f708c62d026fb5340788ba94a55c23df4e1869fec74be455e0b2f5363b8507"}, + {file = "orjson-3.10.15-cp39-cp39-win_amd64.whl", hash = "sha256:efcf6c735c3d22ef60c4aa27a5238f1a477df85e9b15f2142f9d669beb2d13fd"}, + {file = "orjson-3.10.15.tar.gz", hash = "sha256:05ca7fe452a2e9d8d9d706a2984c95b9c2ebc5db417ce0b7a49b91d50642a23e"}, +] + +[[package]] +name = "packaging" +version = "23.1" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"}, + {file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"}, +] + +[[package]] +name = "pathspec" +version = "0.10.2" +description = "Utility library for gitignore style pattern matching of file paths." +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "pathspec-0.10.2-py3-none-any.whl", hash = "sha256:88c2606f2c1e818b978540f73ecc908e13999c6c3a383daf3705652ae79807a5"}, + {file = "pathspec-0.10.2.tar.gz", hash = "sha256:8f6bf73e5758fd365ef5d58ce09ac7c27d2833a8d7da51712eac6e27e35141b0"}, +] + +[[package]] +name = "pkgutil_resolve_name" +version = "1.3.10" +description = "Resolve a name to an object." +optional = false +python-versions = ">=3.6" +groups = ["dev"] +markers = "python_version < \"3.9\"" +files = [ + {file = "pkgutil_resolve_name-1.3.10-py3-none-any.whl", hash = "sha256:ca27cc078d25c5ad71a9de0a7a330146c4e014c2462d9af19c6b828280649c5e"}, + {file = "pkgutil_resolve_name-1.3.10.tar.gz", hash = "sha256:357d6c9e6a755653cfd78893817c0853af365dd51ec97f3d358a819373bbd174"}, +] + +[[package]] +name = "platformdirs" +version = "2.5.4" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "platformdirs-2.5.4-py3-none-any.whl", hash = "sha256:af0276409f9a02373d540bf8480021a048711d572745aef4b7842dad245eba10"}, + {file = "platformdirs-2.5.4.tar.gz", hash = "sha256:1006647646d80f16130f052404c6b901e80ee4ed6bef6792e1f238a8969106f7"}, +] + +[package.extras] +docs = ["furo (>=2022.9.29)", "proselint (>=0.13)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.4)"] +test = ["appdirs (==1.4.4)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] + +[[package]] +name = "pook" +version = "2.0.1" +description = "HTTP traffic mocking and expectations made easy" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "pook-2.0.1-py3-none-any.whl", hash = "sha256:30d73c95e0520f45c1e3889f3bf486e990b6f04b4915aa9daf86cf0d8136b2e1"}, + {file = "pook-2.0.1.tar.gz", hash = "sha256:e04c0e698f256438b4dfbf3ab1b27559f0ec25e42176823167f321f4e8b9c9e4"}, +] + +[package.dependencies] +furl = ">=0.5.6" +jsonschema = ">=2.5.1" +xmltodict = ">=0.11.0" + +[[package]] +name = "pygments" +version = "2.15.0" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "Pygments-2.15.0-py3-none-any.whl", hash = "sha256:77a3299119af881904cd5ecd1ac6a66214b6e9bed1f2db16993b54adede64094"}, + {file = "Pygments-2.15.0.tar.gz", hash = "sha256:f7e36cffc4c517fbc252861b9a6e4644ca0e5abadf9a113c72d1358ad09b9500"}, +] + +[package.extras] +plugins = ["importlib-metadata ; python_version < \"3.8\""] + +[[package]] +name = "pyrsistent" +version = "0.19.2" +description = "Persistent/Functional/Immutable data structures" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +files = [ + {file = "pyrsistent-0.19.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d6982b5a0237e1b7d876b60265564648a69b14017f3b5f908c5be2de3f9abb7a"}, + {file = "pyrsistent-0.19.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:187d5730b0507d9285a96fca9716310d572e5464cadd19f22b63a6976254d77a"}, + {file = "pyrsistent-0.19.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:055ab45d5911d7cae397dc418808d8802fb95262751872c841c170b0dbf51eed"}, + {file = "pyrsistent-0.19.2-cp310-cp310-win32.whl", hash = "sha256:456cb30ca8bff00596519f2c53e42c245c09e1a4543945703acd4312949bfd41"}, + {file = "pyrsistent-0.19.2-cp310-cp310-win_amd64.whl", hash = "sha256:b39725209e06759217d1ac5fcdb510e98670af9e37223985f330b611f62e7425"}, + {file = "pyrsistent-0.19.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2aede922a488861de0ad00c7630a6e2d57e8023e4be72d9d7147a9fcd2d30712"}, + {file = "pyrsistent-0.19.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:879b4c2f4d41585c42df4d7654ddffff1239dc4065bc88b745f0341828b83e78"}, + {file = "pyrsistent-0.19.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c43bec251bbd10e3cb58ced80609c5c1eb238da9ca78b964aea410fb820d00d6"}, + {file = "pyrsistent-0.19.2-cp37-cp37m-win32.whl", hash = "sha256:d690b18ac4b3e3cab73b0b7aa7dbe65978a172ff94970ff98d82f2031f8971c2"}, + {file = "pyrsistent-0.19.2-cp37-cp37m-win_amd64.whl", hash = "sha256:3ba4134a3ff0fc7ad225b6b457d1309f4698108fb6b35532d015dca8f5abed73"}, + {file = "pyrsistent-0.19.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:a178209e2df710e3f142cbd05313ba0c5ebed0a55d78d9945ac7a4e09d923308"}, + {file = "pyrsistent-0.19.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e371b844cec09d8dc424d940e54bba8f67a03ebea20ff7b7b0d56f526c71d584"}, + {file = "pyrsistent-0.19.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:111156137b2e71f3a9936baf27cb322e8024dac3dc54ec7fb9f0bcf3249e68bb"}, + {file = "pyrsistent-0.19.2-cp38-cp38-win32.whl", hash = "sha256:e5d8f84d81e3729c3b506657dddfe46e8ba9c330bf1858ee33108f8bb2adb38a"}, + {file = "pyrsistent-0.19.2-cp38-cp38-win_amd64.whl", hash = "sha256:9cd3e9978d12b5d99cbdc727a3022da0430ad007dacf33d0bf554b96427f33ab"}, + {file = "pyrsistent-0.19.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:f1258f4e6c42ad0b20f9cfcc3ada5bd6b83374516cd01c0960e3cb75fdca6770"}, + {file = "pyrsistent-0.19.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:21455e2b16000440e896ab99e8304617151981ed40c29e9507ef1c2e4314ee95"}, + {file = "pyrsistent-0.19.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bfd880614c6237243ff53a0539f1cb26987a6dc8ac6e66e0c5a40617296a045e"}, + {file = "pyrsistent-0.19.2-cp39-cp39-win32.whl", hash = "sha256:71d332b0320642b3261e9fee47ab9e65872c2bd90260e5d225dabeed93cbd42b"}, + {file = "pyrsistent-0.19.2-cp39-cp39-win_amd64.whl", hash = "sha256:dec3eac7549869365fe263831f576c8457f6c833937c68542d08fde73457d291"}, + {file = "pyrsistent-0.19.2-py3-none-any.whl", hash = "sha256:ea6b79a02a28550c98b6ca9c35b9f492beaa54d7c5c9e9949555893c8a9234d0"}, + {file = "pyrsistent-0.19.2.tar.gz", hash = "sha256:bfa0351be89c9fcbcb8c9879b826f4353be10f58f8a677efab0c017bf7137ec2"}, +] + +[[package]] +name = "pytz" +version = "2022.6" +description = "World timezone definitions, modern and historical" +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "pytz-2022.6-py2.py3-none-any.whl", hash = "sha256:222439474e9c98fced559f1709d89e6c9cbf8d79c794ff3eb9f8800064291427"}, + {file = "pytz-2022.6.tar.gz", hash = "sha256:e89512406b793ca39f5971bc999cc538ce125c0e51c27941bef4568b460095e2"}, +] + +[[package]] +name = "requests" +version = "2.32.4" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "requests-2.32.4-py3-none-any.whl", hash = "sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c"}, + {file = "requests-2.32.4.tar.gz", hash = "sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset_normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +groups = ["dev"] +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "snowballstemmer" +version = "2.2.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, + {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, +] + +[[package]] +name = "sphinx" +version = "7.1.2" +description = "Python documentation generator" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "sphinx-7.1.2-py3-none-any.whl", hash = "sha256:d170a81825b2fcacb6dfd5a0d7f578a053e45d3f2b153fecc948c37344eb4cbe"}, + {file = "sphinx-7.1.2.tar.gz", hash = "sha256:780f4d32f1d7d1126576e0e5ecc19dc32ab76cd24e950228dcf7b1f6d3d9e22f"}, +] + +[package.dependencies] +alabaster = ">=0.7,<0.8" +babel = ">=2.9" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +docutils = ">=0.18.1,<0.21" +imagesize = ">=1.3" +importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""} +Jinja2 = ">=3.0" +packaging = ">=21.0" +Pygments = ">=2.13" +requests = ">=2.25.0" +snowballstemmer = ">=2.0" +sphinxcontrib-applehelp = "*" +sphinxcontrib-devhelp = "*" +sphinxcontrib-htmlhelp = ">=2.0.0" +sphinxcontrib-jsmath = "*" +sphinxcontrib-qthelp = "*" +sphinxcontrib-serializinghtml = ">=1.1.5" + +[package.extras] +docs = ["sphinxcontrib-websupport"] +lint = ["docutils-stubs", "flake8 (>=3.5.0)", "flake8-simplify", "isort", "mypy (>=0.990)", "ruff", "sphinx-lint", "types-requests"] +test = ["cython", "filelock", "html5lib", "pytest (>=4.6)"] + +[[package]] +name = "sphinx-autodoc-typehints" +version = "2.0.1" +description = "Type hints (PEP 484) support for the Sphinx autodoc extension" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "sphinx_autodoc_typehints-2.0.1-py3-none-any.whl", hash = "sha256:f73ae89b43a799e587e39266672c1075b2ef783aeb382d3ebed77c38a3fc0149"}, + {file = "sphinx_autodoc_typehints-2.0.1.tar.gz", hash = "sha256:60ed1e3b2c970acc0aa6e877be42d48029a9faec7378a17838716cacd8c10b12"}, +] + +[package.dependencies] +sphinx = ">=7.1.2" + +[package.extras] +docs = ["furo (>=2024.1.29)"] +numpy = ["nptyping (>=2.5)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.4.2)", "diff-cover (>=8.0.3)", "pytest (>=8.0.1)", "pytest-cov (>=4.1)", "sphobjinv (>=2.3.1)", "typing-extensions (>=4.9)"] + +[[package]] +name = "sphinx-rtd-theme" +version = "3.0.2" +description = "Read the Docs theme for Sphinx" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "sphinx_rtd_theme-3.0.2-py2.py3-none-any.whl", hash = "sha256:422ccc750c3a3a311de4ae327e82affdaf59eb695ba4936538552f3b00f4ee13"}, + {file = "sphinx_rtd_theme-3.0.2.tar.gz", hash = "sha256:b7457bc25dda723b20b086a670b9953c859eab60a2a03ee8eb2bb23e176e5f85"}, +] + +[package.dependencies] +docutils = ">0.18,<0.22" +sphinx = ">=6,<9" +sphinxcontrib-jquery = ">=4,<5" + +[package.extras] +dev = ["bump2version", "transifex-client", "twine", "wheel"] + +[[package]] +name = "sphinxcontrib-applehelp" +version = "1.0.2" +description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" +optional = false +python-versions = ">=3.5" +groups = ["dev"] +files = [ + {file = "sphinxcontrib-applehelp-1.0.2.tar.gz", hash = "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58"}, + {file = "sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-devhelp" +version = "1.0.2" +description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." +optional = false +python-versions = ">=3.5" +groups = ["dev"] +files = [ + {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, + {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-htmlhelp" +version = "2.0.0" +description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" +optional = false +python-versions = ">=3.6" +groups = ["dev"] +files = [ + {file = "sphinxcontrib-htmlhelp-2.0.0.tar.gz", hash = "sha256:f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2"}, + {file = "sphinxcontrib_htmlhelp-2.0.0-py2.py3-none-any.whl", hash = "sha256:d412243dfb797ae3ec2b59eca0e52dac12e75a241bf0e4eb861e450d06c6ed07"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["html5lib", "pytest"] + +[[package]] +name = "sphinxcontrib-jquery" +version = "4.1" +description = "Extension to include jQuery on newer Sphinx releases" +optional = false +python-versions = ">=2.7" +groups = ["dev"] +files = [ + {file = "sphinxcontrib-jquery-4.1.tar.gz", hash = "sha256:1620739f04e36a2c779f1a131a2dfd49b2fd07351bf1968ced074365933abc7a"}, + {file = "sphinxcontrib_jquery-4.1-py2.py3-none-any.whl", hash = "sha256:f936030d7d0147dd026a4f2b5a57343d233f1fc7b363f68b3d4f1cb0993878ae"}, +] + +[package.dependencies] +Sphinx = ">=1.8" + +[[package]] +name = "sphinxcontrib-jsmath" +version = "1.0.1" +description = "A sphinx extension which renders display math in HTML via JavaScript" +optional = false +python-versions = ">=3.5" +groups = ["dev"] +files = [ + {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, + {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, +] + +[package.extras] +test = ["flake8", "mypy", "pytest"] + +[[package]] +name = "sphinxcontrib-qthelp" +version = "1.0.3" +description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." +optional = false +python-versions = ">=3.5" +groups = ["dev"] +files = [ + {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, + {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-serializinghtml" +version = "1.1.5" +description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." +optional = false +python-versions = ">=3.5" +groups = ["dev"] +files = [ + {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, + {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.7" +groups = ["dev"] +markers = "python_version < \"3.11\"" +files = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] + +[[package]] +name = "types-certifi" +version = "2021.10.8.3" +description = "Typing stubs for certifi" +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "types-certifi-2021.10.8.3.tar.gz", hash = "sha256:72cf7798d165bc0b76e1c10dd1ea3097c7063c42c21d664523b928e88b554a4f"}, + {file = "types_certifi-2021.10.8.3-py3-none-any.whl", hash = "sha256:b2d1e325e69f71f7c78e5943d410e650b4707bb0ef32e4ddf3da37f54176e88a"}, +] + +[[package]] +name = "types-setuptools" +version = "75.8.0.20250110" +description = "Typing stubs for setuptools" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "types_setuptools-75.8.0.20250110-py3-none-any.whl", hash = "sha256:a9f12980bbf9bcdc23ecd80755789085bad6bfce4060c2275bc2b4ca9f2bc480"}, + {file = "types_setuptools-75.8.0.20250110.tar.gz", hash = "sha256:96f7ec8bbd6e0a54ea180d66ad68ad7a1d7954e7281a710ea2de75e355545271"}, +] + +[[package]] +name = "types-urllib3" +version = "1.26.25.14" +description = "Typing stubs for urllib3" +optional = false +python-versions = "*" +groups = ["dev"] +files = [ + {file = "types-urllib3-1.26.25.14.tar.gz", hash = "sha256:229b7f577c951b8c1b92c1bc2b2fdb0b49847bd2af6d1cc2a2e3dd340f3bda8f"}, + {file = "types_urllib3-1.26.25.14-py3-none-any.whl", hash = "sha256:9683bbb7fb72e32bfe9d2be6e04875fbe1b3eeec3cbb4ea231435aa7fd6b4f0e"}, +] + +[[package]] +name = "typing-extensions" +version = "4.12.2" +description = "Backported and Experimental Type Hints for Python 3.8+" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +files = [ + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, +] + +[[package]] +name = "urllib3" +version = "2.2.3" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.8" +groups = ["main", "dev"] +files = [ + {file = "urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac"}, + {file = "urllib3-2.2.3.tar.gz", hash = "sha256:e7d814a81dad81e6caf2ec9fdedb284ecc9c73076b62654547cc64ccdcae26e9"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=0.8.0) ; platform_python_implementation != \"CPython\""] +h2 = ["h2 (>=4,<5)"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "websockets" +version = "13.1" +description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" +optional = false +python-versions = ">=3.8" +groups = ["main"] +files = [ + {file = "websockets-13.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f48c749857f8fb598fb890a75f540e3221d0976ed0bf879cf3c7eef34151acee"}, + {file = "websockets-13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c7e72ce6bda6fb9409cc1e8164dd41d7c91466fb599eb047cfda72fe758a34a7"}, + {file = "websockets-13.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:f779498eeec470295a2b1a5d97aa1bc9814ecd25e1eb637bd9d1c73a327387f6"}, + {file = "websockets-13.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4676df3fe46956fbb0437d8800cd5f2b6d41143b6e7e842e60554398432cf29b"}, + {file = "websockets-13.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a7affedeb43a70351bb811dadf49493c9cfd1ed94c9c70095fd177e9cc1541fa"}, + {file = "websockets-13.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1971e62d2caa443e57588e1d82d15f663b29ff9dfe7446d9964a4b6f12c1e700"}, + {file = "websockets-13.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:5f2e75431f8dc4a47f31565a6e1355fb4f2ecaa99d6b89737527ea917066e26c"}, + {file = "websockets-13.1-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:58cf7e75dbf7e566088b07e36ea2e3e2bd5676e22216e4cad108d4df4a7402a0"}, + {file = "websockets-13.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:c90d6dec6be2c7d03378a574de87af9b1efea77d0c52a8301dd831ece938452f"}, + {file = "websockets-13.1-cp310-cp310-win32.whl", hash = "sha256:730f42125ccb14602f455155084f978bd9e8e57e89b569b4d7f0f0c17a448ffe"}, + {file = "websockets-13.1-cp310-cp310-win_amd64.whl", hash = "sha256:5993260f483d05a9737073be197371940c01b257cc45ae3f1d5d7adb371b266a"}, + {file = "websockets-13.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:61fc0dfcda609cda0fc9fe7977694c0c59cf9d749fbb17f4e9483929e3c48a19"}, + {file = "websockets-13.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:ceec59f59d092c5007e815def4ebb80c2de330e9588e101cf8bd94c143ec78a5"}, + {file = "websockets-13.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:c1dca61c6db1166c48b95198c0b7d9c990b30c756fc2923cc66f68d17dc558fd"}, + {file = "websockets-13.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:308e20f22c2c77f3f39caca508e765f8725020b84aa963474e18c59accbf4c02"}, + {file = "websockets-13.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62d516c325e6540e8a57b94abefc3459d7dab8ce52ac75c96cad5549e187e3a7"}, + {file = "websockets-13.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87c6e35319b46b99e168eb98472d6c7d8634ee37750d7693656dc766395df096"}, + {file = "websockets-13.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:5f9fee94ebafbc3117c30be1844ed01a3b177bb6e39088bc6b2fa1dc15572084"}, + {file = "websockets-13.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:7c1e90228c2f5cdde263253fa5db63e6653f1c00e7ec64108065a0b9713fa1b3"}, + {file = "websockets-13.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:6548f29b0e401eea2b967b2fdc1c7c7b5ebb3eeb470ed23a54cd45ef078a0db9"}, + {file = "websockets-13.1-cp311-cp311-win32.whl", hash = "sha256:c11d4d16e133f6df8916cc5b7e3e96ee4c44c936717d684a94f48f82edb7c92f"}, + {file = "websockets-13.1-cp311-cp311-win_amd64.whl", hash = "sha256:d04f13a1d75cb2b8382bdc16ae6fa58c97337253826dfe136195b7f89f661557"}, + {file = "websockets-13.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:9d75baf00138f80b48f1eac72ad1535aac0b6461265a0bcad391fc5aba875cfc"}, + {file = "websockets-13.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:9b6f347deb3dcfbfde1c20baa21c2ac0751afaa73e64e5b693bb2b848efeaa49"}, + {file = "websockets-13.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:de58647e3f9c42f13f90ac7e5f58900c80a39019848c5547bc691693098ae1bd"}, + {file = "websockets-13.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1b54689e38d1279a51d11e3467dd2f3a50f5f2e879012ce8f2d6943f00e83f0"}, + {file = "websockets-13.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cf1781ef73c073e6b0f90af841aaf98501f975d306bbf6221683dd594ccc52b6"}, + {file = "websockets-13.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d23b88b9388ed85c6faf0e74d8dec4f4d3baf3ecf20a65a47b836d56260d4b9"}, + {file = "websockets-13.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3c78383585f47ccb0fcf186dcb8a43f5438bd7d8f47d69e0b56f71bf431a0a68"}, + {file = "websockets-13.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:d6d300f8ec35c24025ceb9b9019ae9040c1ab2f01cddc2bcc0b518af31c75c14"}, + {file = "websockets-13.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a9dcaf8b0cc72a392760bb8755922c03e17a5a54e08cca58e8b74f6902b433cf"}, + {file = "websockets-13.1-cp312-cp312-win32.whl", hash = "sha256:2f85cf4f2a1ba8f602298a853cec8526c2ca42a9a4b947ec236eaedb8f2dc80c"}, + {file = "websockets-13.1-cp312-cp312-win_amd64.whl", hash = "sha256:38377f8b0cdeee97c552d20cf1865695fcd56aba155ad1b4ca8779a5b6ef4ac3"}, + {file = "websockets-13.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:a9ab1e71d3d2e54a0aa646ab6d4eebfaa5f416fe78dfe4da2839525dc5d765c6"}, + {file = "websockets-13.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:b9d7439d7fab4dce00570bb906875734df13d9faa4b48e261c440a5fec6d9708"}, + {file = "websockets-13.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:327b74e915cf13c5931334c61e1a41040e365d380f812513a255aa804b183418"}, + {file = "websockets-13.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:325b1ccdbf5e5725fdcb1b0e9ad4d2545056479d0eee392c291c1bf76206435a"}, + {file = "websockets-13.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:346bee67a65f189e0e33f520f253d5147ab76ae42493804319b5716e46dddf0f"}, + {file = "websockets-13.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:91a0fa841646320ec0d3accdff5b757b06e2e5c86ba32af2e0815c96c7a603c5"}, + {file = "websockets-13.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:18503d2c5f3943e93819238bf20df71982d193f73dcecd26c94514f417f6b135"}, + {file = "websockets-13.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:a9cd1af7e18e5221d2878378fbc287a14cd527fdd5939ed56a18df8a31136bb2"}, + {file = "websockets-13.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:70c5be9f416aa72aab7a2a76c90ae0a4fe2755c1816c153c1a2bcc3333ce4ce6"}, + {file = "websockets-13.1-cp313-cp313-win32.whl", hash = "sha256:624459daabeb310d3815b276c1adef475b3e6804abaf2d9d2c061c319f7f187d"}, + {file = "websockets-13.1-cp313-cp313-win_amd64.whl", hash = "sha256:c518e84bb59c2baae725accd355c8dc517b4a3ed8db88b4bc93c78dae2974bf2"}, + {file = "websockets-13.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:c7934fd0e920e70468e676fe7f1b7261c1efa0d6c037c6722278ca0228ad9d0d"}, + {file = "websockets-13.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:149e622dc48c10ccc3d2760e5f36753db9cacf3ad7bc7bbbfd7d9c819e286f23"}, + {file = "websockets-13.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a569eb1b05d72f9bce2ebd28a1ce2054311b66677fcd46cf36204ad23acead8c"}, + {file = "websockets-13.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:95df24ca1e1bd93bbca51d94dd049a984609687cb2fb08a7f2c56ac84e9816ea"}, + {file = "websockets-13.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d8dbb1bf0c0a4ae8b40bdc9be7f644e2f3fb4e8a9aca7145bfa510d4a374eeb7"}, + {file = "websockets-13.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:035233b7531fb92a76beefcbf479504db8c72eb3bff41da55aecce3a0f729e54"}, + {file = "websockets-13.1-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:e4450fc83a3df53dec45922b576e91e94f5578d06436871dce3a6be38e40f5db"}, + {file = "websockets-13.1-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:463e1c6ec853202dd3657f156123d6b4dad0c546ea2e2e38be2b3f7c5b8e7295"}, + {file = "websockets-13.1-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6d6855bbe70119872c05107e38fbc7f96b1d8cb047d95c2c50869a46c65a8e96"}, + {file = "websockets-13.1-cp38-cp38-win32.whl", hash = "sha256:204e5107f43095012b00f1451374693267adbb832d29966a01ecc4ce1db26faf"}, + {file = "websockets-13.1-cp38-cp38-win_amd64.whl", hash = "sha256:485307243237328c022bc908b90e4457d0daa8b5cf4b3723fd3c4a8012fce4c6"}, + {file = "websockets-13.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:9b37c184f8b976f0c0a231a5f3d6efe10807d41ccbe4488df8c74174805eea7d"}, + {file = "websockets-13.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:163e7277e1a0bd9fb3c8842a71661ad19c6aa7bb3d6678dc7f89b17fbcc4aeb7"}, + {file = "websockets-13.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4b889dbd1342820cc210ba44307cf75ae5f2f96226c0038094455a96e64fb07a"}, + {file = "websockets-13.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:586a356928692c1fed0eca68b4d1c2cbbd1ca2acf2ac7e7ebd3b9052582deefa"}, + {file = "websockets-13.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7bd6abf1e070a6b72bfeb71049d6ad286852e285f146682bf30d0296f5fbadfa"}, + {file = "websockets-13.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d2aad13a200e5934f5a6767492fb07151e1de1d6079c003ab31e1823733ae79"}, + {file = "websockets-13.1-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:df01aea34b6e9e33572c35cd16bae5a47785e7d5c8cb2b54b2acdb9678315a17"}, + {file = "websockets-13.1-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:e54affdeb21026329fb0744ad187cf812f7d3c2aa702a5edb562b325191fcab6"}, + {file = "websockets-13.1-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:9ef8aa8bdbac47f4968a5d66462a2a0935d044bf35c0e5a8af152d58516dbeb5"}, + {file = "websockets-13.1-cp39-cp39-win32.whl", hash = "sha256:deeb929efe52bed518f6eb2ddc00cc496366a14c726005726ad62c2dd9017a3c"}, + {file = "websockets-13.1-cp39-cp39-win_amd64.whl", hash = "sha256:7c65ffa900e7cc958cd088b9a9157a8141c991f8c53d11087e6fb7277a03f81d"}, + {file = "websockets-13.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl", hash = "sha256:5dd6da9bec02735931fccec99d97c29f47cc61f644264eb995ad6c0c27667238"}, + {file = "websockets-13.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:2510c09d8e8df777177ee3d40cd35450dc169a81e747455cc4197e63f7e7bfe5"}, + {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f1c3cf67185543730888b20682fb186fc8d0fa6f07ccc3ef4390831ab4b388d9"}, + {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bcc03c8b72267e97b49149e4863d57c2d77f13fae12066622dc78fe322490fe6"}, + {file = "websockets-13.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:004280a140f220c812e65f36944a9ca92d766b6cc4560be652a0a3883a79ed8a"}, + {file = "websockets-13.1-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e2620453c075abeb0daa949a292e19f56de518988e079c36478bacf9546ced23"}, + {file = "websockets-13.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:9156c45750b37337f7b0b00e6248991a047be4aa44554c9886fe6bdd605aab3b"}, + {file = "websockets-13.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:80c421e07973a89fbdd93e6f2003c17d20b69010458d3a8e37fb47874bd67d51"}, + {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82d0ba76371769d6a4e56f7e83bb8e81846d17a6190971e38b5de108bde9b0d7"}, + {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e9875a0143f07d74dc5e1ded1c4581f0d9f7ab86c78994e2ed9e95050073c94d"}, + {file = "websockets-13.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a11e38ad8922c7961447f35c7b17bffa15de4d17c70abd07bfbe12d6faa3e027"}, + {file = "websockets-13.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:4059f790b6ae8768471cddb65d3c4fe4792b0ab48e154c9f0a04cefaabcd5978"}, + {file = "websockets-13.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl", hash = "sha256:25c35bf84bf7c7369d247f0b8cfa157f989862c49104c5cf85cb5436a641d93e"}, + {file = "websockets-13.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:83f91d8a9bb404b8c2c41a707ac7f7f75b9442a0a876df295de27251a856ad09"}, + {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a43cfdcddd07f4ca2b1afb459824dd3c6d53a51410636a2c7fc97b9a8cf4842"}, + {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:48a2ef1381632a2f0cb4efeff34efa97901c9fbc118e01951ad7cfc10601a9bb"}, + {file = "websockets-13.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:459bf774c754c35dbb487360b12c5727adab887f1622b8aed5755880a21c4a20"}, + {file = "websockets-13.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:95858ca14a9f6fa8413d29e0a585b31b278388aa775b8a81fa24830123874678"}, + {file = "websockets-13.1-py3-none-any.whl", hash = "sha256:a9a396a6ad26130cdae92ae10c36af09d9bfe6cafe69670fd3b6da9b07b4044f"}, + {file = "websockets-13.1.tar.gz", hash = "sha256:a3b3366087c1bc0a2795111edcadddb8b3b59509d5db5d7ea3fdd69f954a8878"}, +] + +[[package]] +name = "xmltodict" +version = "0.13.0" +description = "Makes working with XML feel like you are working with JSON" +optional = false +python-versions = ">=3.4" +groups = ["dev"] +files = [ + {file = "xmltodict-0.13.0-py2.py3-none-any.whl", hash = "sha256:aa89e8fd76320154a40d19a0df04a4695fb9dc5ba977cbb68ab3e4eb225e7852"}, + {file = "xmltodict-0.13.0.tar.gz", hash = "sha256:341595a488e3e01a85a9d8911d8912fd922ede5fecc4dce437eb4b6c8d037e56"}, +] + +[[package]] +name = "zipp" +version = "3.19.1" +description = "Backport of pathlib-compatible object wrapper for zip files" +optional = false +python-versions = ">=3.8" +groups = ["dev"] +markers = "python_version < \"3.10\"" +files = [ + {file = "zipp-3.19.1-py3-none-any.whl", hash = "sha256:2828e64edb5386ea6a52e7ba7cdb17bb30a73a858f5eb6eb93d8d36f5ea26091"}, + {file = "zipp-3.19.1.tar.gz", hash = "sha256:35427f6d5594f4acf82d25541438348c26736fa9b3afa2754bcd63cdb99d8e8f"}, +] + +[package.extras] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +test = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] + +[metadata] +lock-version = "2.1" +python-versions = "^3.8" +content-hash = "c80bc058f0871dd694ea1761d3266a1d46d0265b19312868ccc7e5cf3dbe3244" diff --git a/polygon/__init__.py b/polygon/__init__.py index 9eb4d89a..da6c5136 100644 --- a/polygon/__init__.py +++ b/polygon/__init__.py @@ -1,2 +1,6 @@ -from .websocket import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER from .rest import RESTClient +from .rest.base import version +from .websocket import WebSocketClient +from .exceptions import * + +__version__ = version diff --git a/polygon/exceptions.py b/polygon/exceptions.py new file mode 100644 index 00000000..b8960763 --- /dev/null +++ b/polygon/exceptions.py @@ -0,0 +1,14 @@ +class AuthError(Exception): + """ + Empty or invalid API key + """ + + pass + + +class BadResponse(Exception): + """ + Non-200 response from API + """ + + pass diff --git a/polygon/logging.py b/polygon/logging.py new file mode 100644 index 00000000..171f4f41 --- /dev/null +++ b/polygon/logging.py @@ -0,0 +1,12 @@ +import logging +import sys + + +def get_logger(name: str) -> logging.Logger: + logger = logging.getLogger(name) + handler = logging.StreamHandler(sys.stdout) + formatter = logging.Formatter("%(asctime)s %(name)s %(levelname)s: %(message)s") + handler.setFormatter(formatter) + logger.addHandler(handler) + + return logger diff --git a/polygon/modelclass.py b/polygon/modelclass.py new file mode 100644 index 00000000..5499d15c --- /dev/null +++ b/polygon/modelclass.py @@ -0,0 +1,27 @@ +import inspect +import typing +from dataclasses import dataclass + + +_T = typing.TypeVar("_T") + + +def modelclass(cls: typing.Type[_T]) -> typing.Type[_T]: + cls = dataclass(cls) + attributes = [ + a + for a in cls.__dict__["__annotations__"].keys() + if not a.startswith("__") and not inspect.isroutine(a) + ] + + def init(self, *args, **kwargs): + for i, a in enumerate(args): + if i < len(attributes): + self.__dict__[attributes[i]] = a + for k, v in kwargs.items(): + if k in attributes: + self.__dict__[k] = v + + cls.__init__ = init # type: ignore[assignment] + + return cls diff --git a/polygon/rest/__init__.py b/polygon/rest/__init__.py index fb5d2b40..7484378e 100644 --- a/polygon/rest/__init__.py +++ b/polygon/rest/__init__.py @@ -1 +1,72 @@ -from .client import RESTClient +from .aggs import AggsClient +from .trades import TradesClient +from .quotes import QuotesClient +from .snapshot import SnapshotClient +from .indicators import IndicatorsClient +from .summaries import SummariesClient +from .reference import ( + MarketsClient, + TickersClient, + SplitsClient, + DividendsClient, + ConditionsClient, + ExchangesClient, + ContractsClient, +) +from .vX import VXClient +from typing import Optional, Any +import os + +BASE = "https://api.polygon.io" +ENV_KEY = "POLYGON_API_KEY" + + +class RESTClient( + AggsClient, + TradesClient, + QuotesClient, + SnapshotClient, + MarketsClient, + TickersClient, + SplitsClient, + DividendsClient, + ConditionsClient, + ExchangesClient, + ContractsClient, + IndicatorsClient, + SummariesClient, +): + def __init__( + self, + api_key: Optional[str] = os.getenv(ENV_KEY), + connect_timeout: float = 10.0, + read_timeout: float = 10.0, + num_pools: int = 10, + retries: int = 3, + base: str = BASE, + verbose: bool = False, + trace: bool = False, + custom_json: Optional[Any] = None, + ): + super().__init__( + api_key=api_key, + connect_timeout=connect_timeout, + read_timeout=read_timeout, + num_pools=num_pools, + retries=retries, + base=base, + verbose=verbose, + trace=trace, + custom_json=custom_json, + ) + self.vx = VXClient( + api_key=api_key, + connect_timeout=connect_timeout, + read_timeout=read_timeout, + num_pools=num_pools, + retries=retries, + base=base, + verbose=verbose, + trace=trace, + custom_json=custom_json, + ) diff --git a/polygon/rest/aggs.py b/polygon/rest/aggs.py new file mode 100644 index 00000000..cb874fac --- /dev/null +++ b/polygon/rest/aggs.py @@ -0,0 +1,190 @@ +from .base import BaseClient +from typing import Optional, Any, Dict, List, Union, Iterator +from .models import Agg, GroupedDailyAgg, DailyOpenCloseAgg, PreviousCloseAgg, Sort +from urllib3 import HTTPResponse +from datetime import datetime, date + +from .models.request import RequestOptionBuilder + + +class AggsClient(BaseClient): + def list_aggs( + self, + ticker: str, + multiplier: int, + timespan: str, + # "from" is a keyword in python https://www.w3schools.com/python/python_ref_keywords.asp + from_: Union[str, int, datetime, date], + to: Union[str, int, datetime, date], + adjusted: Optional[bool] = None, + sort: Optional[Union[str, Sort]] = None, + limit: Optional[int] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[Agg], HTTPResponse]: + """ + List aggregate bars for a ticker over a given date range in custom time window sizes. + + :param ticker: The ticker symbol. + :param multiplier: The size of the timespan multiplier. + :param timespan: The size of the time window. + :param from_: The start of the aggregate time window as YYYY-MM-DD, a date, Unix MS Timestamp, or a datetime. + :param to: The end of the aggregate time window as YYYY-MM-DD, a date, Unix MS Timestamp, or a datetime. + :param adjusted: Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + :param sort: Sort the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return results in descending order (newest at the top).The end of the aggregate time window. + :param limit: Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements. + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: Iterator of aggregates + """ + if isinstance(from_, datetime): + from_ = int(from_.timestamp() * self.time_mult("millis")) + + if isinstance(to, datetime): + to = int(to.timestamp() * self.time_mult("millis")) + url = f"/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from_}/{to}" + + return self._paginate( + path=url, + params=self._get_params(self.list_aggs, locals()), + raw=raw, + deserializer=Agg.from_dict, + options=options, + ) + + def get_aggs( + self, + ticker: str, + multiplier: int, + timespan: str, + # "from" is a keyword in python https://www.w3schools.com/python/python_ref_keywords.asp + from_: Union[str, int, datetime, date], + to: Union[str, int, datetime, date], + adjusted: Optional[bool] = None, + sort: Optional[Union[str, Sort]] = None, + limit: Optional[int] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[Agg], HTTPResponse]: + """ + Get aggregate bars for a ticker over a given date range in custom time window sizes. + + :param ticker: The ticker symbol. + :param multiplier: The size of the timespan multiplier. + :param timespan: The size of the time window. + :param from_: The start of the aggregate time window as YYYY-MM-DD, a date, Unix MS Timestamp, or a datetime. + :param to: The end of the aggregate time window as YYYY-MM-DD, a date, Unix MS Timestamp, or a datetime. + :param adjusted: Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + :param sort: Sort the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return results in descending order (newest at the top).The end of the aggregate time window. + :param limit: Limits the number of base aggregates queried to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements. + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: List of aggregates + """ + if isinstance(from_, datetime): + from_ = int(from_.timestamp() * self.time_mult("millis")) + + if isinstance(to, datetime): + to = int(to.timestamp() * self.time_mult("millis")) + url = f"/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from_}/{to}" + + return self._get( + path=url, + params=self._get_params(self.get_aggs, locals()), + result_key="results", + deserializer=Agg.from_dict, + raw=raw, + options=options, + ) + + # TODO: next breaking change release move "market_type" to be 2nd mandatory + # param + def get_grouped_daily_aggs( + self, + date: Union[str, date], + adjusted: Optional[bool] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + locale: str = "us", + market_type: str = "stocks", + include_otc: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[GroupedDailyAgg], HTTPResponse]: + """ + Get the daily open, high, low, and close (OHLC) for the entire market. + + :param date: The beginning date for the aggregate window. + :param adjusted: Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: List of grouped daily aggregates + """ + url = f"/v2/aggs/grouped/locale/{locale}/market/{market_type}/{date}" + + return self._get( + path=url, + params=self._get_params(self.get_grouped_daily_aggs, locals()), + result_key="results", + deserializer=GroupedDailyAgg.from_dict, + raw=raw, + options=options, + ) + + def get_daily_open_close_agg( + self, + ticker: str, + date: Union[str, date], + adjusted: Optional[bool] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[DailyOpenCloseAgg, HTTPResponse]: + """ + Get the open, close and afterhours prices of a stock symbol on a certain date. + + :param ticker: The exchange symbol that this item is traded under. + :param date: The beginning date for the aggregate window. + :param adjusted: Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: Daily open close aggregate + """ + url = f"/v1/open-close/{ticker}/{date}" + + return self._get( + path=url, + params=self._get_params(self.get_daily_open_close_agg, locals()), + deserializer=DailyOpenCloseAgg.from_dict, + raw=raw, + options=options, + ) + + def get_previous_close_agg( + self, + ticker: str, + adjusted: Optional[bool] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[PreviousCloseAgg, HTTPResponse]: + """ + Get the previous day's open, high, low, and close (OHLC) for the specified stock ticker. + + :param ticker: The ticker symbol of the stock/equity. + :param adjusted: Whether or not the results are adjusted for splits. By default, results are adjusted. Set this to false to get results that are NOT adjusted for splits. + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: Previous close aggregate + """ + url = f"/v2/aggs/ticker/{ticker}/prev" + + return self._get( + path=url, + params=self._get_params(self.get_previous_close_agg, locals()), + result_key="results", + deserializer=PreviousCloseAgg.from_dict, + raw=raw, + options=options, + ) diff --git a/polygon/rest/base.py b/polygon/rest/base.py new file mode 100644 index 00000000..d9d4768a --- /dev/null +++ b/polygon/rest/base.py @@ -0,0 +1,260 @@ +import certifi +import json +import urllib3 +import inspect +from urllib3.util.retry import Retry +from enum import Enum +from typing import Optional, Any, Dict +from datetime import datetime +from importlib.metadata import version, PackageNotFoundError +from .models.request import RequestOptionBuilder +from ..logging import get_logger +import logging +from urllib.parse import urlencode +from ..exceptions import AuthError, BadResponse + +logger = get_logger("RESTClient") +version_number = "unknown" +try: + version_number = version("polygon-api-client") +except PackageNotFoundError: + pass + + +class BaseClient: + def __init__( + self, + api_key: Optional[str], + connect_timeout: float, + read_timeout: float, + num_pools: int, + retries: int, + base: str, + verbose: bool, + trace: bool, + custom_json: Optional[Any] = None, + ): + if api_key is None: + raise AuthError( + f"Must specify env var POLYGON_API_KEY or pass api_key in constructor" + ) + + self.API_KEY = api_key + self.BASE = base + + self.headers = { + "Authorization": "Bearer " + self.API_KEY, + "Accept-Encoding": "gzip", + "User-Agent": f"Polygon.io PythonClient/{version_number}", + } + + # initialize self.retries with the parameter value before using it + self.retries = retries + + # https://urllib3.readthedocs.io/en/stable/reference/urllib3.util.html#urllib3.util.Retry.RETRY_AFTER_STATUS_CODES + retry_strategy = Retry( + total=self.retries, + status_forcelist=[ + 413, + 429, + 499, + 500, + 502, + 503, + 504, + ], # default 413, 429, 503 + backoff_factor=0.1, # [0.0s, 0.2s, 0.4s, 0.8s, 1.6s, ...] + ) + + # https://urllib3.readthedocs.io/en/stable/reference/urllib3.poolmanager.html + # https://urllib3.readthedocs.io/en/stable/reference/urllib3.connectionpool.html#urllib3.HTTPConnectionPool + self.client = urllib3.PoolManager( + num_pools=num_pools, + headers=self.headers, # default headers sent with each request. + ca_certs=certifi.where(), + cert_reqs="CERT_REQUIRED", + retries=retry_strategy, # use the customized Retry instance + ) + + self.timeout = urllib3.Timeout(connect=connect_timeout, read=read_timeout) + + if verbose: + logger.setLevel(logging.DEBUG) + self.trace = trace + if custom_json: + self.json = custom_json + else: + self.json = json + + def _decode(self, resp): + return self.json.loads(resp.data.decode("utf-8")) + + def _get( + self, + path: str, + params: Optional[dict] = None, + result_key: Optional[str] = None, + deserializer=None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Any: + option = options if options is not None else RequestOptionBuilder() + + headers = self._concat_headers(option.headers) + + if self.trace: + full_url = f"{self.BASE}{path}" + if params: + full_url += f"?{urlencode(params)}" + print_headers = headers.copy() + if "Authorization" in print_headers: + print_headers["Authorization"] = print_headers["Authorization"].replace( + self.API_KEY, "REDACTED" + ) + print(f"Request URL: {full_url}") + print(f"Request Headers: {print_headers}") + + resp = self.client.request( + "GET", + self.BASE + path, + fields=params, + headers=headers, + ) + + if self.trace: + resp_headers_dict = dict(resp.headers.items()) + print(f"Response Headers: {resp_headers_dict}") + + if resp.status != 200: + raise BadResponse(resp.data.decode("utf-8")) + + if raw: + return resp + + try: + obj = self._decode(resp) + except ValueError as e: + print(f"Error decoding json response: {e}") + return [] + + if result_key: + if result_key not in obj: + return [] + obj = obj[result_key] + + if deserializer: + if type(obj) == list: + obj = [deserializer(o) for o in obj] + else: + obj = deserializer(obj) + + return obj + + @staticmethod + def time_mult(timestamp_res: str) -> int: + if timestamp_res == "nanos": + return 1000000000 + elif timestamp_res == "micros": + return 1000000 + elif timestamp_res == "millis": + return 1000 + + return 1 + + def _get_params( + self, fn, caller_locals: Dict[str, Any], datetime_res: str = "nanos" + ): + params = caller_locals["params"] + if params is None: + params = {} + # https://docs.python.org/3.8/library/inspect.html#inspect.Signature + for argname, v in inspect.signature(fn).parameters.items(): + # https://docs.python.org/3.8/library/inspect.html#inspect.Parameter + if argname in ["params", "raw"]: + continue + if v.default != v.empty: + # timestamp_lt -> timestamp.lt + val = caller_locals.get(argname, v.default) + if isinstance(val, Enum): + val = val.value + elif isinstance(val, bool): + val = str(val).lower() + elif isinstance(val, datetime): + val = int(val.timestamp() * self.time_mult(datetime_res)) + if val is not None: + for ext in ["lt", "lte", "gt", "gte", "any_of"]: + if argname.endswith(f"_{ext}"): + # lop off ext, then rebuild argname with ext, + # using ., and not _ (removesuffix would work) + # but that is python 3.9+ + argname = argname[: -len(f"_{ext}")] + f".{ext}" + if argname.endswith("any_of"): + val = ",".join(val) + params[argname] = val + + return params + + def _concat_headers(self, headers: Optional[Dict[str, str]]) -> Dict[str, str]: + if headers is None: + return self.headers + return {**headers, **self.headers} + + def _paginate_iter( + self, + path: str, + params: dict, + deserializer, + result_key: str = "results", + options: Optional[RequestOptionBuilder] = None, + ): + while True: + resp = self._get( + path=path, + params=params, + deserializer=deserializer, + result_key=result_key, + raw=True, + options=options, + ) + + try: + decoded = self._decode(resp) + except ValueError as e: + print(f"Error decoding json response: {e}") + return [] + + if result_key not in decoded: + return [] + for t in decoded[result_key]: + yield deserializer(t) + if "next_url" in decoded: + path = decoded["next_url"].replace(self.BASE, "") + params = {} + else: + return + + def _paginate( + self, + path: str, + params: dict, + raw: bool, + deserializer, + result_key: str = "results", + options: Optional[RequestOptionBuilder] = None, + ): + if raw: + return self._get( + path=path, + params=params, + deserializer=deserializer, + raw=True, + options=options, + ) + + return self._paginate_iter( + path=path, + params=params, + deserializer=deserializer, + result_key=result_key, + options=options, + ) diff --git a/polygon/rest/client.py b/polygon/rest/client.py deleted file mode 100644 index 3b05fd75..00000000 --- a/polygon/rest/client.py +++ /dev/null @@ -1,253 +0,0 @@ -from typing import Dict, Type - -import requests - -from polygon.rest import models -from polygon.rest.models import unmarshal - - -class RESTClient: - """ This is a custom generated class """ - DEFAULT_HOST = "api.polygon.io" - - def __init__(self, auth_key: str, timeout: int=None): - self.auth_key = auth_key - self.url = "https://" + self.DEFAULT_HOST - - self._session = requests.Session() - self._session.params["apiKey"] = self.auth_key - self.timeout = timeout - - def __enter__(self): - return self - - def __exit__(self, *args): - self.close() - - def close(self): - self._session.close() - - def _handle_response(self, response_type: str, endpoint: str, params: Dict[str, str]) -> Type[models.AnyDefinition]: - resp: requests.Response = self._session.get(endpoint, params=params, timeout=self.timeout) - if resp.status_code == 200: - return unmarshal.unmarshal_json(response_type, resp.json()) - else: - resp.raise_for_status() - - def reference_tickers(self, **query_params) -> models.ReferenceTickersApiResponse: - endpoint = f"{self.url}/v2/reference/tickers" - return self._handle_response("ReferenceTickersApiResponse", endpoint, query_params) - - def reference_tickers_v3(self, next_url=None, **query_params) -> models.ReferenceTickersV3ApiResponse: - endpoint = f"{self.url}/v3/reference/tickers" if not next_url else next_url - return self._handle_response("ReferenceTickersV3ApiResponse", endpoint, query_params) - - def reference_ticker_types(self, **query_params) -> models.ReferenceTickerTypesApiResponse: - endpoint = f"{self.url}/v2/reference/types" - return self._handle_response("ReferenceTickerTypesApiResponse", endpoint, query_params) - - def reference_ticker_details(self, symbol, **query_params) -> models.ReferenceTickerDetailsApiResponse: - endpoint = f"{self.url}/v1/meta/symbols/{symbol}/company" - return self._handle_response("ReferenceTickerDetailsApiResponse", endpoint, query_params) - - def reference_ticker_details_vx(self, symbol, **query_params) -> models.ReferenceTickerDetailsV3ApiResponse: - endpoint = f"{self.url}/vX/reference/tickers/{symbol}" - return self._handle_response("ReferenceTickerDetailsV3ApiResponse", endpoint, query_params) - - def reference_ticker_news(self, symbol, **query_params) -> models.ReferenceTickerNewsApiResponse: - endpoint = f"{self.url}/v1/meta/symbols/{symbol}/news" - return self._handle_response("ReferenceTickerNewsApiResponse", endpoint, query_params) - - def reference_ticker_news_v2(self, **query_params) -> models.ReferenceTickerNewsV2ApiResponse: - endpoint = f"{self.url}/v2/reference/news" - return self._handle_response("ReferenceTickerNewsV2ApiResponse", endpoint, query_params) - - def reference_markets(self, **query_params) -> models.ReferenceMarketsApiResponse: - endpoint = f"{self.url}/v2/reference/markets" - return self._handle_response("ReferenceMarketsApiResponse", endpoint, query_params) - - def reference_locales(self, **query_params) -> models.ReferenceLocalesApiResponse: - endpoint = f"{self.url}/v2/reference/locales" - return self._handle_response("ReferenceLocalesApiResponse", endpoint, query_params) - - def reference_stock_splits(self, symbol, **query_params) -> models.ReferenceStockSplitsApiResponse: - endpoint = f"{self.url}/v2/reference/splits/{symbol}" - return self._handle_response("ReferenceStockSplitsApiResponse", endpoint, query_params) - - def reference_stock_dividends(self, symbol, **query_params) -> models.ReferenceStockDividendsApiResponse: - endpoint = f"{self.url}/v2/reference/dividends/{symbol}" - return self._handle_response("ReferenceStockDividendsApiResponse", endpoint, query_params) - - def reference_stock_financials(self, symbol, **query_params) -> models.ReferenceStockFinancialsApiResponse: - endpoint = f"{self.url}/v2/reference/financials/{symbol}" - return self._handle_response("ReferenceStockFinancialsApiResponse", endpoint, query_params) - - def reference_market_status(self, **query_params) -> models.ReferenceMarketStatusApiResponse: - endpoint = f"{self.url}/v1/marketstatus/now" - return self._handle_response("ReferenceMarketStatusApiResponse", endpoint, query_params) - - def reference_market_holidays(self, **query_params) -> models.ReferenceMarketHolidaysApiResponse: - endpoint = f"{self.url}/v1/marketstatus/upcoming" - return self._handle_response("ReferenceMarketHolidaysApiResponse", endpoint, query_params) - - def stocks_equities_exchanges(self, **query_params) -> models.StocksEquitiesExchangesApiResponse: - endpoint = f"{self.url}/v1/meta/exchanges" - return self._handle_response("StocksEquitiesExchangesApiResponse", endpoint, query_params) - - def stocks_equities_historic_trades(self, symbol, date, - **query_params) -> models.StocksEquitiesHistoricTradesApiResponse: - endpoint = f"{self.url}/v1/historic/trades/{symbol}/{date}" - return self._handle_response("StocksEquitiesHistoricTradesApiResponse", endpoint, query_params) - - def historic_trades_v2(self, ticker, date, **query_params) -> models.HistoricTradesV2ApiResponse: - endpoint = f"{self.url}/v2/ticks/stocks/trades/{ticker}/{date}" - return self._handle_response("HistoricTradesV2ApiResponse", endpoint, query_params) - - def stocks_equities_historic_quotes(self, symbol, date, - **query_params) -> models.StocksEquitiesHistoricQuotesApiResponse: - endpoint = f"{self.url}/v1/historic/quotes/{symbol}/{date}" - return self._handle_response("StocksEquitiesHistoricQuotesApiResponse", endpoint, query_params) - - def historic_n___bbo_quotes_v2(self, ticker, date, **query_params) -> models.HistoricNBboQuotesV2ApiResponse: - endpoint = f"{self.url}/v2/ticks/stocks/nbbo/{ticker}/{date}" - return self._handle_response("HistoricNBboQuotesV2ApiResponse", endpoint, query_params) - - def stocks_equities_last_trade_for_a_symbol(self, symbol, - **query_params) -> models.StocksEquitiesLastTradeForASymbolApiResponse: - endpoint = f"{self.url}/v1/last/stocks/{symbol}" - return self._handle_response("StocksEquitiesLastTradeForASymbolApiResponse", endpoint, query_params) - - def stocks_equities_last_quote_for_a_symbol(self, symbol, - **query_params) -> models.StocksEquitiesLastQuoteForASymbolApiResponse: - endpoint = f"{self.url}/v1/last_quote/stocks/{symbol}" - return self._handle_response("StocksEquitiesLastQuoteForASymbolApiResponse", endpoint, query_params) - - def stocks_equities_daily_open_close(self, symbol, date, - **query_params) -> models.StocksEquitiesDailyOpenCloseApiResponse: - endpoint = f"{self.url}/v1/open-close/{symbol}/{date}" - return self._handle_response("StocksEquitiesDailyOpenCloseApiResponse", endpoint, query_params) - - def stocks_equities_condition_mappings(self, ticktype, - **query_params) -> models.StocksEquitiesConditionMappingsApiResponse: - endpoint = f"{self.url}/v1/meta/conditions/{ticktype}" - return self._handle_response("StocksEquitiesConditionMappingsApiResponse", endpoint, query_params) - - def stocks_equities_snapshot_all_tickers(self, - **query_params) -> models.StocksEquitiesSnapshotAllTickersApiResponse: - endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/tickers" - return self._handle_response("StocksEquitiesSnapshotAllTickersApiResponse", endpoint, query_params) - - def stocks_equities_snapshot_single_ticker(self, ticker, - **query_params) -> models.StocksEquitiesSnapshotSingleTickerApiResponse: - endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/tickers/{ticker}" - return self._handle_response("StocksEquitiesSnapshotSingleTickerApiResponse", endpoint, query_params) - - def stocks_equities_snapshot_gainers_losers(self, direction, - **query_params) -> models.StocksEquitiesSnapshotGainersLosersApiResponse: - endpoint = f"{self.url}/v2/snapshot/locale/us/markets/stocks/{direction}" - return self._handle_response("StocksEquitiesSnapshotGainersLosersApiResponse", endpoint, query_params) - - def stocks_equities_previous_close(self, ticker, **query_params) -> models.StocksEquitiesPreviousCloseApiResponse: - endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/prev" - return self._handle_response("StocksEquitiesPreviousCloseApiResponse", endpoint, query_params) - - def stocks_equities_aggregates(self, ticker, multiplier, timespan, from_, to, - **query_params) -> models.StocksEquitiesAggregatesApiResponse: - endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from_}/{to}" - return self._handle_response("StocksEquitiesAggregatesApiResponse", endpoint, query_params) - - def stocks_equities_grouped_daily(self, locale, market, date, - **query_params) -> models.StocksEquitiesGroupedDailyApiResponse: - endpoint = f"{self.url}/v2/aggs/grouped/locale/{locale}/market/{market}/{date}" - return self._handle_response("StocksEquitiesGroupedDailyApiResponse", endpoint, query_params) - - def forex_currencies_historic_forex_ticks(self, from_, to, date, - **query_params) -> models.ForexCurrenciesHistoricForexTicksApiResponse: - endpoint = f"{self.url}/v1/historic/forex/{from_}/{to}/{date}" - return self._handle_response("ForexCurrenciesHistoricForexTicksApiResponse", endpoint, query_params) - - def forex_currencies_real_time_currency_conversion(self, from_, to, - **query_params) -> models.ForexCurrenciesRealTimeCurrencyConversionApiResponse: - endpoint = f"{self.url}/v1/conversion/{from_}/{to}" - return self._handle_response("ForexCurrenciesRealTimeCurrencyConversionApiResponse", endpoint, query_params) - - def forex_currencies_last_quote_for_a_currency_pair(self, from_, to, - **query_params) -> models.ForexCurrenciesLastQuoteForACurrencyPairApiResponse: - endpoint = f"{self.url}/v1/last_quote/currencies/{from_}/{to}" - return self._handle_response("ForexCurrenciesLastQuoteForACurrencyPairApiResponse", endpoint, query_params) - - def forex_currencies_grouped_daily(self, date, **query_params) -> models.ForexCurrenciesGroupedDailyApiResponse: - endpoint = f"{self.url}/v2/aggs/grouped/locale/global/market/fx/{date}" - return self._handle_response("ForexCurrenciesGroupedDailyApiResponse", endpoint, query_params) - - def forex_currencies_previous_close(self, ticker, **query_params) -> models.ForexCurrenciesGroupedDailyApiResponse: - endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/prev" - return self._handle_response("ForexCurrenciesPreviousCloseApiResponse", endpoint, query_params) - - def forex_currencies_snapshot_all_tickers(self, - **query_params) -> models.ForexCurrenciesSnapshotAllTickersApiResponse: - endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/tickers" - return self._handle_response("ForexCurrenciesSnapshotAllTickersApiResponse", endpoint, query_params) - - def forex_currencies_snapshot_single_ticker(self, ticker, **query_params) -> models.ForexCurrenciesSnapshotSingleTickerApiResponse: - endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/tickers/{ticker}" - return self._handle_response("ForexCurrenciesSnapshotSingleTickerApiResponse", endpoint, query_params) - - def forex_currencies_snapshot_gainers_losers(self, direction, - **query_params) -> models.ForexCurrenciesSnapshotGainersLosersApiResponse: - endpoint = f"{self.url}/v2/snapshot/locale/global/markets/forex/{direction}" - return self._handle_response("ForexCurrenciesSnapshotGainersLosersApiResponse", endpoint, query_params) - - def forex_currencies_aggregates(self, ticker, multiplier, timespan, from_, to, - **query_params) -> models.CurrenciesAggregatesApiResponse: - endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from_}/{to}" - return self._handle_response("CurrenciesAggregatesApiResponse", endpoint, query_params) - - def crypto_crypto_exchanges(self, **query_params) -> models.CryptoCryptoExchangesApiResponse: - endpoint = f"{self.url}/v1/meta/crypto-exchanges" - return self._handle_response("CryptoCryptoExchangesApiResponse", endpoint, query_params) - - def crypto_last_trade_for_a_crypto_pair(self, from_, to, - **query_params) -> models.CryptoLastTradeForACryptoPairApiResponse: - endpoint = f"{self.url}/v1/last/crypto/{from_}/{to}" - return self._handle_response("CryptoLastTradeForACryptoPairApiResponse", endpoint, query_params) - - def crypto_daily_open_close(self, from_, to, date, **query_params) -> models.CryptoDailyOpenCloseApiResponse: - endpoint = f"{self.url}/v1/open-close/crypto/{from_}/{to}/{date}" - return self._handle_response("CryptoDailyOpenCloseApiResponse", endpoint, query_params) - - def crypto_aggregates(self, ticker, multiplier, timespan, from_, to, - **query_params) -> models.CurrenciesAggregatesApiResponse: - endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/range/{multiplier}/{timespan}/{from_}/{to}" - return self._handle_response("CurrenciesAggregatesApiResponse", endpoint, query_params) - - def crypto_historic_crypto_trades(self, from_, to, date, - **query_params) -> models.CryptoHistoricCryptoTradesApiResponse: - endpoint = f"{self.url}/v1/historic/crypto/{from_}/{to}/{date}" - return self._handle_response("CryptoHistoricCryptoTradesApiResponse", endpoint, query_params) - - def crypto_grouped_daily(self, date, **query_params) -> models.CryptoGroupedDailyApiResponse: - endpoint = f"{self.url}/v2/aggs/grouped/locale/global/market/crypto/{date}" - return self._handle_response("CryptoGroupedDailyApiResponse", endpoint, query_params) - - def crypto_previous_close(self, ticker, **query_params) -> models.CryptoPreviousCloseApiResponse: - endpoint = f"{self.url}/v2/aggs/ticker/{ticker}/prev" - return self._handle_response("CryptoPreviousCloseApiResponse", endpoint, query_params) - - def crypto_snapshot_all_tickers(self, **query_params) -> models.CryptoSnapshotAllTickersApiResponse: - endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers" - return self._handle_response("CryptoSnapshotAllTickersApiResponse", endpoint, query_params) - - def crypto_snapshot_single_ticker(self, ticker, **query_params) -> models.CryptoSnapshotSingleTickerApiResponse: - endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}" - return self._handle_response("CryptoSnapshotSingleTickerApiResponse", endpoint, query_params) - - def crypto_snapshot_single_ticker_full_book(self, ticker, - **query_params) -> models.CryptoSnapshotSingleTickerFullBookApiResponse: - endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book" - return self._handle_response("CryptoSnapshotSingleTickerFullBookApiResponse", endpoint, query_params) - - def crypto_snapshot_gainers_losers(self, direction, - **query_params) -> models.CryptoSnapshotGainersLosersApiResponse: - endpoint = f"{self.url}/v2/snapshot/locale/global/markets/crypto/{direction}" - return self._handle_response("CryptoSnapshotGainersLosersApiResponse", endpoint, query_params) diff --git a/polygon/rest/indicators.py b/polygon/rest/indicators.py new file mode 100644 index 00000000..188b59b9 --- /dev/null +++ b/polygon/rest/indicators.py @@ -0,0 +1,239 @@ +from polygon.rest.models.common import SeriesType +from polygon.rest.models.indicators import ( + SMAIndicatorResults, + EMAIndicatorResults, + RSIIndicatorResults, + MACDIndicatorResults, +) +from .base import BaseClient +from typing import Optional, Any, Dict, List, Union +from .models import Order +from urllib3 import HTTPResponse +from datetime import datetime, date + +from .models.request import RequestOptionBuilder + + +class IndicatorsClient(BaseClient): + def get_sma( + self, + ticker: str, + timestamp: Optional[Union[str, int, datetime, date]] = None, + timestamp_lt: Optional[Union[str, int, datetime, date]] = None, + timestamp_lte: Optional[Union[str, int, datetime, date]] = None, + timestamp_gt: Optional[Union[str, int, datetime, date]] = None, + timestamp_gte: Optional[Union[str, int, datetime, date]] = None, + timespan: Optional[str] = None, + window: Optional[int] = None, + adjusted: Optional[bool] = None, + expand_underlying: Optional[bool] = None, + order: Optional[Union[str, Order]] = None, + limit: Optional[int] = None, + params: Optional[Dict[str, Any]] = None, + series_type: Optional[Union[str, SeriesType]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[SMAIndicatorResults, HTTPResponse]: + """ + Get SMA values for a given ticker over a given range with the specified parameters + + :param ticker: The ticker symbol + :param timespan: The size of the underlying aggregate time window + :param window: The window size used to calculate the simple moving average. i.e. a window size of 10 with daily + aggregates would result in a 10-day moving average + :param timestamp: Either a date with the format YYYY-MM-DD or a millisecond timestamp. + :param timestamp_lt: Timestamp less than + :param timestamp_lte: Timestamp less than or equal to + :param timestamp_gt: Timestamp greater than + :param timestamp_gte: Timestamp greater than or equal to + :param adjusted: Whether the underlying aggregates are adjusted for splits. By default, the aggregates used to + calculate this indicator are adjusted. Set this as false to get results that are NOT adjusted for splits + :param expand_underlying: Whether to include the aggregates used to calculate this indicator in the response + :param order: Sort the results by timestamp. asc will return results in ascending order (oldest at the top), + desc will return results in descending order (newest at the top).The end of the aggregate time window + :param limit: Limit the number of results returned, default is 10 and max is 5000 + :param params: Any additional query params + :param series_type: The price in the aggregate which will be used to calculate the simple moving average + i.e. 'close' will result in using close prices to calculate the simple moving average + :param raw: Return raw object instead of results object + :return: SingleIndicatorResults + """ + + url = f"/v1/indicators/sma/{ticker}" + + return self._get( + path=url, + params=self._get_params(self.get_sma, locals()), + result_key="results", + deserializer=SMAIndicatorResults.from_dict, + raw=raw, + options=options, + ) + + def get_ema( + self, + ticker: str, + timestamp: Optional[Union[str, int, datetime, date]] = None, + timestamp_lt: Optional[Union[str, int, datetime, date]] = None, + timestamp_lte: Optional[Union[str, int, datetime, date]] = None, + timestamp_gt: Optional[Union[str, int, datetime, date]] = None, + timestamp_gte: Optional[Union[str, int, datetime, date]] = None, + timespan: Optional[str] = None, + window: Optional[int] = None, + adjusted: Optional[bool] = None, + expand_underlying: Optional[bool] = None, + order: Optional[Union[str, Order]] = None, + limit: Optional[int] = None, + params: Optional[Dict[str, Any]] = None, + series_type: Optional[Union[str, SeriesType]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[EMAIndicatorResults, HTTPResponse]: + """ + Get EMA values for a given ticker over a given range with the specified parameters + + :param ticker: The ticker symbol + :param timespan: The size of the underlying aggregate time window + :param window: The window size used to calculate the exponential moving average. i.e. a window size of 10 with daily + aggregates would result in a 10-day moving average + :param timestamp: Either a date with the format YYYY-MM-DD or a millisecond timestamp. + :param timestamp_lt: Timestamp less than + :param timestamp_lte: Timestamp less than or equal to + :param timestamp_gt: Timestamp greater than + :param timestamp_gte: Timestamp greater than or equal to + :param adjusted: Whether the underlying aggregates are adjusted for splits. By default, the aggregates used to + calculate this indicator are adjusted. Set this as false to get results that are NOT adjusted for splits + :param expand_underlying: Whether to include the aggregates used to calculate this indicator in the response + :param order: Sort the results by timestamp. asc will return results in ascending order (oldest at the top), + desc will return results in descending order (newest at the top).The end of the aggregate time window + :param limit: Limit the number of results returned, default is 10 and max is 5000 + :param params: Any additional query params + :param series_type: The price in the aggregate which will be used to calculate the simple moving average + i.e. 'close' will result in using close prices to calculate the simple moving average + :param raw: Return raw object instead of results object + :return: SingleIndicatorResults + """ + + url = f"/v1/indicators/ema/{ticker}" + + return self._get( + path=url, + params=self._get_params(self.get_ema, locals()), + result_key="results", + deserializer=EMAIndicatorResults.from_dict, + raw=raw, + options=options, + ) + + def get_rsi( + self, + ticker: str, + timestamp: Optional[Union[str, int, datetime, date]] = None, + timestamp_lt: Optional[Union[str, int, datetime, date]] = None, + timestamp_lte: Optional[Union[str, int, datetime, date]] = None, + timestamp_gt: Optional[Union[str, int, datetime, date]] = None, + timestamp_gte: Optional[Union[str, int, datetime, date]] = None, + timespan: Optional[str] = None, + window: Optional[int] = None, + adjusted: Optional[bool] = None, + expand_underlying: Optional[bool] = None, + order: Optional[Union[str, Order]] = None, + limit: Optional[int] = None, + params: Optional[Dict[str, Any]] = None, + series_type: Optional[Union[str, SeriesType]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[RSIIndicatorResults, HTTPResponse]: + """ + Get RSI values for a given ticker over a given range with the specified parameters + + :param ticker: The ticker symbol + :param timespan: The size of the underlying aggregate time window + :param window: The window size used to calculate the simple moving average. i.e. a window size of 10 with daily + aggregates would result in a 10-day moving average + :param timestamp: Either a date with the format YYYY-MM-DD or a millisecond timestamp. + :param timestamp_lt: Timestamp less than + :param timestamp_lte: Timestamp less than or equal to + :param timestamp_gt: Timestamp greater than + :param timestamp_gte: Timestamp greater than or equal to + :param adjusted: Whether the underlying aggregates are adjusted for splits. By default, the aggregates used to + calculate this indicator are adjusted. Set this as false to get results that are NOT adjusted for splits + :param expand_underlying: Whether to include the aggregates used to calculate this indicator in the response + :param order: Sort the results by timestamp. asc will return results in ascending order (oldest at the top), + desc will return results in descending order (newest at the top).The end of the aggregate time window + :param limit: Limit the number of results returned, default is 10 and max is 5000 + :param params: Any additional query params + :param series_type: The price in the aggregate which will be used to calculate the simple moving average + i.e. 'close' will result in using close prices to calculate the simple moving average + :param raw: Return raw object instead of results object + :return: SingleIndicatorResults + """ + + url = f"/v1/indicators/rsi/{ticker}" + + return self._get( + path=url, + params=self._get_params(self.get_rsi, locals()), + result_key="results", + deserializer=RSIIndicatorResults.from_dict, + raw=raw, + options=options, + ) + + def get_macd( + self, + ticker: str, + timestamp: Optional[Union[str, int, datetime, date]] = None, + timestamp_lt: Optional[Union[str, int, datetime, date]] = None, + timestamp_lte: Optional[Union[str, int, datetime, date]] = None, + timestamp_gt: Optional[Union[str, int, datetime, date]] = None, + timestamp_gte: Optional[Union[str, int, datetime, date]] = None, + timespan: Optional[str] = None, + short_window: Optional[int] = None, + long_window: Optional[int] = None, + signal_window: Optional[int] = None, + adjusted: Optional[bool] = None, + expand_underlying: Optional[bool] = None, + order: Optional[Union[str, Order]] = None, + limit: Optional[int] = None, + params: Optional[Dict[str, Any]] = None, + series_type: Optional[Union[str, SeriesType]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[MACDIndicatorResults, HTTPResponse]: + """ + Get MACD values for a given ticker over a given range with the specified parameters + + :param ticker: The ticker symbol + :param timespan: The size of the underlying aggregate time window + :param short_window: The short window size used to calculate the MACD data + :param long_window: The long window size used to calculate the MACD data + :param signal_window: The window size used to calculate the MACD signal line + :param timestamp: Either a date with the format YYYY-MM-DD or a millisecond timestamp. + :param timestamp_lt: Timestamp less than + :param timestamp_lte: Timestamp less than or equal to + :param timestamp_gt: Timestamp greater than + :param timestamp_gte: Timestamp greater than or equal to + :param adjusted: Whether the underlying aggregates are adjusted for splits. By default, the aggregates used to + calculate this indicator are adjusted. Set this as false to get results that are NOT adjusted for splits + :param expand_underlying: Whether to include the aggregates used to calculate this indicator in the response + :param order: Sort the results by timestamp. asc will return results in ascending order (oldest at the top), + desc will return results in descending order (newest at the top).The end of the aggregate time window + :param limit: Limit the number of results returned, default is 10 and max is 5000 + :param params: Any additional query params + :param series_type: The price in the aggregate which will be used to calculate the simple moving average + i.e. 'close' will result in using close prices to calculate the simple moving average + :param raw: Return raw object instead of results object + :return: MACDIndicatorResults + """ + + url = f"/v1/indicators/macd/{ticker}" + + return self._get( + path=url, + params=self._get_params(self.get_macd, locals()), + result_key="results", + deserializer=MACDIndicatorResults.from_dict, + raw=raw, + options=options, + ) diff --git a/polygon/rest/models/__init__.py b/polygon/rest/models/__init__.py index 8afea378..2c9a8086 100644 --- a/polygon/rest/models/__init__.py +++ b/polygon/rest/models/__init__.py @@ -1,223 +1,15 @@ -from .definitions import LastTrade -from .definitions import LastQuote -from .definitions import HistTrade -from .definitions import Quote -from .definitions import Aggregate -from .definitions import Company -from .definitions import CompanyV3 -from .definitions import Address -from .definitions import Symbol -from .definitions import SymbolV3 -from .definitions import Dividend -from .definitions import News -from .definitions import NewsV2 -from .definitions import Publisher -from .definitions import Earning -from .definitions import Financial -from .definitions import Exchange -from .definitions import Error -from .definitions import NotFound -from .definitions import Conflict -from .definitions import Unauthorized -from .definitions import MarketStatus -from .definitions import MarketHoliday -from .definitions import AnalystRatings -from .definitions import RatingSection -from .definitions import CryptoTick -from .definitions import CryptoTickJson -from .definitions import CryptoExchange -from .definitions import CryptoSnapshotTicker -from .definitions import CryptoSnapshotBookItem -from .definitions import CryptoSnapshotTickerBook -from .definitions import CryptoSnapshotAgg -from .definitions import Forex -from .definitions import LastForexTrade -from .definitions import LastForexQuote -from .definitions import ForexAggregate -from .definitions import ForexSnapshotTicker -from .definitions import ForexSnapshotAgg -from .definitions import Ticker -from .definitions import Split -from .definitions import Financials -from .definitions import Trade -from .definitions import StocksSnapshotTicker -from .definitions import StocksSnapshotBookItem -from .definitions import StocksSnapshotTickerBook -from .definitions import StocksV2Trade -from .definitions import StocksV2NBBO -from .definitions import StocksSnapshotAgg -from .definitions import StocksSnapshotQuote -from .definitions import Aggv2 -from .definitions import AggResponse -from .definitions import ReferenceTickersApiResponse -from .definitions import ReferenceTickersV3ApiResponse -from .definitions import ReferenceTickerTypesApiResponse -from .definitions import ReferenceTickerDetailsApiResponse -from .definitions import ReferenceTickerDetailsV3ApiResponse -from .definitions import ReferenceTickerNewsApiResponse -from .definitions import ReferenceTickerNewsV2ApiResponse -from .definitions import ReferenceMarketsApiResponse -from .definitions import ReferenceLocalesApiResponse -from .definitions import ReferenceStockSplitsApiResponse -from .definitions import ReferenceStockDividendsApiResponse -from .definitions import ReferenceStockFinancialsApiResponse -from .definitions import ReferenceMarketStatusApiResponse -from .definitions import ReferenceMarketHolidaysApiResponse -from .definitions import StocksEquitiesExchangesApiResponse -from .definitions import StocksEquitiesHistoricTradesApiResponse -from .definitions import HistoricTradesV2ApiResponse -from .definitions import StocksEquitiesHistoricQuotesApiResponse -from .definitions import HistoricNBboQuotesV2ApiResponse -from .definitions import StocksEquitiesLastTradeForASymbolApiResponse -from .definitions import StocksEquitiesLastQuoteForASymbolApiResponse -from .definitions import StocksEquitiesDailyOpenCloseApiResponse -from .definitions import StocksEquitiesConditionMappingsApiResponse -from .definitions import StocksEquitiesSnapshotAllTickersApiResponse -from .definitions import StocksEquitiesSnapshotSingleTickerApiResponse -from .definitions import StocksEquitiesSnapshotGainersLosersApiResponse -from .definitions import StocksEquitiesPreviousCloseApiResponse -from .definitions import StocksEquitiesAggregatesApiResponse -from .definitions import StocksEquitiesGroupedDailyApiResponse -from .definitions import ForexCurrenciesHistoricForexTicksApiResponse -from .definitions import ForexCurrenciesRealTimeCurrencyConversionApiResponse -from .definitions import ForexCurrenciesLastQuoteForACurrencyPairApiResponse -from. definitions import ForexCurrenciesGroupedDailyApiResponse -from .definitions import ForexCurrenciesPreviousCloseApiResponse -from .definitions import ForexCurrenciesSnapshotAllTickersApiResponse -from .definitions import ForexCurrenciesSnapshotSingleTickerApiResponse -from .definitions import ForexCurrenciesSnapshotGainersLosersApiResponse -from .definitions import CryptoCryptoExchangesApiResponse -from .definitions import CryptoLastTradeForACryptoPairApiResponse -from .definitions import CryptoDailyOpenCloseApiResponse -from .definitions import CryptoHistoricCryptoTradesApiResponse -from .definitions import CryptoGroupedDailyApiResponse -from .definitions import CryptoPreviousCloseApiResponse -from .definitions import CryptoSnapshotAllTickersApiResponse -from .definitions import CryptoSnapshotSingleTickerApiResponse -from .definitions import CryptoSnapshotSingleTickerFullBookApiResponse -from .definitions import CryptoSnapshotGainersLosersApiResponse -from .definitions import CurrenciesAggregatesApiResponse -from .definitions import StockSymbol -from .definitions import ConditionTypeMap -from .definitions import SymbolTypeMap -from .definitions import TickerSymbol - - -import typing - -from .definitions import Definition - - -AnyDefinition = typing.TypeVar("AnyDefinition", bound=Definition) - -# noinspection SpellCheckingInspection -name_to_class: typing.Dict[str, typing.Callable[[], typing.Type[AnyDefinition]]] = { - "LastTrade": LastTrade, - "LastQuote": LastQuote, - "HistTrade": HistTrade, - "Quote": Quote, - "Aggregate": Aggregate, - "Company": Company, - "CompanyV3": CompanyV3, - "Address": Address, - "Symbol": Symbol, - "Dividend": Dividend, - "News": News, - "NewsV2": NewsV2, - "Publisher": Publisher, - "Earning": Earning, - "Financial": Financial, - "Exchange": Exchange, - "Error": Error, - "NotFound": NotFound, - "Conflict": Conflict, - "Unauthorized": Unauthorized, - "MarketStatus": MarketStatus, - "MarketHoliday": MarketHoliday, - "AnalystRatings": AnalystRatings, - "RatingSection": RatingSection, - "CryptoTick": CryptoTick, - "CryptoTickJson": CryptoTickJson, - "CryptoExchange": CryptoExchange, - "CryptoSnapshotTicker": CryptoSnapshotTicker, - "CryptoSnapshotBookItem": CryptoSnapshotBookItem, - "CryptoSnapshotTickerBook": CryptoSnapshotTickerBook, - "CryptoSnapshotAgg": CryptoSnapshotAgg, - "Forex": Forex, - "LastForexTrade": LastForexTrade, - "LastForexQuote": LastForexQuote, - "ForexAggregate": ForexAggregate, - "ForexSnapshotTicker": ForexSnapshotTicker, - "ForexSnapshotAgg": ForexSnapshotAgg, - "Ticker": Ticker, - "Split": Split, - "Financials": Financials, - "Trade": Trade, - "StocksSnapshotTicker": StocksSnapshotTicker, - "StocksSnapshotBookItem": StocksSnapshotBookItem, - "StocksSnapshotTickerBook": StocksSnapshotTickerBook, - "StocksV2Trade": StocksV2Trade, - "StocksV2NBBO": StocksV2NBBO, - "StocksSnapshotAgg": StocksSnapshotAgg, - "StocksSnapshotQuote": StocksSnapshotQuote, - "Aggv2": Aggv2, - "AggResponse": AggResponse, - "ReferenceTickersApiResponse": ReferenceTickersApiResponse, - "ReferenceTickersV3ApiResponse": ReferenceTickersV3ApiResponse, - "ReferenceTickerTypesApiResponse": ReferenceTickerTypesApiResponse, - "ReferenceTickerDetailsApiResponse": ReferenceTickerDetailsApiResponse, - "ReferenceTickerDetailsV3ApiResponse": ReferenceTickerDetailsV3ApiResponse, - "ReferenceTickerNewsApiResponse": ReferenceTickerNewsApiResponse, - "ReferenceTickerNewsV2ApiResponse": ReferenceTickerNewsV2ApiResponse, - "ReferenceMarketsApiResponse": ReferenceMarketsApiResponse, - "ReferenceLocalesApiResponse": ReferenceLocalesApiResponse, - "ReferenceStockSplitsApiResponse": ReferenceStockSplitsApiResponse, - "ReferenceStockDividendsApiResponse": ReferenceStockDividendsApiResponse, - "ReferenceStockFinancialsApiResponse": ReferenceStockFinancialsApiResponse, - "ReferenceMarketStatusApiResponse": ReferenceMarketStatusApiResponse, - "ReferenceMarketHolidaysApiResponse": ReferenceMarketHolidaysApiResponse, - "StocksEquitiesExchangesApiResponse": StocksEquitiesExchangesApiResponse, - "StocksEquitiesHistoricTradesApiResponse": StocksEquitiesHistoricTradesApiResponse, - "HistoricTradesV2ApiResponse": HistoricTradesV2ApiResponse, - "StocksEquitiesHistoricQuotesApiResponse": StocksEquitiesHistoricQuotesApiResponse, - "HistoricNBboQuotesV2ApiResponse": HistoricNBboQuotesV2ApiResponse, - "StocksEquitiesLastTradeForASymbolApiResponse": StocksEquitiesLastTradeForASymbolApiResponse, - "StocksEquitiesLastQuoteForASymbolApiResponse": StocksEquitiesLastQuoteForASymbolApiResponse, - "StocksEquitiesDailyOpenCloseApiResponse": StocksEquitiesDailyOpenCloseApiResponse, - "StocksEquitiesConditionMappingsApiResponse": StocksEquitiesConditionMappingsApiResponse, - "StocksEquitiesSnapshotAllTickersApiResponse": StocksEquitiesSnapshotAllTickersApiResponse, - "StocksEquitiesSnapshotSingleTickerApiResponse": StocksEquitiesSnapshotSingleTickerApiResponse, - "StocksEquitiesSnapshotGainersLosersApiResponse": StocksEquitiesSnapshotGainersLosersApiResponse, - "StocksEquitiesPreviousCloseApiResponse": StocksEquitiesPreviousCloseApiResponse, - "StocksEquitiesAggregatesApiResponse": StocksEquitiesAggregatesApiResponse, - "StocksEquitiesGroupedDailyApiResponse": StocksEquitiesGroupedDailyApiResponse, - "ForexCurrenciesHistoricForexTicksApiResponse": ForexCurrenciesHistoricForexTicksApiResponse, - "ForexCurrenciesRealTimeCurrencyConversionApiResponse": ForexCurrenciesRealTimeCurrencyConversionApiResponse, - "ForexCurrenciesLastQuoteForACurrencyPairApiResponse": ForexCurrenciesLastQuoteForACurrencyPairApiResponse, - "ForexCurrenciesGroupedDailyApiResponse": ForexCurrenciesGroupedDailyApiResponse, - "ForexCurrenciesPreviousCloseApiResponse": ForexCurrenciesPreviousCloseApiResponse, - "ForexCurrenciesSnapshotAllTickersApiResponse": ForexCurrenciesSnapshotAllTickersApiResponse, - "ForexCurrenciesSnapshotSingleTickerApiResponse": ForexCurrenciesSnapshotSingleTickerApiResponse, - "ForexCurrenciesSnapshotGainersLosersApiResponse": ForexCurrenciesSnapshotGainersLosersApiResponse, - "CryptoCryptoExchangesApiResponse": CryptoCryptoExchangesApiResponse, - "CryptoLastTradeForACryptoPairApiResponse": CryptoLastTradeForACryptoPairApiResponse, - "CryptoDailyOpenCloseApiResponse": CryptoDailyOpenCloseApiResponse, - "CryptoHistoricCryptoTradesApiResponse": CryptoHistoricCryptoTradesApiResponse, - "CryptoGroupedDailyApiResponse": CryptoGroupedDailyApiResponse, - "CryptoPreviousCloseApiResponse": CryptoPreviousCloseApiResponse, - "CryptoSnapshotAllTickersApiResponse": CryptoSnapshotAllTickersApiResponse, - "CryptoSnapshotSingleTickerApiResponse": CryptoSnapshotSingleTickerApiResponse, - "CryptoSnapshotSingleTickerFullBookApiResponse": CryptoSnapshotSingleTickerFullBookApiResponse, - "CryptoSnapshotGainersLosersApiResponse": CryptoSnapshotGainersLosersApiResponse, - "CurrenciesAggregatesApiResponse": CurrenciesAggregatesApiResponse, - -} - -# noinspection SpellCheckingInspection -name_to_type = { - "StockSymbol": StockSymbol, - "ConditionTypeMap": ConditionTypeMap, - "SymbolTypeMap": SymbolTypeMap, - "TickerSymbol": TickerSymbol, - -} \ No newline at end of file +from .aggs import * +from .common import * +from .conditions import * +from .contracts import * +from .dividends import * +from .exchanges import * +from .financials import * +from .indicators import * +from .markets import * +from .quotes import * +from .snapshot import * +from .splits import * +from .tickers import * +from .trades import * +from .summaries import * diff --git a/polygon/rest/models/aggs.py b/polygon/rest/models/aggs.py new file mode 100644 index 00000000..cb624121 --- /dev/null +++ b/polygon/rest/models/aggs.py @@ -0,0 +1,118 @@ +from typing import Optional +from ...modelclass import modelclass + + +@modelclass +class Agg: + "Contains aggregate data for a given ticker symbol over a given date range in a custom time window size." + open: Optional[float] = None + high: Optional[float] = None + low: Optional[float] = None + close: Optional[float] = None + volume: Optional[float] = None + vwap: Optional[float] = None + timestamp: Optional[int] = None + transactions: Optional[int] = None + otc: Optional[bool] = None + + @staticmethod + def from_dict(d): + return Agg( + d.get("o", None), + d.get("h", None), + d.get("l", None), + d.get("c", None), + d.get("v", None), + d.get("vw", None), + d.get("t", None), + d.get("n", None), + d.get("otc", None), + ) + + +@modelclass +class GroupedDailyAgg: + "Contains daily open, high, low, and close (OHLC) data for a given date." + ticker: Optional[str] = None + open: Optional[float] = None + high: Optional[float] = None + low: Optional[float] = None + close: Optional[float] = None + volume: Optional[float] = None + vwap: Optional[float] = None + timestamp: Optional[int] = None + transactions: Optional[int] = None + otc: Optional[bool] = None + + @staticmethod + def from_dict(d): + return GroupedDailyAgg( + d.get("T", None), + d.get("o", None), + d.get("h", None), + d.get("l", None), + d.get("c", None), + d.get("v", None), + d.get("vw", None), + d.get("t", None), + d.get("n", None), + d.get("otc", None), + ) + + +@modelclass +class DailyOpenCloseAgg: + "Contains data for open, close and afterhours prices of a ticker symbol on a specified date." + after_hours: Optional[float] = None + close: Optional[float] = None + from_: Optional[str] = None + high: Optional[float] = None + low: Optional[float] = None + open: Optional[float] = None + pre_market: Optional[float] = None + status: Optional[str] = None + symbol: Optional[str] = None + volume: Optional[float] = None + otc: Optional[bool] = None + + @staticmethod + def from_dict(d): + return DailyOpenCloseAgg( + d.get("afterHours", None), + d.get("close", None), + d.get("from", None), + d.get("high", None), + d.get("low", None), + d.get("open", None), + d.get("preMarket", None), + d.get("status", None), + d.get("symbol", None), + d.get("volume", None), + d.get("otc", None), + ) + + +@modelclass +class PreviousCloseAgg: + "Contains data for the previous day's open, high, low, and close (OHLC) of the specified stock ticker." + ticker: Optional[str] = None + close: Optional[float] = None + high: Optional[float] = None + low: Optional[float] = None + open: Optional[float] = None + timestamp: Optional[float] = None + volume: Optional[float] = None + vwap: Optional[float] = None + + @staticmethod + def from_dict(d): + return PreviousCloseAgg( + d.get("T", None), + d.get("c", None), + d.get("h", None), + d.get("l", None), + d.get("o", None), + d.get("t", None), + d.get("v", None), + d.get("vw", None), + ) diff --git a/polygon/rest/models/common.py b/polygon/rest/models/common.py new file mode 100644 index 00000000..5ab47c69 --- /dev/null +++ b/polygon/rest/models/common.py @@ -0,0 +1,103 @@ +from enum import Enum + + +class Sort(Enum): + ASC = "asc" + DESC = "desc" + + +class Order(Enum): + ASC = "asc" + DESC = "desc" + + +class Locale(Enum): + US = "us" + GLOBAL = "global" + + +class Market(Enum): + STOCKS = "stocks" + CRYPTO = "crypto" + FX = "fx" + OTC = "otc" + INDICES = "indices" + + +class AssetClass(Enum): + STOCKS = "stocks" + OPTIONS = "options" + CRYPTO = "crypto" + FX = "fx" + INDICES = "indices" + + +class DividendType(Enum): + CD = "CD" + SC = "SC" + LT = "LT" + ST = "ST" + + +class Frequency(Enum): + ONE_TIME = 0 + ANUALLY = 1 + BIANUALLY = 2 + QUARTERLY = 4 + MONTHLY = 12 + + +class DataType(Enum): + DATA_TRADE = "trade" + DATA_BBO = "bbo" + DATA_NBBO = "nbbo" + + +class SIP(Enum): + CTA = "CTA" + UTP = "UTP" + OPRA = "OPRA" + + +class ExchangeType(Enum): + EXCHANGE = "exchange" + TRF = "TRF" + SIP = "SIP" + + +class Direction(Enum): + GAINERS = "gainers" + LOSERS = "losers" + + +class SnapshotMarketType(Enum): + STOCKS = "stocks" + FOREX = "forex" + CRYPTO = "crypto" + INDICES = "indices" + + +class Timeframe(Enum): + ANNUAL = "annual" + QUARTERLY = "quarterly" + + +class Precision(Enum): + ZERO = 0 + ONE = 1 + TWO = 2 + THREE = 3 + FOUR = 4 + + +class SeriesType(Enum): + OPEN = "open" + CLOSE = "close" + HIGH = "high" + LOW = "low" + + +class LaunchPadOptions(Enum): + X_POLYGON_EDGE_ID = "X-Polygon-Edge-ID" + X_POLYGON_IP_ADDRESS = "X-Polygon-Edge-IP-Address" + X_POLYGON_EDGE_USER_AGENT = "X-Polygon-Edge-User-Agent" diff --git a/polygon/rest/models/conditions.py b/polygon/rest/models/conditions.py new file mode 100644 index 00000000..98baa261 --- /dev/null +++ b/polygon/rest/models/conditions.py @@ -0,0 +1,100 @@ +from typing import Optional, List +from ...modelclass import modelclass + + +@modelclass +class SipMapping: + "Contains data for a mapping to a symbol for each SIP that has a given condition." + CTA: Optional[str] = None + OPRA: Optional[str] = None + UTP: Optional[str] = None + + @staticmethod + def from_dict(d): + return SipMapping(**d) + + +@modelclass +class Consolidated: + "Contains data for aggregation rules on a consolidated (all exchanges) basis." + updates_high_low: Optional[bool] = None + updates_open_close: Optional[bool] = None + updates_volume: Optional[bool] = None + + @staticmethod + def from_dict(d): + return Consolidated(**d) + + +@modelclass +class MarketCenter: + "Contains data for aggregation rules on a per-market-center basis." + updates_high_low: Optional[bool] = None + updates_open_close: Optional[bool] = None + updates_volume: Optional[bool] = None + + @staticmethod + def from_dict(d): + return MarketCenter(**d) + + +@modelclass +class UpdateRules: + "Contains data for a list of aggregation rules." + consolidated: Optional[Consolidated] = None + market_center: Optional[MarketCenter] = None + + @staticmethod + def from_dict(d): + return UpdateRules( + consolidated=( + None + if "consolidated" not in d + else Consolidated.from_dict(d["consolidated"]) + ), + market_center=( + None + if "market_center" not in d + else MarketCenter.from_dict(d["market_center"]) + ), + ) + + +@modelclass +class Condition: + "Condition contains data for a condition that Polygon.io uses." + abbreviation: Optional[str] = None + asset_class: Optional[str] = None + data_types: Optional[List[str]] = None + description: Optional[str] = None + exchange: Optional[int] = None + id: Optional[int] = None + legacy: Optional[bool] = None + name: Optional[str] = None + sip_mapping: Optional[SipMapping] = None + type: Optional[str] = None + update_rules: Optional[UpdateRules] = None + + @staticmethod + def from_dict(d): + return Condition( + abbreviation=d.get("abbreviation", None), + asset_class=d.get("asset_class", None), + data_types=d.get("data_types", None), + description=d.get("description", None), + exchange=d.get("exchange", None), + id=d.get("id", None), + legacy=d.get("legacy", None), + name=d.get("name", None), + sip_mapping=( + None + if "sip_mapping" not in d + else SipMapping.from_dict(d["sip_mapping"]) + ), + type=d.get("type", None), + update_rules=( + None + if "update_rules" not in d + else UpdateRules.from_dict(d["update_rules"]) + ), + ) diff --git a/polygon/rest/models/contracts.py b/polygon/rest/models/contracts.py new file mode 100644 index 00000000..469779b6 --- /dev/null +++ b/polygon/rest/models/contracts.py @@ -0,0 +1,51 @@ +from typing import Optional, List +from ...modelclass import modelclass + + +@modelclass +class Underlying: + "Underlying contains data for an underlying or deliverable associated with an option contract." + amount: Optional[float] = None + type: Optional[str] = None + underlying: Optional[str] = None + + @staticmethod + def from_dict(d): + return Underlying(**d) + + +@modelclass +class OptionsContract: + "OptionsContract contains data for a specified ticker symbol." + additional_underlyings: Optional[List[Underlying]] = None + cfi: Optional[str] = None + contract_type: Optional[str] = None + correction: Optional[str] = None + exercise_style: Optional[str] = None + expiration_date: Optional[str] = None + primary_exchange: Optional[str] = None + shares_per_contract: Optional[float] = None + strike_price: Optional[float] = None + ticker: Optional[str] = None + underlying_ticker: Optional[str] = None + + @staticmethod + def from_dict(d): + return OptionsContract( + additional_underlyings=( + None + if "additional_underlyings" not in d + else [Underlying.from_dict(u) for u in d["additional_underlyings"]] + ), + cfi=d.get("cfi", None), + contract_type=d.get("contract_type", None), + correction=d.get("correction", None), + exercise_style=d.get("exercise_style", None), + expiration_date=d.get("expiration_date", None), + primary_exchange=d.get("primary_exchange", None), + shares_per_contract=d.get("shares_per_contract", None), + strike_price=d.get("strike_price", None), + size=d.get("size", None), + ticker=d.get("ticker", None), + underlying_ticker=d.get("underlying_ticker", None), + ) diff --git a/polygon/rest/models/definitions.py b/polygon/rest/models/definitions.py deleted file mode 100644 index c05b7cde..00000000 --- a/polygon/rest/models/definitions.py +++ /dev/null @@ -1,4180 +0,0 @@ -import keyword -from typing import List, Dict, Any - -from polygon.rest import models - - -class Definition: - _swagger_name_to_python: Dict[str, str] - _attribute_is_primitive: Dict[str, bool] - _attributes_to_types: Dict[str, Any] - - def unmarshal_json(self, input_json): - if isinstance(input_json, list): - list_attribute_name = list(self._swagger_name_to_python.values())[0] - if list_attribute_name in self._attributes_to_types: - list_type = self._attributes_to_types[list_attribute_name] - known_type = list_type.split("[")[1][:-1] - list_items = self._unmarshal_json_list(input_json, known_type) - else: - list_items = input_json - self.__setattr__(list_attribute_name, list_items) - return self - elif isinstance(input_json, dict): - self._unmarshal_json_object(input_json) - return self - elif isinstance(input_json, float) or isinstance(input_json, int): - return input_json - - @staticmethod - def _unmarshal_json_list(input_json, known_type): - items = [] - for item in input_json: - new_item = models.name_to_class[known_type]() - items.append(new_item._unmarshal_json_object(item)) - - return items - - def _unmarshal_json_object(self, input_json): - for key, value in input_json.items(): - if key in self._swagger_name_to_python: - attribute_name = self._swagger_name_to_python[key] - if not self._attribute_is_primitive[attribute_name]: - if attribute_name in self._attributes_to_types: - attribute_type = self._attributes_to_types[attribute_name] - if attribute_type in models.name_to_class: - model = models.name_to_class[attribute_type]() - value = model.unmarshal_json(input_json[key]) - else: - attribute_name = key + ('_' if keyword.iskeyword(key) else '') - - self.__setattr__(attribute_name, value) - return self - - -# noinspection SpellCheckingInspection -class LastTrade(Definition): - _swagger_name_to_python = { - "price": "price", - "size": "size", - "exchange": "exchange", - "cond1": "cond1", - "cond2": "cond2", - "cond3": "cond3", - "cond4": "cond4", - "timestamp": "timestamp", - - } - - _attribute_is_primitive = { - "price": True, - "size": True, - "exchange": True, - "cond1": True, - "cond2": True, - "cond3": True, - "cond4": True, - "timestamp": True, - - } - - _attributes_to_types = { - "price": "int", - "size": "int", - "exchange": "int", - "cond1": "int", - "cond2": "int", - "cond3": "int", - "cond4": "int", - "timestamp": "int", - - } - - def __init__(self): - self.price: int - self.size: int - self.exchange: int - self.cond1: int - self.cond2: int - self.cond3: int - self.cond4: int - self.timestamp: int - - -# noinspection SpellCheckingInspection -class LastQuote(Definition): - _swagger_name_to_python = { - "askprice": "askprice", - "asksize": "asksize", - "askexchange": "askexchange", - "bidprice": "bidprice", - "bidsize": "bidsize", - "bidexchange": "bidexchange", - "timestamp": "timestamp", - - } - - _attribute_is_primitive = { - "askprice": True, - "asksize": True, - "askexchange": True, - "bidprice": True, - "bidsize": True, - "bidexchange": True, - "timestamp": True, - - } - - _attributes_to_types = { - "askprice": "int", - "asksize": "int", - "askexchange": "int", - "bidprice": "int", - "bidsize": "int", - "bidexchange": "int", - "timestamp": "int", - - } - - def __init__(self): - self.askprice: int - self.asksize: int - self.askexchange: int - self.bidprice: int - self.bidsize: int - self.bidexchange: int - self.timestamp: int - - -# noinspection SpellCheckingInspection -class HistTrade(Definition): - _swagger_name_to_python = { - "condition1": "condition1", - "condition2": "condition2", - "condition3": "condition3", - "condition4": "condition4", - "exchange": "exchange", - "price": "price", - "size": "size", - "timestamp": "timestamp", - - } - - _attribute_is_primitive = { - "condition1": True, - "condition2": True, - "condition3": True, - "condition4": True, - "exchange": True, - "price": True, - "size": True, - "timestamp": True, - - } - - _attributes_to_types = { - "condition1": "int", - "condition2": "int", - "condition3": "int", - "condition4": "int", - "exchange": "str", - "price": "int", - "size": "int", - "timestamp": "str", - - } - - def __init__(self): - self.condition1: int - self.condition2: int - self.condition3: int - self.condition4: int - self.exchange: str - self.price: int - self.size: int - self.timestamp: str - - -# noinspection SpellCheckingInspection -class Quote(Definition): - _swagger_name_to_python = { - "c": "condition_of_this_quote", - "bE": "bid_exchange", - "aE": "ask_exchange", - "aP": "ask_price", - "bP": "bid_price", - "bS": "bid_size", - "aS": "ask_size", - "t": "timestamp_of_this_trade", - - } - - _attribute_is_primitive = { - "condition_of_this_quote": True, - "bid_exchange": True, - "ask_exchange": True, - "ask_price": True, - "bid_price": True, - "bid_size": True, - "ask_size": True, - "timestamp_of_this_trade": True, - - } - - _attributes_to_types = { - "condition_of_this_quote": "int", - "bid_exchange": "str", - "ask_exchange": "str", - "ask_price": "int", - "bid_price": "int", - "bid_size": "int", - "ask_size": "int", - "timestamp_of_this_trade": "int", - - } - - def __init__(self): - self.condition_of_this_quote: int - self.bid_exchange: str - self.ask_exchange: str - self.ask_price: int - self.bid_price: int - self.bid_size: int - self.ask_size: int - self.timestamp_of_this_trade: int - - -# noinspection SpellCheckingInspection -class Aggregate(Definition): - _swagger_name_to_python = { - "o": "open_price", - "c": "close_price", - "l": "low_price", - "h": "high_price", - "v": "total_volume_of_all_trades", - "k": "transactions", - "t": "timestamp_of_this_aggregation", - - } - - _attribute_is_primitive = { - "open_price": True, - "close_price": True, - "low_price": True, - "high_price": True, - "total_volume_of_all_trades": True, - "transactions": True, - "timestamp_of_this_aggregation": True, - - } - - _attributes_to_types = { - "open_price": "int", - "close_price": "int", - "low_price": "int", - "high_price": "int", - "total_volume_of_all_trades": "int", - "transactions": "int", - "timestamp_of_this_aggregation": "int", - - } - - def __init__(self): - self.open_price: int - self.close_price: int - self.low_price: int - self.high_price: int - self.total_volume_of_all_trades: int - self.transactions: int - self.timestamp_of_this_aggregation: int - - -# noinspection SpellCheckingInspection -class Company(Definition): - _swagger_name_to_python = { - "logo": "logo", - "exchange": "exchange", - "name": "name", - "symbol": "symbol", - "listdate": "listdate", - "cik": "cik", - "bloomberg": "bloomberg", - "figi": "figi", - "lei": "lei", - "sic": "sic", - "country": "country", - "industry": "industry", - "sector": "sector", - "marketcap": "marketcap", - "employees": "employees", - "phone": "phone", - "ceo": "ceo", - "url": "url", - "description": "description", - "similar": "similar", - "tags": "tags", - "updated": "updated", - - } - - _attribute_is_primitive = { - "logo": True, - "exchange": True, - "name": True, - "symbol": False, - "listdate": True, - "cik": True, - "bloomberg": True, - "figi": True, - "lei": True, - "sic": True, - "country": True, - "industry": True, - "sector": True, - "marketcap": True, - "employees": True, - "phone": True, - "ceo": True, - "url": True, - "description": True, - "similar": False, - "tags": False, - "updated": True, - - } - - _attributes_to_types = { - "logo": "str", - "exchange": "str", - "name": "str", - "symbol": "StockSymbol", - "listdate": "str", - "cik": "str", - "bloomberg": "str", - "figi": "str", - "lei": "str", - "sic": "float", - "country": "str", - "industry": "str", - "sector": "str", - "marketcap": "float", - "employees": "float", - "phone": "str", - "ceo": "str", - "url": "str", - "description": "str", - "similar": "List[StockSymbol]", - "tags": "List[str]", - "updated": "str", - - } - - def __init__(self): - self.logo: str - self.exchange: str - self.name: str - self.symbol: StockSymbol - self.listdate: str - self.cik: str - self.bloomberg: str - self.figi: str - self.lei: str - self.sic: float - self.country: str - self.industry: str - self.sector: str - self.marketcap: float - self.employees: float - self.phone: str - self.ceo: str - self.url: str - self.description: str - self.similar: List[StockSymbol] - self.tags: List[str] - self.updated: str - -class Address(Definition): - _swagger_name_to_python = { - "address1": "address1", - "city": "city", - "state": "state", - } - - _attributes_is_primitive = { - "address1": True, - "city": True, - "state": True, - } - - _attributes_to_types = { - "address1": "str", - "city": "str", - "state": "str", - } - - def __init__(self): - self.address1: str - self.city: str - self.state: str - - -# noinspection SpellCheckingInspection -class CompanyV3(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "name": "name", - "market": "market", - "locale": "locale", - "primary_exchange": "primary_exchange", - "type": "type", - "active": "active", - "currency_name": "currency_name", - "cik": "cik", - "composite_figi": "composite_figi", - "share_class_figi": "share_class_figi", - "last_updated_utc": "last_updated_utc", - "outstanding_shares": "outstanding_shares", - "market_cap": "market_cap", - "phone_number": "phone_number", - "address": "address", - "sic_code": "sic_code", - "sic_description": "sic_description", - } - - _attributes_is_primitive = { - "ticker": True, - "name": True, - "market": True, - "primary_exchange": True, - "type": True, - "active": True, - "currency_name": True, - "cik": True, - "composite_figi": True, - "share_class_figi": True, - "last_updated_utc": True, - "outstanding_shares": True, - "market_cap": True, - "phone_number": True, - "address": False, - "sic_code": True, - "sic_description": True, - } - - _attributes_to_types = { - "ticker": "str", - "name": "str", - "market": "str", - "primary_exchange": "str", - "type": "str", - "active": "bool", - "currency_name": "str", - "cik": "str", - "composite_figi": "str", - "share_class_figi": "str", - "last_updated_utc": "str", - "outstanding_shares": "int", - "market_cap": "int", - "phone_number": "str", - "address": "Address", - "sic_code": "str", - "sic_description": "str", - } - - def __init__(self): - self.ticker: str - self.name: str - self.market: str - self.primary_exchange: str - self.type: str - self.active: bool - self.currency_name: str - self.cik: str - self.composite_figi: str - self.share_class_figi: str - self.last_updated_utc: str - self.outstanding_shares: int - self.market_cap: int - self.phone_number: str - self.address: Address - self.sic_code: str - self.sic_description: str - -# noinspection SpellCheckingInspection -class Symbol(Definition): - _swagger_name_to_python = { - "symbol": "symbol", - "name": "name", - "type": "type", - "url": "url", - "updated": "updated", - "isOTC": "is___otc", - - } - - _attribute_is_primitive = { - "symbol": False, - "name": True, - "type": True, - "url": True, - "updated": True, - "is___otc": True, - - } - - _attributes_to_types = { - "symbol": "StockSymbol", - "name": "str", - "type": "str", - "url": "str", - "updated": "str", - "is___otc": "bool", - - } - - def __init__(self): - self.symbol: StockSymbol - self.name: str - self.type: str - self.url: str - self.updated: str - self.is___otc: bool - - -# noinspection SpellCheckingInspection -class SymbolV3(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "name": "name", - "market": "market", - "locale": "locale", - "primary_exchange": "primary_exchange", - "type": "type", - "active": "active", - "currency_name": "currency_name", - "cik": "cik", - "composite_figi": "composite_figi", - "share_class_figi": "share_class_figi", - "last_updated_utc": "last_updated_utc", - "delisted_utc": "delisted_utc", - } - - _attributes_is_primitive = { - "ticker": True, - "name": True, - "market": True, - "primary_exchange": True, - "type": True, - "active": True, - "currency_name": True, - "cik": True, - "composite_figi": True, - "share_class_figi": True, - "last_updated_utc": True, - "delisted_utc": True, - } - - _attributes_to_types = { - "ticker": "str", - "name": "str", - "market": "str", - "primary_exchange": "str", - "type": "str", - "active": "bool", - "currency_name": "str", - "cik": "str", - "composite_figi": "str", - "share_class_figi": "str", - "last_updated_utc": "str", - "delisted_utc": "str", - } - - def __init__(self): - self.ticker: str - self.name: str - self.market: str - self.primary_exchange: str - self.type: str - self.active: bool - self.currency_name: str - self.cik: str - self.composite_figi: str - self.share_class_figi: str - self.last_updated_utc: str - self.delisted_utc: str - -# noinspection SpellCheckingInspection -class Dividend(Definition): - _swagger_name_to_python = { - "symbol": "symbol", - "type": "type", - "exDate": "ex_date", - "paymentDate": "payment_date", - "recordDate": "record_date", - "declaredDate": "declared_date", - "amount": "amount", - "qualified": "qualified", - "flag": "flag", - - } - - _attribute_is_primitive = { - "symbol": False, - "type": True, - "ex_date": True, - "payment_date": True, - "record_date": True, - "declared_date": True, - "amount": True, - "qualified": True, - "flag": True, - - } - - _attributes_to_types = { - "symbol": "StockSymbol", - "type": "str", - "ex_date": "str", - "payment_date": "str", - "record_date": "str", - "declared_date": "str", - "amount": "float", - "qualified": "str", - "flag": "str", - - } - - def __init__(self): - self.symbol: StockSymbol - self.type: str - self.ex_date: str - self.payment_date: str - self.record_date: str - self.declared_date: str - self.amount: float - self.qualified: str - self.flag: str - - -# noinspection SpellCheckingInspection -class News(Definition): - _swagger_name_to_python = { - "symbols": "symbols", - "title": "title", - "url": "url", - "source": "source", - "summary": "summary", - "image": "image", - "timestamp": "timestamp", - "keywords": "keywords", - - } - - _attribute_is_primitive = { - "symbols": False, - "title": True, - "url": True, - "source": True, - "summary": True, - "image": True, - "timestamp": True, - "keywords": False, - - } - - _attributes_to_types = { - "symbols": "List[StockSymbol]", - "title": "str", - "url": "str", - "source": "str", - "summary": "str", - "image": "str", - "timestamp": "str", - "keywords": "List[str]", - - } - - def __init__(self): - self.symbols: List[StockSymbol] - self.title: str - self.url: str - self.source: str - self.summary: str - self.image: str - self.timestamp: str - self.keywords: List[str] - -class Publisher(Definition): - _swagger_name_to_python = { - "name": "name", - "logo_url": "logo_url", - "homepage_url": "homepage_url", - "favicon_url": "favicon_url", - } - - _attribute_is_primitive = { - "name": True, - "logo_url": True, - "homepage_url": True, - "favicon_url": True, - } - - _attributes_to_type = { - "name": "str", - "logo_url": "str", - "homepage_url": "str", - "favicon_url": "str", - } - - def __init__(self): - self.name: str - self.logo_url: str - self.homepage_url: str - self.favicon_url: str - - -# noinspection SpellCheckingInspection -class NewsV2(Definition): - _swagger_name_to_python = { - "id": "id", - "publisher": "publisher", - "title": "title", - "author": "author", - "published_utc": "published_utc", - "tickers": "tickers", - "amp_url": "amp_url", - "image_url": "image_url", - "description": "description", - "keywords": "keywords", - } - - _attribute_is_primitive = { - "id": True, - "publisher": False, - "title": True, - "author": True, - "published_utc": True, - "tickers": True, - "amp_url": True, - "image_url": True, - "description": True, - "keywords": True, - } - - _attributes_to_type = { - "id": "str", - "publisher": "Publisher", - "title": "str", - "author": "str", - "published_utc": "str", - "tickers": "List[str]", - "amp_url": "str", - "image_url": "str", - "description": "str", - "keywords": "str", - } - - def __init__(self): - self.id: str - self.publisher: Publisher - self.title: str - self.author: str - self.published_utc: str - self.tickers: List[str] - self.amp_url: str - self.image_url: str - self.description: str - self.keywords: str - -# noinspection SpellCheckingInspection -class Earning(Definition): - _swagger_name_to_python = { - "symbol": "symbol", - "EPSReportDate": "e___psrep_ortdate", - "EPSReportDateStr": "e___psrep_ort_datestr", - "fiscalPeriod": "fiscal_period", - "fiscalEndDate": "fiscal_en_ddate", - "actualEPS": "actual___eps", - "consensusEPS": "consensus___eps", - "estimatedEPS": "estimated___eps", - "announceTime": "announce_time", - "numberOfEstimates": "number_o_festimates", - "EPSSurpriseDollar": "e___pssurpr_isedollar", - "yearAgo": "year_ago", - "yearAgoChangePercent": "year_ag_ochan_gepercent", - "estimatedChangePercent": "estimated_chang_epercent", - - } - - _attribute_is_primitive = { - "symbol": True, - "e___psrep_ortdate": True, - "e___psrep_ort_datestr": True, - "fiscal_period": True, - "fiscal_en_ddate": True, - "actual___eps": True, - "consensus___eps": True, - "estimated___eps": True, - "announce_time": True, - "number_o_festimates": True, - "e___pssurpr_isedollar": True, - "year_ago": True, - "year_ag_ochan_gepercent": True, - "estimated_chang_epercent": True, - - } - - _attributes_to_types = { - "symbol": "str", - "e___psrep_ortdate": "str", - "e___psrep_ort_datestr": "str", - "fiscal_period": "str", - "fiscal_en_ddate": "str", - "actual___eps": "float", - "consensus___eps": "float", - "estimated___eps": "float", - "announce_time": "str", - "number_o_festimates": "float", - "e___pssurpr_isedollar": "float", - "year_ago": "float", - "year_ag_ochan_gepercent": "float", - "estimated_chang_epercent": "float", - - } - - def __init__(self): - self.symbol: str - self.e___psrep_ortdate: str - self.e___psrep_ort_datestr: str - self.fiscal_period: str - self.fiscal_en_ddate: str - self.actual___eps: float - self.consensus___eps: float - self.estimated___eps: float - self.announce_time: str - self.number_o_festimates: float - self.e___pssurpr_isedollar: float - self.year_ago: float - self.year_ag_ochan_gepercent: float - self.estimated_chang_epercent: float - - -# noinspection SpellCheckingInspection -class Financial(Definition): - _swagger_name_to_python = { - "symbol": "symbol", - "reportDate": "report_date", - "reportDateStr": "report_dat_estr", - "grossProfit": "gross_profit", - "costOfRevenue": "cost_o_frevenue", - "operatingRevenue": "operating_revenue", - "totalRevenue": "total_revenue", - "operatingIncome": "operating_income", - "netIncome": "net_income", - "researchAndDevelopment": "research_an_ddevelopment", - "operatingExpense": "operating_expense", - "currentAssets": "current_assets", - "totalAssets": "total_assets", - "totalLiabilities": "total_liabilities", - "currentCash": "current_cash", - "currentDebt": "current_debt", - "totalCash": "total_cash", - "totalDebt": "total_debt", - "shareholderEquity": "shareholder_equity", - "cashChange": "cash_change", - "cashFlow": "cash_flow", - "operatingGainsLosses": "operating_gain_slosses", - - } - - _attribute_is_primitive = { - "symbol": True, - "report_date": True, - "report_dat_estr": True, - "gross_profit": True, - "cost_o_frevenue": True, - "operating_revenue": True, - "total_revenue": True, - "operating_income": True, - "net_income": True, - "research_an_ddevelopment": True, - "operating_expense": True, - "current_assets": True, - "total_assets": True, - "total_liabilities": True, - "current_cash": True, - "current_debt": True, - "total_cash": True, - "total_debt": True, - "shareholder_equity": True, - "cash_change": True, - "cash_flow": True, - "operating_gain_slosses": True, - - } - - _attributes_to_types = { - "symbol": "str", - "report_date": "str", - "report_dat_estr": "str", - "gross_profit": "float", - "cost_o_frevenue": "float", - "operating_revenue": "float", - "total_revenue": "float", - "operating_income": "float", - "net_income": "float", - "research_an_ddevelopment": "float", - "operating_expense": "float", - "current_assets": "float", - "total_assets": "float", - "total_liabilities": "float", - "current_cash": "float", - "current_debt": "float", - "total_cash": "float", - "total_debt": "float", - "shareholder_equity": "float", - "cash_change": "float", - "cash_flow": "float", - "operating_gain_slosses": "float", - - } - - def __init__(self): - self.symbol: str - self.report_date: str - self.report_dat_estr: str - self.gross_profit: float - self.cost_o_frevenue: float - self.operating_revenue: float - self.total_revenue: float - self.operating_income: float - self.net_income: float - self.research_an_ddevelopment: float - self.operating_expense: float - self.current_assets: float - self.total_assets: float - self.total_liabilities: float - self.current_cash: float - self.current_debt: float - self.total_cash: float - self.total_debt: float - self.shareholder_equity: float - self.cash_change: float - self.cash_flow: float - self.operating_gain_slosses: float - - -# noinspection SpellCheckingInspection -class Exchange(Definition): - _swagger_name_to_python = { - "id": "i_d_of_the_exchange", - "type": "type", - "market": "market", - "mic": "mic", - "name": "name", - "tape": "tape", - - } - - _attribute_is_primitive = { - "i_d_of_the_exchange": True, - "type": True, - "market": True, - "mic": True, - "name": True, - "tape": True, - - } - - _attributes_to_types = { - "i_d_of_the_exchange": "float", - "type": "str", - "market": "str", - "mic": "str", - "name": "str", - "tape": "str", - - } - - def __init__(self): - self.i_d_of_the_exchange: float - self.type: str - self.market: str - self.mic: str - self.name: str - self.tape: str - - -# noinspection SpellCheckingInspection -class Error(Definition): - _swagger_name_to_python = { - "code": "code", - "message": "message", - "fields": "fields", - - } - - _attribute_is_primitive = { - "code": True, - "message": True, - "fields": True, - - } - - _attributes_to_types = { - "code": "int", - "message": "str", - "fields": "str", - - } - - def __init__(self): - self.code: int - self.message: str - self.fields: str - - -# noinspection SpellCheckingInspection -class NotFound(Definition): - _swagger_name_to_python = { - "message": "message", - - } - - _attribute_is_primitive = { - "message": True, - - } - - _attributes_to_types = { - "message": "str", - - } - - def __init__(self): - self.message: str - - -# noinspection SpellCheckingInspection -class Conflict(Definition): - _swagger_name_to_python = { - "message": "message", - - } - - _attribute_is_primitive = { - "message": True, - - } - - _attributes_to_types = { - "message": "str", - - } - - def __init__(self): - self.message: str - - -# noinspection SpellCheckingInspection -class Unauthorized(Definition): - _swagger_name_to_python = { - "message": "message", - - } - - _attribute_is_primitive = { - "message": True, - - } - - _attributes_to_types = { - "message": "str", - - } - - def __init__(self): - self.message: str - - -# noinspection SpellCheckingInspection -class MarketStatus(Definition): - _swagger_name_to_python = { - "market": "market", - "serverTime": "server_time", - "exchanges": "exchanges", - "currencies": "currencies", - - } - - _attribute_is_primitive = { - "market": True, - "server_time": True, - "exchanges": True, - "currencies": True, - - } - - _attributes_to_types = { - "market": "str", - "server_time": "str", - "exchanges": "Dict[str, str]", - "currencies": "Dict[str, str]", - - } - - def __init__(self): - self.market: str - self.server_time: str - self.exchanges: Dict[str, str] - self.currencies: Dict[str, str] - - -# noinspection SpellCheckingInspection -class MarketHoliday(Definition): - _swagger_name_to_python = { - "exchange": "exchange", - "name": "name", - "status": "status", - "date": "date", - "open": "open", - "close": "close", - - } - - _attribute_is_primitive = { - "exchange": True, - "name": True, - "status": True, - "date": True, - "open": True, - "close": True, - - } - - _attributes_to_types = { - "exchange": "str", - "name": "str", - "status": "str", - "date": "str", - "open": "str", - "close": "str", - - } - - def __init__(self): - self.exchange: str - self.name: str - self.status: str - self.date: str - self.open: str - self.close: str - - -# noinspection SpellCheckingInspection -class AnalystRatings(Definition): - _swagger_name_to_python = { - "symbol": "symbol", - "analysts": "analysts", - "change": "change", - "strongBuy": "strong_buy", - "buy": "buy", - "hold": "hold", - "sell": "sell", - "strongSell": "strong_sell", - "updated": "updated", - - } - - _attribute_is_primitive = { - "symbol": True, - "analysts": True, - "change": True, - "strong_buy": False, - "buy": False, - "hold": False, - "sell": False, - "strong_sell": False, - "updated": True, - - } - - _attributes_to_types = { - "symbol": "str", - "analysts": "float", - "change": "float", - "strong_buy": "RatingSection", - "buy": "RatingSection", - "hold": "RatingSection", - "sell": "RatingSection", - "strong_sell": "RatingSection", - "updated": "str", - - } - - def __init__(self): - self.symbol: str - self.analysts: float - self.change: float - self.strong_buy: RatingSection - self.buy: RatingSection - self.hold: RatingSection - self.sell: RatingSection - self.strong_sell: RatingSection - self.updated: str - - -# noinspection SpellCheckingInspection -class RatingSection(Definition): - _swagger_name_to_python = { - "current": "current", - "month1": "month1", - "month2": "month2", - "month3": "month3", - "month4": "month4", - "month5": "month5", - - } - - _attribute_is_primitive = { - "current": True, - "month1": True, - "month2": True, - "month3": True, - "month4": True, - "month5": True, - - } - - _attributes_to_types = { - "current": "float", - "month1": "float", - "month2": "float", - "month3": "float", - "month4": "float", - "month5": "float", - - } - - def __init__(self): - self.current: float - self.month1: float - self.month2: float - self.month3: float - self.month4: float - self.month5: float - - -# noinspection SpellCheckingInspection -class CryptoTick(Definition): - _swagger_name_to_python = { - "price": "price", - "size": "size", - "exchange": "exchange", - "conditions": "conditions", - "timestamp": "timestamp", - - } - - _attribute_is_primitive = { - "price": True, - "size": True, - "exchange": True, - "conditions": False, - "timestamp": True, - - } - - _attributes_to_types = { - "price": "int", - "size": "int", - "exchange": "int", - "conditions": "List[int]", - "timestamp": "int", - - } - - def __init__(self): - self.price: int - self.size: int - self.exchange: int - self.conditions: List[int] - self.timestamp: int - - -# noinspection SpellCheckingInspection -class CryptoTickJson(Definition): - _swagger_name_to_python = { - "p": "trade_price", - "s": "size_of_the_trade", - "x": "exchange_the_trade_occured_on", - "c": "c", - "t": "timestamp_of_this_trade", - - } - - _attribute_is_primitive = { - "trade_price": True, - "size_of_the_trade": True, - "exchange_the_trade_occured_on": True, - "c": False, - "timestamp_of_this_trade": True, - - } - - _attributes_to_types = { - "trade_price": "int", - "size_of_the_trade": "int", - "exchange_the_trade_occured_on": "int", - "c": "List[int]", - "timestamp_of_this_trade": "int", - - } - - def __init__(self): - self.trade_price: int - self.size_of_the_trade: int - self.exchange_the_trade_occured_on: int - self.c: List[int] - self.timestamp_of_this_trade: int - - -# noinspection SpellCheckingInspection -class CryptoExchange(Definition): - _swagger_name_to_python = { - "id": "i_d_of_the_exchange", - "type": "type", - "market": "market", - "name": "name", - "url": "url", - - } - - _attribute_is_primitive = { - "i_d_of_the_exchange": True, - "type": True, - "market": True, - "name": True, - "url": True, - - } - - _attributes_to_types = { - "i_d_of_the_exchange": "float", - "type": "str", - "market": "str", - "name": "str", - "url": "str", - - } - - def __init__(self): - self.i_d_of_the_exchange: float - self.type: str - self.market: str - self.name: str - self.url: str - - -# noinspection SpellCheckingInspection -class CryptoSnapshotTicker(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "day": "day", - "lastTrade": "last_trade", - "min": "min", - "prevDay": "prev_day", - "todaysChange": "todays_change", - "todaysChangePerc": "todays_chang_eperc", - "updated": "updated", - - } - - _attribute_is_primitive = { - "ticker": True, - "day": False, - "last_trade": False, - "min": False, - "prev_day": False, - "todays_change": True, - "todays_chang_eperc": True, - "updated": True, - - } - - _attributes_to_types = { - "ticker": "str", - "day": "CryptoSnapshotAgg", - "last_trade": "CryptoTickJson", - "min": "CryptoSnapshotAgg", - "prev_day": "CryptoSnapshotAgg", - "todays_change": "int", - "todays_chang_eperc": "int", - "updated": "int", - - } - - def __init__(self): - self.ticker: str - self.day: CryptoSnapshotAgg - self.last_trade: CryptoTickJson - self.min: CryptoSnapshotAgg - self.prev_day: CryptoSnapshotAgg - self.todays_change: int - self.todays_chang_eperc: int - self.updated: int - - -# noinspection SpellCheckingInspection -class CryptoSnapshotBookItem(Definition): - _swagger_name_to_python = { - "p": "price_of_this_book_level", - "x": "exchange_to_size_of_this_price_level", - - } - - _attribute_is_primitive = { - "price_of_this_book_level": True, - "exchange_to_size_of_this_price_level": True, - - } - - _attributes_to_types = { - "price_of_this_book_level": "int", - "exchange_to_size_of_this_price_level": "Dict[str, str]", - - } - - def __init__(self): - self.price_of_this_book_level: int - self.exchange_to_size_of_this_price_level: Dict[str, str] - - -# noinspection SpellCheckingInspection -class CryptoSnapshotTickerBook(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "bids": "bids", - "asks": "asks", - "bidCount": "bid_count", - "askCount": "ask_count", - "spread": "spread", - "updated": "updated", - - } - - _attribute_is_primitive = { - "ticker": True, - "bids": False, - "asks": False, - "bid_count": True, - "ask_count": True, - "spread": True, - "updated": True, - - } - - _attributes_to_types = { - "ticker": "str", - "bids": "List[CryptoSnapshotBookItem]", - "asks": "List[CryptoSnapshotBookItem]", - "bid_count": "int", - "ask_count": "int", - "spread": "int", - "updated": "int", - - } - - def __init__(self): - self.ticker: str - self.bids: List[CryptoSnapshotBookItem] - self.asks: List[CryptoSnapshotBookItem] - self.bid_count: int - self.ask_count: int - self.spread: int - self.updated: int - - -# noinspection SpellCheckingInspection -class CryptoSnapshotAgg(Definition): - _swagger_name_to_python = { - "c": "close_price", - "h": "high_price", - "l": "low_price", - "o": "open_price", - "v": "volume", - - } - - _attribute_is_primitive = { - "close_price": True, - "high_price": True, - "low_price": True, - "open_price": True, - "volume": True, - - } - - _attributes_to_types = { - "close_price": "int", - "high_price": "int", - "low_price": "int", - "open_price": "int", - "volume": "int", - - } - - def __init__(self): - self.close_price: int - self.high_price: int - self.low_price: int - self.open_price: int - self.volume: int - - -# noinspection SpellCheckingInspection -class Forex(Definition): - _swagger_name_to_python = { - "a": "ask_price", - "b": "bid_price", - "t": "timestamp_of_this_trade", - - } - - _attribute_is_primitive = { - "ask_price": True, - "bid_price": True, - "timestamp_of_this_trade": True, - - } - - _attributes_to_types = { - "ask_price": "int", - "bid_price": "int", - "timestamp_of_this_trade": "int", - - } - - def __init__(self): - self.ask_price: int - self.bid_price: int - self.timestamp_of_this_trade: int - - -# noinspection SpellCheckingInspection -class LastForexTrade(Definition): - _swagger_name_to_python = { - "price": "price", - "exchange": "exchange", - "timestamp": "timestamp", - - } - - _attribute_is_primitive = { - "price": True, - "exchange": True, - "timestamp": True, - - } - - _attributes_to_types = { - "price": "int", - "exchange": "int", - "timestamp": "int", - - } - - def __init__(self): - self.price: int - self.exchange: int - self.timestamp: int - - -# noinspection SpellCheckingInspection -class LastForexQuote(Definition): - _swagger_name_to_python = { - "ask": "ask", - "bid": "bid", - "exchange": "exchange", - "timestamp": "timestamp", - - } - - _attribute_is_primitive = { - "ask": True, - "bid": True, - "exchange": True, - "timestamp": True, - - } - - _attributes_to_types = { - "ask": "int", - "bid": "int", - "exchange": "int", - "timestamp": "int", - - } - - def __init__(self): - self.ask: int - self.bid: int - self.exchange: int - self.timestamp: int - - -# noinspection SpellCheckingInspection -class ForexAggregate(Definition): - _swagger_name_to_python = { - "o": "open_price", - "c": "close_price", - "l": "low_price", - "h": "high_price", - "v": "volume_of_all_trades", - "t": "timestamp_of_this_aggregation", - - } - - _attribute_is_primitive = { - "open_price": True, - "close_price": True, - "low_price": True, - "high_price": True, - "volume_of_all_trades": True, - "timestamp_of_this_aggregation": True, - - } - - _attributes_to_types = { - "open_price": "int", - "close_price": "int", - "low_price": "int", - "high_price": "int", - "volume_of_all_trades": "int", - "timestamp_of_this_aggregation": "int", - - } - - def __init__(self): - self.open_price: int - self.close_price: int - self.low_price: int - self.high_price: int - self.volume_of_all_trades: int - self.timestamp_of_this_aggregation: int - - -# noinspection SpellCheckingInspection -class ForexSnapshotTicker(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "day": "day", - "lastTrade": "last_trade", - "min": "min", - "prevDay": "prev_day", - "todaysChange": "todays_change", - "todaysChangePerc": "todays_chang_eperc", - "updated": "updated", - - } - - _attribute_is_primitive = { - "ticker": True, - "day": False, - "last_trade": False, - "min": False, - "prev_day": False, - "todays_change": True, - "todays_chang_eperc": True, - "updated": True, - - } - - _attributes_to_types = { - "ticker": "str", - "day": "ForexSnapshotAgg", - "last_trade": "Forex", - "min": "ForexSnapshotAgg", - "prev_day": "ForexSnapshotAgg", - "todays_change": "int", - "todays_chang_eperc": "int", - "updated": "int", - - } - - def __init__(self): - self.ticker: str - self.day: ForexSnapshotAgg - self.last_trade: Forex - self.min: ForexSnapshotAgg - self.prev_day: ForexSnapshotAgg - self.todays_change: int - self.todays_chang_eperc: int - self.updated: int - - -# noinspection SpellCheckingInspection -class ForexSnapshotAgg(Definition): - _swagger_name_to_python = { - "c": "close_price", - "h": "high_price", - "l": "low_price", - "o": "open_price", - "v": "volume", - - } - - _attribute_is_primitive = { - "close_price": True, - "high_price": True, - "low_price": True, - "open_price": True, - "volume": True, - - } - - _attributes_to_types = { - "close_price": "int", - "high_price": "int", - "low_price": "int", - "open_price": "int", - "volume": "int", - - } - - def __init__(self): - self.close_price: int - self.high_price: int - self.low_price: int - self.open_price: int - self.volume: int - - -# noinspection SpellCheckingInspection -class Ticker(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "name": "name", - "market": "market", - "locale": "locale", - "currency": "currency", - "active": "active", - "primaryExch": "primary_exch", - "url": "url", - "updated": "updated", - "attrs": "attrs", - "codes": "codes", - - } - - _attribute_is_primitive = { - "ticker": False, - "name": True, - "market": True, - "locale": True, - "currency": True, - "active": True, - "primary_exch": True, - "url": True, - "updated": True, - "attrs": True, - "codes": True, - - } - - _attributes_to_types = { - "ticker": "StockSymbol", - "name": "str", - "market": "str", - "locale": "str", - "currency": "str", - "active": "bool", - "primary_exch": "str", - "url": "str", - "updated": "str", - "attrs": "Dict[str, str]", - "codes": "Dict[str, str]", - - } - - def __init__(self): - self.ticker: StockSymbol - self.name: str - self.market: str - self.locale: str - self.currency: str - self.active: bool - self.primary_exch: str - self.url: str - self.updated: str - self.attrs: Dict[str, str] - self.codes: Dict[str, str] - - -# noinspection SpellCheckingInspection -class Split(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "exDate": "ex_date", - "paymentDate": "payment_date", - "recordDate": "record_date", - "declaredDate": "declared_date", - "ratio": "ratio", - "tofactor": "tofactor", - "forfactor": "forfactor", - - } - - _attribute_is_primitive = { - "ticker": False, - "ex_date": True, - "payment_date": True, - "record_date": True, - "declared_date": True, - "ratio": True, - "tofactor": True, - "forfactor": True, - - } - - _attributes_to_types = { - "ticker": "TickerSymbol", - "ex_date": "str", - "payment_date": "str", - "record_date": "str", - "declared_date": "str", - "ratio": "float", - "tofactor": "float", - "forfactor": "float", - - } - - def __init__(self): - self.ticker: TickerSymbol - self.ex_date: str - self.payment_date: str - self.record_date: str - self.declared_date: str - self.ratio: float - self.tofactor: float - self.forfactor: float - - -# noinspection SpellCheckingInspection -class Financials(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "period": "period", - "calendarDate": "calendar_date", - "reportPeriod": "report_period", - "updated": "updated", - "accumulatedOtherComprehensiveIncome": "accumulated_othe_rcomprehensi_veincome", - "assets": "assets", - "assetsAverage": "assets_average", - "assetsCurrent": "assets_current", - "assetTurnover": "asset_turnover", - "assetsNonCurrent": "assets_no_ncurrent", - "bookValuePerShare": "book_valu_ep_ershare", - "capitalExpenditure": "capital_expenditure", - "cashAndEquivalents": "cash_an_dequivalents", - "cashAndEquivalentsUSD": "cash_an_dequivalen___tsusd", - "costOfRevenue": "cost_o_frevenue", - "consolidatedIncome": "consolidated_income", - "currentRatio": "current_ratio", - "debtToEquityRatio": "debt_t_oequi_tyratio", - "debt": "debt", - "debtCurrent": "debt_current", - "debtNonCurrent": "debt_no_ncurrent", - "debtUSD": "debt___usd", - "deferredRevenue": "deferred_revenue", - "depreciationAmortizationAndAccretion": "depreciation_amortizatio_na_ndaccretion", - "deposits": "deposits", - "dividendYield": "dividend_yield", - "dividendsPerBasicCommonShare": "dividends_pe_rbas_iccom_monshare", - "earningBeforeInterestTaxes": "earning_befor_eintere_sttaxes", - "earningsBeforeInterestTaxesDepreciationAmortization": "earnings_befor_eintere_stta_xesdeprecia_tionamortization", - "EBITDAMargin": "e______bitdamargin", - "earningsBeforeInterestTaxesDepreciationAmortizationUSD": "earnings_befor_eintere_stta_xesdeprecia_tionamortiz___ationusd", - "earningBeforeInterestTaxesUSD": "earning_befor_eintere_stta___xesusd", - "earningsBeforeTax": "earnings_befor_etax", - "earningsPerBasicShare": "earnings_pe_rbas_icshare", - "earningsPerDilutedShare": "earnings_pe_rdilut_edshare", - "earningsPerBasicShareUSD": "earnings_pe_rbas_icsh___areusd", - "shareholdersEquity": "shareholders_equity", - "averageEquity": "average_equity", - "shareholdersEquityUSD": "shareholders_equit___yusd", - "enterpriseValue": "enterprise_value", - "enterpriseValueOverEBIT": "enterprise_valu_eov____erebit", - "enterpriseValueOverEBITDA": "enterprise_valu_eov______erebitda", - "freeCashFlow": "free_cas_hflow", - "freeCashFlowPerShare": "free_cas_hfl_ow_pershare", - "foreignCurrencyUSDExchangeRate": "foreign_currenc____yusdexc_hangerate", - "grossProfit": "gross_profit", - "grossMargin": "gross_margin", - "goodwillAndIntangibleAssets": "goodwill_an_dintangib_leassets", - "interestExpense": "interest_expense", - "investedCapital": "invested_capital", - "investedCapitalAverage": "invested_capita_laverage", - "inventory": "inventory", - "investments": "investments", - "investmentsCurrent": "investments_current", - "investmentsNonCurrent": "investments_no_ncurrent", - "totalLiabilities": "total_liabilities", - "currentLiabilities": "current_liabilities", - "liabilitiesNonCurrent": "liabilities_no_ncurrent", - "marketCapitalization": "market_capitalization", - "netCashFlow": "net_cas_hflow", - "netCashFlowBusinessAcquisitionsDisposals": "net_cas_hfl_owbusin_essacquisit_ionsdisposals", - "issuanceEquityShares": "issuance_equit_yshares", - "issuanceDebtSecurities": "issuance_deb_tsecurities", - "paymentDividendsOtherCashDistributions": "payment_dividend_soth_erc_ashdistributions", - "netCashFlowFromFinancing": "net_cas_hfl_owf_romfinancing", - "netCashFlowFromInvesting": "net_cas_hfl_owf_rominvesting", - "netCashFlowInvestmentAcquisitionsDisposals": "net_cas_hfl_owinvestm_entacquisit_ionsdisposals", - "netCashFlowFromOperations": "net_cas_hfl_owf_romoperations", - "effectOfExchangeRateChangesOnCash": "effect_o_fexchan_ger_atecha_n_gesoncash", - "netIncome": "net_income", - "netIncomeCommonStock": "net_incom_ecomm_onstock", - "netIncomeCommonStockUSD": "net_incom_ecomm_onst___ockusd", - "netLossIncomeFromDiscontinuedOperations": "net_los_sinco_mef_romdisconti_nuedoperations", - "netIncomeToNonControllingInterests": "net_incom_e_to_noncontrol_linginterests", - "profitMargin": "profit_margin", - "operatingExpenses": "operating_expenses", - "operatingIncome": "operating_income", - "tradeAndNonTradePayables": "trade_an_dn_ontr_adepayables", - "payoutRatio": "payout_ratio", - "priceToBookValue": "price_t_obo_okvalue", - "priceEarnings": "price_earnings", - "priceToEarningsRatio": "price_t_oearnin_gsratio", - "propertyPlantEquipmentNet": "property_plan_tequipme_ntnet", - "preferredDividendsIncomeStatementImpact": "preferred_dividend_sinco_mestatem_entimpact", - "sharePriceAdjustedClose": "share_pric_eadjust_edclose", - "priceSales": "price_sales", - "priceToSalesRatio": "price_t_osal_esratio", - "tradeAndNonTradeReceivables": "trade_an_dn_ontr_adereceivables", - "accumulatedRetainedEarningsDeficit": "accumulated_retaine_dearnin_gsdeficit", - "revenues": "revenues", - "revenuesUSD": "revenues___usd", - "researchAndDevelopmentExpense": "research_an_ddevelopme_ntexpense", - "returnOnAverageAssets": "return_o_navera_geassets", - "returnOnAverageEquity": "return_o_navera_geequity", - "returnOnInvestedCapital": "return_o_ninvest_edcapital", - "returnOnSales": "return_o_nsales", - "shareBasedCompensation": "share_base_dcompensation", - "sellingGeneralAndAdministrativeExpense": "selling_genera_la_ndadministrat_iveexpense", - "shareFactor": "share_factor", - "shares": "shares", - "weightedAverageShares": "weighted_averag_eshares", - "weightedAverageSharesDiluted": "weighted_averag_eshar_esdiluted", - "salesPerShare": "sales_pe_rshare", - "tangibleAssetValue": "tangible_asse_tvalue", - "taxAssets": "tax_assets", - "incomeTaxExpense": "income_ta_xexpense", - "taxLiabilities": "tax_liabilities", - "tangibleAssetsBookValuePerShare": "tangible_asset_sbo_okva_lu_epershare", - "workingCapital": "working_capital", - - } - - _attribute_is_primitive = { - "ticker": False, - "period": True, - "calendar_date": True, - "report_period": True, - "updated": True, - "accumulated_othe_rcomprehensi_veincome": True, - "assets": True, - "assets_average": True, - "assets_current": True, - "asset_turnover": True, - "assets_no_ncurrent": True, - "book_valu_ep_ershare": True, - "capital_expenditure": True, - "cash_an_dequivalents": True, - "cash_an_dequivalen___tsusd": True, - "cost_o_frevenue": True, - "consolidated_income": True, - "current_ratio": True, - "debt_t_oequi_tyratio": True, - "debt": True, - "debt_current": True, - "debt_no_ncurrent": True, - "debt___usd": True, - "deferred_revenue": True, - "depreciation_amortizatio_na_ndaccretion": True, - "deposits": True, - "dividend_yield": True, - "dividends_pe_rbas_iccom_monshare": True, - "earning_befor_eintere_sttaxes": True, - "earnings_befor_eintere_stta_xesdeprecia_tionamortization": True, - "e______bitdamargin": True, - "earnings_befor_eintere_stta_xesdeprecia_tionamortiz___ationusd": True, - "earning_befor_eintere_stta___xesusd": True, - "earnings_befor_etax": True, - "earnings_pe_rbas_icshare": True, - "earnings_pe_rdilut_edshare": True, - "earnings_pe_rbas_icsh___areusd": True, - "shareholders_equity": True, - "average_equity": True, - "shareholders_equit___yusd": True, - "enterprise_value": True, - "enterprise_valu_eov____erebit": True, - "enterprise_valu_eov______erebitda": True, - "free_cas_hflow": True, - "free_cas_hfl_ow_pershare": True, - "foreign_currenc____yusdexc_hangerate": True, - "gross_profit": True, - "gross_margin": True, - "goodwill_an_dintangib_leassets": True, - "interest_expense": True, - "invested_capital": True, - "invested_capita_laverage": True, - "inventory": True, - "investments": True, - "investments_current": True, - "investments_no_ncurrent": True, - "total_liabilities": True, - "current_liabilities": True, - "liabilities_no_ncurrent": True, - "market_capitalization": True, - "net_cas_hflow": True, - "net_cas_hfl_owbusin_essacquisit_ionsdisposals": True, - "issuance_equit_yshares": True, - "issuance_deb_tsecurities": True, - "payment_dividend_soth_erc_ashdistributions": True, - "net_cas_hfl_owf_romfinancing": True, - "net_cas_hfl_owf_rominvesting": True, - "net_cas_hfl_owinvestm_entacquisit_ionsdisposals": True, - "net_cas_hfl_owf_romoperations": True, - "effect_o_fexchan_ger_atecha_n_gesoncash": True, - "net_income": True, - "net_incom_ecomm_onstock": True, - "net_incom_ecomm_onst___ockusd": True, - "net_los_sinco_mef_romdisconti_nuedoperations": True, - "net_incom_e_to_noncontrol_linginterests": True, - "profit_margin": True, - "operating_expenses": True, - "operating_income": True, - "trade_an_dn_ontr_adepayables": True, - "payout_ratio": True, - "price_t_obo_okvalue": True, - "price_earnings": True, - "price_t_oearnin_gsratio": True, - "property_plan_tequipme_ntnet": True, - "preferred_dividend_sinco_mestatem_entimpact": True, - "share_pric_eadjust_edclose": True, - "price_sales": True, - "price_t_osal_esratio": True, - "trade_an_dn_ontr_adereceivables": True, - "accumulated_retaine_dearnin_gsdeficit": True, - "revenues": True, - "revenues___usd": True, - "research_an_ddevelopme_ntexpense": True, - "return_o_navera_geassets": True, - "return_o_navera_geequity": True, - "return_o_ninvest_edcapital": True, - "return_o_nsales": True, - "share_base_dcompensation": True, - "selling_genera_la_ndadministrat_iveexpense": True, - "share_factor": True, - "shares": True, - "weighted_averag_eshares": True, - "weighted_averag_eshar_esdiluted": True, - "sales_pe_rshare": True, - "tangible_asse_tvalue": True, - "tax_assets": True, - "income_ta_xexpense": True, - "tax_liabilities": True, - "tangible_asset_sbo_okva_lu_epershare": True, - "working_capital": True, - - } - - _attributes_to_types = { - "ticker": "TickerSymbol", - "period": "str", - "calendar_date": "str", - "report_period": "str", - "updated": "str", - "accumulated_othe_rcomprehensi_veincome": "int", - "assets": "int", - "assets_average": "int", - "assets_current": "int", - "asset_turnover": "int", - "assets_no_ncurrent": "int", - "book_valu_ep_ershare": "int", - "capital_expenditure": "int", - "cash_an_dequivalents": "int", - "cash_an_dequivalen___tsusd": "int", - "cost_o_frevenue": "int", - "consolidated_income": "int", - "current_ratio": "int", - "debt_t_oequi_tyratio": "int", - "debt": "int", - "debt_current": "int", - "debt_no_ncurrent": "int", - "debt___usd": "int", - "deferred_revenue": "int", - "depreciation_amortizatio_na_ndaccretion": "int", - "deposits": "int", - "dividend_yield": "int", - "dividends_pe_rbas_iccom_monshare": "int", - "earning_befor_eintere_sttaxes": "int", - "earnings_befor_eintere_stta_xesdeprecia_tionamortization": "int", - "e______bitdamargin": "int", - "earnings_befor_eintere_stta_xesdeprecia_tionamortiz___ationusd": "int", - "earning_befor_eintere_stta___xesusd": "int", - "earnings_befor_etax": "int", - "earnings_pe_rbas_icshare": "int", - "earnings_pe_rdilut_edshare": "int", - "earnings_pe_rbas_icsh___areusd": "int", - "shareholders_equity": "int", - "average_equity": "int", - "shareholders_equit___yusd": "int", - "enterprise_value": "int", - "enterprise_valu_eov____erebit": "int", - "enterprise_valu_eov______erebitda": "int", - "free_cas_hflow": "int", - "free_cas_hfl_ow_pershare": "int", - "foreign_currenc____yusdexc_hangerate": "int", - "gross_profit": "int", - "gross_margin": "int", - "goodwill_an_dintangib_leassets": "int", - "interest_expense": "int", - "invested_capital": "int", - "invested_capita_laverage": "int", - "inventory": "int", - "investments": "int", - "investments_current": "int", - "investments_no_ncurrent": "int", - "total_liabilities": "int", - "current_liabilities": "int", - "liabilities_no_ncurrent": "int", - "market_capitalization": "int", - "net_cas_hflow": "int", - "net_cas_hfl_owbusin_essacquisit_ionsdisposals": "int", - "issuance_equit_yshares": "int", - "issuance_deb_tsecurities": "int", - "payment_dividend_soth_erc_ashdistributions": "int", - "net_cas_hfl_owf_romfinancing": "int", - "net_cas_hfl_owf_rominvesting": "int", - "net_cas_hfl_owinvestm_entacquisit_ionsdisposals": "int", - "net_cas_hfl_owf_romoperations": "int", - "effect_o_fexchan_ger_atecha_n_gesoncash": "int", - "net_income": "int", - "net_incom_ecomm_onstock": "int", - "net_incom_ecomm_onst___ockusd": "int", - "net_los_sinco_mef_romdisconti_nuedoperations": "int", - "net_incom_e_to_noncontrol_linginterests": "int", - "profit_margin": "int", - "operating_expenses": "int", - "operating_income": "int", - "trade_an_dn_ontr_adepayables": "int", - "payout_ratio": "int", - "price_t_obo_okvalue": "int", - "price_earnings": "int", - "price_t_oearnin_gsratio": "int", - "property_plan_tequipme_ntnet": "int", - "preferred_dividend_sinco_mestatem_entimpact": "int", - "share_pric_eadjust_edclose": "int", - "price_sales": "int", - "price_t_osal_esratio": "int", - "trade_an_dn_ontr_adereceivables": "int", - "accumulated_retaine_dearnin_gsdeficit": "int", - "revenues": "int", - "revenues___usd": "int", - "research_an_ddevelopme_ntexpense": "int", - "return_o_navera_geassets": "int", - "return_o_navera_geequity": "int", - "return_o_ninvest_edcapital": "int", - "return_o_nsales": "int", - "share_base_dcompensation": "int", - "selling_genera_la_ndadministrat_iveexpense": "int", - "share_factor": "int", - "shares": "int", - "weighted_averag_eshares": "int", - "weighted_averag_eshar_esdiluted": "int", - "sales_pe_rshare": "int", - "tangible_asse_tvalue": "int", - "tax_assets": "int", - "income_ta_xexpense": "int", - "tax_liabilities": "int", - "tangible_asset_sbo_okva_lu_epershare": "int", - "working_capital": "int", - - } - - def __init__(self): - self.ticker: TickerSymbol - self.period: str - self.calendar_date: str - self.report_period: str - self.updated: str - self.accumulated_othe_rcomprehensi_veincome: int - self.assets: int - self.assets_average: int - self.assets_current: int - self.asset_turnover: int - self.assets_no_ncurrent: int - self.book_valu_ep_ershare: int - self.capital_expenditure: int - self.cash_an_dequivalents: int - self.cash_an_dequivalen___tsusd: int - self.cost_o_frevenue: int - self.consolidated_income: int - self.current_ratio: int - self.debt_t_oequi_tyratio: int - self.debt: int - self.debt_current: int - self.debt_no_ncurrent: int - self.debt___usd: int - self.deferred_revenue: int - self.depreciation_amortizatio_na_ndaccretion: int - self.deposits: int - self.dividend_yield: int - self.dividends_pe_rbas_iccom_monshare: int - self.earning_befor_eintere_sttaxes: int - self.earnings_befor_eintere_stta_xesdeprecia_tionamortization: int - self.e______bitdamargin: int - self.earnings_befor_eintere_stta_xesdeprecia_tionamortiz___ationusd: int - self.earning_befor_eintere_stta___xesusd: int - self.earnings_befor_etax: int - self.earnings_pe_rbas_icshare: int - self.earnings_pe_rdilut_edshare: int - self.earnings_pe_rbas_icsh___areusd: int - self.shareholders_equity: int - self.average_equity: int - self.shareholders_equit___yusd: int - self.enterprise_value: int - self.enterprise_valu_eov____erebit: int - self.enterprise_valu_eov______erebitda: int - self.free_cas_hflow: int - self.free_cas_hfl_ow_pershare: int - self.foreign_currenc____yusdexc_hangerate: int - self.gross_profit: int - self.gross_margin: int - self.goodwill_an_dintangib_leassets: int - self.interest_expense: int - self.invested_capital: int - self.invested_capita_laverage: int - self.inventory: int - self.investments: int - self.investments_current: int - self.investments_no_ncurrent: int - self.total_liabilities: int - self.current_liabilities: int - self.liabilities_no_ncurrent: int - self.market_capitalization: int - self.net_cas_hflow: int - self.net_cas_hfl_owbusin_essacquisit_ionsdisposals: int - self.issuance_equit_yshares: int - self.issuance_deb_tsecurities: int - self.payment_dividend_soth_erc_ashdistributions: int - self.net_cas_hfl_owf_romfinancing: int - self.net_cas_hfl_owf_rominvesting: int - self.net_cas_hfl_owinvestm_entacquisit_ionsdisposals: int - self.net_cas_hfl_owf_romoperations: int - self.effect_o_fexchan_ger_atecha_n_gesoncash: int - self.net_income: int - self.net_incom_ecomm_onstock: int - self.net_incom_ecomm_onst___ockusd: int - self.net_los_sinco_mef_romdisconti_nuedoperations: int - self.net_incom_e_to_noncontrol_linginterests: int - self.profit_margin: int - self.operating_expenses: int - self.operating_income: int - self.trade_an_dn_ontr_adepayables: int - self.payout_ratio: int - self.price_t_obo_okvalue: int - self.price_earnings: int - self.price_t_oearnin_gsratio: int - self.property_plan_tequipme_ntnet: int - self.preferred_dividend_sinco_mestatem_entimpact: int - self.share_pric_eadjust_edclose: int - self.price_sales: int - self.price_t_osal_esratio: int - self.trade_an_dn_ontr_adereceivables: int - self.accumulated_retaine_dearnin_gsdeficit: int - self.revenues: int - self.revenues___usd: int - self.research_an_ddevelopme_ntexpense: int - self.return_o_navera_geassets: int - self.return_o_navera_geequity: int - self.return_o_ninvest_edcapital: int - self.return_o_nsales: int - self.share_base_dcompensation: int - self.selling_genera_la_ndadministrat_iveexpense: int - self.share_factor: int - self.shares: int - self.weighted_averag_eshares: int - self.weighted_averag_eshar_esdiluted: int - self.sales_pe_rshare: int - self.tangible_asse_tvalue: int - self.tax_assets: int - self.income_ta_xexpense: int - self.tax_liabilities: int - self.tangible_asset_sbo_okva_lu_epershare: int - self.working_capital: int - - -# noinspection SpellCheckingInspection -class Trade(Definition): - _swagger_name_to_python = { - "c1": "condition_1_of_this_trade", - "c2": "condition_2_of_this_trade", - "c3": "condition_3_of_this_trade", - "c4": "condition_4_of_this_trade", - "e": "the_exchange_this_trade_happened_on", - "p": "price_of_the_trade", - "s": "size_of_the_trade", - "t": "timestamp_of_this_trade", - - } - - _attribute_is_primitive = { - "condition_1_of_this_trade": True, - "condition_2_of_this_trade": True, - "condition_3_of_this_trade": True, - "condition_4_of_this_trade": True, - "the_exchange_this_trade_happened_on": True, - "price_of_the_trade": True, - "size_of_the_trade": True, - "timestamp_of_this_trade": True, - - } - - _attributes_to_types = { - "condition_1_of_this_trade": "int", - "condition_2_of_this_trade": "int", - "condition_3_of_this_trade": "int", - "condition_4_of_this_trade": "int", - "the_exchange_this_trade_happened_on": "str", - "price_of_the_trade": "int", - "size_of_the_trade": "int", - "timestamp_of_this_trade": "int", - - } - - def __init__(self): - self.condition_1_of_this_trade: int - self.condition_2_of_this_trade: int - self.condition_3_of_this_trade: int - self.condition_4_of_this_trade: int - self.the_exchange_this_trade_happened_on: str - self.price_of_the_trade: int - self.size_of_the_trade: int - self.timestamp_of_this_trade: int - - -# noinspection SpellCheckingInspection -class StocksSnapshotTicker(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "day": "day", - "lastTrade": "last_trade", - "lastQuote": "last_quote", - "min": "min", - "prevDay": "prev_day", - "todaysChange": "todays_change", - "todaysChangePerc": "todays_chang_eperc", - "updated": "updated", - - } - - _attribute_is_primitive = { - "ticker": True, - "day": False, - "last_trade": False, - "last_quote": False, - "min": False, - "prev_day": False, - "todays_change": True, - "todays_chang_eperc": True, - "updated": True, - - } - - _attributes_to_types = { - "ticker": "str", - "day": "StocksSnapshotAgg", - "last_trade": "Trade", - "last_quote": "StocksSnapshotQuote", - "min": "StocksSnapshotAgg", - "prev_day": "StocksSnapshotAgg", - "todays_change": "int", - "todays_chang_eperc": "int", - "updated": "int", - - } - - def __init__(self): - self.ticker: str - self.day: StocksSnapshotAgg - self.last_trade: Trade - self.last_quote: StocksSnapshotQuote - self.min: StocksSnapshotAgg - self.prev_day: StocksSnapshotAgg - self.todays_change: int - self.todays_chang_eperc: int - self.updated: int - - -# noinspection SpellCheckingInspection -class StocksSnapshotBookItem(Definition): - _swagger_name_to_python = { - "p": "price_of_this_book_level", - "x": "exchange_to_size_of_this_price_level", - - } - - _attribute_is_primitive = { - "price_of_this_book_level": True, - "exchange_to_size_of_this_price_level": True, - - } - - _attributes_to_types = { - "price_of_this_book_level": "int", - "exchange_to_size_of_this_price_level": "Dict[str, str]", - - } - - def __init__(self): - self.price_of_this_book_level: int - self.exchange_to_size_of_this_price_level: Dict[str, str] - - -# noinspection SpellCheckingInspection -class StocksSnapshotTickerBook(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "bids": "bids", - "asks": "asks", - "bidCount": "bid_count", - "askCount": "ask_count", - "spread": "spread", - "updated": "updated", - - } - - _attribute_is_primitive = { - "ticker": True, - "bids": False, - "asks": False, - "bid_count": True, - "ask_count": True, - "spread": True, - "updated": True, - - } - - _attributes_to_types = { - "ticker": "str", - "bids": "List[StocksSnapshotBookItem]", - "asks": "List[StocksSnapshotBookItem]", - "bid_count": "int", - "ask_count": "int", - "spread": "int", - "updated": "int", - - } - - def __init__(self): - self.ticker: str - self.bids: List[StocksSnapshotBookItem] - self.asks: List[StocksSnapshotBookItem] - self.bid_count: int - self.ask_count: int - self.spread: int - self.updated: int - - -# noinspection SpellCheckingInspection -class StocksV2Trade(Definition): - _swagger_name_to_python = { - "T": "ticker_of_the_object", - "t": "nanosecond_accuracy_s__ip_unix_timestamp", - "y": "nanosecond_accuracy_participant_exchange_unix_timestamp", - "f": "nanosecond_accuracy_t__rf", - "q": "sequence_number", - "i": "trade_i_d", - "x": "exchange_i_d", - "s": "size_volume_of_the_trade", - "c": "c", - "p": "price_of_the_trade", - "z": "tape_where_trade_occured", - - } - - _attribute_is_primitive = { - "ticker_of_the_object": True, - "nanosecond_accuracy_s__ip_unix_timestamp": True, - "nanosecond_accuracy_participant_exchange_unix_timestamp": True, - "nanosecond_accuracy_t__rf": True, - "sequence_number": True, - "trade_i_d": True, - "exchange_i_d": True, - "size_volume_of_the_trade": True, - "c": False, - "price_of_the_trade": True, - "tape_where_trade_occured": True, - - } - - _attributes_to_types = { - "ticker_of_the_object": "str", - "nanosecond_accuracy_s__ip_unix_timestamp": "int", - "nanosecond_accuracy_participant_exchange_unix_timestamp": "int", - "nanosecond_accuracy_t__rf": "int", - "sequence_number": "int", - "trade_i_d": "str", - "exchange_i_d": "int", - "size_volume_of_the_trade": "int", - "c": "List[int]", - "price_of_the_trade": "int", - "tape_where_trade_occured": "int", - - } - - def __init__(self): - self.ticker_of_the_object: str - self.nanosecond_accuracy_s__ip_unix_timestamp: int - self.nanosecond_accuracy_participant_exchange_unix_timestamp: int - self.nanosecond_accuracy_t__rf: int - self.sequence_number: int - self.trade_i_d: str - self.exchange_i_d: int - self.size_volume_of_the_trade: int - self.c: List[int] - self.price_of_the_trade: int - self.tape_where_trade_occured: int - - -# noinspection SpellCheckingInspection -class StocksV2NBBO(Definition): - _swagger_name_to_python = { - "T": "ticker_of_the_object", - "t": "nanosecond_accuracy_s__ip_unix_timestamp", - "y": "nanosecond_accuracy_participant_exchange_unix_timestamp", - "f": "nanosecond_accuracy_t__rf", - "q": "sequence_number", - "c": "c", - "i": "i", - "p": "b__id_price", - "x": "b__id_exchange__id", - "s": "b__id_size", - "P": "a__sk_price", - "X": "a__sk_exchange__id", - "S": "a__sk_size", - "z": "tape_where_trade_occured", - - } - - _attribute_is_primitive = { - "ticker_of_the_object": True, - "nanosecond_accuracy_s__ip_unix_timestamp": True, - "nanosecond_accuracy_participant_exchange_unix_timestamp": True, - "nanosecond_accuracy_t__rf": True, - "sequence_number": True, - "c": False, - "i": False, - "b__id_price": True, - "b__id_exchange__id": True, - "b__id_size": True, - "a__sk_price": True, - "a__sk_exchange__id": True, - "a__sk_size": True, - "tape_where_trade_occured": True, - - } - - _attributes_to_types = { - "ticker_of_the_object": "str", - "nanosecond_accuracy_s__ip_unix_timestamp": "int", - "nanosecond_accuracy_participant_exchange_unix_timestamp": "int", - "nanosecond_accuracy_t__rf": "int", - "sequence_number": "int", - "c": "List[int]", - "i": "List[int]", - "b__id_price": "int", - "b__id_exchange__id": "int", - "b__id_size": "int", - "a__sk_price": "int", - "a__sk_exchange__id": "int", - "a__sk_size": "int", - "tape_where_trade_occured": "int", - - } - - def __init__(self): - self.ticker_of_the_object: str - self.nanosecond_accuracy_s__ip_unix_timestamp: int - self.nanosecond_accuracy_participant_exchange_unix_timestamp: int - self.nanosecond_accuracy_t__rf: int - self.sequence_number: int - self.c: List[int] - self.i: List[int] - self.b__id_price: int - self.b__id_exchange__id: int - self.b__id_size: int - self.a__sk_price: int - self.a__sk_exchange__id: int - self.a__sk_size: int - self.tape_where_trade_occured: int - - -# noinspection SpellCheckingInspection -class StocksSnapshotAgg(Definition): - _swagger_name_to_python = { - "c": "close_price", - "h": "high_price", - "l": "low_price", - "o": "open_price", - "v": "volume", - - } - - _attribute_is_primitive = { - "close_price": True, - "high_price": True, - "low_price": True, - "open_price": True, - "volume": True, - - } - - _attributes_to_types = { - "close_price": "int", - "high_price": "int", - "low_price": "int", - "open_price": "int", - "volume": "int", - - } - - def __init__(self): - self.close_price: int - self.high_price: int - self.low_price: int - self.open_price: int - self.volume: int - - -# noinspection SpellCheckingInspection -class StocksSnapshotQuote(Definition): - _swagger_name_to_python = { - "p": "bid_price", - "s": "bid_size_in_lots", - "P": "ask_price", - "S": "ask_size_in_lots", - "t": "last_updated_timestamp", - - } - - _attribute_is_primitive = { - "bid_price": True, - "bid_size_in_lots": True, - "ask_price": True, - "ask_size_in_lots": True, - "last_updated_timestamp": True, - - } - - _attributes_to_types = { - "bid_price": "int", - "bid_size_in_lots": "int", - "ask_price": "int", - "ask_size_in_lots": "int", - "last_updated_timestamp": "int", - - } - - def __init__(self): - self.bid_price: int - self.bid_size_in_lots: int - self.ask_price: int - self.ask_size_in_lots: int - self.last_updated_timestamp: int - - -# noinspection SpellCheckingInspection -class Aggv2(Definition): - _swagger_name_to_python = { - "T": "ticker_symbol", - "v": "volume", - "o": "open", - "c": "close", - "h": "high", - "l": "low", - "t": "unix_msec_timestamp", - "n": "number_of_items_in_aggregate_window", - - } - - _attribute_is_primitive = { - "ticker_symbol": True, - "volume": True, - "open": True, - "close": True, - "high": True, - "low": True, - "unix_msec_timestamp": True, - "number_of_items_in_aggregate_window": True, - - } - - _attributes_to_types = { - "ticker_symbol": "str", - "volume": "int", - "open": "int", - "close": "int", - "high": "int", - "low": "int", - "unix_msec_timestamp": "float", - "number_of_items_in_aggregate_window": "float", - - } - - def __init__(self): - self.ticker_symbol: str - self.volume: int - self.open: int - self.close: int - self.high: int - self.low: int - self.unix_msec_timestamp: float - self.number_of_items_in_aggregate_window: float - - -# noinspection SpellCheckingInspection -class AggResponse(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "status": "status", - "adjusted": "adjusted", - "queryCount": "query_count", - "resultsCount": "results_count", - "results": "results", - - } - - _attribute_is_primitive = { - "ticker": True, - "status": True, - "adjusted": True, - "query_count": True, - "results_count": True, - "results": False, - - } - - _attributes_to_types = { - "ticker": "str", - "status": "str", - "adjusted": "bool", - "query_count": "float", - "results_count": "float", - "results": "List[Aggv2]", - - } - - def __init__(self): - self.ticker: str - self.status: str - self.adjusted: bool - self.query_count: float - self.results_count: float - self.results: List[Aggv2] - - -# noinspection SpellCheckingInspection -class ReferenceTickersApiResponse(Definition): - _swagger_name_to_python = { - "symbol": "symbol", - - } - - _attribute_is_primitive = { - "symbol": False, - - } - - _attributes_to_types = { - "symbol": "List[Symbol]", - - } - - def __init__(self): - self.symbol: List[Symbol] - - -# noinspection SpellCheckingInspection -class ReferenceTickersV3ApiResponse(Definition): - _swagger_name_to_python = { - "results": "results", - "status": "status", - "count": "count", - "next_url": "next_url", - } - - _attribute_is_primitive = { - "results": False, - "status": True, - "count": True, - "next_url": True, - } - - _attributes_to_types = { - "results": "List[SymbolV3]", - "status": "str", - "count": "float", - "next_url": "str", - } - - def __init__(self): - self.results: List[SymbolV3] - self.status: str - self.count: float - self.next_url: str - - -# noinspection SpellCheckingInspection -class ReferenceTickerTypesApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "results": "results", - - } - - _attribute_is_primitive = { - "status": True, - "results": True, - - } - - _attributes_to_types = { - "status": "str", - "results": "Dict[str, str]", - - } - - def __init__(self): - self.status: str - self.results: Dict[str, str] - - -# noinspection SpellCheckingInspection -class ReferenceTickerDetailsApiResponse(Definition): - _swagger_name_to_python = { - "company": "company", - - } - - _attribute_is_primitive = { - "company": False, - - } - - _attributes_to_types = { - "company": "Company", - - } - - def __init__(self): - self.company: Company - - -# noinspection SpellCheckingInspection -class ReferenceTickerDetailsV3ApiResponse(Definition): - _swagger_name_to_python = { - "results": "results", - "status": "status", - "count": "count", - } - - _attribute_is_primitive = { - "results": False, - "status": True, - "count": True, - } - - _attributes_to_types = { - "results": "List[CompanyV3]", - "status": "str", - "count": "float", - } - - def __init__(self): - self.results: List[CompanyV3] - self.status: str - self.count: float - - -# noinspection SpellCheckingInspection -class ReferenceTickerNewsApiResponse(Definition): - _swagger_name_to_python = { - "news": "news", - - } - - _attribute_is_primitive = { - "news": False, - - } - - _attributes_to_types = { - "news": "List[News]", - - } - - def __init__(self): - self.news: List[News] - - -# noinspection SpellCheckingInspection -class ReferenceTickerNewsV2ApiResponse(Definition): - _swagger_name_to_python = { - "results": "results", - "next_url": "next_url", - "status": "status", - "count": "count", - } - - _attribute_is_primitive = { - "results": False, - "next_url": True, - "status": True, - "count": True, - } - - _attributes_to_types = { - "results": "List[NewsV2]", - "next_url": "str", - "status": "str", - "count": "float", - } - - def __init__(self): - self.results: List[NewsV2] - self.next_url: str - self.status: str - self.count: float - - -# noinspection SpellCheckingInspection -class ReferenceMarketsApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "results": "results", - - } - - _attribute_is_primitive = { - "status": True, - "results": False, - - } - - _attributes_to_types = { - "status": "str", - "results": "List[Dict[str, str]]", - - } - - def __init__(self): - self.status: str - self.results: List[Dict[str, str]] - - -# noinspection SpellCheckingInspection -class ReferenceLocalesApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "results": "results", - - } - - _attribute_is_primitive = { - "status": True, - "results": False, - - } - - _attributes_to_types = { - "status": "str", - "results": "List[Dict[str, str]]", - - } - - def __init__(self): - self.status: str - self.results: List[Dict[str, str]] - - -# noinspection SpellCheckingInspection -class ReferenceStockSplitsApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "count": "count", - "results": "results", - - } - - _attribute_is_primitive = { - "status": True, - "count": True, - "results": False, - - } - - _attributes_to_types = { - "status": "str", - "count": "float", - "results": "List[Split]", - - } - - def __init__(self): - self.status: str - self.count: float - self.results: List[Split] - - -# noinspection SpellCheckingInspection -class ReferenceStockDividendsApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "count": "count", - "results": "results", - - } - - _attribute_is_primitive = { - "status": True, - "count": True, - "results": False, - - } - - _attributes_to_types = { - "status": "str", - "count": "float", - "results": "List[Dividend]", - - } - - def __init__(self): - self.status: str - self.count: float - self.results: List[Dividend] - - -# noinspection SpellCheckingInspection -class ReferenceStockFinancialsApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "count": "count", - "results": "results", - - } - - _attribute_is_primitive = { - "status": True, - "count": True, - "results": False, - - } - - _attributes_to_types = { - "status": "str", - "count": "float", - "results": "List[Financials]", - - } - - def __init__(self): - self.status: str - self.count: float - self.results: List[Financials] - - -# noinspection SpellCheckingInspection -class ReferenceMarketStatusApiResponse(Definition): - _swagger_name_to_python = { - "marketstatus": "marketstatus", - - } - - _attribute_is_primitive = { - "marketstatus": False, - - } - - _attributes_to_types = { - "marketstatus": "MarketStatus", - - } - - def __init__(self): - self.marketstatus: MarketStatus - - -# noinspection SpellCheckingInspection -class ReferenceMarketHolidaysApiResponse(Definition): - _swagger_name_to_python = { - "marketholiday": "marketholiday", - - } - - _attribute_is_primitive = { - "marketholiday": False, - - } - - _attributes_to_types = { - "marketholiday": "List[MarketHoliday]", - - } - - def __init__(self): - self.marketholiday: List[MarketHoliday] - - -# noinspection SpellCheckingInspection -class StocksEquitiesExchangesApiResponse(Definition): - _swagger_name_to_python = { - "exchange": "exchange", - - } - - _attribute_is_primitive = { - "exchange": False, - - } - - _attributes_to_types = { - "exchange": "List[Exchange]", - - } - - def __init__(self): - self.exchange: List[Exchange] - - -# noinspection SpellCheckingInspection -class StocksEquitiesHistoricTradesApiResponse(Definition): - _swagger_name_to_python = { - "day": "day", - "map": "map", - "msLatency": "ms_latency", - "status": "status", - "symbol": "symbol", - "ticks": "ticks", - - } - - _attribute_is_primitive = { - "day": True, - "map": True, - "ms_latency": True, - "status": True, - "symbol": True, - "ticks": False, - - } - - _attributes_to_types = { - "day": "str", - "map": "Dict[str, str]", - "ms_latency": "int", - "status": "str", - "symbol": "str", - "ticks": "List[Trade]", - - } - - def __init__(self): - self.day: str - self.map: Dict[str, str] - self.ms_latency: int - self.status: str - self.symbol: str - self.ticks: List[Trade] - - -# noinspection SpellCheckingInspection -class HistoricTradesV2ApiResponse(Definition): - _swagger_name_to_python = { - "results_count": "results_count", - "db_latency": "db_latency", - "success": "success", - "ticker": "ticker", - "results": "results", - - } - - _attribute_is_primitive = { - "results_count": True, - "db_latency": True, - "success": True, - "ticker": True, - "results": False, - - } - - _attributes_to_types = { - "results_count": "int", - "db_latency": "int", - "success": "bool", - "ticker": "str", - "results": "List[StocksV2Trade]", - - } - - def __init__(self): - self.results_count: int - self.db_latency: int - self.success: bool - self.ticker: str - self.results: List[StocksV2Trade] - - -# noinspection SpellCheckingInspection -class StocksEquitiesHistoricQuotesApiResponse(Definition): - _swagger_name_to_python = { - "day": "day", - "map": "map", - "msLatency": "ms_latency", - "status": "status", - "symbol": "symbol", - "ticks": "ticks", - - } - - _attribute_is_primitive = { - "day": True, - "map": True, - "ms_latency": True, - "status": True, - "symbol": True, - "ticks": False, - - } - - _attributes_to_types = { - "day": "str", - "map": "Dict[str, str]", - "ms_latency": "int", - "status": "str", - "symbol": "str", - "ticks": "List[Quote]", - - } - - def __init__(self): - self.day: str - self.map: Dict[str, str] - self.ms_latency: int - self.status: str - self.symbol: str - self.ticks: List[Quote] - - -# noinspection SpellCheckingInspection -class HistoricNBboQuotesV2ApiResponse(Definition): - _swagger_name_to_python = { - "results_count": "results_count", - "db_latency": "db_latency", - "success": "success", - "ticker": "ticker", - "results": "results", - - } - - _attribute_is_primitive = { - "results_count": True, - "db_latency": True, - "success": True, - "ticker": True, - "results": False, - - } - - _attributes_to_types = { - "results_count": "int", - "db_latency": "int", - "success": "bool", - "ticker": "str", - "results": "List[StocksV2NBBO]", - - } - - def __init__(self): - self.results_count: int - self.db_latency: int - self.success: bool - self.ticker: str - self.results: List[StocksV2NBBO] - - -# noinspection SpellCheckingInspection -class StocksEquitiesLastTradeForASymbolApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "symbol": "symbol", - "last": "last", - - } - - _attribute_is_primitive = { - "status": True, - "symbol": True, - "last": False, - - } - - _attributes_to_types = { - "status": "str", - "symbol": "str", - "last": "LastTrade", - - } - - def __init__(self): - self.status: str - self.symbol: str - self.last: LastTrade - - -# noinspection SpellCheckingInspection -class StocksEquitiesLastQuoteForASymbolApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "symbol": "symbol", - "last": "last", - - } - - _attribute_is_primitive = { - "status": True, - "symbol": True, - "last": False, - - } - - _attributes_to_types = { - "status": "str", - "symbol": "str", - "last": "LastQuote", - - } - - def __init__(self): - self.status: str - self.symbol: str - self.last: LastQuote - - -# noinspection SpellCheckingInspection -class StocksEquitiesDailyOpenCloseApiResponse(Definition): - _swagger_name_to_python = { - "from": "from_", - "symbol": "symbol", - "open": "open", - "high": "high", - "low": "low", - "close": "close", - "volume": "volume", - "afterHours": "after_hours", - "preMarket": "pre_market", - } - - _attribute_is_primitive = { - "from_": True, - "symbol": True, - "open": True, - "high": True, - "low": True, - "close": True, - "volume": True, - "after_hours": True, - "pre_market": True, - } - - _attributes_to_types = { - "from_": "str", - "symbol": "str", - "open": "float", - "high": "float", - "low": "float", - "close": "float", - "volume": "float", - "after_hours": "float", - "pre_market": "float", - } - - def __init__(self): - self.from_: str - self.symbol: str - self.open: float - self.high: float - self.low: float - self.close: float - self.volume: float - self.after_hours: float - self.pre_market: float - - -# noinspection SpellCheckingInspection -class StocksEquitiesConditionMappingsApiResponse(Definition): - _swagger_name_to_python = { - "conditiontypemap": "conditiontypemap", - - } - - _attribute_is_primitive = { - "conditiontypemap": False, - - } - - _attributes_to_types = { - "conditiontypemap": "ConditionTypeMap", - - } - - def __init__(self): - self.conditiontypemap: ConditionTypeMap - - -# noinspection SpellCheckingInspection -class StocksEquitiesSnapshotAllTickersApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "tickers": "tickers", - - } - - _attribute_is_primitive = { - "status": True, - "tickers": False, - - } - - _attributes_to_types = { - "status": "str", - "tickers": "List[StocksSnapshotTicker]", - - } - - def __init__(self): - self.status: str - self.tickers: List[StocksSnapshotTicker] - - -# noinspection SpellCheckingInspection -class StocksEquitiesSnapshotSingleTickerApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "ticker": "ticker", - - } - - _attribute_is_primitive = { - "status": True, - "ticker": False, - - } - - _attributes_to_types = { - "status": "str", - "ticker": "StocksSnapshotTicker", - - } - - def __init__(self): - self.status: str - self.ticker: StocksSnapshotTicker - - -# noinspection SpellCheckingInspection -class StocksEquitiesSnapshotGainersLosersApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "tickers": "tickers", - - } - - _attribute_is_primitive = { - "status": True, - "tickers": False, - - } - - _attributes_to_types = { - "status": "str", - "tickers": "List[StocksSnapshotTicker]", - - } - - def __init__(self): - self.status: str - self.tickers: List[StocksSnapshotTicker] - - -# noinspection SpellCheckingInspection -class StocksEquitiesPreviousCloseApiResponse(Definition): - _swagger_name_to_python = { - "aggresponse": "aggresponse", - - } - - _attribute_is_primitive = { - "aggresponse": False, - - } - - _attributes_to_types = { - "aggresponse": "AggResponse", - - } - - def __init__(self): - self.aggresponse: AggResponse - - -# noinspection SpellCheckingInspection -class StocksEquitiesAggregatesApiResponse(Definition): - _swagger_name_to_python = { - "aggresponse": "aggresponse", - - } - - _attribute_is_primitive = { - "aggresponse": False, - - } - - _attributes_to_types = { - "aggresponse": "AggResponse", - - } - - def __init__(self): - self.aggresponse: AggResponse - - -# noinspection SpellCheckingInspection -class StocksEquitiesGroupedDailyApiResponse(Definition): - _swagger_name_to_python = { - "aggresponse": "aggresponse", - - } - - _attribute_is_primitive = { - "aggresponse": False, - - } - - _attributes_to_types = { - "aggresponse": "AggResponse", - - } - - def __init__(self): - self.aggresponse: AggResponse - - -# noinspection SpellCheckingInspection -class CurrenciesAggregatesApiResponse(Definition): - _swagger_name_to_python = { - "aggresponse": "aggresponse", - - } - - _attribute_is_primitive = { - "aggresponse": False, - - } - - _attributes_to_types = { - "aggresponse": "AggResponse", - - } - - def __init__(self): - self.aggresponse: AggResponse - -# noinspection SpellCheckingInspection -class ForexCurrenciesHistoricForexTicksApiResponse(Definition): - _swagger_name_to_python = { - "day": "day", - "map": "map", - "msLatency": "ms_latency", - "status": "status", - "pair": "pair", - "ticks": "ticks", - - } - - _attribute_is_primitive = { - "day": True, - "map": True, - "ms_latency": True, - "status": True, - "pair": True, - "ticks": False, - - } - - _attributes_to_types = { - "day": "str", - "map": "Dict[str, str]", - "ms_latency": "int", - "status": "str", - "pair": "str", - "ticks": "List[Forex]", - - } - - def __init__(self): - self.day: str - self.map: Dict[str, str] - self.ms_latency: int - self.status: str - self.pair: str - self.ticks: List[Forex] - - -# noinspection SpellCheckingInspection -class ForexCurrenciesRealTimeCurrencyConversionApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "from": "from_", - "to": "to_currency_symbol", - "initialAmount": "initial_amount", - "converted": "converted", - "lastTrade": "last_trade", - "symbol": "symbol", - - } - - _attribute_is_primitive = { - "status": True, - "from_": True, - "to_currency_symbol": True, - "initial_amount": True, - "converted": True, - "last_trade": False, - "symbol": True, - - } - - _attributes_to_types = { - "status": "str", - "from_": "str", - "to_currency_symbol": "str", - "initial_amount": "float", - "converted": "float", - "last_trade": "LastForexTrade", - "symbol": "str", - - } - - def __init__(self): - self.status: str - self.from_: str - self.to_currency_symbol: str - self.initial_amount: float - self.converted: float - self.last_trade: LastForexTrade - self.symbol: str - - -# noinspection SpellCheckingInspection -class ForexCurrenciesLastQuoteForACurrencyPairApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "symbol": "symbol", - "last": "last", - - } - - _attribute_is_primitive = { - "status": True, - "symbol": True, - "last": False, - - } - - _attributes_to_types = { - "status": "str", - "symbol": "str", - "last": "LastForexQuote", - - } - - def __init__(self): - self.status: str - self.symbol: str - self.last: LastForexQuote - - -# noinspection SpellCheckingInspection -class ForexCurrenciesGroupedDailyApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "adjusted": "adjusted", - "queryCount": "queryCount", - "resultsCount": "resultsCount", - "results": "results", - } - - _attribute_is_primitive = { - "status": True, - "adjusted": True, - "queryCount": True, - "resultsCount": True, - "results": False, - } - - _attributes_to_types = { - "status": "str", - "adjusted": "bool", - "queryCount": "int", - "resultsCount": "int", - "results": "List[Aggv2]" - } - - def __init__(self): - self.status: str - self.adjusted: bool - self.queryCount: int - self.resultsCount: int - self.results: List[Aggv2] - - -# noinspection SpellCheckingInspection -class ForexCurrenciesPreviousCloseApiResponse(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "status": "status", - "adjusted": "adjusted", - "queryCount": "queryCount", - "resultsCount": "resultsCount", - "results": "results", - } - - _attribute_is_primitive = { - "ticker": True, - "status": True, - "adjusted": True, - "queryCount": True, - "resultsCount": True, - "results": False, - } - - _attributes_to_types = { - "ticker": "str", - "status": "str", - "adjusted": "bool", - "queryCount": "int", - "resultsCount": "int", - "results": "List[Aggv2]" - } - - def __init__(self): - self.ticker: str - self.status: str - self.adjusted: bool - self.queryCount: int - self.resultsCount: int - self.results: List[Aggv2] - - -# noinspection SpellCheckingInspection -class ForexCurrenciesSnapshotAllTickersApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "tickers": "tickers", - - } - - _attribute_is_primitive = { - "status": True, - "tickers": False, - - } - - _attributes_to_types = { - "status": "str", - "tickers": "List[ForexSnapshotTicker]", - - } - - def __init__(self): - self.status: str - self.tickers: List[ForexSnapshotTicker] - - -# noinspection SpellCheckingInspection -class ForexCurrenciesSnapshotSingleTickerApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "ticker": "ticker", - } - - _attribute_is_primitive = { - "status": True, - "ticker": False, - } - - _attributes_to_types = { - "status": "str", - "ticker": "ForexSnapshotTicker", - } - - def __init__(self): - self.status: str - self.ticker: ForexSnapshotTicker - - -# noinspection SpellCheckingInspection -class ForexCurrenciesSnapshotGainersLosersApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "tickers": "tickers", - - } - - _attribute_is_primitive = { - "status": True, - "tickers": False, - - } - - _attributes_to_types = { - "status": "str", - "tickers": "List[ForexSnapshotTicker]", - - } - - def __init__(self): - self.status: str - self.tickers: List[ForexSnapshotTicker] - - -# noinspection SpellCheckingInspection -class CryptoCryptoExchangesApiResponse(Definition): - _swagger_name_to_python = { - "cryptoexchange": "cryptoexchange", - - } - - _attribute_is_primitive = { - "cryptoexchange": False, - - } - - _attributes_to_types = { - "cryptoexchange": "List[CryptoExchange]", - - } - - def __init__(self): - self.cryptoexchange: List[CryptoExchange] - - -# noinspection SpellCheckingInspection -class CryptoLastTradeForACryptoPairApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "symbol": "symbol", - "last": "last", - "lastAverage": "last_average", - - } - - _attribute_is_primitive = { - "status": True, - "symbol": True, - "last": False, - "last_average": True, - - } - - _attributes_to_types = { - "status": "str", - "symbol": "str", - "last": "CryptoTick", - "last_average": "Dict[str, str]", - - } - - def __init__(self): - self.status: str - self.symbol: str - self.last: CryptoTick - self.last_average: Dict[str, str] - - -# noinspection SpellCheckingInspection -class CryptoDailyOpenCloseApiResponse(Definition): - _swagger_name_to_python = { - "symbol": "symbol", - "isUTC": "is___utc", - "day": "day", - "open": "open", - "close": "close", - "openTrades": "open_trades", - "closingTrades": "closing_trades", - - } - - _attribute_is_primitive = { - "symbol": True, - "is___utc": True, - "day": True, - "open": True, - "close": True, - "open_trades": False, - "closing_trades": False, - - } - - _attributes_to_types = { - "symbol": "str", - "is___utc": "bool", - "day": "str", - "open": "int", - "close": "int", - "open_trades": "List[CryptoTickJson]", - "closing_trades": "List[CryptoTickJson]", - - } - - def __init__(self): - self.symbol: str - self.is___utc: bool - self.day: str - self.open: int - self.close: int - self.open_trades: List[CryptoTickJson] - self.closing_trades: List[CryptoTickJson] - - -# noinspection SpellCheckingInspection -class CryptoHistoricCryptoTradesApiResponse(Definition): - _swagger_name_to_python = { - "day": "day", - "map": "map", - "msLatency": "ms_latency", - "status": "status", - "symbol": "symbol", - "ticks": "ticks", - - } - - _attribute_is_primitive = { - "day": True, - "map": True, - "ms_latency": True, - "status": True, - "symbol": True, - "ticks": False, - - } - - _attributes_to_types = { - "day": "str", - "map": "Dict[str, str]", - "ms_latency": "int", - "status": "str", - "symbol": "str", - "ticks": "List[CryptoTickJson]", - - } - - def __init__(self): - self.day: str - self.map: Dict[str, str] - self.ms_latency: int - self.status: str - self.symbol: str - self.ticks: List[CryptoTickJson] - - -# noinspection SpellCheckingInspection -class CryptoGroupedDailyApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "adjusted": "adjusted", - "queryCount": "queryCount", - "resultsCount": "resultsCount", - "results": "results", - } - - _attribute_is_primitive = { - "status": True, - "adjusted": True, - "queryCount": True, - "resultsCount": True, - "results": False, - } - - _attributes_to_types = { - "status": "str", - "adjusted": "bool", - "queryCount": "int", - "resultsCount": "int", - "results": "List[Aggv2]" - } - - def __init__(self): - self.status: str - self.adjusted: bool - self.queryCount: int - self.resultsCount: int - self.results: List[Aggv2] - - -# noinspection SpellCheckingInspection -class CryptoPreviousCloseApiResponse(Definition): - _swagger_name_to_python = { - "ticker": "ticker", - "status": "status", - "adjusted": "adjusted", - "queryCount": "queryCount", - "resultsCount": "resultsCount", - "results": "results", - } - - _attribute_is_primitive = { - "ticker": True, - "status": True, - "adjusted": True, - "queryCount": True, - "resultsCount": True, - "results": False, - } - - _attributes_to_types = { - "ticker": "str", - "status": "str", - "adjusted": "bool", - "queryCount": "int", - "resultsCount": "int", - "results": "List[Aggv2]" - } - - def __init__(self): - self.ticker: str - self.status: str - self.adjusted: bool - self.queryCount: int - self.resultsCount: int - self.results: List[Aggv2] - -# noinspection SpellCheckingInspection -class CryptoSnapshotAllTickersApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "tickers": "tickers", - - } - - _attribute_is_primitive = { - "status": True, - "tickers": False, - - } - - _attributes_to_types = { - "status": "str", - "tickers": "List[CryptoSnapshotTicker]", - - } - - def __init__(self): - self.status: str - self.tickers: List[CryptoSnapshotTicker] - - -# noinspection SpellCheckingInspection -class CryptoSnapshotSingleTickerApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "ticker": "ticker", - - } - - _attribute_is_primitive = { - "status": True, - "ticker": False, - - } - - _attributes_to_types = { - "status": "str", - "ticker": "CryptoSnapshotTicker", - - } - - def __init__(self): - self.status: str - self.ticker: CryptoSnapshotTicker - - -# noinspection SpellCheckingInspection -class CryptoSnapshotSingleTickerFullBookApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "data": "data", - - } - - _attribute_is_primitive = { - "status": True, - "data": False, - - } - - _attributes_to_types = { - "status": "str", - "data": "CryptoSnapshotTickerBook", - - } - - def __init__(self): - self.status: str - self.data: CryptoSnapshotTickerBook - - -# noinspection SpellCheckingInspection -class CryptoSnapshotGainersLosersApiResponse(Definition): - _swagger_name_to_python = { - "status": "status", - "tickers": "tickers", - - } - - _attribute_is_primitive = { - "status": True, - "tickers": False, - - } - - _attributes_to_types = { - "status": "str", - "tickers": "List[CryptoSnapshotTicker]", - - } - - def __init__(self): - self.status: str - self.tickers: List[CryptoSnapshotTicker] - - -StockSymbol = str -ConditionTypeMap = Dict[str, str] -SymbolTypeMap = Dict[str, str] -TickerSymbol = str diff --git a/polygon/rest/models/dividends.py b/polygon/rest/models/dividends.py new file mode 100644 index 00000000..68db98a9 --- /dev/null +++ b/polygon/rest/models/dividends.py @@ -0,0 +1,21 @@ +from typing import Optional +from ...modelclass import modelclass + + +@modelclass +class Dividend: + "Dividend contains data for a historical cash dividend, including the ticker symbol, declaration date, ex-dividend date, record date, pay date, frequency, and amount." + id: Optional[int] = None + cash_amount: Optional[float] = None + currency: Optional[str] = None + declaration_date: Optional[str] = None + dividend_type: Optional[str] = None + ex_dividend_date: Optional[str] = None + frequency: Optional[int] = None + pay_date: Optional[str] = None + record_date: Optional[str] = None + ticker: Optional[str] = None + + @staticmethod + def from_dict(d): + return Dividend(**d) diff --git a/polygon/rest/models/exchanges.py b/polygon/rest/models/exchanges.py new file mode 100644 index 00000000..cd93a7d9 --- /dev/null +++ b/polygon/rest/models/exchanges.py @@ -0,0 +1,21 @@ +from typing import Optional +from ...modelclass import modelclass + + +@modelclass +class Exchange: + "Exchange contains data for a condition that Polygon.io uses." + acronym: Optional[str] = None + asset_class: Optional[str] = None + id: Optional[int] = None + locale: Optional[str] = None + mic: Optional[str] = None + name: Optional[str] = None + operating_mic: Optional[str] = None + participant_id: Optional[str] = None + type: Optional[str] = None + url: Optional[str] = None + + @staticmethod + def from_dict(d): + return Exchange(**d) diff --git a/polygon/rest/models/financials.py b/polygon/rest/models/financials.py new file mode 100644 index 00000000..5443e4f6 --- /dev/null +++ b/polygon/rest/models/financials.py @@ -0,0 +1,527 @@ +from dataclasses import dataclass +from typing import Any, Dict, List, Optional +from ...modelclass import modelclass + + +@modelclass +@dataclass +class DataPoint: + """Represents a single numeric or textual data point in the financials.""" + + label: Optional[str] = None + order: Optional[int] = None + unit: Optional[str] = None + value: Optional[float] = None + derived_from: Optional[List[str]] = None + formula: Optional[str] = None + source: Optional[Dict[str, str]] = None + xpath: Optional[str] = None + + @staticmethod + def from_dict(d: Optional[Dict[str, Any]]) -> "DataPoint": + if not d: + return DataPoint() + return DataPoint( + label=d.get("label"), + order=d.get("order"), + unit=d.get("unit"), + value=d.get("value"), + derived_from=d.get("derived_from"), + formula=d.get("formula"), + source=d.get("source"), + xpath=d.get("xpath"), + ) + + +@dataclass +@modelclass +class BalanceSheet: + assets: Optional[DataPoint] = None + current_assets: Optional[DataPoint] = None + cash: Optional[DataPoint] = None + accounts_receivable: Optional[DataPoint] = None + inventory: Optional[DataPoint] = None + prepaid_expenses: Optional[DataPoint] = None + other_current_assets: Optional[DataPoint] = None + noncurrent_assets: Optional[DataPoint] = None + long_term_investments: Optional[DataPoint] = None + fixed_assets: Optional[DataPoint] = None + intangible_assets: Optional[DataPoint] = None + noncurrent_prepaid_expense: Optional[DataPoint] = None + other_noncurrent_assets: Optional[DataPoint] = None + liabilities: Optional[DataPoint] = None + current_liabilities: Optional[DataPoint] = None + accounts_payable: Optional[DataPoint] = None + interest_payable: Optional[DataPoint] = None + wages: Optional[DataPoint] = None + other_current_liabilities: Optional[DataPoint] = None + noncurrent_liabilities: Optional[DataPoint] = None + long_term_debt: Optional[DataPoint] = None + other_noncurrent_liabilities: Optional[DataPoint] = None + commitments_and_contingencies: Optional[DataPoint] = None + redeemable_noncontrolling_interest: Optional[DataPoint] = None + redeemable_noncontrolling_interest_common: Optional[DataPoint] = None + redeemable_noncontrolling_interest_other: Optional[DataPoint] = None + redeemable_noncontrolling_interest_preferred: Optional[DataPoint] = None + equity: Optional[DataPoint] = None + equity_attributable_to_noncontrolling_interest: Optional[DataPoint] = None + equity_attributable_to_parent: Optional[DataPoint] = None + temporary_equity: Optional[DataPoint] = None + temporary_equity_attributable_to_parent: Optional[DataPoint] = None + liabilities_and_equity: Optional[DataPoint] = None + + @staticmethod + def from_dict(d: Optional[Dict[str, Any]]) -> "BalanceSheet": + if not d: + return BalanceSheet() + return BalanceSheet( + assets=DataPoint.from_dict(d.get("assets")), + current_assets=DataPoint.from_dict(d.get("current_assets")), + cash=DataPoint.from_dict(d.get("cash")), + accounts_receivable=DataPoint.from_dict(d.get("accounts_receivable")), + inventory=DataPoint.from_dict(d.get("inventory")), + prepaid_expenses=DataPoint.from_dict(d.get("prepaid_expenses")), + other_current_assets=DataPoint.from_dict(d.get("other_current_assets")), + noncurrent_assets=DataPoint.from_dict(d.get("noncurrent_assets")), + long_term_investments=DataPoint.from_dict(d.get("long_term_investments")), + fixed_assets=DataPoint.from_dict(d.get("fixed_assets")), + intangible_assets=DataPoint.from_dict(d.get("intangible_assets")), + noncurrent_prepaid_expense=DataPoint.from_dict( + d.get("noncurrent_prepaid_expense") + ), + other_noncurrent_assets=DataPoint.from_dict( + d.get("other_noncurrent_assets") + ), + liabilities=DataPoint.from_dict(d.get("liabilities")), + current_liabilities=DataPoint.from_dict(d.get("current_liabilities")), + accounts_payable=DataPoint.from_dict(d.get("accounts_payable")), + interest_payable=DataPoint.from_dict(d.get("interest_payable")), + wages=DataPoint.from_dict(d.get("wages")), + other_current_liabilities=DataPoint.from_dict( + d.get("other_current_liabilities") + ), + noncurrent_liabilities=DataPoint.from_dict(d.get("noncurrent_liabilities")), + long_term_debt=DataPoint.from_dict(d.get("long_term_debt")), + other_noncurrent_liabilities=DataPoint.from_dict( + d.get("other_noncurrent_liabilities") + ), + commitments_and_contingencies=DataPoint.from_dict( + d.get("commitments_and_contingencies") + ), + redeemable_noncontrolling_interest=DataPoint.from_dict( + d.get("redeemable_noncontrolling_interest") + ), + redeemable_noncontrolling_interest_common=DataPoint.from_dict( + d.get("redeemable_noncontrolling_interest_common") + ), + redeemable_noncontrolling_interest_other=DataPoint.from_dict( + d.get("redeemable_noncontrolling_interest_other") + ), + redeemable_noncontrolling_interest_preferred=DataPoint.from_dict( + d.get("redeemable_noncontrolling_interest_preferred") + ), + equity=DataPoint.from_dict(d.get("equity")), + equity_attributable_to_noncontrolling_interest=DataPoint.from_dict( + d.get("equity_attributable_to_noncontrolling_interest") + ), + equity_attributable_to_parent=DataPoint.from_dict( + d.get("equity_attributable_to_parent") + ), + temporary_equity=DataPoint.from_dict(d.get("temporary_equity")), + temporary_equity_attributable_to_parent=DataPoint.from_dict( + d.get("temporary_equity_attributable_to_parent") + ), + liabilities_and_equity=DataPoint.from_dict(d.get("liabilities_and_equity")), + ) + + +@dataclass +@modelclass +class CashFlowStatement: + net_cash_flow_from_operating_activities: Optional[DataPoint] = None + net_cash_flow_from_operating_activities_continuing: Optional[DataPoint] = None + net_cash_flow_from_operating_activities_discontinued: Optional[DataPoint] = None + net_cash_flow_from_investing_activities: Optional[DataPoint] = None + net_cash_flow_from_investing_activities_continuing: Optional[DataPoint] = None + net_cash_flow_from_investing_activities_discontinued: Optional[DataPoint] = None + net_cash_flow_from_financing_activities: Optional[DataPoint] = None + net_cash_flow_from_financing_activities_continuing: Optional[DataPoint] = None + net_cash_flow_from_financing_activities_discontinued: Optional[DataPoint] = None + exchange_gains_losses: Optional[DataPoint] = None + net_cash_flow: Optional[DataPoint] = None + net_cash_flow_continuing: Optional[DataPoint] = None + net_cash_flow_discontinued: Optional[DataPoint] = None + + @staticmethod + def from_dict(d: Optional[Dict[str, Any]]) -> "CashFlowStatement": + if not d: + return CashFlowStatement() + return CashFlowStatement( + net_cash_flow_from_operating_activities=DataPoint.from_dict( + d.get("net_cash_flow_from_operating_activities") + ), + net_cash_flow_from_operating_activities_continuing=DataPoint.from_dict( + d.get("net_cash_flow_from_operating_activities_continuing") + ), + net_cash_flow_from_operating_activities_discontinued=DataPoint.from_dict( + d.get("net_cash_flow_from_operating_activities_discontinued") + ), + net_cash_flow_from_investing_activities=DataPoint.from_dict( + d.get("net_cash_flow_from_investing_activities") + ), + net_cash_flow_from_investing_activities_continuing=DataPoint.from_dict( + d.get("net_cash_flow_from_investing_activities_continuing") + ), + net_cash_flow_from_investing_activities_discontinued=DataPoint.from_dict( + d.get("net_cash_flow_from_investing_activities_discontinued") + ), + net_cash_flow_from_financing_activities=DataPoint.from_dict( + d.get("net_cash_flow_from_financing_activities") + ), + net_cash_flow_from_financing_activities_continuing=DataPoint.from_dict( + d.get("net_cash_flow_from_financing_activities_continuing") + ), + net_cash_flow_from_financing_activities_discontinued=DataPoint.from_dict( + d.get("net_cash_flow_from_financing_activities_discontinued") + ), + exchange_gains_losses=DataPoint.from_dict(d.get("exchange_gains_losses")), + net_cash_flow=DataPoint.from_dict(d.get("net_cash_flow")), + net_cash_flow_continuing=DataPoint.from_dict( + d.get("net_cash_flow_continuing") + ), + net_cash_flow_discontinued=DataPoint.from_dict( + d.get("net_cash_flow_discontinued") + ), + ) + + +@dataclass +@modelclass +class ComprehensiveIncome: + comprehensive_income_loss: Optional[DataPoint] = None + comprehensive_income_loss_attributable_to_noncontrolling_interest: Optional[ + DataPoint + ] = None + comprehensive_income_loss_attributable_to_parent: Optional[DataPoint] = None + other_comprehensive_income_loss: Optional[DataPoint] = None + other_comprehensive_income_loss_attributable_to_noncontrolling_interest: Optional[ + DataPoint + ] = None + other_comprehensive_income_loss_attributable_to_parent: Optional[DataPoint] = None + + @staticmethod + def from_dict(d: Optional[Dict[str, Any]]) -> "ComprehensiveIncome": + if not d: + return ComprehensiveIncome() + return ComprehensiveIncome( + comprehensive_income_loss=DataPoint.from_dict( + d.get("comprehensive_income_loss") + ), + comprehensive_income_loss_attributable_to_noncontrolling_interest=DataPoint.from_dict( + d.get( + "comprehensive_income_loss_attributable_to_noncontrolling_interest" + ) + ), + comprehensive_income_loss_attributable_to_parent=DataPoint.from_dict( + d.get("comprehensive_income_loss_attributable_to_parent") + ), + other_comprehensive_income_loss=DataPoint.from_dict( + d.get("other_comprehensive_income_loss") + ), + other_comprehensive_income_loss_attributable_to_noncontrolling_interest=DataPoint.from_dict( + d.get( + "other_comprehensive_income_loss_attributable_to_noncontrolling_interest" + ) + ), + other_comprehensive_income_loss_attributable_to_parent=DataPoint.from_dict( + d.get("other_comprehensive_income_loss_attributable_to_parent") + ), + ) + + +@dataclass +@modelclass +class IncomeStatement: + revenues: Optional[DataPoint] = None + benefits_costs_expenses: Optional[DataPoint] = None + cost_of_revenue: Optional[DataPoint] = None + cost_of_revenue_goods: Optional[DataPoint] = None + cost_of_revenue_services: Optional[DataPoint] = None + costs_and_expenses: Optional[DataPoint] = None + gross_profit: Optional[DataPoint] = None + gain_loss_on_sale_properties_net_tax: Optional[DataPoint] = None + nonoperating_income_loss: Optional[DataPoint] = None + operating_expenses: Optional[DataPoint] = None + selling_general_and_administrative_expenses: Optional[DataPoint] = None + depreciation_and_amortization: Optional[DataPoint] = None + research_and_development: Optional[DataPoint] = None + other_operating_expenses: Optional[DataPoint] = None + operating_income_loss: Optional[DataPoint] = None + other_operating_income_expenses: Optional[DataPoint] = None + income_loss_before_equity_method_investments: Optional[DataPoint] = None + income_loss_from_continuing_operations_after_tax: Optional[DataPoint] = None + income_loss_from_continuing_operations_before_tax: Optional[DataPoint] = None + income_loss_from_discontinued_operations_net_of_tax: Optional[DataPoint] = None + income_loss_from_discontinued_operations_net_of_tax_adjustment_to_prior_year_gain_loss_on_disposal: Optional[ + DataPoint + ] = None + income_loss_from_discontinued_operations_net_of_tax_during_phase_out: Optional[ + DataPoint + ] = None + income_loss_from_discontinued_operations_net_of_tax_gain_loss_on_disposal: Optional[ + DataPoint + ] = None + income_loss_from_discontinued_operations_net_of_tax_provision_for_gain_loss_on_disposal: Optional[ + DataPoint + ] = None + income_loss_from_equity_method_investments: Optional[DataPoint] = None + income_tax_expense_benefit: Optional[DataPoint] = None + income_tax_expense_benefit_current: Optional[DataPoint] = None + income_tax_expense_benefit_deferred: Optional[DataPoint] = None + interest_and_debt_expense: Optional[DataPoint] = None + interest_and_dividend_income_operating: Optional[DataPoint] = None + interest_expense_operating: Optional[DataPoint] = None + interest_income_expense_after_provision_for_losses: Optional[DataPoint] = None + interest_income_expense_operating_net: Optional[DataPoint] = None + noninterest_expense: Optional[DataPoint] = None + noninterest_income: Optional[DataPoint] = None + provision_for_loan_lease_and_other_losses: Optional[DataPoint] = None + net_income_loss: Optional[DataPoint] = None + net_income_loss_attributable_to_noncontrolling_interest: Optional[DataPoint] = None + net_income_loss_attributable_to_nonredeemable_noncontrolling_interest: Optional[ + DataPoint + ] = None + net_income_loss_attributable_to_parent: Optional[DataPoint] = None + net_income_loss_attributable_to_redeemable_noncontrolling_interest: Optional[ + DataPoint + ] = None + net_income_loss_available_to_common_stockholders_basic: Optional[DataPoint] = None + participating_securities_distributed_and_undistributed_earnings_loss_basic: ( + Optional[DataPoint] + ) = (None) + undistributed_earnings_loss_allocated_to_participating_securities_basic: Optional[ + DataPoint + ] = None + preferred_stock_dividends_and_other_adjustments: Optional[DataPoint] = None + basic_earnings_per_share: Optional[DataPoint] = None + diluted_earnings_per_share: Optional[DataPoint] = None + basic_average_shares: Optional[DataPoint] = None + diluted_average_shares: Optional[DataPoint] = None + common_stock_dividends: Optional[DataPoint] = None + + @staticmethod + def from_dict(d: Optional[Dict[str, Any]]) -> "IncomeStatement": + if not d: + return IncomeStatement() + return IncomeStatement( + revenues=DataPoint.from_dict(d.get("revenues")), + benefits_costs_expenses=DataPoint.from_dict( + d.get("benefits_costs_expenses") + ), + cost_of_revenue=DataPoint.from_dict(d.get("cost_of_revenue")), + cost_of_revenue_goods=DataPoint.from_dict(d.get("cost_of_revenue_goods")), + cost_of_revenue_services=DataPoint.from_dict( + d.get("cost_of_revenue_services") + ), + costs_and_expenses=DataPoint.from_dict(d.get("costs_and_expenses")), + gross_profit=DataPoint.from_dict(d.get("gross_profit")), + gain_loss_on_sale_properties_net_tax=DataPoint.from_dict( + d.get("gain_loss_on_sale_properties_net_tax") + ), + nonoperating_income_loss=DataPoint.from_dict( + d.get("nonoperating_income_loss") + ), + operating_expenses=DataPoint.from_dict(d.get("operating_expenses")), + selling_general_and_administrative_expenses=DataPoint.from_dict( + d.get("selling_general_and_administrative_expenses") + ), + depreciation_and_amortization=DataPoint.from_dict( + d.get("depreciation_and_amortization") + ), + research_and_development=DataPoint.from_dict( + d.get("research_and_development") + ), + other_operating_expenses=DataPoint.from_dict( + d.get("other_operating_expenses") + ), + operating_income_loss=DataPoint.from_dict(d.get("operating_income_loss")), + other_operating_income_expenses=DataPoint.from_dict( + d.get("other_operating_income_expenses") + ), + income_loss_before_equity_method_investments=DataPoint.from_dict( + d.get("income_loss_before_equity_method_investments") + ), + income_loss_from_continuing_operations_after_tax=DataPoint.from_dict( + d.get("income_loss_from_continuing_operations_after_tax") + ), + income_loss_from_continuing_operations_before_tax=DataPoint.from_dict( + d.get("income_loss_from_continuing_operations_before_tax") + ), + income_loss_from_discontinued_operations_net_of_tax=DataPoint.from_dict( + d.get("income_loss_from_discontinued_operations_net_of_tax") + ), + income_loss_from_discontinued_operations_net_of_tax_adjustment_to_prior_year_gain_loss_on_disposal=DataPoint.from_dict( + d.get( + "income_loss_from_discontinued_operations_net_of_tax_adjustment_to_prior_year_gain_loss_on_disposal" + ) + ), + income_loss_from_discontinued_operations_net_of_tax_during_phase_out=DataPoint.from_dict( + d.get( + "income_loss_from_discontinued_operations_net_of_tax_during_phase_out" + ) + ), + income_loss_from_discontinued_operations_net_of_tax_gain_loss_on_disposal=DataPoint.from_dict( + d.get( + "income_loss_from_discontinued_operations_net_of_tax_gain_loss_on_disposal" + ) + ), + income_loss_from_discontinued_operations_net_of_tax_provision_for_gain_loss_on_disposal=DataPoint.from_dict( + d.get( + "income_loss_from_discontinued_operations_net_of_tax_provision_for_gain_loss_on_disposal" + ) + ), + income_loss_from_equity_method_investments=DataPoint.from_dict( + d.get("income_loss_from_equity_method_investments") + ), + income_tax_expense_benefit=DataPoint.from_dict( + d.get("income_tax_expense_benefit") + ), + income_tax_expense_benefit_current=DataPoint.from_dict( + d.get("income_tax_expense_benefit_current") + ), + income_tax_expense_benefit_deferred=DataPoint.from_dict( + d.get("income_tax_expense_benefit_deferred") + ), + interest_and_debt_expense=DataPoint.from_dict( + d.get("interest_and_debt_expense") + ), + interest_and_dividend_income_operating=DataPoint.from_dict( + d.get("interest_and_dividend_income_operating") + ), + interest_expense_operating=DataPoint.from_dict( + d.get("interest_expense_operating") + ), + interest_income_expense_after_provision_for_losses=DataPoint.from_dict( + d.get("interest_income_expense_after_provision_for_losses") + ), + interest_income_expense_operating_net=DataPoint.from_dict( + d.get("interest_income_expense_operating_net") + ), + noninterest_expense=DataPoint.from_dict(d.get("noninterest_expense")), + noninterest_income=DataPoint.from_dict(d.get("noninterest_income")), + provision_for_loan_lease_and_other_losses=DataPoint.from_dict( + d.get("provision_for_loan_lease_and_other_losses") + ), + net_income_loss=DataPoint.from_dict(d.get("net_income_loss")), + net_income_loss_attributable_to_noncontrolling_interest=DataPoint.from_dict( + d.get("net_income_loss_attributable_to_noncontrolling_interest") + ), + net_income_loss_attributable_to_nonredeemable_noncontrolling_interest=DataPoint.from_dict( + d.get( + "net_income_loss_attributable_to_nonredeemable_noncontrolling_interest" + ) + ), + net_income_loss_attributable_to_parent=DataPoint.from_dict( + d.get("net_income_loss_attributable_to_parent") + ), + net_income_loss_attributable_to_redeemable_noncontrolling_interest=DataPoint.from_dict( + d.get( + "net_income_loss_attributable_to_redeemable_noncontrolling_interest" + ) + ), + net_income_loss_available_to_common_stockholders_basic=DataPoint.from_dict( + d.get("net_income_loss_available_to_common_stockholders_basic") + ), + participating_securities_distributed_and_undistributed_earnings_loss_basic=DataPoint.from_dict( + d.get( + "participating_securities_distributed_and_undistributed_earnings_loss_basic" + ) + ), + undistributed_earnings_loss_allocated_to_participating_securities_basic=DataPoint.from_dict( + d.get( + "undistributed_earnings_loss_allocated_to_participating_securities_basic" + ) + ), + preferred_stock_dividends_and_other_adjustments=DataPoint.from_dict( + d.get("preferred_stock_dividends_and_other_adjustments") + ), + basic_earnings_per_share=DataPoint.from_dict( + d.get("basic_earnings_per_share") + ), + diluted_earnings_per_share=DataPoint.from_dict( + d.get("diluted_earnings_per_share") + ), + basic_average_shares=DataPoint.from_dict(d.get("basic_average_shares")), + diluted_average_shares=DataPoint.from_dict(d.get("diluted_average_shares")), + common_stock_dividends=DataPoint.from_dict(d.get("common_stock_dividends")), + ) + + +@dataclass +@modelclass +class Financials: + """ + Contains data for: + - balance_sheet (BalanceSheet) + - cash_flow_statement (CashFlowStatement) + - comprehensive_income (ComprehensiveIncome) + - income_statement (IncomeStatement) + """ + + balance_sheet: Optional[BalanceSheet] = None + cash_flow_statement: Optional[CashFlowStatement] = None + comprehensive_income: Optional[ComprehensiveIncome] = None + income_statement: Optional[IncomeStatement] = None + + @staticmethod + def from_dict(d: Optional[Dict[str, Any]]) -> "Financials": + if not d: + return Financials() + return Financials( + balance_sheet=BalanceSheet.from_dict(d.get("balance_sheet")), + cash_flow_statement=CashFlowStatement.from_dict( + d.get("cash_flow_statement") + ), + comprehensive_income=ComprehensiveIncome.from_dict( + d.get("comprehensive_income") + ), + income_statement=IncomeStatement.from_dict(d.get("income_statement")), + ) + + +@dataclass +@modelclass +class StockFinancial: + """ + StockFinancial contains historical financial data for a stock ticker. + The 'financials' attribute references an instance of Financials + which has typed sub-statements. + """ + + cik: Optional[str] = None + company_name: Optional[str] = None + end_date: Optional[str] = None + filing_date: Optional[str] = None + financials: Optional[Financials] = None + fiscal_period: Optional[str] = None + fiscal_year: Optional[str] = None + source_filing_file_url: Optional[str] = None + source_filing_url: Optional[str] = None + start_date: Optional[str] = None + + @staticmethod + def from_dict(d: Optional[Dict[str, Any]]) -> "StockFinancial": + if not d: + return StockFinancial() + return StockFinancial( + cik=d.get("cik"), + company_name=d.get("company_name"), + end_date=d.get("end_date"), + filing_date=d.get("filing_date"), + financials=Financials.from_dict(d.get("financials", {})), + fiscal_period=d.get("fiscal_period"), + fiscal_year=d.get("fiscal_year"), + source_filing_file_url=d.get("source_filing_file_url"), + source_filing_url=d.get("source_filing_url"), + start_date=d.get("start_date"), + ) diff --git a/polygon/rest/models/indicators.py b/polygon/rest/models/indicators.py new file mode 100644 index 00000000..aedada5a --- /dev/null +++ b/polygon/rest/models/indicators.py @@ -0,0 +1,83 @@ +from sqlite3 import Timestamp +from typing import Optional, Any, Dict, List, Union +from ...modelclass import modelclass +from .aggs import Agg + + +@modelclass +class IndicatorValue: + "Contains one datum for indicators with a single value." + timestamp: Optional[int] = None + value: Optional[float] = None + + @staticmethod + def from_dict(d): + return IndicatorValue( + timestamp=d.get("timestamp", None), + value=d.get("value", None), + ) + + +@modelclass +class MACDIndicatorValue: + "Contains one datum for all MACD values." + timestamp: Optional[int] = None + value: Optional[float] = None + signal: Optional[float] = None + histogram: Optional[float] = None + + @staticmethod + def from_dict(d): + return MACDIndicatorValue( + timestamp=d.get("timestamp", None), + value=d.get("value", None), + signal=d.get("signal", None), + histogram=d.get("histogram", None), + ) + + +@modelclass +class IndicatorUnderlying: + "Contains the URL to call to get the aggs used for building the indicator." + url: Optional[str] = None + aggregates: Optional[List[Agg]] = None + + @staticmethod + def from_dict(d): + return IndicatorUnderlying( + url=d.get("url", None), + aggregates=[Agg.from_dict(a) for a in d.get("aggregates", [])], + ) + + +@modelclass +class SingleIndicatorResults: + "Contains indicator values and Underlying." + values: Optional[List[IndicatorValue]] = None + underlying: Optional[IndicatorUnderlying] = None + + @staticmethod + def from_dict(d): + return SingleIndicatorResults( + values=[IndicatorValue.from_dict(v) for v in (d.get("values", []))], + underlying=IndicatorUnderlying.from_dict(d.get("underlying", None)), + ) + + +SMAIndicatorResults = SingleIndicatorResults +EMAIndicatorResults = SingleIndicatorResults +RSIIndicatorResults = SingleIndicatorResults + + +@modelclass +class MACDIndicatorResults: + "Contains indicator values and Underlying." + values: Optional[List[MACDIndicatorValue]] = None + underlying: Optional[IndicatorUnderlying] = None + + @staticmethod + def from_dict(d): + return MACDIndicatorResults( + values=[MACDIndicatorValue.from_dict(v) for v in (d.get("values", []))], + underlying=IndicatorUnderlying.from_dict(d.get("underlying", None)), + ) diff --git a/polygon/rest/models/markets.py b/polygon/rest/models/markets.py new file mode 100644 index 00000000..4e68abd4 --- /dev/null +++ b/polygon/rest/models/markets.py @@ -0,0 +1,95 @@ +from typing import Optional +from ...modelclass import modelclass + + +@modelclass +class MarketCurrencies: + "Contains currency market status data." + crypto: Optional[str] = None + fx: Optional[str] = None + + @staticmethod + def from_dict(d): + return MarketCurrencies(**d) + + +@modelclass +class MarketExchanges: + "Contains exchange market status data." + nasdaq: Optional[str] = None + nyse: Optional[str] = None + otc: Optional[str] = None + + @staticmethod + def from_dict(d): + return MarketExchanges(**d) + + +@modelclass +class MarketIndices: + "Contains indices market status data." + s_and_p: Optional[str] = None + societe_generale: Optional[str] = None + cgi: Optional[str] = None + msci: Optional[str] = None + ftse_russell: Optional[str] = None + mstar: Optional[str] = None + mstarc: Optional[str] = None + cccy: Optional[str] = None + nasdaq: Optional[str] = None + dow_jones: Optional[str] = None + + @staticmethod + def from_dict(d): + return MarketIndices(**d) + + +@modelclass +class MarketHoliday: + "MarketHoliday contains data for upcoming market holidays and their open/close times." + close: Optional[str] = None + date: Optional[str] = None + exchange: Optional[str] = None + name: Optional[str] = None + open: Optional[str] = None + status: Optional[str] = None + + @staticmethod + def from_dict(d): + return MarketHoliday(**d) + + +@modelclass +class MarketStatus: + "MarketStatus contains data for the current trading status of the exchanges and overall financial markets." + after_hours: Optional[bool] = None + currencies: Optional[MarketCurrencies] = None + early_hours: Optional[bool] = None + exchanges: Optional[MarketExchanges] = None + indicesGroups: Optional[MarketIndices] = None + market: Optional[str] = None + server_time: Optional[str] = None + + @staticmethod + def from_dict(d): + return MarketStatus( + after_hours=d.get("afterHours", None), + currencies=( + None + if "currencies" not in d + else MarketCurrencies.from_dict(d["currencies"]) + ), + early_hours=d.get("earlyHours", None), + exchanges=( + None + if "exchanges" not in d + else MarketExchanges.from_dict(d["exchanges"]) + ), + indicesGroups=( + None + if "indicesGroups" not in d + else MarketIndices.from_dict(d["indicesGroups"]) + ), + market=d.get("market", None), + server_time=d.get("serverTime", None), + ) diff --git a/polygon/rest/models/quotes.py b/polygon/rest/models/quotes.py new file mode 100644 index 00000000..c4f2c00f --- /dev/null +++ b/polygon/rest/models/quotes.py @@ -0,0 +1,109 @@ +from typing import Optional, List +from ...modelclass import modelclass + + +@modelclass +class Quote: + "Quote contains quote data for a specified ticker symbol." + ask_exchange: Optional[int] = None + ask_price: Optional[float] = None + ask_size: Optional[float] = None + bid_exchange: Optional[int] = None + bid_price: Optional[float] = None + bid_size: Optional[float] = None + conditions: Optional[List[int]] = None + indicators: Optional[List[int]] = None + participant_timestamp: Optional[int] = None + sequence_number: Optional[int] = None + sip_timestamp: Optional[int] = None + tape: Optional[int] = None + trf_timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return Quote(**d) + + +@modelclass +class LastQuote: + "LastQuote contains data for the most recent NBBO (Quote) tick for a given stock." + ticker: Optional[str] = None + trf_timestamp: Optional[int] = None + sequence_number: Optional[int] = None + sip_timestamp: Optional[int] = None + participant_timestamp: Optional[int] = None + ask_price: Optional[float] = None + ask_size: Optional[int] = None + ask_exchange: Optional[int] = None + conditions: Optional[List[int]] = None + indicators: Optional[List[int]] = None + bid_price: Optional[float] = None + bid_size: Optional[int] = None + bid_exchange: Optional[int] = None + tape: Optional[int] = None + + @staticmethod + def from_dict(d): + return LastQuote( + ticker=d.get("T", None), + trf_timestamp=d.get("f", None), + sequence_number=d.get("q", None), + sip_timestamp=d.get("t", None), + participant_timestamp=d.get("y", None), + ask_price=d.get("P", None), + ask_size=d.get("S", None), + ask_exchange=d.get("X", None), + conditions=d.get("c", None), + indicators=d.get("i", None), + bid_price=d.get("p", None), + bid_size=d.get("s", None), + bid_exchange=d.get("x", None), + tape=d.get("z", None), + ) + + +@modelclass +class ForexQuote: + "Contains data for a forex quote." + ask: Optional[float] = None + bid: Optional[float] = None + exchange: Optional[int] = None + timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return ForexQuote(**d) + + +@modelclass +class LastForexQuote: + "ForexLastQuote contains data for the last quote tick for a forex currency pair." + last: Optional[ForexQuote] = None + symbol: Optional[str] = None + + @staticmethod + def from_dict(d): + return LastForexQuote( + last=None if "last" not in d else ForexQuote.from_dict(d["last"]), + symbol=d.get("symbol", None), + ) + + +@modelclass +class RealTimeCurrencyConversion: + "RealTimeCurrencyConversion contains data for currency conversions using the latest market conversion rates." + converted: Optional[float] = None + from_: Optional[str] = None + initial_amount: Optional[float] = None + last: Optional[ForexQuote] = None + to: Optional[str] = None + + @staticmethod + def from_dict(d): + return RealTimeCurrencyConversion( + converted=d.get("converted", None), + from_=d.get("from_", None), + initial_amount=d.get("initialAmount", None), + last=None if "last" not in d else ForexQuote.from_dict(d["last"]), + to=d.get("to", None), + ) diff --git a/polygon/rest/models/request.py b/polygon/rest/models/request.py new file mode 100644 index 00000000..85e31daf --- /dev/null +++ b/polygon/rest/models/request.py @@ -0,0 +1,101 @@ +from typing import Dict, Optional + +X_POLYGON_EDGE_ID = "X-Polygon-Edge-ID" +X_POLYGON_EDGE_IP_ADDRESS = "X-Polygon-Edge-IP-Address" +X_POLYGON_EDGE_USER_AGENT = "X-Polygon-Edge-User-Agent" + +HEADER = "header" + + +class RequestOptionBuilder: + def __init__( + self, + edge_id: Optional[str] = None, + edge_ip_address: Optional[str] = None, + edge_user: Optional[str] = None, + ): + """ + RequestOptionBuilder is a utility class to build polygon api options used in requests. + :param edge_id: is a required Launchpad header. It identifies the Edge User requesting data + :param edge_ip_address: is a required Launchpad header. It denotes the originating IP Address of the Edge User + :param edge_user: is an optional Launchpad header. It denotes the originating UserAgent of the Edge User requesting data. + """ + self.headers: Optional[Dict[str, str]] = None + if edge_id is not None and edge_ip_address is not None: + self.edge_headers( + edge_id=edge_id, edge_ip_address=edge_ip_address, edge_user=edge_user + ) + + def edge_headers( + self, + edge_id: str, + edge_ip_address: str, + edge_user: Optional[str] = None, + ) -> "RequestOptionBuilder": + """ + require_edge_headers adds required headers to the headers' dictionary + :param edge_id: is a required Launchpad header. It identifies the Edge User requesting data + :param edge_ip_address: is a required Launchpad header. It denotes the originating IP Address of the Edge User + requesting data + :param edge_user: user_agent: is an optional Launchpad header. It denotes the originating UserAgent of the Edge + User requesting data + :return ResponseOptionBuilder + """ + edge_headers: Dict[str, str] = { + X_POLYGON_EDGE_ID: edge_id, + X_POLYGON_EDGE_IP_ADDRESS: edge_ip_address, + } + + if edge_user is not None: + edge_headers[X_POLYGON_EDGE_USER_AGENT] = edge_user + + self._add_to_edge_headers(**edge_headers) + + return self + + def update_edge_header( + self, + edge_id: Optional[str] = None, + edge_ip_address: Optional[str] = None, + edge_user: Optional[str] = None, + ) -> "RequestOptionBuilder": + """ + used to change individual edge elements of underlying headers' dictionary. + :param edge_id: is a required Launchpad header. It identifies the Edge User requesting data + :param edge_ip_address: is a required Launchpad header. It denotes the originating IP Address of the Edge User + requesting data + :param edge_user: user_agent: is an optional Launchpad header. It denotes the originating UserAgent of the Edge + User requesting data + :return: + """ + if self.headers is None: + raise RequestOptionError( + "must set required fields prior to using update function." + ) + edge_headers: Dict[str, str] = {} + + if edge_id is not None: + edge_headers[X_POLYGON_EDGE_ID] = edge_id + + if edge_ip_address is not None: + edge_headers[X_POLYGON_EDGE_IP_ADDRESS] = edge_ip_address + + if edge_user is not None: + edge_headers[X_POLYGON_EDGE_USER_AGENT] = edge_user + + self._add_to_edge_headers(**edge_headers) + + return self + + def _add_to_edge_headers(self, **headers): + if self.headers is None: + self.headers = {} + + for k, v in headers.items(): + self.headers[k] = v + + +class RequestOptionError(Exception): + """ + Missing required option. + """ diff --git a/polygon/rest/models/snapshot.py b/polygon/rest/models/snapshot.py new file mode 100644 index 00000000..3d38abe2 --- /dev/null +++ b/polygon/rest/models/snapshot.py @@ -0,0 +1,455 @@ +from typing import Optional, List, Dict +from .aggs import Agg +from .quotes import LastQuote +from .trades import LastTrade +from ...modelclass import modelclass + + +@modelclass +class MinuteSnapshot: + "Most recent minute bar." + accumulated_volume: Optional[float] = None + open: Optional[float] = None + high: Optional[float] = None + low: Optional[float] = None + close: Optional[float] = None + volume: Optional[float] = None + vwap: Optional[float] = None + otc: Optional[bool] = None + timestamp: Optional[int] = None + transactions: Optional[int] = None + + @staticmethod + def from_dict(d): + return MinuteSnapshot( + d.get("av", None), + d.get("o", None), + d.get("h", None), + d.get("l", None), + d.get("c", None), + d.get("v", None), + d.get("vw", None), + d.get("otc", None), + d.get("t", None), + d.get("n", None), + ) + + +@modelclass +class IndicesSession: + "Contains data for the most recent daily bar in an options contract." + change: Optional[float] = None + change_percent: Optional[float] = None + close: Optional[float] = None + high: Optional[float] = None + low: Optional[float] = None + open: Optional[float] = None + previous_close: Optional[float] = None + + @staticmethod + def from_dict(d): + return IndicesSession(**d) + + +@modelclass +class IndicesSnapshot: + value: Optional[float] = None + name: Optional[str] = None + type: Optional[str] = None + ticker: Optional[str] = None + market_status: Optional[str] = None + session: Optional[IndicesSession] = None + error: Optional[str] = None + message: Optional[str] = None + + @staticmethod + def from_dict(d): + return IndicesSnapshot( + value=d.get("value", None), + name=d.get("name", None), + type=d.get("type", None), + ticker=d.get("ticker", None), + market_status=d.get("market_status", None), + session=( + None if "session" not in d else IndicesSession.from_dict(d["session"]) + ), + error=d.get("error", None), + message=d.get("message", None), + ) + + +@modelclass +class TickerSnapshot: + "Contains the most up-to-date market data for all traded ticker symbols." + day: Optional[Agg] = None + last_quote: Optional[LastQuote] = None + last_trade: Optional[LastTrade] = None + min: Optional[MinuteSnapshot] = None + prev_day: Optional[Agg] = None + ticker: Optional[str] = None + todays_change: Optional[float] = None + todays_change_percent: Optional[float] = None + updated: Optional[int] = None + fair_market_value: Optional[float] = None + + @staticmethod + def from_dict(d): + return TickerSnapshot( + day=None if "day" not in d else Agg.from_dict(d["day"]), + last_quote=( + None if "lastQuote" not in d else LastQuote.from_dict(d["lastQuote"]) + ), + last_trade=( + None if "lastTrade" not in d else LastTrade.from_dict(d["lastTrade"]) + ), + min=None if "min" not in d else MinuteSnapshot.from_dict(d["min"]), + prev_day=None if "prevDay" not in d else Agg.from_dict(d["prevDay"]), + ticker=d.get("ticker", None), + todays_change=d.get("todaysChange", None), + todays_change_percent=d.get("todaysChangePerc", None), + updated=d.get("updated", None), + fair_market_value=d.get("fmv", None), + ) + + +@modelclass +class DayOptionContractSnapshot: + "Contains data for the most recent daily bar in an options contract." + change: Optional[float] = None + change_percent: Optional[float] = None + close: Optional[float] = None + high: Optional[float] = None + last_updated: Optional[int] = None + low: Optional[float] = None + open: Optional[float] = None + previous_close: Optional[float] = None + volume: Optional[float] = None + vwap: Optional[float] = None + + @staticmethod + def from_dict(d): + return DayOptionContractSnapshot(**d) + + +@modelclass +class OptionDetails: + "Contains details for an options contract." + contract_type: Optional[str] = None + exercise_style: Optional[str] = None + expiration_date: Optional[str] = None + shares_per_contract: Optional[float] = None + strike_price: Optional[float] = None + ticker: Optional[str] = None + + @staticmethod + def from_dict(d): + return OptionDetails(**d) + + +@modelclass +class LastQuoteOptionContractSnapshot: + "Contains data for the most recent quote in an options contract." + ask: Optional[float] = None + ask_size: Optional[float] = None + bid: Optional[float] = None + bid_size: Optional[float] = None + last_updated: Optional[int] = None + midpoint: Optional[float] = None + timeframe: Optional[str] = None + + @staticmethod + def from_dict(d): + return LastQuoteOptionContractSnapshot(**d) + + +@modelclass +class LastTradeOptionContractSnapshot: + "Contains data for the most recent trade for an options contract." + price: Optional[float] = None + sip_timestamp: Optional[int] = None + size: Optional[int] = None + conditions: Optional[List[int]] = None + exchange: Optional[int] = None + timeframe: Optional[str] = None + + @staticmethod + def from_dict(d): + return LastTradeOptionContractSnapshot(**d) + + +@modelclass +class Greeks: + "Contains data for the greeks in an options contract." + delta: Optional[float] = None + gamma: Optional[float] = None + theta: Optional[float] = None + vega: Optional[float] = None + + @staticmethod + def from_dict(d): + return Greeks(**d) + + +@modelclass +class UnderlyingAsset: + "Contains data for the underlying stock in an options contract." + change_to_break_even: Optional[float] = None + last_updated: Optional[int] = None + price: Optional[float] = None + value: Optional[float] = None + ticker: Optional[str] = None + timeframe: Optional[str] = None + + @staticmethod + def from_dict(d): + return UnderlyingAsset(**d) + + +@modelclass +class OptionContractSnapshot: + "Contains data for the snapshot of an option contract of a stock equity." + break_even_price: Optional[float] = None + day: Optional[DayOptionContractSnapshot] = None + details: Optional[OptionDetails] = None + greeks: Optional[Greeks] = None + implied_volatility: Optional[float] = None + last_quote: Optional[LastQuoteOptionContractSnapshot] = None + last_trade: Optional[LastTradeOptionContractSnapshot] = None + open_interest: Optional[float] = None + underlying_asset: Optional[UnderlyingAsset] = None + fair_market_value: Optional[float] = None + + @staticmethod + def from_dict(d): + return OptionContractSnapshot( + break_even_price=d.get("break_even_price", None), + day=( + None + if "day" not in d + else DayOptionContractSnapshot.from_dict(d["day"]) + ), + details=( + None if "details" not in d else OptionDetails.from_dict(d["details"]) + ), + greeks=None if "greeks" not in d else Greeks.from_dict(d["greeks"]), + implied_volatility=d.get("implied_volatility", None), + last_quote=( + None + if "last_quote" not in d + else LastQuoteOptionContractSnapshot.from_dict(d["last_quote"]) + ), + last_trade=( + None + if "last_trade" not in d + else LastTradeOptionContractSnapshot.from_dict(d["last_trade"]) + ), + open_interest=d.get("open_interest", None), + underlying_asset=( + None + if "underlying_asset" not in d + else UnderlyingAsset.from_dict(d["underlying_asset"]) + ), + fair_market_value=d.get("fmv", None), + ) + + +@modelclass +class OrderBookQuote: + "Contains data for a book bid or ask." + price: Optional[float] = None + exchange_shares: Optional[Dict[str, float]] = None + + @staticmethod + def from_dict(d): + return OrderBookQuote( + d.get("p", None), + d.get("x", None), + ) + + +@modelclass +class SnapshotTickerFullBook: + "Contains the current level 2 book of a single ticker. This is the combined book from all of the exchanges." + ticker: Optional[str] = None + bids: Optional[List[OrderBookQuote]] = None + asks: Optional[List[OrderBookQuote]] = None + bid_count: Optional[float] = None + ask_count: Optional[float] = None + spread: Optional[float] = None + updated: Optional[int] = None + + @staticmethod + def from_dict(d): + return SnapshotTickerFullBook( + ticker=d.get("ticker", None), + bids=( + None + if "bids" not in d + else [OrderBookQuote.from_dict(o) for o in d["bids"]] + ), + asks=( + None + if "asks" not in d + else [OrderBookQuote.from_dict(o) for o in d["asks"]] + ), + bid_count=d.get("bidCount", None), + ask_count=d.get("askCount", None), + spread=d.get("spread", None), + updated=d.get("updated", None), + ) + + +@modelclass +class UniversalSnapshotSession: + """Contains data about the most recent trading session for an asset.""" + + price: Optional[float] = None + change: Optional[float] = None + change_percent: Optional[float] = None + early_trading_change: Optional[float] = None + early_trading_change_percent: Optional[float] = None + regular_trading_change: Optional[float] = None + regular_trading_change_percent: Optional[float] = None + late_trading_change: Optional[float] = None + late_trading_change_percent: Optional[float] = None + open: Optional[float] = None + close: Optional[float] = None + high: Optional[float] = None + low: Optional[float] = None + previous_close: Optional[float] = None + volume: Optional[float] = None + + @staticmethod + def from_dict(d): + return UniversalSnapshotSession(**d) + + +@modelclass +class UniversalSnapshotLastQuote: + """Contains the most recent quote for an asset.""" + + ask: Optional[float] = None + ask_size: Optional[float] = None + bid: Optional[float] = None + bid_size: Optional[float] = None + midpoint: Optional[float] = None + exchange: Optional[int] = None + timeframe: Optional[str] = None + last_updated: Optional[int] = None + + @staticmethod + def from_dict(d): + return UniversalSnapshotLastQuote(**d) + + +@modelclass +class UniversalSnapshotLastTrade: + """Contains the most recent trade for an asset.""" + + id: Optional[int] = None + price: Optional[float] = None + size: Optional[int] = None + exchange: Optional[int] = None + conditions: Optional[List[int]] = None + timeframe: Optional[str] = None + last_updated: Optional[int] = None + participant_timestamp: Optional[int] = None + sip_timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return UniversalSnapshotLastTrade(**d) + + +@modelclass +class UniversalSnapshotUnderlyingAsset: + """Contains data for the underlying stock in an options contract.""" + + ticker: Optional[str] = None + price: Optional[float] = None + value: Optional[float] = None + change_to_break_even: Optional[float] = None + timeframe: Optional[str] = None + last_updated: Optional[int] = None + + @staticmethod + def from_dict(d): + return UniversalSnapshotUnderlyingAsset(**d) + + +@modelclass +class UniversalSnapshotDetails: + """Contains details for an options contract.""" + + contract_type: Optional[str] = None + exercise_style: Optional[str] = None + expiration_date: Optional[str] = None + shares_per_contract: Optional[float] = None + strike_price: Optional[float] = None + + @staticmethod + def from_dict(d): + return UniversalSnapshotDetails(**d) + + +@modelclass +class UniversalSnapshot: + """Contains snapshot data for an asset.""" + + ticker: Optional[str] = None + type: Optional[str] = None + session: Optional[UniversalSnapshotSession] = None + last_quote: Optional[UniversalSnapshotLastQuote] = None + last_trade: Optional[UniversalSnapshotLastTrade] = None + greeks: Optional[Greeks] = None + underlying_asset: Optional[UniversalSnapshotUnderlyingAsset] = None + details: Optional[UniversalSnapshotDetails] = None + break_even_price: Optional[float] = None + implied_volatility: Optional[float] = None + open_interest: Optional[float] = None + market_status: Optional[str] = None + name: Optional[str] = None + fair_market_value: Optional[float] = None + error: Optional[str] = None + message: Optional[str] = None + + @staticmethod + def from_dict(d): + return UniversalSnapshot( + ticker=d.get("ticker", None), + type=d.get("type", None), + session=( + None + if "session" not in d + else UniversalSnapshotSession.from_dict(d["session"]) + ), + last_quote=( + None + if "last_quote" not in d + else UniversalSnapshotLastQuote.from_dict(d["last_quote"]) + ), + last_trade=( + None + if "last_trade" not in d + else UniversalSnapshotLastTrade.from_dict(d["last_trade"]) + ), + greeks=None if "greeks" not in d else Greeks.from_dict(d["greeks"]), + underlying_asset=( + None + if "underlying_asset" not in d + else UniversalSnapshotUnderlyingAsset.from_dict(d["underlying_asset"]) + ), + details=( + None + if "details" not in d + else UniversalSnapshotDetails.from_dict(d["details"]) + ), + break_even_price=d.get("break_even_price", None), + implied_volatility=d.get("implied_volatility", None), + open_interest=d.get("open_interest", None), + market_status=d.get("market_status", None), + name=d.get("name", None), + fair_market_value=d.get("fmv", None), + error=d.get("error", None), + message=d.get("message", None), + ) diff --git a/polygon/rest/models/splits.py b/polygon/rest/models/splits.py new file mode 100644 index 00000000..5fb27129 --- /dev/null +++ b/polygon/rest/models/splits.py @@ -0,0 +1,16 @@ +from typing import Optional +from ...modelclass import modelclass + + +@modelclass +class Split: + "Split contains data for a historical stock split, including the ticker symbol, the execution date, and the factors of the split ratio." + id: Optional[int] = None + execution_date: Optional[str] = None + split_from: Optional[int] = None + split_to: Optional[int] = None + ticker: Optional[str] = None + + @staticmethod + def from_dict(d): + return Split(**d) diff --git a/polygon/rest/models/summaries.py b/polygon/rest/models/summaries.py new file mode 100644 index 00000000..21e6f395 --- /dev/null +++ b/polygon/rest/models/summaries.py @@ -0,0 +1,72 @@ +from sqlite3 import Timestamp +from typing import Optional +from ...modelclass import modelclass +from .tickers import Branding + + +@modelclass +class Session: + "Contains Session data for the summaries endpoint." + change: Optional[float] = None + change_percent: Optional[float] = None + early_trading_change: Optional[float] = None + early_trading_change_percent: Optional[float] = None + late_trading_change: Optional[float] = None + late_trading_change_percent: Optional[float] = None + close: Optional[float] = None + high: Optional[float] = None + low: Optional[float] = None + open: Optional[float] = None + previous_close: Optional[float] = None + volume: Optional[float] = None + + @staticmethod + def from_dict(d): + return Session(**d) + + +@modelclass +class Options: + "Contains options data for the summaries endpoint" + contract_type: Optional[str] = None + exercise_style: Optional[str] = None + expiration_date: Optional[str] = None + shares_per_contract: Optional[float] = None + strike_price: Optional[float] = None + underlying_ticker: Optional[float] = None + + @staticmethod + def from_dict(d): + return Options(**d) + + +@modelclass +class SummaryResult: + "Contains summary result data for a list of tickers" + price: Optional[float] = None + name: Optional[str] = None + ticker: Optional[str] = None + branding: Optional[Branding] = None + market_status: Optional[str] = None + last_updated: Optional[int] = None + type: Optional[str] = None + session: Optional[Session] = None + options: Optional[Options] = None + error: Optional[str] = None + message: Optional[str] = None + + @staticmethod + def from_dict(d): + return SummaryResult( + price=d.get("price", None), + name=d.get("name", None), + ticker=d.get("ticker", None), + branding=None if "branding" not in d else Branding.from_dict(d["branding"]), + market_status=d.get("market_status", None), + last_updated=d.get("last_updated", None), + type=d.get("type", None), + session=None if "session" not in d else Session.from_dict(d["session"]), + options=None if "options" not in d else Options.from_dict(d["options"]), + error=d.get("error", None), + message=d.get("message", None), + ) diff --git a/polygon/rest/models/tickers.py b/polygon/rest/models/tickers.py new file mode 100644 index 00000000..76cb6f6f --- /dev/null +++ b/polygon/rest/models/tickers.py @@ -0,0 +1,414 @@ +from typing import Optional, List +from ...modelclass import modelclass + + +@modelclass +class CompanyAddress: + "Contains address data for a ticker detail." + address1: Optional[str] = None + address2: Optional[str] = None + city: Optional[str] = None + state: Optional[str] = None + country: Optional[str] = None + postal_code: Optional[str] = None + + @staticmethod + def from_dict(d): + return CompanyAddress(**d) + + +@modelclass +class Branding: + "Contains branding data for a ticker detail." + icon_url: Optional[str] = None + logo_url: Optional[str] = None + accent_color: Optional[str] = None + light_color: Optional[str] = None + dark_color: Optional[str] = None + + @staticmethod + def from_dict(d): + return Branding(**d) + + +@modelclass +class Insight: + "Contains the insights related to the article." + sentiment: Optional[str] = None + sentiment_reasoning: Optional[str] = None + ticker: Optional[str] = None + + @staticmethod + def from_dict(d): + return Insight(**d) + + +@modelclass +class Publisher: + "Contains publisher data for ticker news." + favicon_url: Optional[str] = None + homepage_url: Optional[str] = None + logo_url: Optional[str] = None + name: Optional[str] = None + + @staticmethod + def from_dict(d): + return Publisher(**d) + + +@modelclass +class Ticker: + "Ticker contains data for a specified ticker symbol." + active: Optional[bool] = None + cik: Optional[str] = None + composite_figi: Optional[str] = None + currency_name: Optional[str] = None + currency_symbol: Optional[str] = None + base_currency_symbol: Optional[str] = None + base_currency_name: Optional[str] = None + delisted_utc: Optional[str] = None + last_updated_utc: Optional[str] = None + locale: Optional[str] = None + market: Optional[str] = None + name: Optional[str] = None + primary_exchange: Optional[str] = None + share_class_figi: Optional[str] = None + ticker: Optional[str] = None + type: Optional[str] = None + source_feed: Optional[str] = None + + @staticmethod + def from_dict(d): + return Ticker(**d) + + +@modelclass +class TickerDetails: + "TickerDetails contains data for a specified ticker symbol." + active: Optional[bool] = None + address: Optional[CompanyAddress] = None + branding: Optional[Branding] = None + cik: Optional[str] = None + composite_figi: Optional[str] = None + currency_name: Optional[str] = None + currency_symbol: Optional[str] = None + base_currency_name: Optional[str] = None + base_currency_symbol: Optional[str] = None + delisted_utc: Optional[str] = None + description: Optional[str] = None + ticker_root: Optional[str] = None + ticker_suffix: Optional[str] = None + homepage_url: Optional[str] = None + list_date: Optional[str] = None + locale: Optional[str] = None + market: Optional[str] = None + market_cap: Optional[float] = None + name: Optional[str] = None + phone_number: Optional[str] = None + primary_exchange: Optional[str] = None + share_class_figi: Optional[str] = None + share_class_shares_outstanding: Optional[int] = None + sic_code: Optional[str] = None + sic_description: Optional[str] = None + ticker: Optional[str] = None + total_employees: Optional[int] = None + type: Optional[str] = None + weighted_shares_outstanding: Optional[int] = None + + @staticmethod + def from_dict(d): + return TickerDetails( + active=d.get("active", None), + address=( + None if "address" not in d else CompanyAddress.from_dict(d["address"]) + ), + branding=None if "branding" not in d else Branding.from_dict(d["branding"]), + cik=d.get("cik", None), + composite_figi=d.get("composite_figi", None), + currency_name=d.get("currency_name", None), + currency_symbol=d.get("currency_symbol", None), + base_currency_name=d.get("base_currency_name", None), + base_currency_symbol=d.get("base_currency_symbol", None), + delisted_utc=d.get("delisted_utc", None), + description=d.get("description", None), + ticker_root=d.get("ticker_root", None), + ticker_suffix=d.get("ticker_suffix", None), + homepage_url=d.get("homepage_url", None), + list_date=d.get("list_date", None), + locale=d.get("locale", None), + market=d.get("market", None), + market_cap=d.get("market_cap", None), + name=d.get("name", None), + phone_number=d.get("phone_number", None), + primary_exchange=d.get("primary_exchange", None), + share_class_figi=d.get("share_class_figi", None), + share_class_shares_outstanding=d.get( + "share_class_shares_outstanding", None + ), + sic_code=d.get("sic_code", None), + sic_description=d.get("sic_description", None), + ticker=d.get("ticker", None), + total_employees=d.get("total_employees", None), + type=d.get("type", None), + weighted_shares_outstanding=d.get("weighted_shares_outstanding", None), + ) + + +@modelclass +class TickerNews: + "TickerDetails contains data for news articles relating to a stock ticker symbol." + amp_url: Optional[str] = None + article_url: Optional[str] = None + author: Optional[str] = None + description: Optional[str] = None + id: Optional[str] = None + image_url: Optional[str] = None + insights: Optional[List[Insight]] = None + keywords: Optional[List[str]] = None + published_utc: Optional[str] = None + publisher: Optional[Publisher] = None + tickers: Optional[List[str]] = None + title: Optional[str] = None + + @staticmethod + def from_dict(d): + return TickerNews( + amp_url=d.get("amp_url", None), + article_url=d.get("article_url", None), + author=d.get("author", None), + description=d.get("description", None), + id=d.get("id", None), + image_url=d.get("image_url", None), + insights=( + [Insight.from_dict(insight) for insight in d["insights"]] + if "insights" in d + else None + ), + keywords=d.get("keywords", None), + published_utc=d.get("published_utc", None), + publisher=( + None if "publisher" not in d else Publisher.from_dict(d["publisher"]) + ), + tickers=d.get("tickers", None), + title=d.get("title", None), + ) + + +@modelclass +class TickerTypes: + "TickerTypes contains data for ticker types." + asset_class: Optional[str] = None + code: Optional[str] = None + description: Optional[str] = None + locale: Optional[str] = None + + @staticmethod + def from_dict(d): + return TickerTypes(**d) + + +@modelclass +class RelatedCompany: + """ + Get a list of tickers related to the queried ticker based on News and Returns data. + """ + + ticker: Optional[str] = None + + @staticmethod + def from_dict(d): + return RelatedCompany( + ticker=d.get("ticker", None), + ) + + +@modelclass +class TickerChange: + ticker: str + + @staticmethod + def from_dict(d): + return TickerChange(**d) + + +@modelclass +class TickerChangeEvent: + type: str + date: str + ticker_change: TickerChange + + @staticmethod + def from_dict(d): + return TickerChangeEvent(**d) + + +@modelclass +class TickerChangeResults: + name: str + composite_figi: str + cik: str + events: Optional[List[TickerChangeEvent]] = None + + @staticmethod + def from_dict(d): + return TickerChangeResults(**d) + + +@modelclass +class IPOListing: + """ + IPO Listing data as returned by the /vX/reference/ipos endpoint. + """ + + announced_date: Optional[str] = None + currency_code: Optional[str] = None + final_issue_price: Optional[float] = None + highest_offer_price: Optional[float] = None + ipo_status: Optional[str] = None + isin: Optional[str] = None + issuer_name: Optional[str] = None + last_updated: Optional[str] = None + listing_date: Optional[str] = None + lot_size: Optional[int] = None + lowest_offer_price: Optional[float] = None + max_shares_offered: Optional[int] = None + min_shares_offered: Optional[int] = None + primary_exchange: Optional[str] = None + security_description: Optional[str] = None + security_type: Optional[str] = None + shares_outstanding: Optional[int] = None + ticker: Optional[str] = None + total_offer_size: Optional[float] = None + us_code: Optional[str] = None + + @staticmethod + def from_dict(d): + return IPOListing( + announced_date=d.get("announced_date"), + currency_code=d.get("currency_code"), + final_issue_price=d.get("final_issue_price"), + highest_offer_price=d.get("highest_offer_price"), + ipo_status=d.get("ipo_status"), + isin=d.get("isin"), + issuer_name=d.get("issuer_name"), + last_updated=d.get("last_updated"), + listing_date=d.get("listing_date"), + lot_size=d.get("lot_size"), + lowest_offer_price=d.get("lowest_offer_price"), + max_shares_offered=d.get("max_shares_offered"), + min_shares_offered=d.get("min_shares_offered"), + primary_exchange=d.get("primary_exchange"), + security_description=d.get("security_description"), + security_type=d.get("security_type"), + shares_outstanding=d.get("shares_outstanding"), + ticker=d.get("ticker"), + total_offer_size=d.get("total_offer_size"), + us_code=d.get("us_code"), + ) + + +@modelclass +class ShortInterest: + """ + Short Interest data for a specific identifier. + """ + + avg_daily_volume: Optional[int] = None + days_to_cover: Optional[float] = None + settlement_date: Optional[str] = None + short_interest: Optional[int] = None + ticker: Optional[str] = None + + @staticmethod + def from_dict(d): + return ShortInterest( + avg_daily_volume=d.get("avg_daily_volume"), + days_to_cover=d.get("days_to_cover"), + settlement_date=d.get("settlement_date"), + short_interest=d.get("short_interest"), + ticker=d.get("ticker"), + ) + + +@modelclass +class ShortVolume: + """ + Short Volume data for a specific identifier on a given date. + """ + + adf_short_volume: Optional[int] = None + adf_short_volume_exempt: Optional[int] = None + date: Optional[str] = None + exempt_volume: Optional[int] = None + nasdaq_carteret_short_volume: Optional[int] = None + nasdaq_carteret_short_volume_exempt: Optional[int] = None + nasdaq_chicago_short_volume: Optional[int] = None + nasdaq_chicago_short_volume_exempt: Optional[int] = None + non_exempt_volume: Optional[int] = None + nyse_short_volume: Optional[int] = None + nyse_short_volume_exempt: Optional[int] = None + short_volume: Optional[int] = None + short_volume_ratio: Optional[float] = None + ticker: Optional[str] = None + total_volume: Optional[int] = None + + @staticmethod + def from_dict(d): + return ShortVolume( + adf_short_volume=d.get("adf_short_volume"), + adf_short_volume_exempt=d.get("adf_short_volume_exempt"), + date=d.get("date"), + exempt_volume=d.get("exempt_volume"), + nasdaq_carteret_short_volume=d.get("nasdaq_carteret_short_volume"), + nasdaq_carteret_short_volume_exempt=d.get( + "nasdaq_carteret_short_volume_exempt" + ), + nasdaq_chicago_short_volume=d.get("nasdaq_chicago_short_volume"), + nasdaq_chicago_short_volume_exempt=d.get( + "nasdaq_chicago_short_volume_exempt" + ), + non_exempt_volume=d.get("non_exempt_volume"), + nyse_short_volume=d.get("nyse_short_volume"), + nyse_short_volume_exempt=d.get("nyse_short_volume_exempt"), + short_volume=d.get("short_volume"), + short_volume_ratio=d.get("short_volume_ratio"), + ticker=d.get("ticker"), + total_volume=d.get("total_volume"), + ) + + +@modelclass +class TreasuryYield: + """ + Treasury yield data for a specific date. + """ + + date: Optional[str] = None + yield_1_month: Optional[float] = None + yield_3_month: Optional[float] = None + yield_6_month: Optional[float] = None + yield_1_year: Optional[float] = None + yield_2_year: Optional[float] = None + yield_3_year: Optional[float] = None + yield_5_year: Optional[float] = None + yield_7_year: Optional[float] = None + yield_10_year: Optional[float] = None + yield_20_year: Optional[float] = None + yield_30_year: Optional[float] = None + + @staticmethod + def from_dict(d): + return TreasuryYield( + date=d.get("date"), + yield_1_month=d.get("yield_1_month"), + yield_3_month=d.get("yield_3_month"), + yield_6_month=d.get("yield_6_month"), + yield_1_year=d.get("yield_1_year"), + yield_2_year=d.get("yield_2_year"), + yield_3_year=d.get("yield_3_year"), + yield_5_year=d.get("yield_5_year"), + yield_7_year=d.get("yield_7_year"), + yield_10_year=d.get("yield_10_year"), + yield_20_year=d.get("yield_20_year"), + yield_30_year=d.get("yield_30_year"), + ) diff --git a/polygon/rest/models/trades.py b/polygon/rest/models/trades.py new file mode 100644 index 00000000..25b9adc7 --- /dev/null +++ b/polygon/rest/models/trades.py @@ -0,0 +1,73 @@ +from typing import Optional, List +from ...modelclass import modelclass + + +@modelclass +class Trade: + "Trade contains trade data for a specified ticker symbol." + conditions: Optional[List[int]] = None + correction: Optional[int] = None + exchange: Optional[int] = None + id: Optional[str] = None + participant_timestamp: Optional[int] = None + price: Optional[float] = None + sequence_number: Optional[int] = None + sip_timestamp: Optional[int] = None + size: Optional[float] = None + tape: Optional[int] = None + trf_id: Optional[int] = None + trf_timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return Trade(**d) + + +@modelclass +class LastTrade: + "Contains data for the most recent trade for a given ticker symbol." + ticker: Optional[str] = None + trf_timestamp: Optional[int] = None + sequence_number: Optional[float] = None + sip_timestamp: Optional[int] = None + participant_timestamp: Optional[int] = None + conditions: Optional[List[int]] = None + correction: Optional[int] = None + id: Optional[str] = None + price: Optional[float] = None + trf_id: Optional[int] = None + size: Optional[float] = None + exchange: Optional[int] = None + tape: Optional[int] = None + + @staticmethod + def from_dict(d): + return LastTrade( + d.get("T", None), + d.get("f", None), + d.get("q", None), + d.get("t", None), + d.get("y", None), + d.get("c", None), + d.get("e", None), + d.get("i", None), + d.get("p", None), + d.get("r", None), + d.get("s", None), + d.get("x", None), + d.get("z", None), + ) + + +@modelclass +class CryptoTrade: + "Contains data for a crypto trade." + conditions: Optional[List[int]] = None + exchange: Optional[int] = None + price: Optional[float] = None + size: Optional[float] = None + timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return CryptoTrade(**d) diff --git a/polygon/rest/models/unmarshal.py b/polygon/rest/models/unmarshal.py deleted file mode 100644 index 720fe7c0..00000000 --- a/polygon/rest/models/unmarshal.py +++ /dev/null @@ -1,9 +0,0 @@ -from typing import Type - -from polygon.rest import models - - -def unmarshal_json(response_type, resp_json) -> Type[models.AnyDefinition]: - obj = models.name_to_class[response_type]() - obj.unmarshal_json(resp_json) - return obj diff --git a/polygon/rest/quotes.py b/polygon/rest/quotes.py new file mode 100644 index 00000000..31f46047 --- /dev/null +++ b/polygon/rest/quotes.py @@ -0,0 +1,143 @@ +from .base import BaseClient +from typing import Optional, Any, Dict, Union, Iterator +from .models import ( + Quote, + LastQuote, + LastForexQuote, + RealTimeCurrencyConversion, + Sort, + Order, + Precision, +) +from urllib3 import HTTPResponse +from datetime import datetime, date + +from .models.request import RequestOptionBuilder + + +# https://polygon.io/docs/stocks +class QuotesClient(BaseClient): + def list_quotes( + self, + ticker: str, + timestamp: Optional[Union[str, int, datetime, date]] = None, + timestamp_lt: Optional[Union[str, int, datetime, date]] = None, + timestamp_lte: Optional[Union[str, int, datetime, date]] = None, + timestamp_gt: Optional[Union[str, int, datetime, date]] = None, + timestamp_gte: Optional[Union[str, int, datetime, date]] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[Quote], HTTPResponse]: + """ + Get quotes for a ticker symbol in a given time range. + + :param ticker: The ticker symbol to get quotes for. + :param timestamp: Query by timestamp. Either a date with the format YYYY-MM-DD or a nanosecond timestamp. + :param timestamp_lt: Timestamp less than + :param timestamp_lte: Timestamp less than or equal to + :param timestamp_gt: Timestamp greater than + :param timestamp_gte: Timestamp greater than or equal to + :param limit: Limit the number of results returned per-page, default is 10 and max is 50000. + :param sort: Sort field used for ordering. + :param order: Order results based on the sort field. + :param params: Any additional query params. + :param raw: Return HTTPResponse object instead of results object. + :return: List of quotes + """ + url = f"/v3/quotes/{ticker}" + + return self._paginate( + path=url, + params=self._get_params(self.list_quotes, locals()), + raw=raw, + deserializer=Quote.from_dict, + options=options, + ) + + def get_last_quote( + self, + ticker: str, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[LastQuote, HTTPResponse]: + """ + Get the most recent NBBO (Quote) tick for a given stock. + + :param ticker: The ticker symbol of the stock/equity. + :param params: Any additional query params. + :param raw: Return HTTPResponse object instead of results object. + :return: Last Quote + """ + url = f"/v2/last/nbbo/{ticker}" + + return self._get( + path=url, + params=params, + result_key="results", + deserializer=LastQuote.from_dict, + raw=raw, + options=options, + ) + + def get_last_forex_quote( + self, + from_: str, + to: str, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[LastForexQuote, HTTPResponse]: + """ + Get the last quote tick for a forex currency pair. + + :param from_: The "from" symbol of the pair. + :param to: The "to" symbol of the pair. + :param params: Any additional query params. + :param raw: Return HTTPResponse object instead of results object. + :return: Last Forex Quote + """ + url = f"/v1/last_quote/currencies/{from_}/{to}" + + return self._get( + path=url, + params=params, + deserializer=LastForexQuote.from_dict, + raw=raw, + options=options, + ) + + def get_real_time_currency_conversion( + self, + from_: str, + to: str, + amount: Optional[float] = None, + precision: Union[int, Precision] = 2, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[RealTimeCurrencyConversion, HTTPResponse]: + """ + Get currency conversions using the latest market conversion rates. + + :param from_: The "from" symbol of the pair. + :param to: The "to" symbol of the pair. + :param amount: The amount to convert, with a decimal. + :param precision: The decimal precision of the conversion. Defaults to 2 which is 2 decimal places accuracy. + :param params: Any additional query params. + :param raw: Return HTTPResponse object instead of results object. + :return: Real-Time Currency Conversion + """ + url = f"/v1/conversion/{from_}/{to}" + + return self._get( + path=url, + params=self._get_params(self.get_real_time_currency_conversion, locals()), + deserializer=RealTimeCurrencyConversion.from_dict, + raw=raw, + options=options, + ) diff --git a/polygon/rest/reference.py b/polygon/rest/reference.py new file mode 100644 index 00000000..e1695cb2 --- /dev/null +++ b/polygon/rest/reference.py @@ -0,0 +1,739 @@ +from .base import BaseClient +from typing import Optional, Any, Dict, List, Union, Iterator +from .models import ( + MarketHoliday, + MarketStatus, + Ticker, + TickerChangeResults, + TickerDetails, + TickerNews, + RelatedCompany, + TickerTypes, + Sort, + Order, + AssetClass, + Locale, + Split, + Dividend, + DividendType, + Frequency, + Condition, + DataType, + SIP, + Exchange, + OptionsContract, + ShortInterest, + ShortVolume, + TreasuryYield, +) +from urllib3 import HTTPResponse +from datetime import date + +from .models.request import RequestOptionBuilder + + +class MarketsClient(BaseClient): + def get_market_holidays( + self, params: Optional[Dict[str, Any]] = None, raw: bool = False + ) -> Union[List[MarketHoliday], HTTPResponse]: + """ + Get upcoming market holidays and their open/close times. + + :param params: Any additional query params. + :param raw: Return HTTPResponse object instead of results object. + :return: List of market holidays. + """ + url = "/v1/marketstatus/upcoming" + + return self._get( + path=url, + params=params, + deserializer=MarketHoliday.from_dict, + raw=raw, + result_key="", + ) + + def get_market_status( + self, params: Optional[Dict[str, Any]] = None, raw: bool = False + ) -> Union[MarketStatus, HTTPResponse]: + """ + Get the current trading status of the exchanges and overall financial markets. + + :param params: Any additional query params. + :param raw: Return HTTPResponse object instead of results object. + :return: Market status. + """ + url = "/v1/marketstatus/now" + + return self._get( + path=url, params=params, deserializer=MarketStatus.from_dict, raw=raw + ) + + +class TickersClient(BaseClient): + def list_tickers( + self, + ticker: Optional[str] = None, + ticker_lt: Optional[str] = None, + ticker_lte: Optional[str] = None, + ticker_gt: Optional[str] = None, + ticker_gte: Optional[str] = None, + type: Optional[str] = None, + market: Optional[str] = None, + exchange: Optional[str] = None, + cusip: Optional[int] = None, + cik: Optional[int] = None, + date: Optional[str] = None, + active: Optional[bool] = None, + search: Optional[str] = None, + limit: Optional[int] = 10, + sort: Optional[Union[str, Sort]] = "ticker", + order: Optional[Union[str, Order]] = "asc", + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[Ticker], HTTPResponse]: + """ + Query all ticker symbols which are supported by Polygon.io. This API currently includes Stocks/Equities, Indices, Forex, and Crypto. + + :param ticker: Specify a ticker symbol. Defaults to empty string which queries all tickers. + :param ticker_lt: Ticker less than. + :param ticker_lte: Ticker less than or equal to. + :param ticker_gt: Ticker greater than. + :param ticker_gte: Ticker greater than or equal to. + :param type: Specify the type of the tickers. Find the types that we support via our Ticker Types API. Defaults to empty string which queries all types. + :param market: Filter by market type. By default all markets are included. + :param exchange: Specify the assets primary exchange Market Identifier Code (MIC) according to ISO 10383. Defaults to empty string which queries all exchanges. + :param cusip: Specify the CUSIP code of the asset you want to search for. Find more information about CUSIP codes at their website. Defaults to empty string which queries all CUSIPs. + :param cik: Specify the CIK of the asset you want to search for. Find more information about CIK codes at their website. Defaults to empty string which queries all CIKs. + :param date: Specify a point in time to retrieve tickers available on that date. Defaults to the most recent available date. + :param search: Search for terms within the ticker and/or company name. + :param active: Specify if the tickers returned should be actively traded on the queried date. Default is true. + :param limit: Limit the size of the response per-page, default is 100 and max is 1000. + :param sort: The field to sort the results on. Default is ticker. If the search query parameter is present, sort is ignored and results are ordered by relevance. + :param order: The order to sort the results on. Default is asc (ascending). + :param params: Any additional query params. + :param raw: Return raw object instead of results object. + :return: List of tickers. + """ + url = "/v3/reference/tickers" + + return self._paginate( + path=url, + params=self._get_params(self.list_tickers, locals()), + raw=raw, + deserializer=Ticker.from_dict, + options=options, + ) + + def get_ticker_details( + self, + ticker: Optional[str] = None, + date: Optional[str] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[TickerDetails, HTTPResponse]: + """ + Get a single ticker supported by Polygon.io. This response will have detailed information about the ticker and the company behind it. + + :param ticker: The ticker symbol of the asset. + :param date: Specify a point in time to get information about the ticker available on that date. When retrieving information from SEC filings, we compare this date with the period of report date on the SEC filing. + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: Ticker Details V3 + """ + url = f"/v3/reference/tickers/{ticker}" + + return self._get( + path=url, + params=self._get_params(self.get_ticker_details, locals()), + deserializer=TickerDetails.from_dict, + raw=raw, + result_key="results", + options=options, + ) + + def get_ticker_events( + self, + ticker: str, + types: Optional[str] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[TickerChangeResults, HTTPResponse]: + """ + Get event history of ticker given particular point in time. + :param ticker: The ticker symbol of the asset. + :param params: Additional query parameters + :param raw: Return raw object instead of results object. + :return: Ticker Event VX + """ + url = f"/vX/reference/tickers/{ticker}/events" + + return self._get( + path=url, + params=self._get_params(self.get_ticker_events, locals()), + deserializer=TickerChangeResults.from_dict, + result_key="results", + raw=raw, + options=options, + ) + + def list_ticker_news( + self, + ticker: Optional[str] = None, + ticker_lt: Optional[str] = None, + ticker_lte: Optional[str] = None, + ticker_gt: Optional[str] = None, + ticker_gte: Optional[str] = None, + published_utc: Optional[str] = None, + published_utc_lt: Optional[str] = None, + published_utc_lte: Optional[str] = None, + published_utc_gt: Optional[str] = None, + published_utc_gte: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[TickerNews], HTTPResponse]: + """ + Get the most recent news articles relating to a stock ticker symbol, including a summary of the article and a link to the original source. + + :param ticker: Return results that contain this ticker. + :param published_utc: Return results published on, before, or after this date. + :param limit: Limit the number of results returned per-page, default is 10 and max is 1000. + :param sort: Sort field used for ordering. + :param order: Order results based on the sort field. + :param params: Any additional query params. + :param raw: Return raw object instead of results object. + :return: Ticker News. + """ + url = "/v2/reference/news" + + return self._paginate( + path=url, + params=self._get_params(self.list_ticker_news, locals()), + raw=raw, + deserializer=TickerNews.from_dict, + options=options, + ) + + def get_ticker_types( + self, + asset_class: Optional[Union[str, AssetClass]] = None, + locale: Optional[Union[str, Locale]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[TickerTypes], HTTPResponse]: + """ + List all ticker types that Polygon.io has. + + :param asset_class: Filter by asset class. + :param locale: Filter by locale. + :param params: Any additional query params. + :param raw: Return raw object instead of results object. + :return: Ticker Types. + """ + url = "/v3/reference/tickers/types" + + return self._get( + path=url, + params=self._get_params(self.get_ticker_types, locals()), + deserializer=TickerTypes.from_dict, + raw=raw, + result_key="results", + options=options, + ) + + def get_related_companies( + self, + ticker: Optional[str] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[RelatedCompany, HTTPResponse]: + """ + Get a list of tickers related to the queried ticker based on News and Returns data. + + :param ticker: The ticker symbol to search. + :param params: Any additional query params. + :param raw: Return raw object instead of results object. + :return: Related Companies. + """ + url = f"/v1/related-companies/{ticker}" + + return self._get( + path=url, + params=self._get_params(self.get_related_companies, locals()), + deserializer=RelatedCompany.from_dict, + raw=raw, + result_key="results", + options=options, + ) + + +class SplitsClient(BaseClient): + def list_splits( + self, + ticker: Optional[str] = None, + ticker_lt: Optional[str] = None, + ticker_lte: Optional[str] = None, + ticker_gt: Optional[str] = None, + ticker_gte: Optional[str] = None, + execution_date: Optional[Union[str, date]] = None, + execution_date_lt: Optional[Union[str, date]] = None, + execution_date_lte: Optional[Union[str, date]] = None, + execution_date_gt: Optional[Union[str, date]] = None, + execution_date_gte: Optional[Union[str, date]] = None, + reverse_split: Optional[bool] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[Split], HTTPResponse]: + """ + Get a list of historical stock splits, including the ticker symbol, the execution date, and the factors of the split ratio. + + :param ticker: Return the stock splits that contain this ticker. + :param ticker_lt: Ticker less than. + :param ticker_lte: Ticker less than or equal to. + :param ticker_gt: Ticker greater than. + :param ticker_gte: Ticker greater than or equal to. + :param execution_date: Query by execution date with the format YYYY-MM-DD. + :param execution_date_lt: Execution date less than. + :param execution_date_lte: Execution date less than or equal to. + :param execution_date_gt: Execution date greater than. + :param execution_date_gte: Execution date greater than or equal to. + :param reverse_split: Query for reverse stock splits. A split ratio where split_from is greater than split_to represents a reverse split. By default this filter is not used. + :param limit: Limit the number of results returned per-page, default is 10 and max is 1000. + :param sort: Sort field used for ordering. + :param order: Order results based on the sort field. + :param params: Any additional query params. + :param raw: Return raw object instead of results object. + :return: List of splits. + """ + url = "/v3/reference/splits" + + return self._paginate( + path=url, + params=self._get_params(self.list_splits, locals()), + raw=raw, + deserializer=Split.from_dict, + options=options, + ) + + +class DividendsClient(BaseClient): + def list_dividends( + self, + ticker: Optional[str] = None, + ticker_lt: Optional[str] = None, + ticker_lte: Optional[str] = None, + ticker_gt: Optional[str] = None, + ticker_gte: Optional[str] = None, + ex_dividend_date: Optional[Union[str, date]] = None, + ex_dividend_date_lt: Optional[Union[str, date]] = None, + ex_dividend_date_lte: Optional[Union[str, date]] = None, + ex_dividend_date_gt: Optional[Union[str, date]] = None, + ex_dividend_date_gte: Optional[Union[str, date]] = None, + record_date: Optional[Union[str, date]] = None, + record_date_lt: Optional[Union[str, date]] = None, + record_date_lte: Optional[Union[str, date]] = None, + record_date_gt: Optional[Union[str, date]] = None, + record_date_gte: Optional[Union[str, date]] = None, + declaration_date: Optional[Union[str, date]] = None, + declaration_date_lt: Optional[Union[str, date]] = None, + declaration_date_lte: Optional[Union[str, date]] = None, + declaration_date_gt: Optional[Union[str, date]] = None, + declaration_date_gte: Optional[Union[str, date]] = None, + pay_date: Optional[Union[str, date]] = None, + pay_date_lt: Optional[Union[str, date]] = None, + pay_date_lte: Optional[Union[str, date]] = None, + pay_date_gt: Optional[Union[str, date]] = None, + pay_date_gte: Optional[Union[str, date]] = None, + frequency: Optional[Union[int, Frequency]] = None, + cash_amount: Optional[float] = None, + cash_amount_lt: Optional[float] = None, + cash_amount_lte: Optional[float] = None, + cash_amount_gt: Optional[float] = None, + cash_amount_gte: Optional[float] = None, + dividend_type: Optional[Union[str, DividendType]] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[Dividend], HTTPResponse]: + """ + Get a list of historical cash dividends, including the ticker symbol, declaration date, ex-dividend date, record date, pay date, frequency, and amount. + + :param ticker: Return the dividends that contain this ticker. + :param ticker_lt: Ticker less than. + :param ticker_lte: Ticker less than or equal to. + :param ticker_gt: Ticker greater than. + :param ticker_gte: Ticker greater than or equal to. + :param ex_dividend_date: Query by ex-dividend date with the format YYYY-MM-DD. + :param ex_dividend_date_lt: Ex-dividend date less than. + :param ex_dividend_date_lte: Ex-dividend date less than or equal to. + :param ex_dividend_date_gt: Ex-dividend date greater than. + :param ex_dividend_date_gte: Ex-dividend date greater than or equal to. + :param record_date: Query by record date with the format YYYY-MM-DD. + :param record_date_lt: Record date less than. + :param record_date_lte: Record date less than or equal to. + :param record_date_gt: Record date greater than. + :param record_date_gte: Record date greater than or equal to. + :param declaration_date: Query by declaration date with the format YYYY-MM-DD. + :param declaration_date_lt: Declaration date less than. + :param declaration_date_lte: Declaration date less than or equal to. + :param declaration_date_gt: Declaration date greater than. + :param declaration_date_gte: Declaration date greater than or equal to. + :param pay_date: Query by pay date with the format YYYY-MM-DD. + :param pay_date_lt: Pay date less than. + :param pay_date_lte: Pay date less than or equal to. + :param pay_date_gt: Pay date greater than. + :param pay_date_gte: Pay date greater than or equal to. + :param frequency: Query by 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). + :param cash_amount: Query by the cash amount of the dividend. + :param dividend_type: Query by the type of dividend. Dividends that have been paid and/or are expected to be paid on consistent schedules are denoted as CD. Special 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. + :param limit: Limit the number of results returned per-page, default is 10 and max is 1000. + :param sort: Sort field used for ordering. + :param order: Order results based on the sort field. + :param params: Any additional query params. + :param raw: Return raw object instead of results object. + :return: List of dividends. + """ + url = "/v3/reference/dividends" + + return self._paginate( + path=url, + params=self._get_params(self.list_dividends, locals()), + raw=raw, + deserializer=Dividend.from_dict, + options=options, + ) + + +class ConditionsClient(BaseClient): + def list_conditions( + self, + asset_class: Optional[Union[str, AssetClass]] = None, + data_type: Optional[Union[str, DataType]] = None, + id: Optional[int] = None, + sip: Optional[Union[str, SIP]] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[Condition], HTTPResponse]: + """ + List all conditions that Polygon.io uses. + + :param asset_class: Filter for conditions within a given asset class. + :param data_type: Data types that this condition applies to. + :param id: Filter for conditions with a given ID. + :param sip: Filter by SIP. If the condition contains a mapping for that SIP, the condition will be returned. + :param limit: Limit the number of results returned per-page, default is 10 and max is 1000. + :param sort: Sort field used for ordering. + :param order: Order results based on the sort field. + :param params: Any additional query params. + :param raw: Return raw object instead of results object. + :return: List of conditions. + """ + url = "/v3/reference/conditions" + + return self._paginate( + path=url, + params=self._get_params(self.list_conditions, locals()), + raw=raw, + deserializer=Condition.from_dict, + options=options, + ) + + +class ExchangesClient(BaseClient): + def get_exchanges( + self, + asset_class: Optional[Union[str, AssetClass]] = None, + locale: Optional[Union[str, Locale]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[Exchange], HTTPResponse]: + """ + List all exchanges that Polygon.io knows about. + + :param asset_class: Filter by asset class. + :param locale: Filter by locale. + :param params: Any additional query params. + :param raw: Return HTTPResponse object instead of results object. + :return: List of exchanges. + """ + url = "/v3/reference/exchanges" + + return self._get( + path=url, + params=self._get_params(self.get_exchanges, locals()), + deserializer=Exchange.from_dict, + raw=raw, + result_key="results", + options=options, + ) + + +class ContractsClient(BaseClient): + def get_options_contract( + self, + ticker: str, + as_of: Optional[Union[str, date]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[OptionsContract, HTTPResponse]: + """ + Get the most recent trade for a ticker. + + :param ticker: The ticker symbol of the asset + :param as_of: Specify a point in time for the contract as of this date with format YYYY-MM-DD. + :param params: Any additional query params. + :param raw: Return raw object instead of results object. + :return: Last trade. + """ + url = f"/v3/reference/options/contracts/{ticker}" + + return self._get( + path=url, + params=self._get_params(self.get_options_contract, locals()), + result_key="results", + deserializer=OptionsContract.from_dict, + raw=raw, + options=options, + ) + + def list_options_contracts( + self, + underlying_ticker: Optional[str] = None, + underlying_ticker_lt: Optional[str] = None, + underlying_ticker_lte: Optional[str] = None, + underlying_ticker_gt: Optional[str] = None, + underlying_ticker_gte: Optional[str] = None, + contract_type: Optional[str] = None, + expiration_date: Optional[Union[str, date]] = None, + expiration_date_lt: Optional[Union[str, date]] = None, + expiration_date_lte: Optional[Union[str, date]] = None, + expiration_date_gt: Optional[Union[str, date]] = None, + expiration_date_gte: Optional[Union[str, date]] = None, + as_of: Optional[Union[str, date]] = None, + strike_price: Optional[float] = None, + strike_price_lt: Optional[float] = None, + strike_price_lte: Optional[float] = None, + strike_price_gt: Optional[float] = None, + strike_price_gte: Optional[float] = None, + expired: Optional[bool] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[OptionsContract], HTTPResponse]: + """ + List historical options contracts. + + :param underlying_ticker: Query for contracts relating to an underlying stock ticker. + :param contract_type: Query by the type of contract. + :param expiration_date: Query by contract expiration with date format YYYY-MM-DD. + :param as_of: Specify a point in time for contracts as of this date with format YYYY-MM-DD. + :param strike_price: Query by strike price of a contract. + :param expired: Query for expired contracts. + :param limit: Limit the number of results returned per-page, default is 10 and max is 1000. + :param sort: Sort field used for ordering. + :param order: Order results based on the sort field. + :param params: Any additional query params. + :param raw: Return raw object instead of results object + :return: List of options contracts. + """ + url = "/v3/reference/options/contracts" + + return self._paginate( + path=url, + params=self._get_params(self.list_options_contracts, locals()), + raw=raw, + deserializer=OptionsContract.from_dict, + options=options, + ) + + def list_short_interest( + self, + ticker: Optional[str] = None, + days_to_cover: Optional[str] = None, + days_to_cover_lt: Optional[str] = None, + days_to_cover_lte: Optional[str] = None, + days_to_cover_gt: Optional[str] = None, + days_to_cover_gte: Optional[str] = None, + settlement_date: Optional[str] = None, + settlement_date_lt: Optional[str] = None, + settlement_date_lte: Optional[str] = None, + settlement_date_gt: Optional[str] = None, + settlement_date_gte: Optional[str] = None, + avg_daily_volume: Optional[str] = None, + avg_daily_volume_lt: Optional[str] = None, + avg_daily_volume_lte: Optional[str] = None, + avg_daily_volume_gt: Optional[str] = None, + avg_daily_volume_gte: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[ShortInterest], HTTPResponse]: + """ + Retrieve short interest data for stocks. + + :param ticker: Filter by the primary ticker symbol. + :param days_to_cover: Filter by the days to cover value. + :param days_to_cover_lt: Filter for days to cover dates less than the provided date. + :param days_to_cover_lte: Filter for days to cover dates less than or equal to the provided date. + :param days_to_cover_gt: Filter for days to cover dates greater than the provided date. + :param days_to_cover_gte: Filter for days to cover dates greater than or equal to the provided date. + :param settlement_date: Filter by settlement date (YYYY-MM-DD). + :param settlement_date_lt: Filter for settlement dates less than the provided date. + :param settlement_date_lte: Filter for settlement dates less than or equal to the provided date. + :param settlement_date_gt: Filter for settlement dates greater than the provided date. + :param settlement_date_gte: Filter for settlement dates greater than or equal to the provided date. + :param avg_daily_volume: Filter by average daily volume. + :param avg_daily_volume_lt: Filter for average daily volume dates less than the provided date. + :param avg_daily_volume_lte: Filter for average daily volume dates less than or equal to the provided date. + :param avg_daily_volume_gt: Filter for average daily volume dates greater than the provided date. + :param avg_daily_volume_gte: Filter for average daily volume dates greater than or equal to the provided date. + :param limit: Limit the number of results returned. Default 10, max 50000. + :param sort: Field to sort by (e.g., "ticker"). + :param order: Order results based on the sort field ("asc" or "desc"). Default "desc". + :param params: Additional query parameters. + :param raw: Return raw HTTPResponse object if True, else return List[ShortInterest]. + :param options: RequestOptionBuilder for additional headers or params. + :return: A list of ShortInterest objects or HTTPResponse if raw=True. + """ + url = "/stocks/v1/short-interest" + + return self._paginate( + path=url, + params=self._get_params(self.list_short_interest, locals()), + deserializer=ShortInterest.from_dict, + raw=raw, + result_key="results", + options=options, + ) + + def list_short_volume( + self, + ticker: Optional[str] = None, + date: Optional[str] = None, + date_lt: Optional[str] = None, + date_lte: Optional[str] = None, + date_gt: Optional[str] = None, + date_gte: Optional[str] = None, + short_volume_ratio: Optional[str] = None, + short_volume_ratio_lt: Optional[str] = None, + short_volume_ratio_lte: Optional[str] = None, + short_volume_ratio_gt: Optional[str] = None, + short_volume_ratio_gte: Optional[str] = None, + total_volume: Optional[str] = None, + total_volume_lt: Optional[str] = None, + total_volume_lte: Optional[str] = None, + total_volume_gt: Optional[str] = None, + total_volume_gte: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[ShortVolume], HTTPResponse]: + """ + Retrieve short volume data for stocks. + + :param ticker: Filter by the primary ticker symbol. + :param date: Filter by the date of trade activity (YYYY-MM-DD). + :param date_lt: Filter for dates less than the provided date. + :param date_lte: Filter for dates less than or equal to the provided date. + :param date_gt: Filter for dates greater than the provided date. + :param date_gte: Filter for dates greater than or equal to the provided date. + :param short_volume_ratio: Filter by short volume ratio. + :param short_volume_ratio_lt: Filter for short volume ratio less than the provided date. + :param short_volume_ratio_lte: Filter for short volume ratio less than or equal to the provided date. + :param short_volume_ratio_gt: Filter for short volume ratio greater than the provided date. + :param short_volume_ratio_gte: Filter for short volume ratio greater than or equal to the provided date. + :param total_volume: Filter by total volume. + :param total_volume_lt: Filter for total volume less than the provided date. + :param total_volume_lte: Filter for total volume less than or equal to the provided date. + :param total_volume_gt: Filter for total volume greater than the provided date. + :param total_volume_gte: Filter for total volume greater than or equal to the provided date. + :param limit: Limit the number of results returned. Default 10, max 50000. + :param sort: Field to sort by (e.g., "ticker"). + :param order: Order results based on the sort field ("asc" or "desc"). Default "desc". + :param params: Additional query parameters. + :param raw: Return raw HTTPResponse object if True, else return List[ShortVolume]. + :param options: RequestOptionBuilder for additional headers or params. + :return: A list of ShortVolume objects or HTTPResponse if raw=True. + """ + url = "/stocks/v1/short-volume" + + return self._paginate( + path=url, + params=self._get_params(self.list_short_volume, locals()), + deserializer=ShortVolume.from_dict, + raw=raw, + result_key="results", + options=options, + ) + + def list_treasury_yields( + self, + date: Optional[str] = None, + date_gt: Optional[str] = None, + date_gte: Optional[str] = None, + date_lt: Optional[str] = None, + date_lte: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[TreasuryYield], HTTPResponse]: + """ + Retrieve treasury yield data. + + :param date: Calendar date of the yield observation (YYYY-MM-DD). + :param date_gt: Filter for dates greater than the provided date. + :param date_gte: Filter for dates greater than or equal to the provided date. + :param date_lt: Filter for dates less than the provided date. + :param date_lte: Filter for dates less than or equal to the provided date. + :param limit: Limit the number of results returned. Default 100, max 50000. + :param sort: Field to sort by (e.g., "date"). Default "date". + :param order: Order results based on the sort field ("asc" or "desc"). Default "desc". + :param params: Additional query parameters. + :param raw: Return raw HTTPResponse object if True, else return List[TreasuryYield]. + :param options: RequestOptionBuilder for additional headers or params. + :return: A list of TreasuryYield objects or HTTPResponse if raw=True. + """ + url = "/fed/v1/treasury-yields" + + return self._paginate( + path=url, + params=self._get_params(self.list_treasury_yields, locals()), + deserializer=TreasuryYield.from_dict, + raw=raw, + result_key="results", + options=options, + ) diff --git a/polygon/rest/snapshot.py b/polygon/rest/snapshot.py new file mode 100644 index 00000000..3d6a6ce7 --- /dev/null +++ b/polygon/rest/snapshot.py @@ -0,0 +1,256 @@ +from .base import BaseClient +from typing import Optional, Any, Dict, List, Union, Iterator +from .models import ( + TickerSnapshot, + Direction, + OptionContractSnapshot, + SnapshotMarketType, + SnapshotTickerFullBook, + UniversalSnapshot, + IndicesSnapshot, + Sort, + Order, +) +from urllib3 import HTTPResponse + +from .models.request import RequestOptionBuilder + + +def get_locale(market_type: Union[SnapshotMarketType, str]): + if market_type == SnapshotMarketType.STOCKS.value: + return "us" + + return "global" + + +class SnapshotClient(BaseClient): + def list_universal_snapshots( + self, + type: Optional[Union[str, SnapshotMarketType]] = None, + ticker_any_of: Optional[List[str]] = None, + order: Optional[Union[str, Order]] = None, + limit: Optional[int] = 10, + sort: Optional[Union[str, Sort]] = None, + ticker_lt: Optional[str] = None, + ticker_lte: Optional[str] = None, + ticker_gt: Optional[str] = None, + ticker_gte: Optional[str] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[UniversalSnapshot], HTTPResponse]: + """ + Get snapshots for assets of all types + - https://polygon.io/docs/stocks/get_v3_snapshot + - https://polygon.io/docs/options/get_v3_snapshot + - https://polygon.io/docs/indices/get_v3_snapshot + - https://polygon.io/docs/forex/get_v3_snapshot + - https://polygon.io/docs/crypto/get_v3_snapshot + + :param type: the type of the asset + :param ticker_any_of: Comma-separated list of tickers, up to a maximum of 250. If no tickers are passed then all + :param order: The order to sort the results on. Default is asc (ascending). + :param limit: Limit the size of the response per-page, default is 10 and max is 250. + :param sort: The field to sort the results on. Default is ticker. If the search query parameter is present, sort is ignored and results are ordered by relevance. + results will be returned in a paginated manner. Warning: The maximum number of characters allowed in a URL + are subject to your technology stack. + :param ticker_lt search for tickers less than + :param ticker_lte search for tickers less than or equal to + :param ticker_gt search for tickers greater than + :param ticker_gte search for tickers greater than or equal to + :param raw: returns the raw HTTP response if true, else the response is deserialized into a structured object + :param options: request options + :return: list of Snapshots + """ + url = f"/v3/snapshot" + return self._paginate( + path=url, + params=self._get_params(self.list_universal_snapshots, locals()), + result_key="results", + deserializer=UniversalSnapshot.from_dict, + raw=raw, + options=options, + ) + + def get_snapshot_all( + self, + market_type: Union[str, SnapshotMarketType], + tickers: Optional[Union[str, List[str]]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + include_otc: Optional[bool] = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[TickerSnapshot], HTTPResponse]: + """ + Get the most up-to-date market data for all traded stock symbols. + + Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST. + + :param market_type: Which market to get a snapshot of. + :param tickers: A comma separated list of tickers to get snapshots for. + :param include_otc: Include OTC securities in the response. Default is false (don't include OTC securities). + :return: List of Snapshots + """ + locale = get_locale(market_type) + url = f"/v2/snapshot/locale/{locale}/markets/{market_type}/tickers" + if type(tickers) is list: + tickers = ",".join(tickers) + return self._get( + path=url, + params=self._get_params(self.get_snapshot_all, locals()), + deserializer=TickerSnapshot.from_dict, + raw=raw, + result_key="tickers", + options=options, + ) + + def get_snapshot_direction( + self, + market_type: Union[str, SnapshotMarketType], + direction: Union[str, Direction], + params: Optional[Dict[str, Any]] = None, + include_otc: Optional[bool] = False, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[TickerSnapshot], HTTPResponse]: + """ + Get the most up-to-date market data for the current top 20 gainers or losers of the day in the stocks/equities markets. + + Top gainers are those tickers whose price has increased by the highest percentage since the previous day's close. Top losers are those tickers whose price has decreased by the highest percentage since the previous day's close. + + Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. + + :param market_type: Which market to get a snapshot of. + :param direction: The direction ("gainers" or "losers") + :param include_otc: Include OTC securities in the response. Default is false (don't include OTC securities). + :return: List of Snapshots + """ + locale = get_locale(market_type) + url = f"/v2/snapshot/locale/{locale}/markets/{market_type}/{direction}" + return self._get( + path=url, + params=self._get_params(self.get_snapshot_direction, locals()), + result_key="tickers", + deserializer=TickerSnapshot.from_dict, + raw=raw, + options=options, + ) + + def get_snapshot_ticker( + self, + market_type: Union[str, SnapshotMarketType], + ticker: str, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[TickerSnapshot, HTTPResponse]: + """ + Get the most up-to-date market data for all traded stock symbols. + + Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. This can happen as early as 4am EST. + + :param market_type: Which market to get a snapshot of. + :param ticker: The ticker symbol. + :return: List of Snapshots + """ + locale = get_locale(market_type) + url = f"/v2/snapshot/locale/{locale}/markets/{market_type}/tickers/{ticker}" + return self._get( + path=url, + params=self._get_params(self.get_snapshot_ticker, locals()), + result_key="ticker", + deserializer=TickerSnapshot.from_dict, + raw=raw, + options=options, + ) + + def get_snapshot_option( + self, + underlying_asset: str, + option_contract: str, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[OptionContractSnapshot, HTTPResponse]: + """ + Get the snapshot of an option contract for a stock equity. + + :param underlying_asset: The underlying ticker symbol of the option contract. + :param option_contract: The option contract identifier. + :return: List of Snapshots + """ + url = f"/v3/snapshot/options/{underlying_asset}/{option_contract}" + return self._get( + path=url, + params=self._get_params(self.get_snapshot_option, locals()), + result_key="results", + deserializer=OptionContractSnapshot.from_dict, + raw=raw, + options=options, + ) + + def list_snapshot_options_chain( + self, + underlying_asset: str, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[OptionContractSnapshot], HTTPResponse]: + """ + Get the snapshot of all options contracts for an underlying ticker. + + :param underlying_asset: The underlying ticker symbol of the option contract. + :return: List of Snapshots + """ + url = f"/v3/snapshot/options/{underlying_asset}" + return self._paginate( + path=url, + params=self._get_params(self.list_snapshot_options_chain, locals()), + result_key="results", + deserializer=OptionContractSnapshot.from_dict, + raw=raw, + options=options, + ) + + def get_snapshot_crypto_book( + self, + ticker: str, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[SnapshotTickerFullBook, HTTPResponse]: + """ + Get the current level 2 book of a single ticker. This is the combined book from all of the exchanges. + + Note: Snapshot data is cleared at 12am EST and gets populated as data is received from the exchanges. + + :param ticker: The ticker symbol. + :return: List of Snapshots + """ + url = f"/v2/snapshot/locale/global/markets/crypto/tickers/{ticker}/book" + return self._get( + path=url, + params=self._get_params(self.get_snapshot_crypto_book, locals()), + result_key="data", + deserializer=SnapshotTickerFullBook.from_dict, + raw=raw, + options=options, + ) + + def get_snapshot_indices( + self, + ticker_any_of: Optional[Union[str, List[str]]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[IndicesSnapshot], HTTPResponse]: + url = f"/v3/snapshot/indices" + + return self._get( + path=url, + params=self._get_params(self.get_snapshot_indices, locals()), + deserializer=IndicesSnapshot.from_dict, + raw=raw, + result_key="results", + options=options, + ) diff --git a/polygon/rest/summaries.py b/polygon/rest/summaries.py new file mode 100644 index 00000000..bc91825c --- /dev/null +++ b/polygon/rest/summaries.py @@ -0,0 +1,35 @@ +from polygon.rest.models.summaries import SummaryResult +from .base import BaseClient +from typing import Optional, Any, Dict, List, Union +from urllib3 import HTTPResponse + +from .models.request import RequestOptionBuilder + + +class SummariesClient(BaseClient): + def get_summaries( + self, + ticker_any_of: Optional[List[str]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[SummaryResult], HTTPResponse]: + """ + GetSummaries retrieves summaries for the ticker list with the given params. + For more details see https://polygon.io/docs/stocks/get_v1_summaries. + + :param ticker_any_of: The ticker symbol + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: SummaryResults + """ + + url = f"/v1/summaries" + return self._get( + path=url, + params=self._get_params(self.get_summaries, locals()), + result_key="results", + deserializer=SummaryResult.from_dict, + raw=raw, + options=options, + ) diff --git a/polygon/rest/trades.py b/polygon/rest/trades.py new file mode 100644 index 00000000..3aad1d0e --- /dev/null +++ b/polygon/rest/trades.py @@ -0,0 +1,104 @@ +from .base import BaseClient +from typing import Optional, Any, Dict, Union, Iterator +from .models import Trade, LastTrade, CryptoTrade, Sort, Order +from urllib3 import HTTPResponse +from datetime import datetime, date + +from .models.request import RequestOptionBuilder + + +class TradesClient(BaseClient): + def list_trades( + self, + ticker: str, + timestamp: Optional[Union[str, int, datetime, date]] = None, + timestamp_lt: Optional[Union[str, int, datetime, date]] = None, + timestamp_lte: Optional[Union[str, int, datetime, date]] = None, + timestamp_gt: Optional[Union[str, int, datetime, date]] = None, + timestamp_gte: Optional[Union[str, int, datetime, date]] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[Trade], HTTPResponse]: + """ + Get trades for a ticker symbol in a given time range. + + :param ticker: The ticker symbol. + :param timestamp: Either a date with the format YYYY-MM-DD or a nanosecond timestamp. + :param timestamp_lt: Timestamp less than + :param timestamp_lte: Timestamp less than or equal to + :param timestamp_gt: Timestamp greater than + :param timestamp_gte: Timestamp greater than or equal to + :param limit: Limits the number of base aggregates queried per-page to create the aggregate results. Max 50000 and Default 5000. Read more about how limit is used to calculate aggregate results in our article on Aggregate Data API Improvements. + :param sort: Sort the results by timestamp. asc will return results in ascending order (oldest at the top), desc will return results in descending order (newest at the top).The end of the aggregate time window. + :param order: Order results based on the sort field + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: Iterator of trades + """ + url = f"/v3/trades/{ticker}" + + return self._paginate( + path=url, + params=self._get_params(self.list_trades, locals()), + raw=raw, + deserializer=Trade.from_dict, + options=options, + ) + + def get_last_trade( + self, + ticker: str, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[LastTrade, HTTPResponse]: + """ + Get the most recent trade for a ticker. + + :param ticker: The ticker symbol of the asset + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: Last trade + """ + url = f"/v2/last/trade/{ticker}" + + return self._get( + path=url, + params=self._get_params(self.get_last_trade, locals()), + result_key="results", + deserializer=LastTrade.from_dict, + raw=raw, + options=options, + ) + + def get_last_crypto_trade( + self, + from_: str, + to: str, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[CryptoTrade, HTTPResponse]: + """ + Get the last trade tick for a cryptocurrency pair. + + :param from_: The "from" symbol of the pair. + :param to: The "to" symbol of the pair. + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: Last crypto trade + """ + url = f"/v1/last/crypto/{from_}/{to}" + + return self._get( + path=url, + params=self._get_params(self.get_last_crypto_trade, locals()), + result_key="last", + deserializer=CryptoTrade.from_dict, + raw=raw, + options=options, + ) diff --git a/polygon/rest/vX.py b/polygon/rest/vX.py new file mode 100644 index 00000000..ebd95a1a --- /dev/null +++ b/polygon/rest/vX.py @@ -0,0 +1,122 @@ +from .base import BaseClient +from typing import Optional, Any, Dict, List, Union, Iterator +from .models import ( + StockFinancial, + IPOListing, + Timeframe, + Sort, + Order, +) +from urllib3 import HTTPResponse +from datetime import datetime, date +from .models.request import RequestOptionBuilder + + +class VXClient(BaseClient): + def list_stock_financials( + self, + ticker: Optional[str] = None, + cik: Optional[str] = None, + company_name: Optional[str] = None, + company_name_search: Optional[str] = None, + sic: Optional[str] = None, + filing_date: Optional[Union[str, int, datetime, date]] = None, + filing_date_lt: Optional[Union[str, int, datetime, date]] = None, + filing_date_lte: Optional[Union[str, int, datetime, date]] = None, + filing_date_gt: Optional[Union[str, int, datetime, date]] = None, + filing_date_gte: Optional[Union[str, int, datetime, date]] = None, + period_of_report_date: Optional[Union[str, int, datetime, date]] = None, + period_of_report_date_lt: Optional[Union[str, int, datetime, date]] = None, + period_of_report_date_lte: Optional[Union[str, int, datetime, date]] = None, + period_of_report_date_gt: Optional[Union[str, int, datetime, date]] = None, + period_of_report_date_gte: Optional[Union[str, int, datetime, date]] = None, + timeframe: Optional[Union[str, Timeframe]] = None, + include_sources: Optional[bool] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[Iterator[StockFinancial], HTTPResponse]: + """ + Get historical financial data for a stock ticker. + + :param ticker: Query by company ticker. + :param cik: Query by central index key (CIK) Number. + :param company_name: Query by company name. + :param company_name_search: Query by company name with partial-match text search. + :param sic: Query by standard industrial classification (SIC). + :param filing_date: Query by the date when the filing with financials data was filed in YYYY-MM-DD format. + :param filing_date_lt: filing_date less than. + :param filing_date_lte: filing_date less than or equal to. + :param filing_date_gt: filing_date greater than. + :param filing_date_gte: filing_date greater than or equal to. + :param period_of_report_date: The period of report for the period_of_report with financials data in YYYY-MM-DD format. + :param period_of_report_date_lt: period_of_report_date less than. + :param period_of_report_date_lte: period_of_report_date less than or equal to. + :param period_of_report_date_gt: period_of_report_date greater than. + :param period_of_report_date_gte: period_of_report_date greater than or equal to. + :param timeframe: Query by timeframe. + :param include_sources: Whether or not to include the xpath and formula attributes for each financial data point. + :param limit: Limit the number of results returned per-page, default is 10 and max is 100. + :param sort: Sort field used for ordering. + :param order: Order results based on the sort field. + :param params: Any additional query params + :param raw: Return raw object instead of results object + :return: Iterator of financials + """ + url = "/vX/reference/financials" + + return self._paginate( + path=url, + params=self._get_params(self.list_stock_financials, locals()), + raw=raw, + deserializer=StockFinancial.from_dict, + options=options, + ) + + def list_ipos( + self, + ticker: Optional[str] = None, + us_code: Optional[str] = None, + isin: Optional[str] = None, + listing_date: Optional[str] = None, + listing_date_lt: Optional[str] = None, + listing_date_lte: Optional[str] = None, + listing_date_gt: Optional[str] = None, + listing_date_gte: Optional[str] = None, + ipo_status: Optional[str] = None, + limit: Optional[int] = None, + sort: Optional[Union[str, Sort]] = None, + order: Optional[Union[str, Order]] = None, + params: Optional[Dict[str, Any]] = None, + raw: bool = False, + options: Optional[RequestOptionBuilder] = None, + ) -> Union[List[IPOListing], HTTPResponse]: + """ + Retrieve upcoming or historical IPOs. + + :param ticker: Filter by a case-sensitive ticker symbol. + :param us_code: Filter by a US code (unique identifier for a North American financial security). + :param isin: Filter by an International Securities Identification Number (ISIN). + :param listing_date: Filter by the listing date (YYYY-MM-DD). + :param ipo_status: Filter by IPO status (e.g. "new", "pending", "history", etc.). + :param limit: Limit the number of results per page. Default 10, max 1000. + :param sort: Field to sort by. Default is "listing_date". + :param order: Order results based on the sort field ("asc" or "desc"). Default "desc". + :param params: Additional query params. + :param raw: Return raw HTTPResponse object if True, else return List[IPOListing]. + :param options: RequestOptionBuilder for additional headers or params. + :return: A list of IPOListing objects or HTTPResponse if raw=True. + """ + url = "/vX/reference/ipos" + + return self._paginate( + path=url, + params=self._get_params(self.list_ipos, locals()), + deserializer=IPOListing.from_dict, + raw=raw, + result_key="results", + options=options, + ) diff --git a/polygon/websocket/__init__.py b/polygon/websocket/__init__.py index a0f9603a..77865d3f 100644 --- a/polygon/websocket/__init__.py +++ b/polygon/websocket/__init__.py @@ -1 +1,268 @@ -from .websocket_client import WebSocketClient, STOCKS_CLUSTER, FOREX_CLUSTER, CRYPTO_CLUSTER +import os +from enum import Enum +from typing import Optional, Union, List, Set, Callable, Awaitable, Any +import logging +import json +import asyncio +import ssl +import certifi +from .models import * +from websockets.client import connect, WebSocketClientProtocol +from websockets.exceptions import ConnectionClosedOK, ConnectionClosedError +from ..logging import get_logger +import logging +from ..exceptions import AuthError + +env_key = "POLYGON_API_KEY" +logger = get_logger("WebSocketClient") + + +class WebSocketClient: + def __init__( + self, + api_key: Optional[str] = os.getenv(env_key), + feed: Union[str, Feed] = Feed.RealTime, + market: Union[str, Market] = Market.Stocks, + raw: bool = False, + verbose: bool = False, + subscriptions: Optional[List[str]] = None, + max_reconnects: Optional[int] = 5, + secure: bool = True, + custom_json: Optional[Any] = None, + **kwargs, + ): + """ + Initialize a Polygon WebSocketClient. + + :param api_key: Your API key. + :param feed: The feed to subscribe to. + :param raw: Whether to pass raw Union[str, bytes] to user callback. + :param verbose: Whether to log client and server status messages. + :param subscriptions: List of subscription parameters. + :param max_reconnects: How many times to reconnect on network outage before ending .connect event loop. + :param custom_json: Optional module exposing loads/dumps functions (similar to Python's json module) to be used for JSON conversions. + :return: A client. + """ + if api_key is None: + raise AuthError( + f"Must specify env var {env_key} or pass api_key in constructor" + ) + self.api_key = api_key + self.feed = feed + self.market = market + self.raw = raw + if verbose: + logger.setLevel(logging.DEBUG) + self.websocket_cfg = kwargs + if isinstance(feed, Enum): + feed = feed.value + if isinstance(market, Enum): + market = market.value + self.url = f"ws{'s' if secure else ''}://{feed}/{market}" + self.subscribed = False + self.subs: Set[str] = set() + self.max_reconnects = max_reconnects + self.websocket: Optional[WebSocketClientProtocol] = None + if subscriptions is None: + subscriptions = [] + self.scheduled_subs: Set[str] = set(subscriptions) + self.schedule_resub = True + if custom_json: + self.json = custom_json + else: + self.json = json + + # https://websockets.readthedocs.io/en/stable/reference/client.html#opening-a-connection + async def connect( + self, + processor: Union[ + Callable[[List[WebSocketMessage]], Awaitable], + Callable[[Union[str, bytes]], Awaitable], + ], + close_timeout: int = 1, + **kwargs, + ): + """ + Connect to websocket server and run `processor(msg)` on every new `msg`. + + :param processor: The callback to process messages. + :param close_timeout: How long to wait for handshake when calling .close. + :raises AuthError: If invalid API key is supplied. + """ + reconnects = 0 + logger.debug("connect: %s", self.url) + # darwin needs some extra <3 + ssl_context = None + if self.url.startswith("wss://"): + ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + ssl_context.load_verify_locations(certifi.where()) + + async for s in connect( + self.url, close_timeout=close_timeout, ssl=ssl_context, **kwargs + ): + self.websocket = s + try: + msg = await s.recv() + logger.debug("connected: %s", msg) + logger.debug("authing...") + await s.send( + self.json.dumps({"action": "auth", "params": self.api_key}) + ) + auth_msg = await s.recv() + auth_msg_parsed = self.json.loads(auth_msg) + logger.debug("authed: %s", auth_msg) + if auth_msg_parsed[0]["status"] == "auth_failed": + raise AuthError(auth_msg_parsed[0]["message"]) + while True: + if self.schedule_resub: + logger.debug( + "reconciling: %s %s", self.subs, self.scheduled_subs + ) + new_subs = self.scheduled_subs.difference(self.subs) + await self._subscribe(new_subs) + old_subs = self.subs.difference(self.scheduled_subs) + await self._unsubscribe(old_subs) + self.subs = self.scheduled_subs + self.subs = set(self.scheduled_subs) + self.schedule_resub = False + + try: + cmsg: Union[List[WebSocketMessage], Union[str, bytes]] = ( + await asyncio.wait_for(s.recv(), timeout=1) + ) + except asyncio.TimeoutError: + continue + + if not self.raw: + # we know cmsg is Data + msgJson = self.json.loads(cmsg) # type: ignore + for m in msgJson: + if m["ev"] == "status": + logger.debug("status: %s", m["message"]) + continue + cmsg = parse(msgJson, logger) + + if len(cmsg) > 0: + await processor(cmsg) # type: ignore + except ConnectionClosedOK as e: + logger.debug("connection closed (OK): %s", e) + return + except ConnectionClosedError as e: + logger.debug("connection closed (ERR): %s", e) + reconnects += 1 + self.scheduled_subs = set(self.subs) + self.subs = set() + self.schedule_resub = True + if self.max_reconnects is not None and reconnects > self.max_reconnects: + return + continue + + def run( + self, + handle_msg: Union[ + Callable[[List[WebSocketMessage]], None], + Callable[[Union[str, bytes]], None], + ], + close_timeout: int = 1, + **kwargs, + ): + """ + Connect to websocket server and run `processor(msg)` on every new `msg`. Synchronous version of `.connect`. + + :param processor: The callback to process messages. + :param close_timeout: How long to wait for handshake when calling .close. + :raises AuthError: If invalid API key is supplied. + """ + + async def handle_msg_wrapper(msgs): + handle_msg(msgs) + + asyncio.run(self.connect(handle_msg_wrapper, close_timeout, **kwargs)) + + async def _subscribe(self, topics: Union[List[str], Set[str]]): + if self.websocket is None or len(topics) == 0: + return + subs = ",".join(topics) + logger.debug("subbing: %s", subs) + await self.websocket.send( + self.json.dumps({"action": "subscribe", "params": subs}) + ) + + async def _unsubscribe(self, topics: Union[List[str], Set[str]]): + if self.websocket is None or len(topics) == 0: + return + subs = ",".join(topics) + logger.debug("unsubbing: %s", subs) + await self.websocket.send( + self.json.dumps({"action": "unsubscribe", "params": subs}) + ) + + @staticmethod + def _parse_subscription(s: str): + s = s.strip() + split = s.split(".", 1) # Split at the first period + if len(split) != 2: + logger.warning("invalid subscription:", s) + return [None, None] + + return split + + def subscribe(self, *subscriptions: str): + """ + Subscribe to given subscriptions. + + :param subscriptions: Subscriptions (args) + """ + for s in subscriptions: + topic, sym = self._parse_subscription(s) + if topic == None: + continue + logger.debug("sub desired: %s", s) + self.scheduled_subs.add(s) + # If user subs to X.*, remove other X.\w+ + if sym == "*": + for t in list(self.subs): + if t.startswith(topic): + self.scheduled_subs.discard(t) + + self.schedule_resub = True + + def unsubscribe(self, *subscriptions: str): + """ + Unsubscribe from given subscriptions. + + :param subscriptions: Subscriptions (args) + """ + for s in subscriptions: + topic, sym = self._parse_subscription(s) + if topic == None: + continue + logger.debug("sub undesired: %s", s) + self.scheduled_subs.discard(s) + + # If user unsubs to X.*, remove other X.\w+ + if sym == "*": + for t in list(self.subs): + if t.startswith(topic): + self.scheduled_subs.discard(t) + + self.schedule_resub = True + + def unsubscribe_all(self): + """ + Unsubscribe from all subscriptions. + """ + self.scheduled_subs = set() + self.schedule_resub = True + + async def close(self): + """ + Close the websocket connection. + """ + logger.debug("closing") + + if self.websocket: + await self.websocket.close() + self.websocket = None + else: + logger.warning("no websocket open to close") diff --git a/polygon/websocket/models/__init__.py b/polygon/websocket/models/__init__.py new file mode 100644 index 00000000..06cab55d --- /dev/null +++ b/polygon/websocket/models/__init__.py @@ -0,0 +1,52 @@ +from typing import Dict, Any, List +from .common import * +from .models import * +import logging + + +def parse_single(data: Dict[str, Any]): + event_type = data["ev"] + if event_type in [EventType.EquityAgg.value, EventType.EquityAggMin.value]: + return EquityAgg.from_dict(data) + elif event_type in [ + EventType.CryptoAgg.value, + EventType.CryptoAggSec.value, + EventType.ForexAgg.value, + EventType.ForexAggSec.value, + ]: + return CurrencyAgg.from_dict(data) + elif event_type == EventType.EquityTrade.value: + return EquityTrade.from_dict(data) + elif event_type == EventType.CryptoTrade.value: + return CryptoTrade.from_dict(data) + elif event_type == EventType.EquityQuote.value: + return EquityQuote.from_dict(data) + elif event_type == EventType.ForexQuote.value: + return ForexQuote.from_dict(data) + elif event_type == EventType.CryptoQuote.value: + return CryptoQuote.from_dict(data) + elif event_type == EventType.Imbalances.value: + return Imbalance.from_dict(data) + elif event_type == EventType.LimitUpLimitDown.value: + return LimitUpLimitDown.from_dict(data) + elif event_type == EventType.CryptoL2.value: + return Level2Book.from_dict(data) + elif event_type == EventType.Value.value: + return IndexValue.from_dict(data) + elif event_type == EventType.LaunchpadValue.value: + return LaunchpadValue.from_dict(data) + elif event_type == EventType.BusinessFairMarketValue.value: + return FairMarketValue.from_dict(data) + return None + + +def parse(msg: List[Dict[str, Any]], logger: logging.Logger) -> List[WebSocketMessage]: + res = [] + for m in msg: + parsed = parse_single(m) + if parsed is None: + if m["ev"] != "status": + logger.warning("could not parse message %s", m) + else: + res.append(parsed) + return res diff --git a/polygon/websocket/models/common.py b/polygon/websocket/models/common.py new file mode 100644 index 00000000..38aea4c4 --- /dev/null +++ b/polygon/websocket/models/common.py @@ -0,0 +1,57 @@ +from enum import Enum + + +class Feed(Enum): + Delayed = "delayed.polygon.io" + RealTime = "socket.polygon.io" + Nasdaq = "nasdaqfeed.polygon.io" + PolyFeed = "polyfeed.polygon.io" + PolyFeedPlus = "polyfeedplus.polygon.io" + StarterFeed = "starterfeed.polygon.io" + Launchpad = "launchpad.polygon.io" + Business = "business.polygon.io" + EdgxBusiness = "edgx-business.polygon.io" + IEXBusiness = "iex-business.polygon.io" + DelayedBusiness = "delayed-business.polygon.io" + DelayedEdgxBusiness = "delayed-edgx-business.polygon.io" + DelayedNasdaqLastSaleBusiness = "delayed-nasdaq-last-sale-business.polygon.io" + DelayedNasdaqBasic = "delayed-nasdaq-basic-business.polygon.io" + DelayedFullMarketBusiness = "delayed-fullmarket-business.polygon.io" + FullMarketBusiness = "fullmarket-business.polygon.io" + NasdaqLastSaleBusiness = "nasdaq-last-sale-business.polygon.io" + NasdaqBasicBusiness = "nasdaq-basic-business.polygon.io" + + +class Market(Enum): + Stocks = "stocks" + Options = "options" + Forex = "forex" + Crypto = "crypto" + Indices = "indices" + + +class EventType(Enum): + EquityAgg = "A" + EquityAggMin = "AM" + CryptoAgg = "XA" + CryptoAggSec = "XAS" + ForexAgg = "CA" + ForexAggSec = "CAS" + EquityTrade = "T" + CryptoTrade = "XT" + EquityQuote = "Q" + ForexQuote = "C" + CryptoQuote = "XQ" + Imbalances = "NOI" + LimitUpLimitDown = "LULD" + CryptoL2 = "XL2" + Value = "V" + """Launchpad* EventTypes are only available to Launchpad users. These values are the same across all asset classes ( + stocks, options, forex, crypto). + """ + LaunchpadValue = "LV" + LaunchpadAggMin = "AM" + """Business* EventTypes are only available to Business users. These values are the same across all asset classes ( + stocks, options, forex, crypto). + """ + BusinessFairMarketValue = "FMV" diff --git a/polygon/websocket/models/models.py b/polygon/websocket/models/models.py new file mode 100644 index 00000000..d6fa0c29 --- /dev/null +++ b/polygon/websocket/models/models.py @@ -0,0 +1,381 @@ +from typing import Optional, List, Union, NewType +from .common import EventType +from ...modelclass import modelclass + + +@modelclass +class EquityAgg: + """EquityAgg contains aggregate data for either stock tickers, option contracts or index tickers.""" + + event_type: Optional[Union[str, EventType]] = None + symbol: Optional[str] = None + volume: Optional[float] = None + accumulated_volume: Optional[float] = None + official_open_price: Optional[float] = None + vwap: Optional[float] = None + open: Optional[float] = None + close: Optional[float] = None + high: Optional[float] = None + low: Optional[float] = None + aggregate_vwap: Optional[float] = None + average_size: Optional[float] = None + start_timestamp: Optional[int] = None + end_timestamp: Optional[int] = None + otc: Optional[bool] = None + + @staticmethod + def from_dict(d): + return EquityAgg( + d.get("ev", None), + d.get("sym", None), + d.get("v", None), + d.get("av", None), + d.get("op", None), + d.get("vw", None), + d.get("o", None), + d.get("c", None), + d.get("h", None), + d.get("l", None), + d.get("a", None), + d.get("z", None), + d.get("s", None), + d.get("e", None), + d.get("otc", None), + ) + + +@modelclass +class CurrencyAgg: + "CurrencyAgg contains aggregate data for either forex currency pairs or crypto pairs." + event_type: Optional[Union[str, EventType]] = None + pair: Optional[str] = None + open: Optional[float] = None + close: Optional[float] = None + high: Optional[float] = None + low: Optional[float] = None + volume: Optional[float] = None + vwap: Optional[float] = None + start_timestamp: Optional[int] = None + end_timestamp: Optional[int] = None + avg_trade_size: Optional[float] = None + + @staticmethod + def from_dict(d): + return CurrencyAgg( + d.get("ev", None), + d.get("pair", None), + d.get("o", None), + d.get("c", None), + d.get("h", None), + d.get("l", None), + d.get("v", None), + d.get("vw", None), + d.get("s", None), + d.get("e", None), + d.get("z", None), + ) + + +@modelclass +class EquityTrade: + "EquityTrade contains trade data for either stock tickers or option contracts." + event_type: Optional[Union[str, EventType]] = None + symbol: Optional[str] = None + exchange: Optional[int] = None + id: Optional[str] = None + tape: Optional[int] = None + price: Optional[float] = None + size: Optional[int] = None + conditions: Optional[List[int]] = None + timestamp: Optional[int] = None + sequence_number: Optional[int] = None + trf_id: Optional[int] = None + trf_timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return EquityTrade( + d.get("ev", None), + d.get("sym", None), + d.get("x", None), + d.get("i", None), + d.get("z", None), + d.get("p", None), + d.get("s", None), + d.get("c", None), + d.get("t", None), + d.get("q", None), + d.get("trfi", None), + d.get("trft", None), + ) + + +@modelclass +class CryptoTrade: + "CryptoTrade contains trade data for a crypto pair." + event_type: Optional[Union[str, EventType]] = None + pair: Optional[str] = None + exchange: Optional[int] = None + id: Optional[str] = None + price: Optional[float] = None + size: Optional[float] = None + conditions: Optional[List[int]] = None + timestamp: Optional[int] = None + received_timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return CryptoTrade( + d.get("ev", None), + d.get("pair", None), + d.get("x", None), + d.get("i", None), + d.get("p", None), + d.get("s", None), + d.get("c", None), + d.get("t", None), + d.get("r", None), + ) + + +@modelclass +class EquityQuote: + "EquityQuote contains quote data for either stock tickers or option contracts." + event_type: Optional[Union[str, EventType]] = None + symbol: Optional[str] = None + bid_exchange_id: Optional[int] = None + bid_price: Optional[float] = None + bid_size: Optional[int] = None + ask_exchange_id: Optional[int] = None + ask_price: Optional[float] = None + ask_size: Optional[int] = None + condition: Optional[int] = None + indicators: Optional[List[int]] = None + timestamp: Optional[int] = None + tape: Optional[int] = None + sequence_number: Optional[int] = None + trf_id: Optional[int] = None + trf_timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return EquityQuote( + d.get("ev", None), + d.get("sym", None), + d.get("bx", None), + d.get("bp", None), + d.get("bs", None), + d.get("ax", None), + d.get("ap", None), + d.get("as", None), + d.get("c", None), + d.get("i", None), + d.get("t", None), + d.get("z", None), + d.get("q", None), + d.get("trfi", None), + d.get("trft", None), + ) + + +@modelclass +class ForexQuote: + "ForexQuote contains quote data for a forex currency pair." + event_type: Optional[Union[str, EventType]] = None + pair: Optional[str] = None + exchange_id: Optional[int] = None + ask_price: Optional[float] = None + bid_price: Optional[float] = None + timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return ForexQuote( + d.get("ev", None), + d.get("p", None), + d.get("x", None), + d.get("a", None), + d.get("b", None), + d.get("t", None), + ) + + +@modelclass +class CryptoQuote: + "CryptoQuote contains quote data for a crypto pair." + event_type: Optional[Union[str, EventType]] = None + pair: Optional[str] = None + bid_price: Optional[int] = None + bid_size: Optional[float] = None + ask_price: Optional[int] = None + ask_size: Optional[int] = None + timestamp: Optional[float] = None + exchange_id: Optional[int] = None + received_timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return CryptoQuote( + d.get("ev", None), + d.get("pair", None), + d.get("bp", None), + d.get("bs", None), + d.get("ap", None), + d.get("as", None), + d.get("t", None), + d.get("x", None), + d.get("r", None), + ) + + +@modelclass +class Imbalance: + "Imbalance contains imbalance event data for a given stock ticker symbol." + event_type: Optional[Union[str, EventType]] = None + symbol: Optional[str] = None + time_stamp: Optional[int] = None + auction_time: Optional[int] = None + auction_type: Optional[str] = None + symbol_sequence: Optional[int] = None + exchange_id: Optional[int] = None + imbalance_quantity: Optional[int] = None + paired_quantity: Optional[int] = None + book_clearing_price: Optional[float] = None + + @staticmethod + def from_dict(d): + return Imbalance( + d.get("ev", None), + d.get("T", None), + d.get("t", None), + d.get("at", None), + d.get("a", None), + d.get("i", None), + d.get("x", None), + d.get("o", None), + d.get("p", None), + d.get("b", None), + ) + + +@modelclass +class LimitUpLimitDown: + "LimitUpLimitDown contains LULD event data for a given stock ticker symbol." + event_type: Optional[Union[str, EventType]] = None + symbol: Optional[str] = None + high_price: Optional[float] = None + low_price: Optional[float] = None + indicators: Optional[List[int]] = None + tape: Optional[int] = None + timestamp: Optional[int] = None + sequence_number: Optional[int] = None + + @staticmethod + def from_dict(d): + return LimitUpLimitDown( + d.get("ev", None), + d.get("T", None), + d.get("h", None), + d.get("l", None), + d.get("i", None), + d.get("z", None), + d.get("t", None), + d.get("q", None), + ) + + +@modelclass +class Level2Book: + "Level2Book contains level 2 book data for a given crypto pair." + event_type: Optional[Union[str, EventType]] = None + pair: Optional[str] = None + bid_prices: Optional[float] = None + ask_prices: Optional[float] = None + timestamp: Optional[int] = None + exchange_id: Optional[int] = None + received_timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return Level2Book( + d.get("ev", None), + d.get("pair", None), + d.get("b", None), + d.get("a", None), + d.get("t", None), + d.get("x", None), + d.get("r", None), + ) + + +@modelclass +class IndexValue: + event_type: Optional[Union[str, EventType]] = None + value: Optional[float] = None + ticker: Optional[str] = None + timestamp: Optional[str] = None + + @staticmethod + def from_dict(d): + return IndexValue( + d.get("ev", None), + d.get("val", None), + d.get("T", None), + d.get("t", None), + ) + + +@modelclass +class LaunchpadValue: + event_type: Optional[Union[str, EventType]] = None + value: Optional[float] = None + symbol: Optional[str] = None + timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return LaunchpadValue( + event_type=d.get("ev", None), + value=d.get("val", None), + symbol=d.get("sym", None), + timestamp=d.get("t", None), + ) + + +@modelclass +class FairMarketValue: + event_type: Optional[Union[str, EventType]] = None + fmv: Optional[float] = None + ticker: Optional[str] = None + timestamp: Optional[int] = None + + @staticmethod + def from_dict(d): + return FairMarketValue( + event_type=d.get("ev", None), + fmv=d.get("fmv", None), + ticker=d.get("sym", None), + timestamp=d.get("t", None), + ) + + +WebSocketMessage = NewType( + "WebSocketMessage", + List[ + Union[ + EquityAgg, + CurrencyAgg, + EquityTrade, + CryptoTrade, + EquityQuote, + ForexQuote, + CryptoQuote, + Imbalance, + LimitUpLimitDown, + Level2Book, + IndexValue, + LaunchpadValue, + FairMarketValue, + ] + ], +) diff --git a/polygon/websocket/websocket_client.py b/polygon/websocket/websocket_client.py deleted file mode 100644 index 3c046485..00000000 --- a/polygon/websocket/websocket_client.py +++ /dev/null @@ -1,111 +0,0 @@ -import signal -import threading -from typing import Optional, Callable - -import websocket - -STOCKS_CLUSTER = "stocks" -FOREX_CLUSTER = "forex" -CRYPTO_CLUSTER = "crypto" - - -class WebSocketClient: - DEFAULT_HOST = "socket.polygon.io" - - # TODO: Either an instance of the client couples 1:1 with the cluster or an instance of the Client couples 1:3 with - # the 3 possible clusters (I think I like client per, but then a problem is the user can make multiple clients for - # the same cluster and that's not desirable behavior, - # somehow keeping track with multiple Client instances will be the difficulty) - def __init__(self, cluster: str, auth_key: str, process_message: Optional[Callable[[str], None]] = None, - on_close: Optional[Callable[[websocket.WebSocketApp], None]] = None, - on_error: Optional[Callable[[websocket.WebSocketApp, str], None]] = None): - self._host = self.DEFAULT_HOST - self.url = f"wss://{self._host}/{cluster}" - self.ws: websocket.WebSocketApp = websocket.WebSocketApp(self.url, on_open=self._default_on_open(), - on_close=self._default_on_close, - on_error=self._default_on_error, - on_message=self._default_on_message()) - self.auth_key = auth_key - - self.process_message = process_message - self.ws.on_close = on_close - self.ws.on_error = on_error - - # being authenticated is an event that must occur before any other action is sent to the server - self._authenticated = threading.Event() - # self._run_thread is only set if the client is run asynchronously - self._run_thread: Optional[threading.Thread] = None - - # TODO: this probably isn't great design. - # If the user defines their own signal handler then this will gets overwritten. - # We still need to make sure that killing, terminating, interrupting the program closes the connection - signal.signal(signal.SIGINT, self._cleanup_signal_handler()) - signal.signal(signal.SIGTERM, self._cleanup_signal_handler()) - - def run(self): - self.ws.run_forever() - - def run_async(self): - self._run_thread = threading.Thread(target=self.run) - self._run_thread.start() - - def close_connection(self): - self.ws.close() - if self._run_thread: - self._run_thread.join() - - def subscribe(self, *params): - # TODO: make this a decorator or context manager - self._authenticated.wait() - - sub_message = '{"action":"subscribe","params":"%s"}' % self._format_params(params) - self.ws.send(sub_message) - - def unsubscribe(self, *params): - # TODO: make this a decorator or context manager - self._authenticated.wait() - - sub_message = '{"action":"unsubscribe","params":"%s"}' % self._format_params(params) - self.ws.send(sub_message) - - def _cleanup_signal_handler(self): - return lambda signalnum, frame: self.close_connection() - - def _authenticate(self, ws): - ws.send('{"action":"auth","params":"%s"}' % self.auth_key) - self._authenticated.set() - - @staticmethod - def _format_params(params): - return ",".join(params) - - @property - def process_message(self): - return self.__process_message - - @process_message.setter - def process_message(self, pm): - if pm: - self.__process_message = pm - self.ws.on_message = lambda ws, message: self.__process_message(message) - - def _default_on_message(self): - return lambda ws, message: self._default_process_message(message) - - @staticmethod - def _default_process_message(message): - print(message) - - def _default_on_open(self): - def f(ws): - self._authenticate(ws) - - return f - - @staticmethod - def _default_on_error(ws, error): - print("error:", error) - - @staticmethod - def _default_on_close(ws): - print("### closed ###") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..6dc126b6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,47 @@ +[tool.poetry] +name = "polygon-api-client" +version = "0.0.0" +description = "Official Polygon.io REST and Websocket client." +authors = ["polygon.io"] +license = "MIT" +homepage = "https://polygon.io" +repository = "https://github.com/polygon-io/client-python" +documentation = "https://polygon.io/docs" +keywords = [ + "polygon", + "free", + "rest", + "stock", + "market", + "data", + "api", + "polygon.io", + "websocket", + "client" +] +packages = [ + { include = "polygon" } +] + +[tool.poetry.dependencies] +python = "^3.8" +urllib3 = ">=1.26.9,<3.0.0" +websockets = ">=10.3,<15.0" +certifi = ">=2022.5.18,<2026.0.0" + +[tool.poetry.dev-dependencies] +black = "^24.8.0" +mypy = "^1.13" +types-urllib3 = "^1.26.25" +Sphinx = "^7.1.2" +sphinx-rtd-theme = "^3.0.2" +# keep this in sync with docs/requirements.txt for readthedocs.org +sphinx-autodoc-typehints = "^2.0.1" +types-certifi = "^2021.10.8" +types-setuptools = "^75.8.0" +pook = "^2.0.1" +orjson = "^3.10.15" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a62a3359..00000000 --- a/requirements.txt +++ /dev/null @@ -1,19 +0,0 @@ -atomicwrites>=1.3.0 -attrs>=19.3.0 -certifi>=2019.9.11 -chardet>=3.0.4 -idna>=2.8 -importlib-metadata>=0.23 -more-itertools>=7.2.0 -packaging>=19.2 -pluggy>=0.13.0 -py>=1.8.0 -pyparsing>=2.4.4 -pytest>=5.2.2 -requests>=2.22.0 -six>=1.13.0 -urllib3>=1.25.6 -wcwidth>=0.1.7 -websocket-client>=0.56.0 -websockets>=8.0.2 -zipp>=0.6.0 diff --git a/rest-example.py b/rest-example.py deleted file mode 100644 index a517db12..00000000 --- a/rest-example.py +++ /dev/null @@ -1,28 +0,0 @@ -import datetime - -from polygon import RESTClient - - -def ts_to_datetime(ts) -> str: - return datetime.datetime.fromtimestamp(ts / 1000.0).strftime('%Y-%m-%d %H:%M') - - -def main(): - key = "your api key" - - # RESTClient can be used as a context manager to facilitate closing the underlying http session - # https://requests.readthedocs.io/en/master/user/advanced/#session-objects - with RESTClient(key) as client: - from_ = "2019-01-01" - to = "2019-02-01" - resp = client.stocks_equities_aggregates("AAPL", 1, "minute", from_, to, unadjusted=False) - - print(f"Minute aggregates for {resp.ticker} between {from_} and {to}.") - - for result in resp.results: - dt = ts_to_datetime(result["t"]) - print(f"{dt}\n\tO: {result['o']}\n\tH: {result['h']}\n\tL: {result['l']}\n\tC: {result['c']} ") - - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 45095315..00000000 --- a/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup, find_packages - -import os -import sys - -version = os.getenv("VERSION") -if not version: - print("no version supplied") - sys.exit(1) - -def get_readme_md_contents(): - """read the contents of your README file""" - with open("README.md", encoding='utf-8') as f: - long_description = f.read() - return long_description - -setup( - name="polygon-api-client", - version=version, - description="Polygon API client", - long_description=get_readme_md_contents(), - long_description_content_type="text/markdown", - author_email="support@polygon.io", - url="https://github.com/polygon-io/client-python", - packages=find_packages(), - classifiers=[ - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - "Operating System :: OS Independent", - "Topic :: Office/Business :: Financial :: Investment" - ], - install_requires=[ - "websocket-client>=0.56.0", - "websockets>=8.0.2", - "requests>=2.22.0" - ] -) diff --git a/test_rest/base.py b/test_rest/base.py new file mode 100644 index 00000000..45aa168e --- /dev/null +++ b/test_rest/base.py @@ -0,0 +1,43 @@ +from polygon import RESTClient + +import os +import re +import unittest +import pook # type: ignore + +# mocks are stored in file tree +mocks = [] +dirname = os.path.dirname(__file__) +mockdir = os.path.join(dirname, "mocks") +for dname, _, files in os.walk(mockdir): + for fname in files: + if fname.endswith(".json"): + abspath = os.path.join(dname, fname) + with open(abspath, "r") as f: + urllpath = abspath.replace(mockdir, "").replace("\\", "/") + urllpath = re.sub(".json$", "", urllpath) + urllpath = re.sub("/index$", "", urllpath) + # Windows will be sad. We support dev on Windows. + if "?" in urllpath: + raise Exception(f"use & instead of ? in path ${urllpath}") + urllpath = urllpath.replace("&", "?", 1) + if ":" in urllpath: + raise Exception(f"use ; instead of : in path ${urllpath}") + urllpath = urllpath.replace(";", ":", 1) + # print(abspath, urllpath) + mocks.append((urllpath, f.read())) + + +unittest.util._MAX_LENGTH = 30000 # type: ignore + + +class BaseTest(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.maxDiff = None + cls.c = RESTClient("", verbose=True) + pook.on() + for m in mocks: + url = cls.c.BASE + m[0] + # print("register", url) + pook.get(url, reply=200, response_body=m[1]) diff --git a/test_rest/mocks/v1/conversion/AUD/USD&amount=100&precision=2.json b/test_rest/mocks/v1/conversion/AUD/USD&amount=100&precision=2.json new file mode 100644 index 00000000..dfb5ebb9 --- /dev/null +++ b/test_rest/mocks/v1/conversion/AUD/USD&amount=100&precision=2.json @@ -0,0 +1,15 @@ +{ + "converted": 69.31, + "from": "AUD", + "initialAmount": 100, + "last": { + "ask": 1.4436264, + "bid": 1.4427932, + "exchange": 48, + "timestamp": 1652195426000 + }, + "request_id": "b2cbbd1c2aa9eadd738087deef2bcf95", + "status": "success", + "symbol": "USD/AUD", + "to": "USD" +} \ No newline at end of file diff --git a/test_rest/mocks/v1/indicators/ema/AAPL&window=5&adjusted=false×tamp.lte=1478393873000×tamp.gte=1477972800000.json b/test_rest/mocks/v1/indicators/ema/AAPL&window=5&adjusted=false×tamp.lte=1478393873000×tamp.gte=1477972800000.json new file mode 100644 index 00000000..333016cb --- /dev/null +++ b/test_rest/mocks/v1/indicators/ema/AAPL&window=5&adjusted=false×tamp.lte=1478393873000×tamp.gte=1477972800000.json @@ -0,0 +1,27 @@ +{ + "results": { + "underlying": { + "url": "http://localhost:8081/v2/aggs/ticker/AAPL/range/1/day/1477368000000/1478393873000?adjusted=false\u0026limit=50000\u0026sort=desc" + }, + "values": [ + { + "timestamp": 1478232000000, + "value": 110.96883950617286 + }, + { + "timestamp": 1478145600000, + "value": 112.03325925925927 + }, + { + "timestamp": 1478059200000, + "value": 113.1348888888889 + }, + { + "timestamp": 1477972800000, + "value": 113.90733333333334 + } + ] + }, + "status": "OK", + "request_id": "aaa162ba-e0b6-4c4a-aa05-dcac472aea71" +} \ No newline at end of file diff --git a/test_rest/mocks/v1/indicators/macd/SPY&signal_window=10&long_window=20×tamp.gt=2022-08-09.json b/test_rest/mocks/v1/indicators/macd/SPY&signal_window=10&long_window=20×tamp.gt=2022-08-09.json new file mode 100644 index 00000000..8c44e7ca --- /dev/null +++ b/test_rest/mocks/v1/indicators/macd/SPY&signal_window=10&long_window=20×tamp.gt=2022-08-09.json @@ -0,0 +1,59 @@ +{ + "results": { + "underlying": { + "url": "http://localhost:8081/v2/aggs/ticker/SPY/range/1/day/1657670400000/1660926503659?limit=50000&sort=desc" + }, + "values": [ + { + "timestamp": 1660881600000, + "value": 6.912856964275647, + "signal": 49.504484615884834, + "histogram": -42.59162765160919 + }, + { + "timestamp": 1660795200000, + "value": 7.509881940545313, + "signal": 58.96929076068688, + "histogram": -51.45940882014157 + }, + { + "timestamp": 1660708800000, + "value": 7.734132135566654, + "signal": 70.40471494294057, + "histogram": -62.67058280737392 + }, + { + "timestamp": 1660622400000, + "value": 7.973958808765531, + "signal": 84.331511122357, + "histogram": -76.35755231359147 + }, + { + "timestamp": 1660536000000, + "value": 7.90112075397235, + "signal": 101.2998560809329, + "histogram": -93.39873532696055 + }, + { + "timestamp": 1660276800000, + "value": 7.719066821080332, + "signal": 122.05513059803525, + "histogram": -114.33606377695492 + }, + { + "timestamp": 1660190400000, + "value": 7.468267821253335, + "signal": 147.4631447706919, + "histogram": -139.99487694943858 + }, + { + "timestamp": 1660104000000, + "value": 7.542041992364375, + "signal": 178.5731174261227, + "histogram": -171.03107543375833 + } + ] + }, + "status": "OK", + "request_id": "b5163e30-64c6-4298-8217-aab3152ea79f" +} diff --git a/test_rest/mocks/v1/indicators/rsi/AAPL&window=20×pan=minute&adjusted=true×tamp.gt=2022-08-18.json b/test_rest/mocks/v1/indicators/rsi/AAPL&window=20×pan=minute&adjusted=true×tamp.gt=2022-08-18.json new file mode 100644 index 00000000..5d434057 --- /dev/null +++ b/test_rest/mocks/v1/indicators/rsi/AAPL&window=20×pan=minute&adjusted=true×tamp.gt=2022-08-18.json @@ -0,0 +1,159 @@ +{ + "results": { + "underlying": { + "url": "https://api.polygon.io/v2/aggs/ticker/AAPL/range/15/minute/1660521600000/1660928746001?limit=50000&sort=desc" + }, + "values": [ + { + "timestamp": 1660928400000, + "value": 172.46568754351864 + }, + { + "timestamp": 1660927500000, + "value": 172.43049675862588 + }, + { + "timestamp": 1660926600000, + "value": 172.39791747006018 + }, + { + "timestamp": 1660925700000, + "value": 172.37032983532967 + }, + { + "timestamp": 1660924800000, + "value": 172.39246981799596 + }, + { + "timestamp": 1660923900000, + "value": 172.4199719041008 + }, + { + "timestamp": 1660923000000, + "value": 172.4462847361114 + }, + { + "timestamp": 1660922100000, + "value": 172.48168312938628 + }, + { + "timestamp": 1660921200000, + "value": 172.5318603009006 + }, + { + "timestamp": 1660920300000, + "value": 172.60100349046908 + }, + { + "timestamp": 1660919400000, + "value": 172.68216175262373 + }, + { + "timestamp": 1660918500000, + "value": 172.7343682528999 + }, + { + "timestamp": 1660917600000, + "value": 172.7937754374157 + }, + { + "timestamp": 1660916700000, + "value": 172.8239623255647 + }, + { + "timestamp": 1660915800000, + "value": 172.82964257036102 + }, + { + "timestamp": 1660914900000, + "value": 172.8215102093464 + }, + { + "timestamp": 1660914000000, + "value": 172.7816691787513 + }, + { + "timestamp": 1660913100000, + "value": 172.79237119756723 + }, + { + "timestamp": 1660912200000, + "value": 172.8094629025743 + }, + { + "timestamp": 1660911300000, + "value": 172.82942741863474 + }, + { + "timestamp": 1660910400000, + "value": 172.85463030480682 + }, + { + "timestamp": 1660909500000, + "value": 172.88038086320753 + }, + { + "timestamp": 1660908600000, + "value": 172.91094726986097 + }, + { + "timestamp": 1660907700000, + "value": 172.95420487721478 + }, + { + "timestamp": 1660906800000, + "value": 172.99148960113214 + }, + { + "timestamp": 1660905900000, + "value": 173.03796219072498 + }, + { + "timestamp": 1660905000000, + "value": 173.0998529476434 + }, + { + "timestamp": 1660904100000, + "value": 173.17457431055323 + }, + { + "timestamp": 1660903200000, + "value": 173.23505581692726 + }, + { + "timestamp": 1660902300000, + "value": 173.3166406397617 + }, + { + "timestamp": 1660901400000, + "value": 173.3920764965787 + }, + { + "timestamp": 1660900500000, + "value": 173.4628213909554 + }, + { + "timestamp": 1660899600000, + "value": 173.5494341689507 + }, + { + "timestamp": 1660898700000, + "value": 173.63884829199816 + }, + { + "timestamp": 1660897800000, + "value": 173.73872705957692 + }, + { + "timestamp": 1660896900000, + "value": 173.8480667500587 + }, + { + "timestamp": 1660896000000, + "value": 173.97207377638065 + } + ] + }, + "status": "OK", + "request_id": "e0ee044f-88e9-4b18-a44e-a64923ac1c39" +} diff --git a/test_rest/mocks/v1/indicators/sma/AAPL&window=30×pan=quarter×tamp=1483958600&expand_underlying=true.json b/test_rest/mocks/v1/indicators/sma/AAPL&window=30×pan=quarter×tamp=1483958600&expand_underlying=true.json new file mode 100644 index 00000000..79a7e788 --- /dev/null +++ b/test_rest/mocks/v1/indicators/sma/AAPL&window=30×pan=quarter×tamp=1483958600&expand_underlying=true.json @@ -0,0 +1,46 @@ +{ + "status": "OK", + "request_id": "6a7e466379af0a71039d60cc78e72282", + "next_url": "https://api.polygon.io/v1/indicators/sma/AAPL?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIxLTA0LTI1JmxpbWl0PTEmb3JkZ", + "results": { + "values":[ + { + "timestamp": 1578027600, + "value": 141.34 + }, + { + "timestamp": 1578035600, + "value": 139.33 + }, + { + "timestamp": 1578049600, + "value": 138.22 + } + ], + "underlying": { + "aggregates": [ + { + "v": 135647456, + "vw": 74.6099, + "o": 74.06, + "c": 75.0875, + "h": 75.15, + "l": 73.7975, + "t": 1577941200000, + "n": 1 + }, + { + "v": 146535512, + "vw": 74.7026, + "o": 74.2875, + "c": 74.3575, + "h": 75.145, + "l": 74.125, + "t": 1578027600000, + "n": 1 + } + ], + "url": "https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/1626912000000/1629590400000?adjusted=true&limit=50000&sort=desc" + } + } +} \ No newline at end of file diff --git a/test_rest/mocks/v1/last/crypto/BTC/USD.json b/test_rest/mocks/v1/last/crypto/BTC/USD.json new file mode 100644 index 00000000..d9204670 --- /dev/null +++ b/test_rest/mocks/v1/last/crypto/BTC/USD.json @@ -0,0 +1,14 @@ +{ + "last": { + "conditions": [ + 2 + ], + "exchange": 2, + "price": 39976.89682331, + "size": 0.005, + "timestamp": 1651180409688 + }, + "request_id": "d67c9bfe1fa0c29db9177d78b3ab713c", + "status": "success", + "symbol": "BTC-USD" +} \ No newline at end of file diff --git a/test_rest/mocks/v1/last_quote/currencies/AUD/USD.json b/test_rest/mocks/v1/last_quote/currencies/AUD/USD.json new file mode 100644 index 00000000..fb25e665 --- /dev/null +++ b/test_rest/mocks/v1/last_quote/currencies/AUD/USD.json @@ -0,0 +1,11 @@ +{ + "last": { + "ask": 0.69527, + "bid": 0.6952, + "exchange": 48, + "timestamp": 1652193694000 + }, + "request_id": "54259e767db5057989cddbe33a2eaf1b", + "status": "success", + "symbol": "AUD/USD" +} \ No newline at end of file diff --git a/test_rest/mocks/v1/marketstatus/now.json b/test_rest/mocks/v1/marketstatus/now.json new file mode 100644 index 00000000..51172de1 --- /dev/null +++ b/test_rest/mocks/v1/marketstatus/now.json @@ -0,0 +1,15 @@ +{ + "market": "extended-hours", + "earlyHours": false, + "afterHours": true, + "serverTime": "2022-04-28T16:48:08-04:00", + "exchanges": { + "nyse": "extended-hours", + "nasdaq": "extended-hours", + "otc": "extended-hours" + }, + "currencies": { + "fx": "open", + "crypto": "open" + } +} \ No newline at end of file diff --git a/test_rest/mocks/v1/marketstatus/upcoming.json b/test_rest/mocks/v1/marketstatus/upcoming.json new file mode 100644 index 00000000..0090f783 --- /dev/null +++ b/test_rest/mocks/v1/marketstatus/upcoming.json @@ -0,0 +1,90 @@ +[ + { + "exchange": "NYSE", + "name": "Memorial Day", + "date": "2022-05-30", + "status": "closed" + }, + { + "exchange": "NASDAQ", + "name": "Memorial Day", + "date": "2022-05-30", + "status": "closed" + }, + { + "exchange": "NASDAQ", + "name": "Juneteenth", + "date": "2022-06-20", + "status": "closed" + }, + { + "exchange": "NYSE", + "name": "Juneteenth", + "date": "2022-06-20", + "status": "closed" + }, + { + "exchange": "NYSE", + "name": "Independence Day", + "date": "2022-07-04", + "status": "closed" + }, + { + "exchange": "NASDAQ", + "name": "Independence Day", + "date": "2022-07-04", + "status": "closed" + }, + { + "exchange": "NYSE", + "name": "Labor Day", + "date": "2022-09-05", + "status": "closed" + }, + { + "exchange": "NASDAQ", + "name": "Labor Day", + "date": "2022-09-05", + "status": "closed" + }, + { + "exchange": "NYSE", + "name": "Thanksgiving", + "date": "2022-11-24", + "status": "closed" + }, + { + "exchange": "NASDAQ", + "name": "Thanksgiving", + "date": "2022-11-24", + "status": "closed" + }, + { + "exchange": "NYSE", + "name": "Thanksgiving", + "date": "2022-11-25", + "status": "early-close", + "open": "2022-11-25T14:30:00.000Z", + "close": "2022-11-25T18:00:00.000Z" + }, + { + "exchange": "NASDAQ", + "name": "Thanksgiving", + "date": "2022-11-25", + "status": "early-close", + "open": "2022-11-25T14:30:00.000Z", + "close": "2022-11-25T18:00:00.000Z" + }, + { + "exchange": "NYSE", + "name": "Christmas", + "date": "2022-12-26", + "status": "closed" + }, + { + "exchange": "NASDAQ", + "name": "Christmas", + "date": "2022-12-26", + "status": "closed" + } +] \ No newline at end of file diff --git a/test_rest/mocks/v1/open-close/AAPL/2005-04-01&adjusted=true.json b/test_rest/mocks/v1/open-close/AAPL/2005-04-01&adjusted=true.json new file mode 100644 index 00000000..9600b11c --- /dev/null +++ b/test_rest/mocks/v1/open-close/AAPL/2005-04-01&adjusted=true.json @@ -0,0 +1,12 @@ +{ + "status": "OK", + "from": "2021-04-01", + "symbol": "AAPL", + "open": 123.66, + "high": 124.18, + "low": 122.49, + "close": 123, + "volume": 75089134, + "afterHours": 123, + "preMarket": 123.45 +} \ No newline at end of file diff --git a/test_rest/mocks/v1/summaries&ticker.any_of=NCLH%2CO%3ANCLH221014C00005000%2CC%3AEURUSD%2CX%3ABTCUSD%2CAPx.json b/test_rest/mocks/v1/summaries&ticker.any_of=NCLH%2CO%3ANCLH221014C00005000%2CC%3AEURUSD%2CX%3ABTCUSD%2CAPx.json new file mode 100644 index 00000000..3d4e504c --- /dev/null +++ b/test_rest/mocks/v1/summaries&ticker.any_of=NCLH%2CO%3ANCLH221014C00005000%2CC%3AEURUSD%2CX%3ABTCUSD%2CAPx.json @@ -0,0 +1,101 @@ +{ + "request_id":"abc123", + "results":[ + { + "branding":{ + "icon_url":"https://api.polygon.io/icon.png", + "logo_url":"https://api.polygon.io/logo.svg" + }, + "market_status":"closed", + "name":"Norwegian Cruise Lines", + "price":22.3, + "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":"NCLH", + "type":"stocks" + }, + { + "market_status":"closed", + "name":"NCLH $5 Call", + "options":{ + "contract_type":"call", + "exercise_style":"american", + "expiration_date":"2022-10-14", + "shares_per_contract":100, + "strike_price":5, + "underlying_ticker":"NCLH" + }, + "price":6.6, + "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" + }, + { + "market_status":"open", + "name":"Euro - United States Dollar", + "price":0.97989, + "session":{ + "change":-0.0001, + "change_percent":-0.67, + "close":0.97989, + "high":0.98999, + "low":0.96689, + "open":0.97889, + "previous_close":0.98001 + }, + "ticker":"C:EURUSD", + "type":"fx" + }, + { + "branding":{ + "icon_url":"https://api.polygon.io/icon.png", + "logo_url":"https://api.polygon.io/logo.svg" + }, + "market_status":"open", + "name":"Bitcoin - United States Dollar", + "price":32154.68, + "session":{ + "change":-201.23, + "change_percent":-0.77, + "close":32154.68, + "high":33124.28, + "low":28182.88, + "open":31129.32, + "previous_close":33362.18 + }, + "ticker":"X:BTCUSD", + "type":"crypto" + }, + { + "error":"NOT_FOUND", + "message":"Ticker not found.", + "ticker":"APx" + } + ], + "status":"OK" +} \ No newline at end of file diff --git a/test_rest/mocks/v2/aggs/grouped/locale/us/market/stocks/2005-04-04&adjusted=true.json b/test_rest/mocks/v2/aggs/grouped/locale/us/market/stocks/2005-04-04&adjusted=true.json new file mode 100644 index 00000000..160e577e --- /dev/null +++ b/test_rest/mocks/v2/aggs/grouped/locale/us/market/stocks/2005-04-04&adjusted=true.json @@ -0,0 +1,21 @@ +{ + "queryCount": 1, + "resultsCount": 1, + "adjusted": true, + "results": [ + { + "T": "GIK", + "v": 895345, + "vw": 9.9979, + "o": 9.99, + "c": 10.02, + "h": 10.02, + "l": 9.9, + "t": 1602705600000, + "n": 96 + } + ], + "status": "OK", + "request_id": "eae3ded2d6d43f978125b7a8a609fad9", + "count": 1 +} \ No newline at end of file diff --git a/test_rest/mocks/v2/aggs/ticker/AAPL/prev.json b/test_rest/mocks/v2/aggs/ticker/AAPL/prev.json new file mode 100644 index 00000000..61b5e3ae --- /dev/null +++ b/test_rest/mocks/v2/aggs/ticker/AAPL/prev.json @@ -0,0 +1,22 @@ +{ + "ticker": "AAPL", + "queryCount": 1, + "resultsCount": 1, + "adjusted": true, + "results": [ + { + "T": "AAPL", + "v": 95595226.0, + "vw": 158.6074, + "o": 162.25, + "c": 156.8, + "h": 162.34, + "l": 156.72, + "t": 1651003200000, + "n": 899965 + } + ], + "status": "OK", + "request_id": "5e5378d5ecaf3df794bb52e45d015d2e", + "count": 1 +} \ No newline at end of file diff --git a/test_rest/mocks/v2/aggs/ticker/AAPL/range/1/day/2005-04-01/2005-04-04.json b/test_rest/mocks/v2/aggs/ticker/AAPL/range/1/day/2005-04-01/2005-04-04.json new file mode 100644 index 00000000..82c09f8b --- /dev/null +++ b/test_rest/mocks/v2/aggs/ticker/AAPL/range/1/day/2005-04-01/2005-04-04.json @@ -0,0 +1,31 @@ +{ + "ticker": "AAPL", + "queryCount": 2, + "resultsCount": 2, + "adjusted": true, + "results": [ + { + "v": 642646396.0, + "vw": 1.469, + "o": 1.5032, + "c": 1.4604, + "h": 1.5064, + "l": 1.4489, + "t": 1112331600000, + "n": 82132 + }, + { + "v": 578172308.0, + "vw": 1.4589, + "o": 1.4639, + "c": 1.4675, + "h": 1.4754, + "l": 1.4343, + "t": 1112587200000, + "n": 65543 + } + ], + "status": "OK", + "request_id": "12afda77aab3b1936c5fb6ef4241ae42", + "count": 2 +} \ No newline at end of file diff --git a/test_rest/mocks/v2/aggs/ticker/AAPL/range/1/day/2005-04-02/2005-04-04.json b/test_rest/mocks/v2/aggs/ticker/AAPL/range/1/day/2005-04-02/2005-04-04.json new file mode 100644 index 00000000..82c09f8b --- /dev/null +++ b/test_rest/mocks/v2/aggs/ticker/AAPL/range/1/day/2005-04-02/2005-04-04.json @@ -0,0 +1,31 @@ +{ + "ticker": "AAPL", + "queryCount": 2, + "resultsCount": 2, + "adjusted": true, + "results": [ + { + "v": 642646396.0, + "vw": 1.469, + "o": 1.5032, + "c": 1.4604, + "h": 1.5064, + "l": 1.4489, + "t": 1112331600000, + "n": 82132 + }, + { + "v": 578172308.0, + "vw": 1.4589, + "o": 1.4639, + "c": 1.4675, + "h": 1.4754, + "l": 1.4343, + "t": 1112587200000, + "n": 65543 + } + ], + "status": "OK", + "request_id": "12afda77aab3b1936c5fb6ef4241ae42", + "count": 2 +} \ No newline at end of file diff --git a/test_rest/mocks/v2/last/nbbo/AAPL.json b/test_rest/mocks/v2/last/nbbo/AAPL.json new file mode 100644 index 00000000..2f728afb --- /dev/null +++ b/test_rest/mocks/v2/last/nbbo/AAPL.json @@ -0,0 +1,17 @@ +{ + "results": { + "p": 155.65, + "s": 1, + "x": 19, + "P": 155.66, + "S": 14, + "X": 11, + "z": 3, + "T": "AAPL", + "t": 1652192754171838500, + "y": 1652192754171619000, + "q": 26006043 + }, + "status": "OK", + "request_id": "8f6450b5edbd1446ad0304023fad77ae" +} \ No newline at end of file diff --git a/test_rest/mocks/v2/last/trade/AAPL.json b/test_rest/mocks/v2/last/trade/AAPL.json new file mode 100644 index 00000000..1df54d78 --- /dev/null +++ b/test_rest/mocks/v2/last/trade/AAPL.json @@ -0,0 +1,21 @@ +{ + "results": { + "c": [ + 12, + 37 + ], + "i": "237688", + "p": 166.25, + "s": 2, + "x": 4, + "r": 202, + "z": 3, + "T": "AAPL", + "t": 1651179319310617300, + "y": 1651179319308000000, + "f": 1651179319310588400, + "q": 7084210 + }, + "status": "OK", + "request_id": "d4bafa50e72cf9ed19ac538ae1a3185a" +} \ No newline at end of file diff --git a/test_rest/mocks/v2/reference/news&ticker=NFLX.json b/test_rest/mocks/v2/reference/news&ticker=NFLX.json new file mode 100644 index 00000000..84fa63ba --- /dev/null +++ b/test_rest/mocks/v2/reference/news&ticker=NFLX.json @@ -0,0 +1,29 @@ +{ + "results": [ + { + "id": "JeJEhAVoKaqJ2zF9nzQYMg07UlEeWlis6Dsop33TPQY", + "publisher": { + "name": "MarketWatch", + "homepage_url": "https://www.marketwatch.com/", + "logo_url": "https://s3.polygon.io/public/assets/news/logos/marketwatch.svg", + "favicon_url": "https://s3.polygon.io/public/assets/news/favicons/marketwatch.ico" + }, + "title": "Theres a big hole in the Feds theory of inflation\u2014incomes are falling at a record 10.9 rate", + "author": "MarketWatch", + "published_utc": "2022-04-28T17:08:00Z", + "article_url": "https://www.marketwatch.com/story/theres-a-big-hole-in-the-feds-theory-of-inflationincomes-are-falling-at-a-record-10-9-rate-11651165705", + "tickers": [ + "MSFT", + "TSN", + "NFLX", + "AMZN" + ], + "amp_url": "https://www.marketwatch.com/amp/story/theres-a-big-hole-in-the-feds-theory-of-inflationincomes-are-falling-at-a-record-10-9-rate-11651165705", + "image_url": "https://images.mktw.net/im-533637/social", + "description": "If inflation is all due to an overly generous federal government giving its people too much money, then our inflation problem is about to go away." + } + ], + "status": "OK", + "request_id": "f5248459196e12f27520afd41cee5126", + "count": 10 +} \ No newline at end of file diff --git a/test_rest/mocks/v2/snapshot/locale/global/markets/crypto/tickers/X;BTCUSD/book.json b/test_rest/mocks/v2/snapshot/locale/global/markets/crypto/tickers/X;BTCUSD/book.json new file mode 100644 index 00000000..cdbb5ae3 --- /dev/null +++ b/test_rest/mocks/v2/snapshot/locale/global/markets/crypto/tickers/X;BTCUSD/book.json @@ -0,0 +1,39 @@ +{ + "data": { + "askCount": 593.1412981600005, + "asks": [ + { + "p": 11454, + "x": { + "2": 1 + } + }, + { + "p": 11455, + "x": { + "2": 1 + } + } + ], + "bidCount": 694.951789670001, + "bids": [ + { + "p": 16303.17, + "x": { + "1": 2 + } + }, + { + "p": 16302.94, + "x": { + "1": 0.02859424, + "6": 0.023455 + } + } + ], + "spread": -4849.17, + "ticker": "X:BTCUSD", + "updated": 1605295074162 + }, + "status": "OK" +} \ No newline at end of file diff --git a/test_rest/mocks/v2/snapshot/locale/us/markets/stocks/gainers.json b/test_rest/mocks/v2/snapshot/locale/us/markets/stocks/gainers.json new file mode 100644 index 00000000..c41d2b54 --- /dev/null +++ b/test_rest/mocks/v2/snapshot/locale/us/markets/stocks/gainers.json @@ -0,0 +1,104 @@ +{ + "status": "OK", + "tickers": [ + { + "day": { + "c": 6.42, + "h": 6.99, + "l": 6.4, + "o": 6.81, + "v": 115782, + "vw": 6.656 + }, + "lastQuote": { + "P": 6.43, + "S": 1, + "p": 6.4, + "s": 1, + "t": 1651251738312628478 + }, + "lastTrade": { + "c": [ + 14, + 41 + ], + "i": "100", + "p": 6.42, + "s": 200, + "t": 1651251334045891221, + "x": 8 + }, + "min": { + "av": 115689, + "c": 6.42, + "h": 6.542, + "l": 6.42, + "o": 6.49, + "v": 2671, + "vw": 6.4604, + "t": 1684428600000, + "n": 5 + }, + "prevDay": { + "c": 0.29, + "h": 0.348, + "l": 0.29, + "o": 0.3443, + "v": 1488660, + "vw": 0.317 + }, + "ticker": "NVCN", + "todaysChange": 6.13, + "todaysChangePerc": 2113.793, + "updated": 1651251360000000000 + }, + { + "day": { + "c": 4.2107, + "h": 4.95, + "l": 4.21, + "o": 4.31, + "v": 453199, + "vw": 4.4181 + }, + "lastQuote": { + "P": 4.22, + "S": 9, + "p": 4.21, + "s": 11, + "t": 1651251781709136903 + }, + "lastTrade": { + "c": null, + "i": "1084", + "p": 4.2116, + "s": 241, + "t": 1651251789345841015, + "x": 4 + }, + "min": { + "av": 453189, + "c": 4.2107, + "h": 4.2107, + "l": 4.2107, + "o": 4.2107, + "v": 1012, + "vw": 4.2107, + "t": 1684428600000, + "n": 5 + }, + "prevDay": { + "c": 0.1953, + "h": 0.2966, + "l": 0.195, + "o": 0.29, + "v": 8784033, + "vw": 0.2278 + }, + "ticker": "BIOL", + "todaysChange": 4.016, + "todaysChangePerc": 2056.477, + "updated": 1651251789345841015 + } + ] +} \ No newline at end of file diff --git a/test_rest/mocks/v2/snapshot/locale/us/markets/stocks/tickers/AAPL.json b/test_rest/mocks/v2/snapshot/locale/us/markets/stocks/tickers/AAPL.json new file mode 100644 index 00000000..fb382df2 --- /dev/null +++ b/test_rest/mocks/v2/snapshot/locale/us/markets/stocks/tickers/AAPL.json @@ -0,0 +1,53 @@ +{ + "request_id": "957db942cab2d6b0633b9b4820db0cb2", + "status": "OK", + "ticker": { + "day": { + "c": 160.315, + "h": 166.2, + "l": 159.8, + "o": 161.84, + "v": 68840127, + "vw": 162.7124 + }, + "fmv": 160.315, + "lastQuote": { + "P": 159.99, + "S": 5, + "p": 159.98, + "s": 3, + "t": 1651251948407646487 + }, + "lastTrade": { + "c": null, + "i": "121351", + "p": 159.99, + "s": 200, + "t": 1651251948294080343, + "x": 12 + }, + "min": { + "av": 68834255, + "c": 160.3, + "h": 160.71, + "l": 160.3, + "o": 160.71, + "v": 197226, + "vw": 160.5259, + "t": 1684428600000, + "n": 5 + }, + "prevDay": { + "c": 163.64, + "h": 164.515, + "l": 158.93, + "o": 159.25, + "v": 130149192, + "vw": 161.8622 + }, + "ticker": "AAPL", + "todaysChange": -3.65, + "todaysChangePerc": -2.231, + "updated": 1651251948294080343 + } +} \ No newline at end of file diff --git a/test_rest/mocks/v2/snapshot/locale/us/markets/stocks/tickers/index.json b/test_rest/mocks/v2/snapshot/locale/us/markets/stocks/tickers/index.json new file mode 100644 index 00000000..4316f2cc --- /dev/null +++ b/test_rest/mocks/v2/snapshot/locale/us/markets/stocks/tickers/index.json @@ -0,0 +1,58 @@ +{ + "count": 1, + "status": "OK", + "tickers": [ + { + "day": { + "c": 20.506, + "h": 20.64, + "l": 20.506, + "o": 20.64, + "v": 37216, + "vw": 20.616 + }, + "fmv": 20.5, + "lastQuote": { + "P": 20.6, + "S": 22, + "p": 20.5, + "s": 13, + "t": 1605192959994246100 + }, + "lastTrade": { + "c": [ + 14, + 41 + ], + "i": "71675577320245", + "p": 20.506, + "s": 2416, + "t": 1605192894630916600, + "x": 4 + }, + "min": { + "av": 37216, + "c": 20.506, + "h": 20.506, + "l": 20.506, + "o": 20.506, + "v": 5000, + "vw": 20.5105, + "t": 1684428600000, + "n": 5 + }, + "prevDay": { + "c": 20.63, + "h": 21, + "l": 20.5, + "o": 20.79, + "v": 292738, + "vw": 20.6939 + }, + "ticker": "BCAT", + "todaysChange": -0.124, + "todaysChangePerc": -0.601, + "updated": 1605192894630916600 + } + ] +} \ No newline at end of file diff --git a/test_rest/mocks/v3/quotes/AAPL&cursor=YXA9MTkyODgxNjYmYXM9JmxpbWl0PTEwJm9yZGVyPWRlc2Mmc29ydD10aW1lc3RhbXAmdGltZXN0YW1wLmx0ZT0yMDIyLTA1LTEwVDE0JTNBMTElM0ExMi42OTA2NjExODla.json b/test_rest/mocks/v3/quotes/AAPL&cursor=YXA9MTkyODgxNjYmYXM9JmxpbWl0PTEwJm9yZGVyPWRlc2Mmc29ydD10aW1lc3RhbXAmdGltZXN0YW1wLmx0ZT0yMDIyLTA1LTEwVDE0JTNBMTElM0ExMi42OTA2NjExODla.json new file mode 100644 index 00000000..cb763a03 --- /dev/null +++ b/test_rest/mocks/v3/quotes/AAPL&cursor=YXA9MTkyODgxNjYmYXM9JmxpbWl0PTEwJm9yZGVyPWRlc2Mmc29ydD10aW1lc3RhbXAmdGltZXN0YW1wLmx0ZT0yMDIyLTA1LTEwVDE0JTNBMTElM0ExMi42OTA2NjExODla.json @@ -0,0 +1,126 @@ +{ + "results": [ + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 2, + "bid_exchange": 19, + "bid_price": 155.86, + "bid_size": 1, + "participant_timestamp": 1652191872690177000, + "sequence_number": 19288135, + "sip_timestamp": 1652191872690386918, + "tape": 3 + }, + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 2, + "bid_exchange": 15, + "bid_price": 155.85, + "bid_size": 5, + "participant_timestamp": 1652191872688200000, + "sequence_number": 19288101, + "sip_timestamp": 1652191872688383612, + "tape": 3 + }, + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 15, + "bid_price": 155.85, + "bid_size": 5, + "participant_timestamp": 1652191872687729447, + "sequence_number": 19288096, + "sip_timestamp": 1652191872687968794, + "tape": 3 + }, + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 19, + "bid_price": 155.85, + "bid_size": 4, + "participant_timestamp": 1652191872686891199, + "sequence_number": 19288093, + "sip_timestamp": 1652191872687168881, + "tape": 3 + }, + { + "ask_exchange": 15, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 19, + "bid_price": 155.85, + "bid_size": 4, + "participant_timestamp": 1652191872677145000, + "sequence_number": 19288051, + "sip_timestamp": 1652191872677330035, + "tape": 3 + }, + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 4, + "bid_exchange": 19, + "bid_price": 155.85, + "bid_size": 4, + "participant_timestamp": 1652191872676782000, + "sequence_number": 19288049, + "sip_timestamp": 1652191872676973864, + "tape": 3 + }, + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 4, + "bid_exchange": 19, + "bid_price": 155.85, + "bid_size": 3, + "participant_timestamp": 1652191872664864000, + "sequence_number": 19288026, + "sip_timestamp": 1652191872665047506, + "tape": 3 + }, + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 4, + "bid_exchange": 19, + "bid_price": 155.85, + "bid_size": 4, + "participant_timestamp": 1652191872663336000, + "sequence_number": 19288010, + "sip_timestamp": 1652191872663527001, + "tape": 3 + }, + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 19, + "bid_price": 155.85, + "bid_size": 4, + "participant_timestamp": 1652191872663291000, + "sequence_number": 19288009, + "sip_timestamp": 1652191872663480163, + "tape": 3 + }, + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 2, + "bid_exchange": 19, + "bid_price": 155.85, + "bid_size": 4, + "participant_timestamp": 1652191872663233957, + "sequence_number": 19288004, + "sip_timestamp": 1652191872663407429, + "tape": 3 + } + ], + "status": "OK", + "request_id": "74f65a8eee41f475f5a05e31059a9245" +} \ No newline at end of file diff --git a/test_rest/mocks/v3/quotes/AAPL.json b/test_rest/mocks/v3/quotes/AAPL.json new file mode 100644 index 00000000..3fbb9d19 --- /dev/null +++ b/test_rest/mocks/v3/quotes/AAPL.json @@ -0,0 +1,127 @@ +{ + "results": [ + { + "ask_exchange": 15, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 19, + "bid_price": 155.85, + "bid_size": 4, + "participant_timestamp": 1652191872800402200, + "sequence_number": 19288684, + "sip_timestamp": 1652191872800638700, + "tape": 3 + }, + { + "ask_exchange": 15, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 15, + "bid_price": 155.85, + "bid_size": 5, + "participant_timestamp": 1652191872774195000, + "sequence_number": 19288618, + "sip_timestamp": 1652191872774441200, + "tape": 3 + }, + { + "ask_exchange": 15, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 19, + "bid_price": 155.85, + "bid_size": 4, + "participant_timestamp": 1652191872773756000, + "sequence_number": 19288617, + "sip_timestamp": 1652191872773945300, + "tape": 3 + }, + { + "ask_exchange": 15, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 12, + "bid_price": 155.85, + "bid_size": 3, + "participant_timestamp": 1652191872753255000, + "sequence_number": 19288557, + "sip_timestamp": 1652191872753443000, + "tape": 3 + }, + { + "ask_exchange": 15, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 19, + "bid_price": 155.85, + "bid_size": 3, + "participant_timestamp": 1652191872751394300, + "sequence_number": 19288549, + "sip_timestamp": 1652191872751569400, + "tape": 3 + }, + { + "ask_exchange": 15, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 21, + "bid_price": 155.86, + "bid_size": 1, + "participant_timestamp": 1652191872750485800, + "sequence_number": 19288528, + "sip_timestamp": 1652191872750826800, + "tape": 3 + }, + { + "ask_exchange": 15, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 11, + "bid_price": 155.86, + "bid_size": 1, + "participant_timestamp": 1652191872750458400, + "sequence_number": 19288525, + "sip_timestamp": 1652191872750633000, + "tape": 3 + }, + { + "ask_exchange": 15, + "ask_price": 155.87, + "ask_size": 3, + "bid_exchange": 21, + "bid_price": 155.86, + "bid_size": 2, + "participant_timestamp": 1652191872750206000, + "sequence_number": 19288519, + "sip_timestamp": 1652191872750488300, + "tape": 3 + }, + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 1, + "bid_exchange": 21, + "bid_price": 155.86, + "bid_size": 2, + "participant_timestamp": 1652191872748910000, + "sequence_number": 19288491, + "sip_timestamp": 1652191872749094400, + "tape": 3 + }, + { + "ask_exchange": 19, + "ask_price": 155.87, + "ask_size": 2, + "bid_exchange": 21, + "bid_price": 155.86, + "bid_size": 2, + "participant_timestamp": 1652191872690425000, + "sequence_number": 19288166, + "sip_timestamp": 1652191872690661000, + "tape": 3 + } + ], + "status": "OK", + "request_id": "280bc9f4c6d0ba24a819f0d153b15d85", + "next_url": "https://api.polygon.io/v3/quotes/AAPL?cursor=YXA9MTkyODgxNjYmYXM9JmxpbWl0PTEwJm9yZGVyPWRlc2Mmc29ydD10aW1lc3RhbXAmdGltZXN0YW1wLmx0ZT0yMDIyLTA1LTEwVDE0JTNBMTElM0ExMi42OTA2NjExODla" +} \ No newline at end of file diff --git a/test_rest/mocks/v3/reference/conditions&asset_class=stocks.json b/test_rest/mocks/v3/reference/conditions&asset_class=stocks.json new file mode 100644 index 00000000..9cd894df --- /dev/null +++ b/test_rest/mocks/v3/reference/conditions&asset_class=stocks.json @@ -0,0 +1,252 @@ +{ + "results": [ + { + "id": 1, + "type": "sale_condition", + "name": "Acquisition", + "asset_class": "stocks", + "sip_mapping": { + "UTP": "A" + }, + "update_rules": { + "consolidated": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + }, + "market_center": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + } + }, + "data_types": [ + "trade" + ] + }, + { + "id": 2, + "type": "sale_condition", + "name": "Average Price Trade", + "asset_class": "stocks", + "sip_mapping": { + "CTA": "B", + "UTP": "W" + }, + "update_rules": { + "consolidated": { + "updates_high_low": false, + "updates_open_close": false, + "updates_volume": true + }, + "market_center": { + "updates_high_low": false, + "updates_open_close": false, + "updates_volume": true + } + }, + "data_types": [ + "trade" + ] + }, + { + "id": 3, + "type": "sale_condition", + "name": "Automatic Execution", + "asset_class": "stocks", + "sip_mapping": { + "CTA": "E" + }, + "update_rules": { + "consolidated": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + }, + "market_center": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + } + }, + "data_types": [ + "trade" + ] + }, + { + "id": 4, + "type": "sale_condition", + "name": "Bunched Trade", + "asset_class": "stocks", + "sip_mapping": { + "UTP": "B" + }, + "update_rules": { + "consolidated": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + }, + "market_center": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + } + }, + "data_types": [ + "trade" + ] + }, + { + "id": 5, + "type": "sale_condition", + "name": "Bunched Sold Trade", + "asset_class": "stocks", + "sip_mapping": { + "UTP": "G" + }, + "update_rules": { + "consolidated": { + "updates_high_low": true, + "updates_open_close": false, + "updates_volume": true + }, + "market_center": { + "updates_high_low": true, + "updates_open_close": false, + "updates_volume": true + } + }, + "data_types": [ + "trade" + ] + }, + { + "id": 6, + "type": "sale_condition", + "name": "CAP Election", + "asset_class": "stocks", + "sip_mapping": { + "CTA": "I" + }, + "update_rules": { + "consolidated": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + }, + "market_center": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + } + }, + "data_types": [ + "trade" + ], + "legacy": true + }, + { + "id": 7, + "type": "sale_condition", + "name": "Cash Sale", + "asset_class": "stocks", + "sip_mapping": { + "CTA": "C", + "UTP": "C" + }, + "update_rules": { + "consolidated": { + "updates_high_low": false, + "updates_open_close": false, + "updates_volume": true + }, + "market_center": { + "updates_high_low": false, + "updates_open_close": false, + "updates_volume": true + } + }, + "data_types": [ + "trade" + ] + }, + { + "id": 8, + "type": "sale_condition", + "name": "Closing Prints", + "asset_class": "stocks", + "sip_mapping": { + "UTP": "6" + }, + "update_rules": { + "consolidated": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + }, + "market_center": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + } + }, + "data_types": [ + "trade" + ] + }, + { + "id": 9, + "type": "sale_condition", + "name": "Cross Trade", + "asset_class": "stocks", + "sip_mapping": { + "CTA": "X", + "UTP": "X" + }, + "update_rules": { + "consolidated": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + }, + "market_center": { + "updates_high_low": true, + "updates_open_close": true, + "updates_volume": true + } + }, + "data_types": [ + "trade" + ] + }, + { + "id": 10, + "type": "sale_condition", + "name": "Derivatively Priced", + "asset_class": "stocks", + "sip_mapping": { + "CTA": "4", + "UTP": "4" + }, + "update_rules": { + "consolidated": { + "updates_high_low": true, + "updates_open_close": false, + "updates_volume": true + }, + "market_center": { + "updates_high_low": true, + "updates_open_close": false, + "updates_volume": true + } + }, + "data_types": [ + "trade" + ] + } + ], + "status": "OK", + "request_id": "4c915a9cb249e40d08d031d70567d615", + "count": 10 +} \ No newline at end of file diff --git a/test_rest/mocks/v3/reference/dividends.json b/test_rest/mocks/v3/reference/dividends.json new file mode 100644 index 00000000..1150e0d8 --- /dev/null +++ b/test_rest/mocks/v3/reference/dividends.json @@ -0,0 +1,106 @@ +{ + "results": [ + { + "cash_amount": 0.59375, + "declaration_date": "2020-09-09", + "dividend_type": "CD", + "ex_dividend_date": "2025-06-12", + "frequency": 4, + "pay_date": "2025-06-30", + "record_date": "2025-06-15", + "ticker": "CSSEN" + }, + { + "cash_amount": 0.59375, + "declaration_date": "2020-09-09", + "dividend_type": "CD", + "ex_dividend_date": "2025-03-13", + "frequency": 4, + "pay_date": "2025-03-31", + "record_date": "2025-03-15", + "ticker": "CSSEN" + }, + { + "cash_amount": 0.59375, + "declaration_date": "2020-09-09", + "dividend_type": "CD", + "ex_dividend_date": "2024-12-12", + "frequency": 4, + "pay_date": "2024-12-31", + "record_date": "2024-12-15", + "ticker": "CSSEN" + }, + { + "cash_amount": 0.59375, + "declaration_date": "2020-09-09", + "dividend_type": "CD", + "ex_dividend_date": "2024-09-12", + "frequency": 4, + "pay_date": "2024-09-30", + "record_date": "2024-09-15", + "ticker": "CSSEN" + }, + { + "cash_amount": 0.59375, + "declaration_date": "2020-09-09", + "dividend_type": "CD", + "ex_dividend_date": "2024-06-13", + "frequency": 4, + "pay_date": "2024-06-30", + "record_date": "2024-06-15", + "ticker": "CSSEN" + }, + { + "cash_amount": 0.59375, + "declaration_date": "2020-09-09", + "dividend_type": "CD", + "ex_dividend_date": "2024-03-14", + "frequency": 4, + "pay_date": "2024-03-31", + "record_date": "2024-03-15", + "ticker": "CSSEN" + }, + { + "cash_amount": 0.59375, + "declaration_date": "2020-09-09", + "dividend_type": "CD", + "ex_dividend_date": "2023-12-14", + "frequency": 4, + "pay_date": "2023-12-31", + "record_date": "2023-12-15", + "ticker": "CSSEN" + }, + { + "cash_amount": 0.5, + "declaration_date": "2022-02-10", + "dividend_type": "CD", + "ex_dividend_date": "2023-11-13", + "frequency": 4, + "pay_date": "2023-11-15", + "record_date": "2023-11-14", + "ticker": "AIRTP" + }, + { + "cash_amount": 0.59375, + "declaration_date": "2020-09-09", + "dividend_type": "CD", + "ex_dividend_date": "2023-09-14", + "frequency": 4, + "pay_date": "2023-09-30", + "record_date": "2023-09-15", + "ticker": "CSSEN" + }, + { + "cash_amount": 0.5, + "declaration_date": "2022-02-10", + "dividend_type": "CD", + "ex_dividend_date": "2023-08-11", + "frequency": 4, + "pay_date": "2023-08-15", + "record_date": "2023-08-14", + "ticker": "AIRTP" + } + ], + "status": "OK", + "request_id": "0326f1f88a2867a7184c116f5b1edd00" +} \ No newline at end of file diff --git a/test_rest/mocks/v3/reference/exchanges.json b/test_rest/mocks/v3/reference/exchanges.json new file mode 100644 index 00000000..05e67e2f --- /dev/null +++ b/test_rest/mocks/v3/reference/exchanges.json @@ -0,0 +1,271 @@ +{ + "results": [ + { + "id": 1, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "NYSE American, LLC", + "acronym": "AMEX", + "mic": "XASE", + "operating_mic": "XNYS", + "participant_id": "A", + "url": "https://www.nyse.com/markets/nyse-american" + }, + { + "id": 2, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "Nasdaq OMX BX, Inc.", + "mic": "XBOS", + "operating_mic": "XNAS", + "participant_id": "B", + "url": "https://www.nasdaq.com/solutions/nasdaq-bx-stock-market" + }, + { + "id": 3, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "NYSE National, Inc.", + "acronym": "NSX", + "mic": "XCIS", + "operating_mic": "XNYS", + "participant_id": "C", + "url": "https://www.nyse.com/markets/nyse-national" + }, + { + "id": 4, + "type": "TRF", + "asset_class": "stocks", + "locale": "us", + "name": "FINRA NYSE TRF", + "mic": "FINY", + "operating_mic": "XNYS", + "participant_id": "D", + "url": "https://www.finra.org" + }, + { + "id": 4, + "type": "TRF", + "asset_class": "stocks", + "locale": "us", + "name": "FINRA Nasdaq TRF Carteret", + "mic": "FINN", + "operating_mic": "FINR", + "participant_id": "D", + "url": "https://www.finra.org" + }, + { + "id": 4, + "type": "TRF", + "asset_class": "stocks", + "locale": "us", + "name": "FINRA Nasdaq TRF Chicago", + "mic": "FINC", + "operating_mic": "FINR", + "participant_id": "D", + "url": "https://www.finra.org" + }, + { + "id": 4, + "type": "TRF", + "asset_class": "stocks", + "locale": "us", + "name": "FINRA Alternative Display Facility", + "mic": "XADF", + "operating_mic": "FINR", + "participant_id": "D", + "url": "https://www.finra.org" + }, + { + "id": 5, + "type": "SIP", + "asset_class": "stocks", + "locale": "us", + "name": "Unlisted Trading Privileges", + "operating_mic": "XNAS", + "participant_id": "E", + "url": "https://www.utpplan.com" + }, + { + "id": 6, + "type": "TRF", + "asset_class": "stocks", + "locale": "us", + "name": "International Securities Exchange, LLC - Stocks", + "mic": "XISE", + "operating_mic": "XNAS", + "participant_id": "I", + "url": "https://nasdaq.com/solutions/nasdaq-ise" + }, + { + "id": 7, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "Cboe EDGA", + "mic": "EDGA", + "operating_mic": "XCBO", + "participant_id": "J", + "url": "https://www.cboe.com/us/equities" + }, + { + "id": 8, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "Cboe EDGX", + "mic": "EDGX", + "operating_mic": "XCBO", + "participant_id": "K", + "url": "https://www.cboe.com/us/equities" + }, + { + "id": 9, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "NYSE Chicago, Inc.", + "mic": "XCHI", + "operating_mic": "XNYS", + "participant_id": "M", + "url": "https://www.nyse.com/markets/nyse-chicago" + }, + { + "id": 10, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "New York Stock Exchange", + "mic": "XNYS", + "operating_mic": "XNYS", + "participant_id": "N", + "url": "https://www.nyse.com" + }, + { + "id": 11, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "NYSE Arca, Inc.", + "mic": "ARCX", + "operating_mic": "XNYS", + "participant_id": "P", + "url": "https://www.nyse.com/markets/nyse-arca" + }, + { + "id": 12, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "Nasdaq", + "mic": "XNAS", + "operating_mic": "XNAS", + "participant_id": "T", + "url": "https://www.nasdaq.com" + }, + { + "id": 13, + "type": "SIP", + "asset_class": "stocks", + "locale": "us", + "name": "Consolidated Tape Association", + "operating_mic": "XNYS", + "participant_id": "S", + "url": "https://www.nyse.com/data/cta" + }, + { + "id": 14, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "Long-Term Stock Exchange", + "mic": "LTSE", + "operating_mic": "LTSE", + "participant_id": "L", + "url": "https://www.ltse.com" + }, + { + "id": 15, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "Investors Exchange", + "mic": "IEXG", + "operating_mic": "IEXG", + "participant_id": "V", + "url": "https://www.iextrading.com" + }, + { + "id": 16, + "type": "TRF", + "asset_class": "stocks", + "locale": "us", + "name": "Cboe Stock Exchange", + "mic": "CBSX", + "operating_mic": "XCBO", + "participant_id": "W", + "url": "https://www.cboe.com" + }, + { + "id": 17, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "Nasdaq Philadelphia Exchange LLC", + "mic": "XPHL", + "operating_mic": "XNAS", + "participant_id": "X", + "url": "https://www.nasdaq.com/solutions/nasdaq-phlx" + }, + { + "id": 18, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "Cboe BYX", + "mic": "BATY", + "operating_mic": "XCBO", + "participant_id": "Y", + "url": "https://www.cboe.com/us/equities" + }, + { + "id": 19, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "Cboe BZX", + "mic": "BATS", + "operating_mic": "XCBO", + "participant_id": "Z", + "url": "https://www.cboe.com/us/equities" + }, + { + "id": 20, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "MIAX Pearl", + "mic": "EPRL", + "operating_mic": "MIHI", + "participant_id": "H", + "url": "https://www.miaxoptions.com/alerts/pearl-equities" + }, + { + "id": 21, + "type": "exchange", + "asset_class": "stocks", + "locale": "us", + "name": "Members Exchange", + "mic": "MEMX", + "operating_mic": "MEMX", + "participant_id": "U", + "url": "https://www.memx.com" + } + ], + "status": "OK", + "request_id": "c0109b8a70a931efe47cef085c7a7f5e", + "count": 24 +} \ No newline at end of file diff --git a/test_rest/mocks/v3/reference/options/contracts&cursor=YXA9JTdCJTIySUQlMjIlM0ElMjIy.json b/test_rest/mocks/v3/reference/options/contracts&cursor=YXA9JTdCJTIySUQlMjIlM0ElMjIy.json new file mode 100644 index 00000000..4a041387 --- /dev/null +++ b/test_rest/mocks/v3/reference/options/contracts&cursor=YXA9JTdCJTIySUQlMjIlM0ElMjIy.json @@ -0,0 +1,116 @@ +{ + "results": [ + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 115, + "ticker": "O:A220520C00115000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 120, + "ticker": "O:A220520C00120000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 125, + "ticker": "O:A220520C00125000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 130, + "ticker": "O:A220520C00130000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 135, + "ticker": "O:A220520C00135000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 140, + "ticker": "O:A220520C00140000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 145, + "ticker": "O:A220520C00145000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 150, + "ticker": "O:A220520C00150000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 155, + "ticker": "O:A220520C00155000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 160, + "ticker": "O:A220520C00160000", + "underlying_ticker": "A" + } + ], + "status": "OK", + "request_id": "7ab36c77b9412ecc95275a94461be18f" +} \ No newline at end of file diff --git a/test_rest/mocks/v3/reference/options/contracts.json b/test_rest/mocks/v3/reference/options/contracts.json new file mode 100644 index 00000000..639c5cf5 --- /dev/null +++ b/test_rest/mocks/v3/reference/options/contracts.json @@ -0,0 +1,117 @@ +{ + "results": [ + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 65, + "ticker": "O:A220520C00065000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 70, + "ticker": "O:A220520C00070000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 75, + "ticker": "O:A220520C00075000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 80, + "ticker": "O:A220520C00080000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 85, + "ticker": "O:A220520C00085000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 90, + "ticker": "O:A220520C00090000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 95, + "ticker": "O:A220520C00095000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 100, + "ticker": "O:A220520C00100000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 105, + "ticker": "O:A220520C00105000", + "underlying_ticker": "A" + }, + { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-05-20", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 110, + "ticker": "O:A220520C00110000", + "underlying_ticker": "A" + } + ], + "status": "OK", + "request_id": "30ece14c74dcfc5ad4785b08fd21456d", + "next_url": "https://api.polygon.io/v3/reference/options/contracts?cursor=YXA9JTdCJTIySUQlMjIlM0ElMjIy" +} \ No newline at end of file diff --git a/test_rest/mocks/v3/reference/options/contracts/OEVRI240119C00002500.json b/test_rest/mocks/v3/reference/options/contracts/OEVRI240119C00002500.json new file mode 100644 index 00000000..5ceaa157 --- /dev/null +++ b/test_rest/mocks/v3/reference/options/contracts/OEVRI240119C00002500.json @@ -0,0 +1,15 @@ +{ + "results": { + "cfi": "OCASPS", + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2024-01-19", + "primary_exchange": "BATO", + "shares_per_contract": 100, + "strike_price": 2.5, + "ticker": "O:EVRI240119C00002500", + "underlying_ticker": "EVRI" + }, + "status": "OK", + "request_id": "c6a1dbcd2337b5887761d09bd4afdff8" +} \ No newline at end of file diff --git a/test_rest/mocks/v3/reference/splits.json b/test_rest/mocks/v3/reference/splits.json new file mode 100644 index 00000000..3c60d759 --- /dev/null +++ b/test_rest/mocks/v3/reference/splits.json @@ -0,0 +1,66 @@ +{ + "results": [ + { + "execution_date": "2022-07-18", + "split_from": 1, + "split_to": 20, + "ticker": "GOOGL" + }, + { + "execution_date": "2022-07-18", + "split_from": 1, + "split_to": 20, + "ticker": "GOOG" + }, + { + "execution_date": "2022-07-01", + "split_from": 1, + "split_to": 3, + "ticker": "CTO" + }, + { + "execution_date": "2022-06-29", + "split_from": 1, + "split_to": 10, + "ticker": "SHOP" + }, + { + "execution_date": "2022-06-22", + "split_from": 1, + "split_to": 10, + "ticker": "SHOP" + }, + { + "execution_date": "2022-06-10", + "split_from": 1, + "split_to": 4, + "ticker": "DXCM" + }, + { + "execution_date": "2022-06-06", + "split_from": 1, + "split_to": 20, + "ticker": "AMZN" + }, + { + "execution_date": "2022-05-20", + "split_from": 2, + "split_to": 1, + "ticker": "BRW" + }, + { + "execution_date": "2022-05-16", + "split_from": 1, + "split_to": 2, + "ticker": "CM" + }, + { + "execution_date": "2022-05-02", + "split_from": 3, + "split_to": 4, + "ticker": "CIG.C" + } + ], + "status": "OK", + "request_id": "b52de486daf5491e6b9ebdf5e0bf65bc" +} \ No newline at end of file diff --git a/test_rest/mocks/v3/reference/tickers&cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIyLTA0LTI3JmxpbWl0PTImb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUFBJTdDZjEyMmJjYmY4YWQwNzRmZmJlMTZmNjkxOWQ0ZDc3NjZlMzA3MWNmNmU1Nzg3OGE0OGU1NjQ1YzQyM2U3NzJhOSZzb3J0PXRpY2tlcg.json b/test_rest/mocks/v3/reference/tickers&cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIyLTA0LTI3JmxpbWl0PTImb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUFBJTdDZjEyMmJjYmY4YWQwNzRmZmJlMTZmNjkxOWQ0ZDc3NjZlMzA3MWNmNmU1Nzg3OGE0OGU1NjQ1YzQyM2U3NzJhOSZzb3J0PXRpY2tlcg.json new file mode 100644 index 00000000..0cad5983 --- /dev/null +++ b/test_rest/mocks/v3/reference/tickers&cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIyLTA0LTI3JmxpbWl0PTImb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUFBJTdDZjEyMmJjYmY4YWQwNzRmZmJlMTZmNjkxOWQ0ZDc3NjZlMzA3MWNmNmU1Nzg3OGE0OGU1NjQ1YzQyM2U3NzJhOSZzb3J0PXRpY2tlcg.json @@ -0,0 +1,34 @@ +{ + "results": [ + { + "ticker": "AAA", + "name": "AAF First Priority CLO Bond ETF", + "market": "stocks", + "locale": "us", + "primary_exchange": "ARCX", + "type": "ETF", + "active": true, + "currency_name": "usd", + "composite_figi": "BBG00X5FSP48", + "share_class_figi": "BBG00X5FSPZ4", + "last_updated_utc": "2022-04-27T00:00:00Z" + }, + { + "ticker": "AAAU", + "name": "Goldman Sachs Physical Gold ETF Shares", + "market": "stocks", + "locale": "us", + "primary_exchange": "BATS", + "type": "ETF", + "active": true, + "currency_name": "usd", + "cik": "0001708646", + "composite_figi": "BBG00LPXX872", + "share_class_figi": "BBG00LPXX8Z1", + "last_updated_utc": "2022-04-27T00:00:00Z" + } + ], + "status": "OK", + "request_id": "40d60d83fa0628503b4d13387b7bde2a", + "count": 2 +} \ No newline at end of file diff --git a/test_rest/mocks/v3/reference/tickers.json b/test_rest/mocks/v3/reference/tickers.json new file mode 100644 index 00000000..0dd09f5c --- /dev/null +++ b/test_rest/mocks/v3/reference/tickers.json @@ -0,0 +1,36 @@ +{ + "results": [ + { + "ticker": "A", + "name": "Agilent Technologies Inc.", + "market": "stocks", + "locale": "us", + "primary_exchange": "XNYS", + "type": "CS", + "active": true, + "currency_name": "usd", + "cik": "0001090872", + "composite_figi": "BBG000C2V3D6", + "share_class_figi": "BBG001SCTQY4", + "last_updated_utc": "2022-04-27T00:00:00Z" + }, + { + "ticker": "AA", + "name": "Alcoa Corporation", + "market": "stocks", + "locale": "us", + "primary_exchange": "XNYS", + "type": "CS", + "active": true, + "currency_name": "usd", + "cik": "0001675149", + "composite_figi": "BBG00B3T3HD3", + "share_class_figi": "BBG00B3T3HF1", + "last_updated_utc": "2022-04-27T00:00:00Z" + } + ], + "status": "OK", + "request_id": "37089bb3b4ef99a796cdc82ff971e447", + "count": 2, + "next_url": "https://api.polygon.io/v3/reference/tickers?cursor=YWN0aXZlPXRydWUmZGF0ZT0yMDIyLTA0LTI3JmxpbWl0PTImb3JkZXI9YXNjJnBhZ2VfbWFya2VyPUFBJTdDZjEyMmJjYmY4YWQwNzRmZmJlMTZmNjkxOWQ0ZDc3NjZlMzA3MWNmNmU1Nzg3OGE0OGU1NjQ1YzQyM2U3NzJhOSZzb3J0PXRpY2tlcg" +} \ No newline at end of file diff --git a/test_rest/mocks/v3/reference/tickers/AAPL&date=2020-10-01.json b/test_rest/mocks/v3/reference/tickers/AAPL&date=2020-10-01.json new file mode 100644 index 00000000..80f3e470 --- /dev/null +++ b/test_rest/mocks/v3/reference/tickers/AAPL&date=2020-10-01.json @@ -0,0 +1,38 @@ +{ + "results": { + "ticker": "AAPL", + "name": "Apple Inc.", + "market": "stocks", + "locale": "us", + "primary_exchange": "XNAS", + "type": "CS", + "active": true, + "currency_name": "usd", + "cik": "0000320193", + "composite_figi": "BBG000B9XRY4", + "share_class_figi": "BBG001S5N8V8", + "market_cap": 1916103105630, + "phone_number": "(408) 996-1010", + "address": { + "address1": "ONE APPLE PARK WAY", + "city": "CUPERTINO", + "state": "CA", + "postal_code": "95014" + }, + "description": "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.", + "sic_code": "3571", + "sic_description": "ELECTRONIC COMPUTERS", + "ticker_root": "AAPL", + "homepage_url": "https://www.apple.com", + "total_employees": 154000, + "list_date": "1980-12-12", + "branding": { + "logo_url": "https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-05-01_logo.svg", + "icon_url": "https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-05-01_icon.png" + }, + "share_class_shares_outstanding": 16319440000, + "weighted_shares_outstanding": 16185181000 + }, + "status": "OK", + "request_id": "ce8688b5f3a571351376ebd77acd146e" +} diff --git a/test_rest/mocks/v3/reference/tickers/AAPL.json b/test_rest/mocks/v3/reference/tickers/AAPL.json new file mode 100644 index 00000000..306fb384 --- /dev/null +++ b/test_rest/mocks/v3/reference/tickers/AAPL.json @@ -0,0 +1,38 @@ +{ + "results": { + "ticker": "AAPL", + "name": "Apple Inc.", + "market": "stocks", + "locale": "us", + "primary_exchange": "XNAS", + "type": "CS", + "active": true, + "currency_name": "usd", + "cik": "0000320193", + "composite_figi": "BBG000B9XRY4", + "share_class_figi": "BBG001S5N8V8", + "market_cap": 2488795282370, + "phone_number": "(408) 996-1010", + "address": { + "address1": "ONE APPLE PARK WAY", + "city": "CUPERTINO", + "state": "CA", + "postal_code": "95014" + }, + "description": "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.", + "sic_code": "3571", + "sic_description": "ELECTRONIC COMPUTERS", + "ticker_root": "AAPL", + "homepage_url": "https://www.apple.com", + "total_employees": 154000, + "list_date": "1980-12-12", + "branding": { + "logo_url": "https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-05-01_logo.svg", + "icon_url": "https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-05-01_icon.png" + }, + "share_class_shares_outstanding": 16319440000, + "weighted_shares_outstanding": 16185181000 + }, + "status": "OK", + "request_id": "ce8688b5f3a571351376ebd77acd146e" +} diff --git a/test_rest/mocks/v3/reference/tickers/types.json b/test_rest/mocks/v3/reference/tickers/types.json new file mode 100644 index 00000000..25fa9e04 --- /dev/null +++ b/test_rest/mocks/v3/reference/tickers/types.json @@ -0,0 +1,97 @@ +{ + "results": [ + { + "code": "CS", + "description": "Common Stock", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "PFD", + "description": "Preferred Stock", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "WARRANT", + "description": "Warrant", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "RIGHT", + "description": "Rights", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "BOND", + "description": "Corporate Bond", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "ETF", + "description": "Exchange Traded Fund", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "ETN", + "description": "Exchange Traded Note", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "SP", + "description": "Structured Product", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "ADRC", + "description": "American Depository Receipt Common", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "ADRW", + "description": "American Depository Receipt Warrants", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "ADRR", + "description": "American Depository Receipt Rights", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "FUND", + "description": "Fund", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "BASKET", + "description": "Basket", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "UNIT", + "description": "Unit", + "asset_class": "stocks", + "locale": "us" + }, + { + "code": "LT", + "description": "Liquidating Trust", + "asset_class": "stocks", + "locale": "us" + } + ], + "status": "OK", + "request_id": "efbfc7c2304bba6c2f19a2567f568134", + "count": 15 +} \ No newline at end of file diff --git a/test_rest/mocks/v3/snapshot.json b/test_rest/mocks/v3/snapshot.json new file mode 100644 index 00000000..9a09706c --- /dev/null +++ b/test_rest/mocks/v3/snapshot.json @@ -0,0 +1,115 @@ +{ + "request_id": "abc123", + "results": [ + { + "break_even_price": 171.075, + "details": { + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2022-10-14", + "shares_per_contract": 100, + "strike_price": 5, + "underlying_ticker": "NCLH" + }, + "fmv": 20.5, + "greeks": { + "delta": 0.5520187372272933, + "gamma": 0.00706756515659829, + "theta": -0.018532772783847958, + "vega": 0.7274811132998142 + }, + "implied_volatility": 0.3048997097864957, + "last_quote": { + "ask": 21.25, + "ask_size": 110, + "bid": 20.9, + "bid_size": 172, + "last_updated": 1636573458756383500, + "midpoint": 21.075, + "timeframe": "REAL-TIME" + }, + "last_trade": { + "conditions": [ + 209 + ], + "exchange": 316, + "price": 0.05, + "sip_timestamp": 1675280958783136800, + "size": 2, + "timeframe": "REAL-TIME" + }, + "market_status": "closed", + "name": "NCLH $5 Call", + "open_interest": 8921, + "session": { + "change": -0.05, + "change_percent": -1.07, + "close": 6.65, + "early_trading_change": -0.01, + "early_trading_change_percent": -0.03, + "high": 7.01, + "late_trading_change": -0.4, + "late_trading_change_percent": -0.02, + "low": 5.42, + "open": 6.7, + "previous_close": 6.71, + "volume": 67 + }, + "ticker": "O:NCLH221014C00005000", + "type": "options", + "underlying_asset": { + "change_to_break_even": 23.123999999999995, + "last_updated": 1636573459862384600, + "price": 147.951, + "ticker": "AAPL", + "timeframe": "REAL-TIME" + } + }, + { + "fmv": 0.05, + "last_quote": { + "ask": 21.25, + "ask_size": 110, + "bid": 20.9, + "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" +} \ No newline at end of file diff --git a/test_rest/mocks/v3/snapshot/indices&ticker.any_of=SPX%2CAPx%2CAPy.json b/test_rest/mocks/v3/snapshot/indices&ticker.any_of=SPX%2CAPx%2CAPy.json new file mode 100644 index 00000000..09ad9f12 --- /dev/null +++ b/test_rest/mocks/v3/snapshot/indices&ticker.any_of=SPX%2CAPx%2CAPy.json @@ -0,0 +1,30 @@ +{ + "results": [ + { + "value": 3822.39, + "name": "S&P 500", + "ticker": "SPX", + "type": "indices", + "market_status": "closed", + "session": { + "change": -50.01, + "change_percent": -1.45, + "close": 3822.39, + "high": 3834.41, + "low": 38217.11, + "open": 3827.38, + "previous_close": 3812.19 + } + }, + { + "ticker": "APx", + "error": "NOT_FOUND", + "message": "Ticker not found." + }, + { + "ticker": "APy", + "error": "NOT_ENTITLED", + "message": "Not entitled to this ticker." + } + ] +} \ No newline at end of file diff --git a/test_rest/mocks/v3/snapshot/options/AAPL.json b/test_rest/mocks/v3/snapshot/options/AAPL.json new file mode 100644 index 00000000..84e38b93 --- /dev/null +++ b/test_rest/mocks/v3/snapshot/options/AAPL.json @@ -0,0 +1,61 @@ + + { + "request_id": "104d9b901d0c9e81d284cb8b41c5cdd3", + "results": [{ + "break_even_price": 179.075, + "day": { + "change": -2.3999999999999986, + "change_percent": -7.643312101910824, + "close": 29, + "high": 32.25, + "last_updated": 1651204800000000000, + "low": 29, + "open": 29.99, + "previous_close": 31.4, + "volume": 8, + "vwap": 30.7738 + }, + "details": { + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2023-06-16", + "shares_per_contract": 100, + "strike_price": 150, + "ticker": "O:AAPL230616C00150000" + }, + "fmv": 20.5, + "greeks": { + "delta": 0.6436614934293701, + "gamma": 0.0061735291012820675, + "theta": -0.028227189324641973, + "vega": 0.6381159723175714 + }, + "implied_volatility": 0.3570277203465058, + "last_quote": { + "ask": 29.25, + "ask_size": 209, + "bid": 28.9, + "bid_size": 294, + "last_updated": 1651254260800059648, + "midpoint": 29.075, + "timeframe": "REAL-TIME" + }, + "last_trade":{ + "price": 29.25, + "sip_timestamp": 1678718527714665700, + "size": 1, + "conditions": [209], + "exchange": 309, + "timeframe": "REAL-TIME" + }, + "open_interest": 8133, + "underlying_asset": { + "change_to_break_even": 19.11439999999999, + "last_updated": 1651254263172073152, + "price": 159.9606, + "ticker": "AAPL", + "timeframe": "REAL-TIME" + } + }], + "status": "OK" +} diff --git a/test_rest/mocks/v3/snapshot/options/AAPL/O;AAPL230616C00150000.json b/test_rest/mocks/v3/snapshot/options/AAPL/O;AAPL230616C00150000.json new file mode 100644 index 00000000..d63e980e --- /dev/null +++ b/test_rest/mocks/v3/snapshot/options/AAPL/O;AAPL230616C00150000.json @@ -0,0 +1,60 @@ +{ + "request_id": "104d9b901d0c9e81d284cb8b41c5cdd3", + "results": { + "break_even_price": 179.075, + "day": { + "change": -2.3999999999999986, + "change_percent": -7.643312101910824, + "close": 29, + "high": 32.25, + "last_updated": 1651204800000000000, + "low": 29, + "open": 29.99, + "previous_close": 31.4, + "volume": 8, + "vwap": 30.7738 + }, + "details": { + "contract_type": "call", + "exercise_style": "american", + "expiration_date": "2023-06-16", + "shares_per_contract": 100, + "strike_price": 150, + "ticker": "O:AAPL230616C00150000" + }, + "fmv": 29.2, + "greeks": { + "delta": 0.6436614934293701, + "gamma": 0.0061735291012820675, + "theta": -0.028227189324641973, + "vega": 0.6381159723175714 + }, + "implied_volatility": 0.3570277203465058, + "last_quote": { + "ask": 29.25, + "ask_size": 209, + "bid": 28.9, + "bid_size": 294, + "last_updated": 1651254260800059648, + "midpoint": 29.075, + "timeframe": "REAL-TIME" + }, + "last_trade":{ + "price": 29.25, + "sip_timestamp": 1678718527714665700, + "size": 1, + "conditions": [209], + "exchange": 309, + "timeframe": "REAL-TIME" + }, + "open_interest": 8133, + "underlying_asset": { + "change_to_break_even": 19.11439999999999, + "last_updated": 1651254263172073152, + "price": 159.9606, + "ticker": "AAPL", + "timeframe": "REAL-TIME" + } + }, + "status": "OK" +} diff --git a/test_rest/mocks/v3/trades/AAPL&limit=2.json b/test_rest/mocks/v3/trades/AAPL&limit=2.json new file mode 100644 index 00000000..1ce58194 --- /dev/null +++ b/test_rest/mocks/v3/trades/AAPL&limit=2.json @@ -0,0 +1,40 @@ +{ + "results": [ + { + "conditions": [ + 12, + 37 + ], + "correction": 1, + "exchange": 11, + "id": "183276", + "participant_timestamp": 1651181822461636600, + "price": 156.43, + "sequence_number": 7179341, + "sip_timestamp": 1651181822461979400, + "size": 10, + "tape": 3, + "trf_id": 3, + "trf_timestamp": 1651181557090806500 + }, + { + "conditions": [ + 12, + 37 + ], + "correction": 1, + "exchange": 12, + "id": "183276", + "participant_timestamp": 1651181822461636600, + "price": 157.43, + "sequence_number": 7179341, + "sip_timestamp": 1651181822461979400, + "size": 10, + "tape": 3, + "trf_id": 3, + "trf_timestamp": 1651181557090806500 + } + ], + "status": "OK", + "request_id": "756f9910624b35a47eb07f21a7a373bb" +} \ No newline at end of file diff --git a/test_rest/mocks/vX/reference/financials.json b/test_rest/mocks/vX/reference/financials.json new file mode 100644 index 00000000..ae84513b --- /dev/null +++ b/test_rest/mocks/vX/reference/financials.json @@ -0,0 +1,310 @@ +{ + "results": [ + { + "financials": { + "balance_sheet": { + "equity_attributable_to_noncontrolling_interest": { + "label": "Equity Attributable To Noncontrolling Interest", + "value": 2.51e+08, + "unit": "USD", + "order": 1500 + }, + "liabilities": { + "label": "Liabilities", + "value": 1.4561e+10, + "unit": "USD", + "order": 600 + }, + "equity_attributable_to_parent": { + "label": "Equity Attributable To Parent", + "value": 6.509e+09, + "unit": "USD", + "order": 1600 + }, + "noncurrent_assets": { + "label": "Noncurrent Assets", + "value": 1.6046e+10, + "unit": "USD", + "order": 300 + }, + "liabilities_and_equity": { + "label": "Liabilities And Equity", + "value": 2.1321e+10, + "unit": "USD", + "order": 1900 + }, + "assets": { + "label": "Assets", + "value": 2.1321e+10, + "unit": "USD", + "order": 100 + }, + "fixed_assets": { + "label": "Fixed Assets", + "value": 2.814e+09, + "unit": "USD", + "order": 400 + }, + "noncurrent_liabilities": { + "label": "Noncurrent Liabilities", + "value": 1.1716e+10, + "unit": "USD", + "order": 800 + }, + "current_assets": { + "label": "Current Assets", + "value": 5.275e+09, + "unit": "USD", + "order": 200 + }, + "equity": { + "label": "Equity", + "value": 6.76e+09, + "unit": "USD", + "order": 1400 + }, + "current_liabilities": { + "label": "Current Liabilities", + "value": 2.845e+09, + "unit": "USD", + "order": 700 + } + }, + "cash_flow_statement": { + "net_cash_flow_from_investing_activities": { + "label": "Net Cash Flow From Investing Activities", + "value": -3.29e+08, + "unit": "USD", + "order": 400 + }, + "net_cash_flow_from_operating_activities_continuing": { + "label": "Net Cash Flow From Operating Activities, Continuing", + "value": 8.56e+08, + "unit": "USD", + "order": 200 + }, + "exchange_gains_losses": { + "label": "Exchange Gains/Losses", + "value": 0, + "unit": "USD", + "order": 1000 + }, + "net_cash_flow_continuing": { + "label": "Net Cash Flow, Continuing", + "value": -1.47e+08, + "unit": "USD", + "order": 1200 + }, + "net_cash_flow": { + "label": "Net Cash Flow", + "value": -1.47e+08, + "unit": "USD", + "order": 1100 + }, + "net_cash_flow_from_financing_activities": { + "label": "Net Cash Flow From Financing Activities", + "value": -6.74e+08, + "unit": "USD", + "order": 700 + }, + "net_cash_flow_from_investing_activities_continuing": { + "label": "Net Cash Flow From Investing Activities, Continuing", + "value": -3.29e+08, + "unit": "USD", + "order": 500 + }, + "net_cash_flow_from_operating_activities": { + "label": "Net Cash Flow From Operating Activities", + "value": 8.56e+08, + "unit": "USD", + "order": 100 + }, + "net_cash_flow_from_financing_activities_continuing": { + "label": "Net Cash Flow From Financing Activities, Continuing", + "value": -6.74e+08, + "unit": "USD", + "order": 800 + } + }, + "comprehensive_income": { + "comprehensive_income_loss_attributable_to_noncontrolling_interest": { + "label": "Comprehensive Income/Loss Attributable To Noncontrolling Interest", + "value": 9e+06, + "unit": "USD", + "order": 200 + }, + "comprehensive_income_loss_attributable_to_parent": { + "label": "Comprehensive Income/Loss Attributable To Parent", + "value": 6.35e+08, + "unit": "USD", + "order": 300 + }, + "other_comprehensive_income_loss": { + "label": "Other Comprehensive Income/Loss", + "value": -2.2e+07, + "unit": "USD", + "order": 400 + }, + "other_comprehensive_income_loss_attributable_to_parent": { + "label": "Other Comprehensive Income/Loss Attributable To Parent", + "value": -2.2e+07, + "unit": "USD", + "order": 600 + }, + "comprehensive_income_loss": { + "label": "Comprehensive Income/Loss", + "value": 6.44e+08, + "unit": "USD", + "order": 100 + } + }, + "income_statement": { + "income_loss_before_equity_method_investments": { + "label": "Income/Loss Before Equity Method Investments", + "value": 7.68e+08, + "unit": "USD", + "order": 1300 + }, + "diluted_earnings_per_share": { + "label": "Diluted Earnings Per Share", + "value": 2.48, + "unit": "USD / shares", + "order": 4300 + }, + "income_loss_from_equity_method_investments": { + "label": "Income/Loss From Equity Method Investments", + "value": 1.2e+07, + "unit": "USD", + "order": 2100 + }, + "operating_expenses": { + "label": "Operating Expenses", + "value": 9.04e+08, + "unit": "USD", + "order": 1000 + }, + "income_loss_from_continuing_operations_after_tax": { + "label": "Income/Loss From Continuing Operations After Tax", + "value": 6.54e+08, + "unit": "USD", + "order": 1400 + }, + "preferred_stock_dividends_and_other_adjustments": { + "label": "Preferred Stock Dividends And Other Adjustments", + "value": 0, + "unit": "USD", + "order": 3900 + }, + "basic_earnings_per_share": { + "label": "Basic Earnings Per Share", + "value": 2.5, + "unit": "USD / shares", + "order": 4200 + }, + "cost_of_revenue": { + "label": "Cost Of Revenue", + "value": 1.359e+09, + "unit": "USD", + "order": 300 + }, + "net_income_loss_attributable_to_parent": { + "label": "Net Income/Loss Attributable To Parent", + "value": 6.57e+08, + "unit": "USD", + "order": 3500 + }, + "income_loss_from_continuing_operations_before_tax": { + "label": "Income/Loss From Continuing Operations Before Tax", + "value": 7.68e+08, + "unit": "USD", + "order": 1500 + }, + "income_tax_expense_benefit_deferred": { + "label": "Income Tax Expense/Benefit, Deferred", + "value": -3.3e+07, + "unit": "USD", + "order": 2400 + }, + "costs_and_expenses": { + "label": "Costs And Expenses", + "value": 2.368e+09, + "unit": "USD", + "order": 600 + }, + "gross_profit": { + "label": "Gross Profit", + "value": 1.777e+09, + "unit": "USD", + "order": 800 + }, + "benefits_costs_expenses": { + "label": "Benefits Costs and Expenses", + "value": 2.368e+09, + "unit": "USD", + "order": 200 + }, + "participating_securities_distributed_and_undistributed_earnings_loss_basic": { + "label": "Participating Securities, Distributed And Undistributed Earnings/Loss, Basic", + "value": 0, + "unit": "USD", + "order": 3800 + }, + "income_tax_expense_benefit": { + "label": "Income Tax Expense/Benefit", + "value": 1.14e+08, + "unit": "USD", + "order": 2200 + }, + "net_income_loss_attributable_to_noncontrolling_interest": { + "label": "Net Income/Loss Attributable To Noncontrolling Interest", + "value": 9e+06, + "unit": "USD", + "order": 3300 + }, + "interest_expense_operating": { + "label": "Interest Expense, Operating", + "value": 1.04e+08, + "unit": "USD", + "order": 2700 + }, + "net_income_loss_available_to_common_stockholders_basic": { + "label": "Net Income/Loss Available To Common Stockholders, Basic", + "value": 6.57e+08, + "unit": "USD", + "order": 3700 + }, + "revenues": { + "label": "Revenues", + "value": 3.136e+09, + "unit": "USD", + "order": 100 + }, + "net_income_loss": { + "label": "Net Income/Loss", + "value": 6.66e+08, + "unit": "USD", + "order": 3200 + }, + "operating_income_loss": { + "label": "Operating Income/Loss", + "value": 8.73e+08, + "unit": "USD", + "order": 1100 + } + } + }, + "start_date": "2022-01-01", + "end_date": "2022-04-03", + "filing_date": "2022-05-03", + "cik": "0001413447", + "company_name": "NXP Semiconductors N.V.", + "fiscal_period": "Q1", + "fiscal_year": "2022", + "source_filing_url": "https://api.polygon.io/v1/reference/sec/filings/0001413447-22-000014", + "source_filing_file_url": "https://api.polygon.io/v1/reference/sec/filings/0001413447-22-000014/files/nxpi-20220403_htm.xml" + } + ], + "status": "OK", + "request_id": "414d65d9ba18a52010614a3247ceddeb", + "count": 1 +} \ No newline at end of file diff --git a/test_rest/mocks/vX/reference/tickers/META/events&types=ticker_change.json b/test_rest/mocks/vX/reference/tickers/META/events&types=ticker_change.json new file mode 100644 index 00000000..19e4cec0 --- /dev/null +++ b/test_rest/mocks/vX/reference/tickers/META/events&types=ticker_change.json @@ -0,0 +1,25 @@ +{ + "results": { + "name": "Meta Platforms, Inc. Class A Common Stock", + "composite_figi": "BBG000MM2P62", + "cik": "0001326801", + "events": [ + { + "ticker_change": { + "ticker": "META" + }, + "type": "ticker_change", + "date": "2022-06-11" + }, + { + "ticker_change": { + "ticker": "FB" + }, + "type": "ticker_change", + "date": "2012-05-18" + } + ] + }, + "status": "OK", + "request_id": "8c911ff1-5ca8-41e8-9bbf-e625141caacc" +} diff --git a/test_rest/models/test_requests.py b/test_rest/models/test_requests.py new file mode 100644 index 00000000..48b25a9a --- /dev/null +++ b/test_rest/models/test_requests.py @@ -0,0 +1,103 @@ +import unittest + +from polygon import RESTClient +from polygon.rest.models.request import ( + RequestOptionBuilder, + X_POLYGON_EDGE_ID, + X_POLYGON_EDGE_USER_AGENT, + X_POLYGON_EDGE_IP_ADDRESS, +) + + +class RequestTest(unittest.TestCase): + def test_empty_request_options(self): + options = RequestOptionBuilder() + + expected_edge_headers = None + assert expected_edge_headers == options.headers + + def test_request_options_with_initialized_values(self): + options = RequestOptionBuilder( + edge_id="test", edge_ip_address="test", edge_user="test" + ) + + expected_object = { + X_POLYGON_EDGE_ID: "test", + X_POLYGON_EDGE_IP_ADDRESS: "test", + X_POLYGON_EDGE_USER_AGENT: "test", + } + + assert expected_object == options.headers + + def test_request_options_builder(self): + options = RequestOptionBuilder().edge_headers( + edge_id="test", edge_ip_address="test" + ) + + required_options = { + X_POLYGON_EDGE_ID: "test", + X_POLYGON_EDGE_IP_ADDRESS: "test", + } + print(options.headers, required_options) + self.assertDictEqual(required_options, options.headers) + + all_options = { + X_POLYGON_EDGE_ID: "test", + X_POLYGON_EDGE_IP_ADDRESS: "test", + X_POLYGON_EDGE_USER_AGENT: "test", + } + + options = options.update_edge_header(edge_user="test") + self.assertDictEqual(all_options, options.headers) + + def test_header_update(self): + options = RequestOptionBuilder( + edge_id="test", edge_ip_address="test", edge_user="test" + ) + + # this mocks the expected behavior during the request.get function call + # in the BaseClient. + headers = options.headers + + expected_headers = { + "X-Polygon-Edge-ID": "test", + "X-Polygon-Edge-IP-Address": "test", + "X-Polygon-Edge-User-Agent": "test", + } + + self.assertDictEqual(headers, expected_headers) + + expected_headers = { + "X-Polygon-Edge-ID": "test2", + "X-Polygon-Edge-IP-Address": "test2", + "X-Polygon-Edge-User-Agent": "test2", + } + + options = options.update_edge_header( + edge_id="test2", edge_ip_address="test2", edge_user="test2" + ) + + self.assertDictEqual(options.headers, expected_headers) + + def test_clint_headers_concat(self): + client = RESTClient(api_key="test") + options = RequestOptionBuilder("test", "test", "test") + concat_headers = client._concat_headers(options.headers) + + expected = { + "Authorization": "Bearer test", + "User-Agent": "Polygon.io PythonClient/0.0.0", + "X-Polygon-Edge-ID": "test", + "X-Polygon-Edge-IP-Address": "test", + "X-Polygon-Edge-User-Agent": "test", + } + + self.assertDictEqual(concat_headers, expected) + + headers = None + expected = { + "Authorization": "Bearer test", + "User-Agent": "Polygon.io PythonClient/0.0.0", + } + + self.assertDictEqual(expected, client._concat_headers(headers)) diff --git a/test_rest/test_aggs.py b/test_rest/test_aggs.py new file mode 100644 index 00000000..a589fe33 --- /dev/null +++ b/test_rest/test_aggs.py @@ -0,0 +1,113 @@ +from base import BaseTest +from polygon.rest.models import ( + Agg, + GroupedDailyAgg, + DailyOpenCloseAgg, + PreviousCloseAgg, +) + + +class AggsTest(BaseTest): + def test_list_aggs(self): + aggs = [ + a for a in self.c.list_aggs("AAPL", 1, "day", "2005-04-02", "2005-04-04") + ] + expected = [ + Agg( + open=1.5032, + high=1.5064, + low=1.4489, + close=1.4604, + volume=642646396.0, + vwap=1.469, + timestamp=1112331600000, + transactions=82132, + ), + Agg( + open=1.4639, + high=1.4754, + low=1.4343, + close=1.4675, + volume=578172308.0, + vwap=1.4589, + timestamp=1112587200000, + transactions=65543, + ), + ] + self.assertEqual(aggs, expected) + + def test_get_aggs(self): + aggs = self.c.get_aggs("AAPL", 1, "day", "2005-04-01", "2005-04-04") + expected = [ + Agg( + open=1.5032, + high=1.5064, + low=1.4489, + close=1.4604, + volume=642646396.0, + vwap=1.469, + timestamp=1112331600000, + transactions=82132, + ), + Agg( + open=1.4639, + high=1.4754, + low=1.4343, + close=1.4675, + volume=578172308.0, + vwap=1.4589, + timestamp=1112587200000, + transactions=65543, + ), + ] + self.assertEqual(aggs, expected) + + def test_get_grouped_daily_aggs(self): + aggs = self.c.get_grouped_daily_aggs("2005-04-04", True) + expected = [ + GroupedDailyAgg( + ticker="GIK", + open=9.99, + high=10.02, + low=9.9, + close=10.02, + volume=895345, + vwap=9.9979, + timestamp=1602705600000, + transactions=96, + ) + ] + self.assertEqual(aggs, expected) + + def test_get_daily_open_close_agg(self): + aggs = self.c.get_daily_open_close_agg("AAPL", "2005-04-01", True) + expected = DailyOpenCloseAgg( + after_hours=123, + close=123, + from_="2021-04-01", + high=124.18, + low=122.49, + open=123.66, + pre_market=123.45, + status="OK", + symbol="AAPL", + volume=75089134, + ) + + self.assertEqual(aggs, expected) + + def test_get_previous_close_agg(self): + aggs = self.c.get_previous_close_agg("AAPL") + expected = [ + PreviousCloseAgg( + ticker="AAPL", + close=156.8, + high=162.34, + low=156.72, + open=162.25, + timestamp=1651003200000, + volume=95595226.0, + vwap=158.6074, + ) + ] + self.assertEqual(aggs, expected) diff --git a/test_rest/test_conditions.py b/test_rest/test_conditions.py new file mode 100644 index 00000000..3ec5bb00 --- /dev/null +++ b/test_rest/test_conditions.py @@ -0,0 +1,256 @@ +from polygon.rest.models import ( + Condition, + SipMapping, + UpdateRules, + Consolidated, + MarketCenter, +) +from base import BaseTest + + +class ConditionsTest(BaseTest): + def test_list_conditions(self): + conditions = [c for c in self.c.list_conditions("stocks")] + expected = [ + Condition( + abbreviation=None, + asset_class="stocks", + data_types=["trade"], + description=None, + exchange=None, + id=1, + legacy=None, + name="Acquisition", + sip_mapping=SipMapping(CTA=None, OPRA=None, UTP="A"), + type="sale_condition", + update_rules=UpdateRules( + consolidated=Consolidated( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + market_center=MarketCenter( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + ), + ), + Condition( + abbreviation=None, + asset_class="stocks", + data_types=["trade"], + description=None, + exchange=None, + id=2, + legacy=None, + name="Average Price Trade", + sip_mapping=SipMapping(CTA="B", OPRA=None, UTP="W"), + type="sale_condition", + update_rules=UpdateRules( + consolidated=Consolidated( + updates_high_low=False, + updates_open_close=False, + updates_volume=True, + ), + market_center=MarketCenter( + updates_high_low=False, + updates_open_close=False, + updates_volume=True, + ), + ), + ), + Condition( + abbreviation=None, + asset_class="stocks", + data_types=["trade"], + description=None, + exchange=None, + id=3, + legacy=None, + name="Automatic Execution", + sip_mapping=SipMapping(CTA="E", OPRA=None, UTP=None), + type="sale_condition", + update_rules=UpdateRules( + consolidated=Consolidated( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + market_center=MarketCenter( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + ), + ), + Condition( + abbreviation=None, + asset_class="stocks", + data_types=["trade"], + description=None, + exchange=None, + id=4, + legacy=None, + name="Bunched Trade", + sip_mapping=SipMapping(CTA=None, OPRA=None, UTP="B"), + type="sale_condition", + update_rules=UpdateRules( + consolidated=Consolidated( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + market_center=MarketCenter( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + ), + ), + Condition( + abbreviation=None, + asset_class="stocks", + data_types=["trade"], + description=None, + exchange=None, + id=5, + legacy=None, + name="Bunched Sold Trade", + sip_mapping=SipMapping(CTA=None, OPRA=None, UTP="G"), + type="sale_condition", + update_rules=UpdateRules( + consolidated=Consolidated( + updates_high_low=True, + updates_open_close=False, + updates_volume=True, + ), + market_center=MarketCenter( + updates_high_low=True, + updates_open_close=False, + updates_volume=True, + ), + ), + ), + Condition( + abbreviation=None, + asset_class="stocks", + data_types=["trade"], + description=None, + exchange=None, + id=6, + legacy=True, + name="CAP Election", + sip_mapping=SipMapping(CTA="I", OPRA=None, UTP=None), + type="sale_condition", + update_rules=UpdateRules( + consolidated=Consolidated( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + market_center=MarketCenter( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + ), + ), + Condition( + abbreviation=None, + asset_class="stocks", + data_types=["trade"], + description=None, + exchange=None, + id=7, + legacy=None, + name="Cash Sale", + sip_mapping=SipMapping(CTA="C", OPRA=None, UTP="C"), + type="sale_condition", + update_rules=UpdateRules( + consolidated=Consolidated( + updates_high_low=False, + updates_open_close=False, + updates_volume=True, + ), + market_center=MarketCenter( + updates_high_low=False, + updates_open_close=False, + updates_volume=True, + ), + ), + ), + Condition( + abbreviation=None, + asset_class="stocks", + data_types=["trade"], + description=None, + exchange=None, + id=8, + legacy=None, + name="Closing Prints", + sip_mapping=SipMapping(CTA=None, OPRA=None, UTP="6"), + type="sale_condition", + update_rules=UpdateRules( + consolidated=Consolidated( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + market_center=MarketCenter( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + ), + ), + Condition( + abbreviation=None, + asset_class="stocks", + data_types=["trade"], + description=None, + exchange=None, + id=9, + legacy=None, + name="Cross Trade", + sip_mapping=SipMapping(CTA="X", OPRA=None, UTP="X"), + type="sale_condition", + update_rules=UpdateRules( + consolidated=Consolidated( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + market_center=MarketCenter( + updates_high_low=True, + updates_open_close=True, + updates_volume=True, + ), + ), + ), + Condition( + abbreviation=None, + asset_class="stocks", + data_types=["trade"], + description=None, + exchange=None, + id=10, + legacy=None, + name="Derivatively Priced", + sip_mapping=SipMapping(CTA="4", OPRA=None, UTP="4"), + type="sale_condition", + update_rules=UpdateRules( + consolidated=Consolidated( + updates_high_low=True, + updates_open_close=False, + updates_volume=True, + ), + market_center=MarketCenter( + updates_high_low=True, + updates_open_close=False, + updates_volume=True, + ), + ), + ), + ] + self.assertEqual(conditions, expected) diff --git a/test_rest/test_contracts.py b/test_rest/test_contracts.py new file mode 100644 index 00000000..98c836a6 --- /dev/null +++ b/test_rest/test_contracts.py @@ -0,0 +1,308 @@ +from polygon.rest.models import OptionsContract +from base import BaseTest + + +class ContractsTest(BaseTest): + def test_get_options_contract(self): + contract = self.c.get_options_contract("OEVRI240119C00002500") + expected = OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2024-01-19", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=2.5, + size=None, + ticker="O:EVRI240119C00002500", + underlying_ticker="EVRI", + ) + self.assertEqual(contract, expected) + + def test_list_options_contracts(self): + contracts = [c for c in self.c.list_options_contracts()] + expected = [ + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=65, + size=None, + ticker="O:A220520C00065000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=70, + size=None, + ticker="O:A220520C00070000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=75, + size=None, + ticker="O:A220520C00075000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=80, + size=None, + ticker="O:A220520C00080000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=85, + size=None, + ticker="O:A220520C00085000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=90, + size=None, + ticker="O:A220520C00090000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=95, + size=None, + ticker="O:A220520C00095000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=100, + size=None, + ticker="O:A220520C00100000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=105, + size=None, + ticker="O:A220520C00105000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=110, + size=None, + ticker="O:A220520C00110000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=115, + size=None, + ticker="O:A220520C00115000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=120, + size=None, + ticker="O:A220520C00120000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=125, + size=None, + ticker="O:A220520C00125000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=130, + size=None, + ticker="O:A220520C00130000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=135, + size=None, + ticker="O:A220520C00135000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=140, + size=None, + ticker="O:A220520C00140000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=145, + size=None, + ticker="O:A220520C00145000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=150, + size=None, + ticker="O:A220520C00150000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=155, + size=None, + ticker="O:A220520C00155000", + underlying_ticker="A", + ), + OptionsContract( + additional_underlyings=None, + cfi="OCASPS", + contract_type="call", + correction=None, + exercise_style="american", + expiration_date="2022-05-20", + primary_exchange="BATO", + shares_per_contract=100, + strike_price=160, + size=None, + ticker="O:A220520C00160000", + underlying_ticker="A", + ), + ] + self.assertEqual(contracts, expected) diff --git a/test_rest/test_dividends.py b/test_rest/test_dividends.py new file mode 100644 index 00000000..3c422425 --- /dev/null +++ b/test_rest/test_dividends.py @@ -0,0 +1,110 @@ +from polygon.rest.models import Dividend +from base import BaseTest + + +class DividendsTest(BaseTest): + def test_list_dividends(self): + dividends = [d for d in self.c.list_dividends()] + expected = [ + Dividend( + cash_amount=0.59375, + declaration_date="2020-09-09", + dividend_type="CD", + ex_dividend_date="2025-06-12", + frequency=4, + pay_date="2025-06-30", + record_date="2025-06-15", + ticker="CSSEN", + ), + Dividend( + cash_amount=0.59375, + declaration_date="2020-09-09", + dividend_type="CD", + ex_dividend_date="2025-03-13", + frequency=4, + pay_date="2025-03-31", + record_date="2025-03-15", + ticker="CSSEN", + ), + Dividend( + cash_amount=0.59375, + declaration_date="2020-09-09", + dividend_type="CD", + ex_dividend_date="2024-12-12", + frequency=4, + pay_date="2024-12-31", + record_date="2024-12-15", + ticker="CSSEN", + ), + Dividend( + cash_amount=0.59375, + declaration_date="2020-09-09", + dividend_type="CD", + ex_dividend_date="2024-09-12", + frequency=4, + pay_date="2024-09-30", + record_date="2024-09-15", + ticker="CSSEN", + ), + Dividend( + cash_amount=0.59375, + declaration_date="2020-09-09", + dividend_type="CD", + ex_dividend_date="2024-06-13", + frequency=4, + pay_date="2024-06-30", + record_date="2024-06-15", + ticker="CSSEN", + ), + Dividend( + cash_amount=0.59375, + declaration_date="2020-09-09", + dividend_type="CD", + ex_dividend_date="2024-03-14", + frequency=4, + pay_date="2024-03-31", + record_date="2024-03-15", + ticker="CSSEN", + ), + Dividend( + cash_amount=0.59375, + declaration_date="2020-09-09", + dividend_type="CD", + ex_dividend_date="2023-12-14", + frequency=4, + pay_date="2023-12-31", + record_date="2023-12-15", + ticker="CSSEN", + ), + Dividend( + cash_amount=0.5, + declaration_date="2022-02-10", + dividend_type="CD", + ex_dividend_date="2023-11-13", + frequency=4, + pay_date="2023-11-15", + record_date="2023-11-14", + ticker="AIRTP", + ), + Dividend( + cash_amount=0.59375, + declaration_date="2020-09-09", + dividend_type="CD", + ex_dividend_date="2023-09-14", + frequency=4, + pay_date="2023-09-30", + record_date="2023-09-15", + ticker="CSSEN", + ), + Dividend( + cash_amount=0.5, + declaration_date="2022-02-10", + dividend_type="CD", + ex_dividend_date="2023-08-11", + frequency=4, + pay_date="2023-08-15", + record_date="2023-08-14", + ticker="AIRTP", + ), + ] + self.assertEqual(dividends, expected) diff --git a/test_rest/test_exchanges.py b/test_rest/test_exchanges.py new file mode 100644 index 00000000..ab51cd58 --- /dev/null +++ b/test_rest/test_exchanges.py @@ -0,0 +1,298 @@ +from polygon.rest.models import Exchange +from base import BaseTest + + +class ExchangesTest(BaseTest): + def test_get_exchanges(self): + exchanges = self.c.get_exchanges("stocks") + expected = [ + Exchange( + acronym="AMEX", + asset_class="stocks", + id=1, + locale="us", + mic="XASE", + name="NYSE American, LLC", + operating_mic="XNYS", + participant_id="A", + type="exchange", + url="https://www.nyse.com/markets/nyse-american", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=2, + locale="us", + mic="XBOS", + name="Nasdaq OMX BX, Inc.", + operating_mic="XNAS", + participant_id="B", + type="exchange", + url="https://www.nasdaq.com/solutions/nasdaq-bx-stock-market", + ), + Exchange( + acronym="NSX", + asset_class="stocks", + id=3, + locale="us", + mic="XCIS", + name="NYSE National, Inc.", + operating_mic="XNYS", + participant_id="C", + type="exchange", + url="https://www.nyse.com/markets/nyse-national", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=4, + locale="us", + mic="FINY", + name="FINRA NYSE TRF", + operating_mic="XNYS", + participant_id="D", + type="TRF", + url="https://www.finra.org", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=4, + locale="us", + mic="FINN", + name="FINRA Nasdaq TRF Carteret", + operating_mic="FINR", + participant_id="D", + type="TRF", + url="https://www.finra.org", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=4, + locale="us", + mic="FINC", + name="FINRA Nasdaq TRF Chicago", + operating_mic="FINR", + participant_id="D", + type="TRF", + url="https://www.finra.org", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=4, + locale="us", + mic="XADF", + name="FINRA Alternative Display Facility", + operating_mic="FINR", + participant_id="D", + type="TRF", + url="https://www.finra.org", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=5, + locale="us", + mic=None, + name="Unlisted Trading Privileges", + operating_mic="XNAS", + participant_id="E", + type="SIP", + url="https://www.utpplan.com", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=6, + locale="us", + mic="XISE", + name="International Securities Exchange, LLC - Stocks", + operating_mic="XNAS", + participant_id="I", + type="TRF", + url="https://nasdaq.com/solutions/nasdaq-ise", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=7, + locale="us", + mic="EDGA", + name="Cboe EDGA", + operating_mic="XCBO", + participant_id="J", + type="exchange", + url="https://www.cboe.com/us/equities", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=8, + locale="us", + mic="EDGX", + name="Cboe EDGX", + operating_mic="XCBO", + participant_id="K", + type="exchange", + url="https://www.cboe.com/us/equities", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=9, + locale="us", + mic="XCHI", + name="NYSE Chicago, Inc.", + operating_mic="XNYS", + participant_id="M", + type="exchange", + url="https://www.nyse.com/markets/nyse-chicago", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=10, + locale="us", + mic="XNYS", + name="New York Stock Exchange", + operating_mic="XNYS", + participant_id="N", + type="exchange", + url="https://www.nyse.com", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=11, + locale="us", + mic="ARCX", + name="NYSE Arca, Inc.", + operating_mic="XNYS", + participant_id="P", + type="exchange", + url="https://www.nyse.com/markets/nyse-arca", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=12, + locale="us", + mic="XNAS", + name="Nasdaq", + operating_mic="XNAS", + participant_id="T", + type="exchange", + url="https://www.nasdaq.com", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=13, + locale="us", + mic=None, + name="Consolidated Tape Association", + operating_mic="XNYS", + participant_id="S", + type="SIP", + url="https://www.nyse.com/data/cta", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=14, + locale="us", + mic="LTSE", + name="Long-Term Stock Exchange", + operating_mic="LTSE", + participant_id="L", + type="exchange", + url="https://www.ltse.com", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=15, + locale="us", + mic="IEXG", + name="Investors Exchange", + operating_mic="IEXG", + participant_id="V", + type="exchange", + url="https://www.iextrading.com", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=16, + locale="us", + mic="CBSX", + name="Cboe Stock Exchange", + operating_mic="XCBO", + participant_id="W", + type="TRF", + url="https://www.cboe.com", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=17, + locale="us", + mic="XPHL", + name="Nasdaq Philadelphia Exchange LLC", + operating_mic="XNAS", + participant_id="X", + type="exchange", + url="https://www.nasdaq.com/solutions/nasdaq-phlx", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=18, + locale="us", + mic="BATY", + name="Cboe BYX", + operating_mic="XCBO", + participant_id="Y", + type="exchange", + url="https://www.cboe.com/us/equities", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=19, + locale="us", + mic="BATS", + name="Cboe BZX", + operating_mic="XCBO", + participant_id="Z", + type="exchange", + url="https://www.cboe.com/us/equities", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=20, + locale="us", + mic="EPRL", + name="MIAX Pearl", + operating_mic="MIHI", + participant_id="H", + type="exchange", + url="https://www.miaxoptions.com/alerts/pearl-equities", + ), + Exchange( + acronym=None, + asset_class="stocks", + id=21, + locale="us", + mic="MEMX", + name="Members Exchange", + operating_mic="MEMX", + participant_id="U", + type="exchange", + url="https://www.memx.com", + ), + ] + self.assertEqual(exchanges, expected) diff --git a/test_rest/test_indicators.py b/test_rest/test_indicators.py new file mode 100644 index 00000000..bad16025 --- /dev/null +++ b/test_rest/test_indicators.py @@ -0,0 +1,206 @@ +from base import BaseTest +from polygon.rest.models.aggs import Agg +from polygon.rest.models.indicators import ( + SingleIndicatorResults, + SMAIndicatorResults, + EMAIndicatorResults, + RSIIndicatorResults, + MACDIndicatorResults, + IndicatorValue, + MACDIndicatorValue, + IndicatorUnderlying, +) + + +class IndicatorsTest(BaseTest): + def test_get_sma_indicators(self): + indicators = self.c.get_sma( + ticker="AAPL", + window=30, + timespan="quarter", + timestamp="1483958600", + expand_underlying=True, + ) + expected = SMAIndicatorResults( + values=[ + IndicatorValue(timestamp=1578027600, value=141.34), + IndicatorValue(timestamp=1578035600, value=139.33), + IndicatorValue(timestamp=1578049600, value=138.22), + ], + underlying=IndicatorUnderlying( + url="https://api.polygon.io/v2/aggs/ticker/AAPL/range/1/day/1626912000000/1629590400000?adjusted=true&limit=50000&sort=desc", + aggregates=[ + Agg( + open=74.06, + high=75.15, + low=73.7975, + close=75.0875, + volume=135647456, + vwap=74.6099, + timestamp=1577941200000, + transactions=1, + otc=None, + ), + Agg( + open=74.2875, + high=75.145, + low=74.125, + close=74.3575, + volume=146535512, + vwap=74.7026, + timestamp=1578027600000, + transactions=1, + otc=None, + ), + ], + ), + ) + self.assertEqual(indicators, expected) + + def test_get_ema_indicators(self): + indicators = self.c.get_ema( + ticker="AAPL", + timestamp_lte="1478393873000", + window=5, + adjusted=False, + timestamp_gte="1477972800000", + ) + + expected = EMAIndicatorResults( + values=[ + IndicatorValue(timestamp=1478232000000, value=110.96883950617286), + IndicatorValue(timestamp=1478145600000, value=112.03325925925927), + IndicatorValue(timestamp=1478059200000, value=113.1348888888889), + IndicatorValue(timestamp=1477972800000, value=113.90733333333334), + ], + underlying=IndicatorUnderlying( + url="http://localhost:8081/v2/aggs/ticker/AAPL/range/1/day/1477368000000/1478393873000?adjusted=false&limit=50000&sort=desc", + aggregates=[], + ), + ) + + self.assertEqual(indicators, expected) + + def test_get_macd_indicators(self): + indicators = self.c.get_macd( + ticker="SPY", + signal_window=10, + long_window=20, + timestamp_gt="2022-08-09", + ) + + expected = MACDIndicatorResults( + values=[ + MACDIndicatorValue( + timestamp=1660881600000, + value=6.912856964275647, + signal=49.504484615884834, + histogram=-42.59162765160919, + ), + MACDIndicatorValue( + timestamp=1660795200000, + value=7.509881940545313, + signal=58.96929076068688, + histogram=-51.45940882014157, + ), + MACDIndicatorValue( + timestamp=1660708800000, + value=7.734132135566654, + signal=70.40471494294057, + histogram=-62.67058280737392, + ), + MACDIndicatorValue( + timestamp=1660622400000, + value=7.973958808765531, + signal=84.331511122357, + histogram=-76.35755231359147, + ), + MACDIndicatorValue( + timestamp=1660536000000, + value=7.90112075397235, + signal=101.2998560809329, + histogram=-93.39873532696055, + ), + MACDIndicatorValue( + timestamp=1660276800000, + value=7.719066821080332, + signal=122.05513059803525, + histogram=-114.33606377695492, + ), + MACDIndicatorValue( + timestamp=1660190400000, + value=7.468267821253335, + signal=147.4631447706919, + histogram=-139.99487694943858, + ), + MACDIndicatorValue( + timestamp=1660104000000, + value=7.542041992364375, + signal=178.5731174261227, + histogram=-171.03107543375833, + ), + ], + underlying=IndicatorUnderlying( + url="http://localhost:8081/v2/aggs/ticker/SPY/range/1/day/1657670400000/1660926503659?limit=50000&sort=desc", + aggregates=[], + ), + ) + + self.assertEqual(indicators, expected) + + def test_get_rsi_indicators(self): + indicators = self.c.get_rsi( + ticker="AAPL", + window=20, + timespan="minute", + adjusted=True, + timestamp_gt="2022-08-18", + ) + + expected = RSIIndicatorResults( + values=[ + IndicatorValue(timestamp=1660928400000, value=172.46568754351864), + IndicatorValue(timestamp=1660927500000, value=172.43049675862588), + IndicatorValue(timestamp=1660926600000, value=172.39791747006018), + IndicatorValue(timestamp=1660925700000, value=172.37032983532967), + IndicatorValue(timestamp=1660924800000, value=172.39246981799596), + IndicatorValue(timestamp=1660923900000, value=172.4199719041008), + IndicatorValue(timestamp=1660923000000, value=172.4462847361114), + IndicatorValue(timestamp=1660922100000, value=172.48168312938628), + IndicatorValue(timestamp=1660921200000, value=172.5318603009006), + IndicatorValue(timestamp=1660920300000, value=172.60100349046908), + IndicatorValue(timestamp=1660919400000, value=172.68216175262373), + IndicatorValue(timestamp=1660918500000, value=172.7343682528999), + IndicatorValue(timestamp=1660917600000, value=172.7937754374157), + IndicatorValue(timestamp=1660916700000, value=172.8239623255647), + IndicatorValue(timestamp=1660915800000, value=172.82964257036102), + IndicatorValue(timestamp=1660914900000, value=172.8215102093464), + IndicatorValue(timestamp=1660914000000, value=172.7816691787513), + IndicatorValue(timestamp=1660913100000, value=172.79237119756723), + IndicatorValue(timestamp=1660912200000, value=172.8094629025743), + IndicatorValue(timestamp=1660911300000, value=172.82942741863474), + IndicatorValue(timestamp=1660910400000, value=172.85463030480682), + IndicatorValue(timestamp=1660909500000, value=172.88038086320753), + IndicatorValue(timestamp=1660908600000, value=172.91094726986097), + IndicatorValue(timestamp=1660907700000, value=172.95420487721478), + IndicatorValue(timestamp=1660906800000, value=172.99148960113214), + IndicatorValue(timestamp=1660905900000, value=173.03796219072498), + IndicatorValue(timestamp=1660905000000, value=173.0998529476434), + IndicatorValue(timestamp=1660904100000, value=173.17457431055323), + IndicatorValue(timestamp=1660903200000, value=173.23505581692726), + IndicatorValue(timestamp=1660902300000, value=173.3166406397617), + IndicatorValue(timestamp=1660901400000, value=173.3920764965787), + IndicatorValue(timestamp=1660900500000, value=173.4628213909554), + IndicatorValue(timestamp=1660899600000, value=173.5494341689507), + IndicatorValue(timestamp=1660898700000, value=173.63884829199816), + IndicatorValue(timestamp=1660897800000, value=173.73872705957692), + IndicatorValue(timestamp=1660896900000, value=173.8480667500587), + IndicatorValue(timestamp=1660896000000, value=173.97207377638065), + ], + underlying=IndicatorUnderlying( + url="https://api.polygon.io/v2/aggs/ticker/AAPL/range/15/minute/1660521600000/1660928746001?limit=50000&sort=desc", + aggregates=[], + ), + ) + + self.assertEqual(indicators, expected) diff --git a/test_rest/test_markets.py b/test_rest/test_markets.py new file mode 100644 index 00000000..e9de8514 --- /dev/null +++ b/test_rest/test_markets.py @@ -0,0 +1,141 @@ +from polygon.rest.models import ( + MarketHoliday, + MarketStatus, + MarketCurrencies, + MarketExchanges, +) +from base import BaseTest + + +class MarketsTest(BaseTest): + def test_get_market_holidays(self): + holidays = self.c.get_market_holidays() + expected = [ + MarketHoliday( + close=None, + date="2022-05-30", + exchange="NYSE", + name="Memorial Day", + open=None, + status="closed", + ), + MarketHoliday( + close=None, + date="2022-05-30", + exchange="NASDAQ", + name="Memorial Day", + open=None, + status="closed", + ), + MarketHoliday( + close=None, + date="2022-06-20", + exchange="NASDAQ", + name="Juneteenth", + open=None, + status="closed", + ), + MarketHoliday( + close=None, + date="2022-06-20", + exchange="NYSE", + name="Juneteenth", + open=None, + status="closed", + ), + MarketHoliday( + close=None, + date="2022-07-04", + exchange="NYSE", + name="Independence Day", + open=None, + status="closed", + ), + MarketHoliday( + close=None, + date="2022-07-04", + exchange="NASDAQ", + name="Independence Day", + open=None, + status="closed", + ), + MarketHoliday( + close=None, + date="2022-09-05", + exchange="NYSE", + name="Labor Day", + open=None, + status="closed", + ), + MarketHoliday( + close=None, + date="2022-09-05", + exchange="NASDAQ", + name="Labor Day", + open=None, + status="closed", + ), + MarketHoliday( + close=None, + date="2022-11-24", + exchange="NYSE", + name="Thanksgiving", + open=None, + status="closed", + ), + MarketHoliday( + close=None, + date="2022-11-24", + exchange="NASDAQ", + name="Thanksgiving", + open=None, + status="closed", + ), + MarketHoliday( + close="2022-11-25T18:00:00.000Z", + date="2022-11-25", + exchange="NYSE", + name="Thanksgiving", + open="2022-11-25T14:30:00.000Z", + status="early-close", + ), + MarketHoliday( + close="2022-11-25T18:00:00.000Z", + date="2022-11-25", + exchange="NASDAQ", + name="Thanksgiving", + open="2022-11-25T14:30:00.000Z", + status="early-close", + ), + MarketHoliday( + close=None, + date="2022-12-26", + exchange="NYSE", + name="Christmas", + open=None, + status="closed", + ), + MarketHoliday( + close=None, + date="2022-12-26", + exchange="NASDAQ", + name="Christmas", + open=None, + status="closed", + ), + ] + self.assertEqual(holidays, expected) + + def test_get_market_status(self): + status = self.c.get_market_status() + expected = MarketStatus( + after_hours=True, + currencies=MarketCurrencies(crypto="open", fx="open"), + early_hours=False, + exchanges=MarketExchanges( + nasdaq="extended-hours", nyse="extended-hours", otc="extended-hours" + ), + market="extended-hours", + server_time="2022-04-28T16:48:08-04:00", + ) + self.assertEqual(status, expected) diff --git a/test_rest/test_modelclass.py b/test_rest/test_modelclass.py new file mode 100644 index 00000000..651a6393 --- /dev/null +++ b/test_rest/test_modelclass.py @@ -0,0 +1,51 @@ +from polygon.rest.models import Agg +from base import BaseTest + + +class ModelclassTest(BaseTest): + def test_extra_field(self): + a = Agg( + open=1.5032, + high=1.5064, + low=1.4489, + close=1.4604, + volume=642646396.0, + vwap=1.469, + timestamp=1112331600000, + transactions=82132, + ) + b = Agg( + open=1.5032, + high=1.5064, + low=1.4489, + close=1.4604, + volume=642646396.0, + vwap=1.469, + timestamp=1112331600000, + transactions=82132, + extra_field=22, + ) + self.assertEqual(a, b) + + def test_init_order(self): + a = Agg( + open=1.5032, + high=1.5064, + low=1.4489, + close=1.4604, + volume=642646396.0, + vwap=1.469, + timestamp=1112331600000, + transactions=82132, + ) + b = Agg( + 1.5032, + 1.5064, + 1.4489, + 1.4604, + 642646396.0, + 1.469, + 1112331600000, + 82132, + ) + self.assertEqual(a, b) diff --git a/test_rest/test_quotes.py b/test_rest/test_quotes.py new file mode 100644 index 00000000..17b701b6 --- /dev/null +++ b/test_rest/test_quotes.py @@ -0,0 +1,362 @@ +from base import BaseTest +from polygon.rest.models import ( + Quote, + LastQuote, + ForexQuote, + LastForexQuote, + RealTimeCurrencyConversion, +) + + +class QuotesTest(BaseTest): + def test_list_quotes(self): + quotes = [q for q in self.c.list_quotes("AAPL")] + expected = [ + Quote( + ask_exchange=15, + ask_price=155.87, + ask_size=3, + bid_exchange=19, + bid_price=155.85, + bid_size=4, + conditions=None, + indicators=None, + participant_timestamp=1652191872800402200, + sequence_number=19288684, + sip_timestamp=1652191872800638700, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=15, + ask_price=155.87, + ask_size=3, + bid_exchange=15, + bid_price=155.85, + bid_size=5, + conditions=None, + indicators=None, + participant_timestamp=1652191872774195000, + sequence_number=19288618, + sip_timestamp=1652191872774441200, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=15, + ask_price=155.87, + ask_size=3, + bid_exchange=19, + bid_price=155.85, + bid_size=4, + conditions=None, + indicators=None, + participant_timestamp=1652191872773756000, + sequence_number=19288617, + sip_timestamp=1652191872773945300, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=15, + ask_price=155.87, + ask_size=3, + bid_exchange=12, + bid_price=155.85, + bid_size=3, + conditions=None, + indicators=None, + participant_timestamp=1652191872753255000, + sequence_number=19288557, + sip_timestamp=1652191872753443000, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=15, + ask_price=155.87, + ask_size=3, + bid_exchange=19, + bid_price=155.85, + bid_size=3, + conditions=None, + indicators=None, + participant_timestamp=1652191872751394300, + sequence_number=19288549, + sip_timestamp=1652191872751569400, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=15, + ask_price=155.87, + ask_size=3, + bid_exchange=21, + bid_price=155.86, + bid_size=1, + conditions=None, + indicators=None, + participant_timestamp=1652191872750485800, + sequence_number=19288528, + sip_timestamp=1652191872750826800, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=15, + ask_price=155.87, + ask_size=3, + bid_exchange=11, + bid_price=155.86, + bid_size=1, + conditions=None, + indicators=None, + participant_timestamp=1652191872750458400, + sequence_number=19288525, + sip_timestamp=1652191872750633000, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=15, + ask_price=155.87, + ask_size=3, + bid_exchange=21, + bid_price=155.86, + bid_size=2, + conditions=None, + indicators=None, + participant_timestamp=1652191872750206000, + sequence_number=19288519, + sip_timestamp=1652191872750488300, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=1, + bid_exchange=21, + bid_price=155.86, + bid_size=2, + conditions=None, + indicators=None, + participant_timestamp=1652191872748910000, + sequence_number=19288491, + sip_timestamp=1652191872749094400, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=2, + bid_exchange=21, + bid_price=155.86, + bid_size=2, + conditions=None, + indicators=None, + participant_timestamp=1652191872690425000, + sequence_number=19288166, + sip_timestamp=1652191872690661000, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=2, + bid_exchange=19, + bid_price=155.86, + bid_size=1, + conditions=None, + indicators=None, + participant_timestamp=1652191872690177000, + sequence_number=19288135, + sip_timestamp=1652191872690386918, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=2, + bid_exchange=15, + bid_price=155.85, + bid_size=5, + conditions=None, + indicators=None, + participant_timestamp=1652191872688200000, + sequence_number=19288101, + sip_timestamp=1652191872688383612, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=3, + bid_exchange=15, + bid_price=155.85, + bid_size=5, + conditions=None, + indicators=None, + participant_timestamp=1652191872687729447, + sequence_number=19288096, + sip_timestamp=1652191872687968794, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=3, + bid_exchange=19, + bid_price=155.85, + bid_size=4, + conditions=None, + indicators=None, + participant_timestamp=1652191872686891199, + sequence_number=19288093, + sip_timestamp=1652191872687168881, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=15, + ask_price=155.87, + ask_size=3, + bid_exchange=19, + bid_price=155.85, + bid_size=4, + conditions=None, + indicators=None, + participant_timestamp=1652191872677145000, + sequence_number=19288051, + sip_timestamp=1652191872677330035, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=4, + bid_exchange=19, + bid_price=155.85, + bid_size=4, + conditions=None, + indicators=None, + participant_timestamp=1652191872676782000, + sequence_number=19288049, + sip_timestamp=1652191872676973864, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=4, + bid_exchange=19, + bid_price=155.85, + bid_size=3, + conditions=None, + indicators=None, + participant_timestamp=1652191872664864000, + sequence_number=19288026, + sip_timestamp=1652191872665047506, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=4, + bid_exchange=19, + bid_price=155.85, + bid_size=4, + conditions=None, + indicators=None, + participant_timestamp=1652191872663336000, + sequence_number=19288010, + sip_timestamp=1652191872663527001, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=3, + bid_exchange=19, + bid_price=155.85, + bid_size=4, + conditions=None, + indicators=None, + participant_timestamp=1652191872663291000, + sequence_number=19288009, + sip_timestamp=1652191872663480163, + tape=3, + trf_timestamp=None, + ), + Quote( + ask_exchange=19, + ask_price=155.87, + ask_size=2, + bid_exchange=19, + bid_price=155.85, + bid_size=4, + conditions=None, + indicators=None, + participant_timestamp=1652191872663233957, + sequence_number=19288004, + sip_timestamp=1652191872663407429, + tape=3, + trf_timestamp=None, + ), + ] + self.assertEqual(quotes, expected) + + def test_get_last_quote(self): + last = self.c.get_last_quote("AAPL") + expected = LastQuote( + ticker="AAPL", + trf_timestamp=None, + sequence_number=26006043, + sip_timestamp=1652192754171838500, + participant_timestamp=1652192754171619000, + ask_price=155.66, + ask_size=14, + ask_exchange=11, + conditions=None, + indicators=None, + bid_price=155.65, + bid_size=1, + bid_exchange=19, + tape=3, + ) + + self.assertEqual(last, expected) + + def test_get_last_forex_quote(self): + last_forex = self.c.get_last_forex_quote("AUD", "USD") + expected = LastForexQuote( + last=ForexQuote( + ask=0.69527, bid=0.6952, exchange=48, timestamp=1652193694000 + ), + symbol="AUD/USD", + ) + + self.assertEqual(last_forex, expected) + + def test_get_real_time_currency_conversion(self): + conversion = self.c.get_real_time_currency_conversion("AUD", "USD", 100, 2) + expected = RealTimeCurrencyConversion( + converted=69.31, + from_=None, + initial_amount=100, + last=ForexQuote( + ask=1.4436264, bid=1.4427932, exchange=48, timestamp=1652195426000 + ), + to="USD", + ) + + self.assertEqual(conversion, expected) diff --git a/test_rest/test_snapshots.py b/test_rest/test_snapshots.py new file mode 100644 index 00000000..48e90bd4 --- /dev/null +++ b/test_rest/test_snapshots.py @@ -0,0 +1,460 @@ +from base import BaseTest +from polygon.rest.models import ( + TickerSnapshot, + OptionContractSnapshot, + SnapshotTickerFullBook, + Agg, + MinuteSnapshot, + LastQuote, + LastTrade, + OrderBookQuote, + UnderlyingAsset, + LastQuoteOptionContractSnapshot, + LastTradeOptionContractSnapshot, + Greeks, + OptionDetails, + DayOptionContractSnapshot, + UniversalSnapshot, + UniversalSnapshotDetails, + UniversalSnapshotLastQuote, + UniversalSnapshotLastTrade, + UniversalSnapshotUnderlyingAsset, + UniversalSnapshotSession, + IndicesSnapshot, + IndicesSession, +) + + +class SnapshotsTest(BaseTest): + def test_list_universal_snapshots(self): + expected = [ + UniversalSnapshot( + ticker="O:NCLH221014C00005000", + implied_volatility=0.3048997097864957, + type="options", + market_status="closed", + name="NCLH $5 Call", + open_interest=8921, + break_even_price=171.075, + details=UniversalSnapshotDetails( + contract_type="call", + exercise_style="american", + expiration_date="2022-10-14", + shares_per_contract=100, + strike_price=5, + underlying_ticker="NCLH", + ), + fair_market_value=20.5, + greeks=Greeks( + delta=0.5520187372272933, + gamma=0.00706756515659829, + theta=-0.018532772783847958, + vega=0.7274811132998142, + ), + last_quote=UniversalSnapshotLastQuote( + ask=21.25, + ask_size=110, + bid=20.9, + bid_size=172, + last_updated=1636573458756383500, + midpoint=21.075, + timeframe="REAL-TIME", + ), + last_trade=UniversalSnapshotLastTrade( + conditions=[209], + exchange=316, + price=0.05, + sip_timestamp=1675280958783136800, + size=2, + timeframe="REAL-TIME", + ), + session=UniversalSnapshotSession( + 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, + ), + underlying_asset=UniversalSnapshotUnderlyingAsset( + change_to_break_even=23.123999999999995, + last_updated=1636573459862384600, + price=147.951, + ticker="AAPL", + timeframe="REAL-TIME", + ), + ), + UniversalSnapshot( + fair_market_value=0.05, + last_quote=UniversalSnapshotLastQuote( + ask=21.25, + ask_size=110, + bid=20.9, + bid_size=172, + last_updated=1636573458756383500, + timeframe="REAL-TIME", + ), + last_trade=UniversalSnapshotLastTrade( + conditions=[209], + exchange=316, + id="4064", + last_updated=1675280958783136800, + price=0.05, + size=2, + timeframe="REAL-TIME", + ), + market_status="closed", + name="Apple Inc.", + session=UniversalSnapshotSession( + 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", + ), + UniversalSnapshot( + error="NOT_FOUND", message="Ticker not found.", ticker="TSLAAPL" + ), + ] + snapshots = [s for s in self.c.list_universal_snapshots()] + self.assertEqual(snapshots, expected) + + def test_get_snapshot_all(self): + snapshots = self.c.get_snapshot_all("stocks") + expected = [ + TickerSnapshot( + day=Agg( + open=20.64, + high=20.64, + low=20.506, + close=20.506, + volume=37216, + vwap=20.616, + timestamp=None, + transactions=None, + ), + fair_market_value=20.5, + last_quote=LastQuote( + ticker=None, + trf_timestamp=None, + sequence_number=None, + sip_timestamp=1605192959994246100, + participant_timestamp=None, + ask_price=20.6, + ask_size=22, + ask_exchange=None, + conditions=None, + indicators=None, + bid_price=20.5, + bid_size=13, + bid_exchange=None, + tape=None, + ), + last_trade=LastTrade( + ticker=None, + trf_timestamp=None, + sequence_number=None, + sip_timestamp=1605192894630916600, + participant_timestamp=None, + conditions=[14, 41], + correction=None, + id="71675577320245", + price=20.506, + trf_id=None, + size=2416, + exchange=4, + tape=None, + ), + min=MinuteSnapshot( + accumulated_volume=37216, + open=20.506, + high=20.506, + low=20.506, + close=20.506, + volume=5000, + vwap=20.5105, + timestamp=1684428600000, + transactions=5, + ), + prev_day=Agg( + open=20.79, + high=21, + low=20.5, + close=20.63, + volume=292738, + vwap=20.6939, + timestamp=None, + transactions=None, + ), + ticker="BCAT", + todays_change=-0.124, + todays_change_percent=-0.601, + updated=1605192894630916600, + ) + ] + self.assertEqual(snapshots, expected) + + def test_get_snapshot_ticker(self): + snapshots = self.c.get_snapshot_ticker("stocks", "AAPL") + expected = TickerSnapshot( + day=Agg( + open=161.84, + high=166.2, + low=159.8, + close=160.315, + volume=68840127, + vwap=162.7124, + timestamp=None, + transactions=None, + ), + fair_market_value=160.315, + last_quote=LastQuote( + ticker=None, + trf_timestamp=None, + sequence_number=None, + sip_timestamp=1651251948407646487, + participant_timestamp=None, + ask_price=159.99, + ask_size=5, + ask_exchange=None, + conditions=None, + indicators=None, + bid_price=159.98, + bid_size=3, + bid_exchange=None, + tape=None, + ), + last_trade=LastTrade( + ticker=None, + trf_timestamp=None, + sequence_number=None, + sip_timestamp=1651251948294080343, + participant_timestamp=None, + conditions=None, + correction=None, + id="121351", + price=159.99, + trf_id=None, + size=200, + exchange=12, + tape=None, + ), + min=MinuteSnapshot( + accumulated_volume=68834255, + open=160.71, + high=160.71, + low=160.3, + close=160.3, + volume=197226, + vwap=160.5259, + timestamp=1684428600000, + transactions=5, + ), + prev_day=Agg( + open=159.25, + high=164.515, + low=158.93, + close=163.64, + volume=130149192, + vwap=161.8622, + timestamp=None, + transactions=None, + ), + ticker="AAPL", + todays_change=-3.65, + todays_change_percent=-2.231, + updated=1651251948294080343, + ) + self.assertEqual(snapshots, expected) + + def test_get_snapshot_option(self): + snapshots = self.c.get_snapshot_option("AAPL", "O:AAPL230616C00150000") + expected = OptionContractSnapshot( + break_even_price=179.075, + day=DayOptionContractSnapshot( + change=-2.3999999999999986, + change_percent=-7.643312101910824, + close=29, + high=32.25, + last_updated=1651204800000000000, + low=29, + open=29.99, + previous_close=31.4, + volume=8, + vwap=30.7738, + ), + details=OptionDetails( + contract_type="call", + exercise_style="american", + expiration_date="2023-06-16", + shares_per_contract=100, + strike_price=150, + ticker="O:AAPL230616C00150000", + ), + fair_market_value=29.2, + greeks=Greeks( + delta=0.6436614934293701, + gamma=0.0061735291012820675, + theta=-0.028227189324641973, + vega=0.6381159723175714, + ), + implied_volatility=0.3570277203465058, + last_quote=LastQuoteOptionContractSnapshot( + ask=29.25, + ask_size=209, + bid=28.9, + bid_size=294, + last_updated=1651254260800059648, + midpoint=29.075, + timeframe="REAL-TIME", + ), + last_trade=LastTradeOptionContractSnapshot( + price=29.25, + sip_timestamp=1678718527714665700, + size=1, + conditions=[209], + exchange=309, + timeframe="REAL-TIME", + ), + open_interest=8133, + underlying_asset=UnderlyingAsset( + change_to_break_even=19.11439999999999, + last_updated=1651254263172073152, + price=159.9606, + ticker="AAPL", + timeframe="REAL-TIME", + ), + ) + self.assertEqual(snapshots, expected) + + def test_list_snapshot_options_chain(self): + snapshots = [s for s in self.c.list_snapshot_options_chain("AAPL")] + expected = [ + OptionContractSnapshot( + break_even_price=179.075, + day=DayOptionContractSnapshot( + change=-2.3999999999999986, + change_percent=-7.643312101910824, + close=29, + high=32.25, + last_updated=1651204800000000000, + low=29, + open=29.99, + previous_close=31.4, + volume=8, + vwap=30.7738, + ), + details=OptionDetails( + contract_type="call", + exercise_style="american", + expiration_date="2023-06-16", + shares_per_contract=100, + strike_price=150, + ticker="O:AAPL230616C00150000", + ), + fair_market_value=20.5, + greeks=Greeks( + delta=0.6436614934293701, + gamma=0.0061735291012820675, + theta=-0.028227189324641973, + vega=0.6381159723175714, + ), + implied_volatility=0.3570277203465058, + last_quote=LastQuoteOptionContractSnapshot( + ask=29.25, + ask_size=209, + bid=28.9, + bid_size=294, + last_updated=1651254260800059648, + midpoint=29.075, + timeframe="REAL-TIME", + ), + last_trade=LastTradeOptionContractSnapshot( + price=29.25, + sip_timestamp=1678718527714665700, + size=1, + conditions=[209], + exchange=309, + timeframe="REAL-TIME", + ), + open_interest=8133, + underlying_asset=UnderlyingAsset( + change_to_break_even=19.11439999999999, + last_updated=1651254263172073152, + price=159.9606, + ticker="AAPL", + timeframe="REAL-TIME", + ), + ) + ] + self.assertEqual(snapshots, expected) + + def test_get_snapshot_crypto_book(self): + snapshots = self.c.get_snapshot_crypto_book("X:BTCUSD") + expected = SnapshotTickerFullBook( + ticker="X:BTCUSD", + bids=[ + OrderBookQuote(price=16303.17, exchange_shares={"1": 2}), + OrderBookQuote( + price=16302.94, exchange_shares={"1": 0.02859424, "6": 0.023455} + ), + ], + asks=[ + OrderBookQuote(price=11454, exchange_shares={"2": 1}), + OrderBookQuote(price=11455, exchange_shares={"2": 1}), + ], + bid_count=694.951789670001, + ask_count=593.1412981600005, + spread=-4849.17, + updated=1605295074162, + ) + self.assertEqual(snapshots, expected) + + def test_get_snapshot_indices(self): + ticker_any_of = ["SPX", "APx", "APy"] + summary_results = self.c.get_snapshot_indices(ticker_any_of) + expected = [ + IndicesSnapshot( + value=3822.39, + name="S&P 500", + type="indices", + ticker="SPX", + market_status="closed", + session=IndicesSession( + change=-50.01, + change_percent=-1.45, + close=3822.39, + high=3834.41, + low=38217.11, + open=3827.38, + previous_close=3812.19, + ), + ), + IndicesSnapshot( + ticker="APx", + message="Ticker not found.", + error="NOT_FOUND", + ), + IndicesSnapshot( + ticker="APy", + error="NOT_ENTITLED", + message="Not entitled to this ticker.", + ), + ] + self.assertEqual(summary_results, expected) diff --git a/test_rest/test_splits.py b/test_rest/test_splits.py new file mode 100644 index 00000000..4635e45e --- /dev/null +++ b/test_rest/test_splits.py @@ -0,0 +1,32 @@ +from polygon.rest.models import Split +from base import BaseTest + + +class SplitsTest(BaseTest): + def test_list_splits(self): + splits = [s for s in self.c.list_splits()] + expected = [ + Split( + execution_date="2022-07-18", split_from=1, split_to=20, ticker="GOOGL" + ), + Split( + execution_date="2022-07-18", split_from=1, split_to=20, ticker="GOOG" + ), + Split(execution_date="2022-07-01", split_from=1, split_to=3, ticker="CTO"), + Split( + execution_date="2022-06-29", split_from=1, split_to=10, ticker="SHOP" + ), + Split( + execution_date="2022-06-22", split_from=1, split_to=10, ticker="SHOP" + ), + Split(execution_date="2022-06-10", split_from=1, split_to=4, ticker="DXCM"), + Split( + execution_date="2022-06-06", split_from=1, split_to=20, ticker="AMZN" + ), + Split(execution_date="2022-05-20", split_from=2, split_to=1, ticker="BRW"), + Split(execution_date="2022-05-16", split_from=1, split_to=2, ticker="CM"), + Split( + execution_date="2022-05-02", split_from=3, split_to=4, ticker="CIG.C" + ), + ] + self.assertEqual(splits, expected) diff --git a/test_rest/test_summaries.py b/test_rest/test_summaries.py new file mode 100644 index 00000000..97737eee --- /dev/null +++ b/test_rest/test_summaries.py @@ -0,0 +1,106 @@ +from polygon.rest.models import SummaryResult, Branding, Session, Options +from base import BaseTest + + +class SummariesTest(BaseTest): + def test_get_summaries_list(self): + ticker_any_of = ["NCLH", "O:NCLH221014C00005000", "C:EURUSD", "X:BTCUSD", "APx"] + summary_results = self.c.get_summaries(ticker_any_of) + expected = [ + SummaryResult( + price=22.3, + name="Norwegian Cruise Lines", + ticker="NCLH", + branding=Branding( + icon_url="https://api.polygon.io/icon.png", + logo_url="https://api.polygon.io/logo.svg", + ), + market_status="closed", + type="stocks", + session=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, + ), + ), + SummaryResult( + price=6.6, + name="NCLH $5 Call", + ticker="O:NCLH221014C00005000", + market_status="closed", + type="options", + session=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, + ), + options=Options( + contract_type="call", + exercise_style="american", + expiration_date="2022-10-14", + shares_per_contract=100, + strike_price=5, + underlying_ticker="NCLH", + ), + ), + SummaryResult( + price=0.97989, + name="Euro - United States Dollar", + ticker="C:EURUSD", + market_status="open", + type="fx", + session=Session( + change=-0.0001, + change_percent=-0.67, + close=0.97989, + high=0.98999, + low=0.96689, + open=0.97889, + previous_close=0.98001, + ), + ), + SummaryResult( + price=32154.68, + name="Bitcoin - United States Dollar", + ticker="X:BTCUSD", + branding=Branding( + icon_url="https://api.polygon.io/icon.png", + logo_url="https://api.polygon.io/logo.svg", + ), + market_status="open", + type="crypto", + session=Session( + change=-201.23, + change_percent=-0.77, + close=32154.68, + high=33124.28, + low=28182.88, + open=31129.32, + previous_close=33362.18, + ), + ), + SummaryResult( + ticker="APx", + error="NOT_FOUND", + message="Ticker not found.", + ), + ] + self.assertEqual(summary_results, expected) diff --git a/test_rest/test_tickers.py b/test_rest/test_tickers.py new file mode 100644 index 00000000..338386aa --- /dev/null +++ b/test_rest/test_tickers.py @@ -0,0 +1,261 @@ +from polygon.rest.models import ( + Ticker, + TickerDetails, + TickerNews, + TickerTypes, + TickerChangeEvent, + TickerChangeResults, + Publisher, + Branding, + CompanyAddress, +) +from base import BaseTest + + +class TickersTest(BaseTest): + def test_list_tickers(self): + tickers = [t for t in self.c.list_tickers()] + expected = [ + Ticker( + active=True, + cik="0001090872", + composite_figi="BBG000C2V3D6", + currency_name="usd", + currency_symbol=None, + base_currency_symbol=None, + base_currency_name=None, + delisted_utc=None, + last_updated_utc="2022-04-27T00:00:00Z", + locale="us", + market="stocks", + name="Agilent Technologies Inc.", + primary_exchange="XNYS", + share_class_figi="BBG001SCTQY4", + ticker="A", + type="CS", + ), + Ticker( + active=True, + cik="0001675149", + composite_figi="BBG00B3T3HD3", + currency_name="usd", + currency_symbol=None, + base_currency_symbol=None, + base_currency_name=None, + delisted_utc=None, + last_updated_utc="2022-04-27T00:00:00Z", + locale="us", + market="stocks", + name="Alcoa Corporation", + primary_exchange="XNYS", + share_class_figi="BBG00B3T3HF1", + ticker="AA", + type="CS", + ), + Ticker( + active=True, + cik=None, + composite_figi="BBG00X5FSP48", + currency_name="usd", + currency_symbol=None, + base_currency_symbol=None, + base_currency_name=None, + delisted_utc=None, + last_updated_utc="2022-04-27T00:00:00Z", + locale="us", + market="stocks", + name="AAF First Priority CLO Bond ETF", + primary_exchange="ARCX", + share_class_figi="BBG00X5FSPZ4", + ticker="AAA", + type="ETF", + ), + Ticker( + active=True, + cik="0001708646", + composite_figi="BBG00LPXX872", + currency_name="usd", + currency_symbol=None, + base_currency_symbol=None, + base_currency_name=None, + delisted_utc=None, + last_updated_utc="2022-04-27T00:00:00Z", + locale="us", + market="stocks", + name="Goldman Sachs Physical Gold ETF Shares", + primary_exchange="BATS", + share_class_figi="BBG00LPXX8Z1", + ticker="AAAU", + type="ETF", + ), + ] + self.assertEqual(tickers, expected) + + def test_get_ticker_details(self): + details = self.c.get_ticker_details("AAPL") + expected = TickerDetails( + active=True, + address=CompanyAddress( + address1="ONE APPLE PARK WAY", + city="CUPERTINO", + state="CA", + postal_code="95014", + ), + branding=Branding( + icon_url="https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-05-01_icon.png", + logo_url="https://api.polygon.io/v1/reference/company-branding/d3d3LmFwcGxlLmNvbQ/images/2022-05-01_logo.svg", + ), + cik="0000320193", + composite_figi="BBG000B9XRY4", + currency_name="usd", + delisted_utc=None, + description="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.", + ticker_root="AAPL", + homepage_url="https://www.apple.com", + list_date="1980-12-12", + locale="us", + market="stocks", + market_cap=2488795282370, + name="Apple Inc.", + phone_number="(408) 996-1010", + primary_exchange="XNAS", + share_class_figi="BBG001S5N8V8", + share_class_shares_outstanding=16319440000, + sic_code="3571", + sic_description="ELECTRONIC COMPUTERS", + ticker="AAPL", + total_employees=154000, + type="CS", + weighted_shares_outstanding=16185181000, + ) + self.assertEqual(details, expected) + + expected.market_cap = 1916103105630 + details = self.c.get_ticker_details("AAPL", date="2020-10-01") + + self.assertEqual(details, expected) + + def test_list_ticker_news(self): + news = [t for t in self.c.list_ticker_news("NFLX")] + expected = [ + TickerNews( + amp_url="https://www.marketwatch.com/amp/story/theres-a-big-hole-in-the-feds-theory-of-inflationincomes-are-falling-at-a-record-10-9-rate-11651165705", + article_url="https://www.marketwatch.com/story/theres-a-big-hole-in-the-feds-theory-of-inflationincomes-are-falling-at-a-record-10-9-rate-11651165705", + author="MarketWatch", + description="If inflation is all due to an overly generous federal government giving its people too much money, then our inflation problem is about to go away.", + id="JeJEhAVoKaqJ2zF9nzQYMg07UlEeWlis6Dsop33TPQY", + image_url="https://images.mktw.net/im-533637/social", + keywords=None, + published_utc="2022-04-28T17:08:00Z", + publisher=Publisher( + favicon_url="https://s3.polygon.io/public/assets/news/favicons/marketwatch.ico", + homepage_url="https://www.marketwatch.com/", + logo_url="https://s3.polygon.io/public/assets/news/logos/marketwatch.svg", + name="MarketWatch", + ), + tickers=["MSFT", "TSN", "NFLX", "AMZN"], + title="Theres a big hole in the Feds theory of inflation—incomes are falling at a record 10.9 rate", + ) + ] + self.assertEqual(news, expected) + + def test_get_ticker_types(self): + types = self.c.get_ticker_types("stocks") + expected = [ + TickerTypes( + asset_class="stocks", code="CS", description="Common Stock", locale="us" + ), + TickerTypes( + asset_class="stocks", + code="PFD", + description="Preferred Stock", + locale="us", + ), + TickerTypes( + asset_class="stocks", code="WARRANT", description="Warrant", locale="us" + ), + TickerTypes( + asset_class="stocks", code="RIGHT", description="Rights", locale="us" + ), + TickerTypes( + asset_class="stocks", + code="BOND", + description="Corporate Bond", + locale="us", + ), + TickerTypes( + asset_class="stocks", + code="ETF", + description="Exchange Traded Fund", + locale="us", + ), + TickerTypes( + asset_class="stocks", + code="ETN", + description="Exchange Traded Note", + locale="us", + ), + TickerTypes( + asset_class="stocks", + code="SP", + description="Structured Product", + locale="us", + ), + TickerTypes( + asset_class="stocks", + code="ADRC", + description="American Depository Receipt Common", + locale="us", + ), + TickerTypes( + asset_class="stocks", + code="ADRW", + description="American Depository Receipt Warrants", + locale="us", + ), + TickerTypes( + asset_class="stocks", + code="ADRR", + description="American Depository Receipt Rights", + locale="us", + ), + TickerTypes( + asset_class="stocks", code="FUND", description="Fund", locale="us" + ), + TickerTypes( + asset_class="stocks", code="BASKET", description="Basket", locale="us" + ), + TickerTypes( + asset_class="stocks", code="UNIT", description="Unit", locale="us" + ), + TickerTypes( + asset_class="stocks", + code="LT", + description="Liquidating Trust", + locale="us", + ), + ] + + self.assertEqual(types, expected) + + def test_get_ticker_events_ticker_change(self): + events = self.c.get_ticker_events(ticker="META", types="ticker_change") + expected = TickerChangeResults( + name="Meta Platforms, Inc. Class A Common Stock", + composite_figi="BBG000MM2P62", + cik="0001326801", + events=[ + { + "ticker_change": {"ticker": "META"}, + "type": "ticker_change", + "date": "2022-06-11", + }, + { + "ticker_change": {"ticker": "FB"}, + "type": "ticker_change", + "date": "2012-05-18", + }, + ], + ) + + self.assertEqual(expected, events) diff --git a/test_rest/test_trades.py b/test_rest/test_trades.py new file mode 100644 index 00000000..6acc73b0 --- /dev/null +++ b/test_rest/test_trades.py @@ -0,0 +1,73 @@ +from base import BaseTest +from polygon.rest.models import ( + Trade, + LastTrade, + CryptoTrade, +) + + +class TradesTest(BaseTest): + def test_get_last_trade(self): + last_trade = self.c.get_last_trade("AAPL") + expected = LastTrade( + ticker="AAPL", + trf_timestamp=1651179319310588400, + sequence_number=7084210, + sip_timestamp=1651179319310617300, + participant_timestamp=1651179319308000000, + conditions=[12, 37], + correction=None, + id="237688", + price=166.25, + trf_id=202, + size=2, + exchange=4, + tape=3, + ) + + self.assertEqual(last_trade, expected) + + def test_get_last_crypto_trade(self): + last_trade_crypto = self.c.get_last_crypto_trade("BTC", "USD") + expected = CryptoTrade( + conditions=[2], + exchange=2, + price=39976.89682331, + size=0.005, + timestamp=1651180409688, + ) + self.assertEqual(last_trade_crypto, expected) + + def test_trades(self): + trades = [t for t in self.c.list_trades(ticker="AAPL", limit=2)] + expected = [ + Trade( + conditions=[12, 37], + correction=1, + exchange=11, + id="183276", + participant_timestamp=1651181822461636600, + price=156.43, + sequence_number=7179341, + sip_timestamp=1651181822461979400, + size=10, + tape=3, + trf_id=3, + trf_timestamp=1651181557090806500, + ), + Trade( + conditions=[12, 37], + correction=1, + exchange=12, + id="183276", + participant_timestamp=1651181822461636600, + price=157.43, + sequence_number=7179341, + sip_timestamp=1651181822461979400, + size=10, + tape=3, + trf_id=3, + trf_timestamp=1651181557090806500, + ), + ] + self.assertEqual(trades, expected) diff --git a/test_websocket/base_ws.py b/test_websocket/base_ws.py new file mode 100644 index 00000000..c4a6acad --- /dev/null +++ b/test_websocket/base_ws.py @@ -0,0 +1,28 @@ +import unittest +import asyncio +from mock_server import run_mock_server +from typing import List +from polygon.websocket import WebSocketMessage + +unittest.util._MAX_LENGTH = 30000 # type: ignore + + +# https://docs.python.org/3/library/unittest.html#unittest.IsolatedAsyncioTestCase +class BaseTest(unittest.IsolatedAsyncioTestCase): + expected: List[WebSocketMessage] = [] + count = 0 + + def expectProcessor(self, msg): + self.assertEqual(msg, self.expected[self.count]) + self.count += 1 + + def expectResponse(self, msg): + self.expected.append(msg) + + async def asyncSetUp(self): + self.maxDiff = None + loop = asyncio.get_event_loop() + self.task = loop.create_task(run_mock_server()) + + async def asyncTearDown(self): + self.task.cancel() diff --git a/test_websocket/mock_server.py b/test_websocket/mock_server.py new file mode 100644 index 00000000..4cf8ab4c --- /dev/null +++ b/test_websocket/mock_server.py @@ -0,0 +1,104 @@ +from websockets import serve # type: ignore +import asyncio +import json + +port = 8765 +subs = set() + + +async def mock_server(websocket): + await websocket.send( + '[{"ev":"status","status":"connected","message":"Connected Successfully"}]' + ) + async for message in websocket: + message = json.loads(message) + if "action" not in message: + continue + if message["action"] == "auth": + await websocket.send( + '[{"ev":"status","status":"auth_success","message":"authenticated"}]' + ) + elif message["action"] == "subscribe": + for p in message["params"].split(","): + subs.add(p) + await websocket.send( + json.dumps( + [ + { + "ev": "status", + "status": "success", + "message": f"subscribed to: {p}", + } + ] + ) + ) + await websocket.send( + json.dumps( + [ + { + "ev": "T", + "sym": "AAPL", + "i": "5096", + "x": 10, + "p": 161.87, + "s": 300, + "c": [14, 41], + "t": 1651684192462, + "q": 4009402, + "z": 3, + } + ] + ) + ) + await websocket.send( + json.dumps( + [ + { + "ev": "T", + "sym": "AMZN", + "i": "72815", + "x": 12, + "p": 161.87, + "s": 1, + "c": [14, 37, 41], + "t": 1651684192536, + "q": 4009408, + "z": 3, + }, + { + "ev": "T", + "sym": "AMZN", + "i": "799", + "x": 4, + "p": 161.87, + "s": 100, + "t": 1651684192717, + "q": 4009434, + "z": 3, + }, + ] + ) + ) + elif message["action"] == "unsubscribe": + for p in message["params"].split(","): + subs.discard(p) + await websocket.send( + json.dumps( + [ + { + "ev": "status", + "status": "success", + "message": f"unsubscribed to: {p}", + } + ] + ) + ) + + +async def run_mock_server(): + async with serve(mock_server, "localhost", port): + await asyncio.Future() # run forever + + +if __name__ == "__main__": + asyncio.run(run_mock_server()) diff --git a/test_websocket/test_conn.py b/test_websocket/test_conn.py new file mode 100644 index 00000000..2fcfd464 --- /dev/null +++ b/test_websocket/test_conn.py @@ -0,0 +1,71 @@ +from polygon import WebSocketClient +from base_ws import BaseTest +from mock_server import subs, port +import asyncio +from polygon.websocket import EquityTrade + + +class WebSocketsTest(BaseTest): + async def test_conn(self): + c = WebSocketClient( + api_key="", feed=f"localhost:{port}", verbose=True, secure=False + ) + self.expectResponse( + [ + EquityTrade( + event_type="T", + symbol="AAPL", + exchange=10, + id="5096", + tape=3, + price=161.87, + size=300, + conditions=[14, 41], + timestamp=1651684192462, + sequence_number=4009402, + ) + ] + ) + c.subscribe("T.AAPL") + + def binded(msg): + self.expectProcessor(msg) + + asyncio.get_event_loop().create_task(c.connect(binded)) + self.expectResponse( + [ + EquityTrade( + event_type="T", + symbol="AMZN", + exchange=12, + id="72815", + tape=3, + price=161.87, + size=1, + conditions=[14, 37, 41], + timestamp=1651684192536, + sequence_number=4009408, + ), + EquityTrade( + event_type="T", + symbol="AMZN", + exchange=4, + id="799", + tape=3, + price=161.87, + size=100, + conditions=None, + timestamp=1651684192717, + sequence_number=4009434, + ), + ] + ) + c.subscribe("T.AMZN") + self.assertEqual(subs, c.subs) + c.unsubscribe_all() + self.assertEqual(subs, set()) + c.subscribe("T.*") + self.assertEqual(subs, c.subs) + c.unsubscribe("T.*") + self.assertEqual(subs, set()) + await c.close() diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 8fa455ad..00000000 --- a/tox.ini +++ /dev/null @@ -1,7 +0,0 @@ -[tox] -envlist = py3 - -[testenv] -deps = -r requirements.txt -commands = pytest -passenv = API_KEY diff --git a/upload b/upload deleted file mode 100755 index 81baf9cf..00000000 --- a/upload +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -python -m twine upload --username ${USERNAME} --password ${PASSWORD} dist/* diff --git a/websocket_example/polygon.py b/websocket_example/polygon.py deleted file mode 100644 index 760a27c0..00000000 --- a/websocket_example/polygon.py +++ /dev/null @@ -1,32 +0,0 @@ -# Be sure to pip install polygon-api-client - -import time - -from polygon import WebSocketClient, STOCKS_CLUSTER - - -def my_custom_process_message(message): - print("this is my custom message processing", message) - - -def my_custom_error_handler(ws, error): - print("this is my custom error handler", error) - - -def my_custom_close_handler(ws): - print("this is my custom close handler") - - -def main(): - key = 'your api key' - my_client = WebSocketClient(STOCKS_CLUSTER, key, my_custom_process_message) - my_client.run_async() - - my_client.subscribe("T.MSFT", "T.AAPL", "T.AMD", "T.NVDA") - time.sleep(1) - - my_client.close_connection() - - -if __name__ == "__main__": - main()