From a75d32610b62999d7ea4a29aecf4ce05571dc1db Mon Sep 17 00:00:00 2001 From: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Date: Mon, 5 Feb 2024 17:01:15 +0000 Subject: [PATCH 1/7] Docs/byod (#5996) * add byod to reference * fix: rename add-in name * feat: add data conectors page * fix: additional notes * tiny tweaks * update functions.json and openapi.json * fix: fix bug in hedge controller * fix: another bug hedgecontroller * black --------- Co-authored-by: DidierRLopes --- .../stocks/options/hedge/hedge_controller.py | 46 +- website/content/excel/data-conectors.md | 36 + website/content/excel/functions.json | 98 +- .../content/excel/getting-started/basics.md | 2 +- .../excel/getting-started/installation.md | 4 +- website/content/excel/openapi.json | 5333 ++++++++++++++--- website/content/excel/templates.mdx | 4 +- .../integrate-your-own-backend.md | 1 - website/generate_excel_markdown.py | 95 +- website/src/pages/index.tsx | 4 +- 10 files changed, 4755 insertions(+), 868 deletions(-) create mode 100644 website/content/excel/data-conectors.md diff --git a/openbb_terminal/stocks/options/hedge/hedge_controller.py b/openbb_terminal/stocks/options/hedge/hedge_controller.py index 8969d88d845..7eb716b9024 100644 --- a/openbb_terminal/stocks/options/hedge/hedge_controller.py +++ b/openbb_terminal/stocks/options/hedge/hedge_controller.py @@ -49,26 +49,40 @@ class HedgeController(BaseController): self.underlying_asset_position: str = "" self.chain = get_option_chain(ticker, expiration) - self.calls = list( - zip( - self.chain.calls["strike"].tolist(), - self.chain.calls["impliedVolatility"].tolist(), - self.chain.calls["lastPrice"].tolist(), - self.chain.calls["currency"].tolist(), + self.calls = ( + list( + zip( + self.chain.calls["strike"].tolist(), + self.chain.calls["impliedVolatility"].tolist(), + self.chain.calls["lastPrice"].tolist(), + self.chain.calls["currency"].tolist(), + ) ) + if "calls" in self.chain.columns + else [] ) - self.puts = list( - zip( - self.chain.puts["strike"].tolist(), - self.chain.puts["impliedVolatility"].tolist(), - self.chain.puts["lastPrice"].tolist(), - self.chain.calls["currency"].tolist(), + self.puts = ( + list( + zip( + self.chain.puts["strike"].tolist(), + self.chain.puts["impliedVolatility"].tolist(), + self.chain.puts["lastPrice"].tolist(), + self.chain.calls["currency"].tolist(), + ) ) + if "puts" in self.chain.columns + else [] ) + start = self.calls[0] if self.calls else 0 + end = self.calls[-1] if self.calls else 0 + + start = int(start[0]) if isinstance(start, list) and start else 0 + end = int(end[0]) if isinstance(end, list) and end else 0 + self.PICK_CHOICES = [ f"{strike} {position} {side}" - for strike in range(int(self.calls[0][0]), int(self.calls[-1][0]), 5) + for strike in range(start, end, 5) for position in ["Long", "Short"] for side in ["Call", "Put"] ] @@ -76,7 +90,11 @@ class HedgeController(BaseController): self.ticker = ticker self.current_price: float = get_price(ticker) self.expiration = expiration - self.implied_volatility = self.chain.calls["impliedVolatility"] + self.implied_volatility = ( + self.chain.calls.get("impliedVolatility", 0.0) + if "calls" in self.chain.columns + else 0.0 + ) self.options: Dict = {"Portfolio": {}, "Option A": {}, "Option B": {}} self.underlying = 0.0 self.side: str = "" diff --git a/website/content/excel/data-conectors.md b/website/content/excel/data-conectors.md new file mode 100644 index 00000000000..14df7fe3ab8 --- /dev/null +++ b/website/content/excel/data-conectors.md @@ -0,0 +1,36 @@ +--- +title: Data connectors +sidebar_position: 4 +description: Access your data connectors from OpenBB Terminal Pro inside OpenBB Add-in for Excel. +keywords: +- Microsoft Excel +- Add-in +- Advanced +- Data connectors +- BYOD +- Bring your own data +--- + + +import HeadTitle from '@site/src/components/General/HeadTitle.tsx'; + + + +OpenBB Add-In for Excel allows you to access your [data connectors](https://docs.openbb.co/pro/main-menu/data-connectors) from OpenBB Terminal Pro inside Microsoft Excel. + +To access data from a [single widget](https://docs.openbb.co/pro/main-menu/data-connectors/single-widget) use: + +```excel +=OBB.BYOD("widget_name") +``` + +To access data from your own [backend](https://docs.openbb.co/pro/main-menu/data-connectors/integrate-your-own-backend) use: + +```excel +=OBB.BYOD("widget_name", "backend_name") +``` + +#### Additional notes + +- Make sure your backend's CORS settings allow requests coming from . +- Requests via HTTP will be blocked by Excel. So if you are using the Add-in for Excel on Mac or Office on the web with Safari browser you need to run your backend via HTTPS. diff --git a/website/content/excel/functions.json b/website/content/excel/functions.json index 54a2329f3b1..1ee4434785c 100644 --- a/website/content/excel/functions.json +++ b/website/content/excel/functions.json @@ -1,5 +1,27 @@ { "functions": [ + { + "description": "Bring Your Own Data features from OpenBB Terminal Pro.", + "helpUrl": "https://docs.openbb.co/excel/data-conectors", + "id": "BYOD", + "name": "BYOD", + "parameters": [ + { + "description": "Name of the widget to get data for.", + "name": "widget", + "type": "string" + }, + { + "description": "Name of the backend to use, required for widgets in custom backends.", + "name": "backend", + "optional": true, + "type": "string" + } + ], + "result": { + "dimensionality": "matrix" + } + }, { "description": "Cryptocurrency Historical Price. Cryptocurrency historical price data.", "helpUrl": "https://docs.openbb.co/excel/reference/crypto/price/historical", @@ -1316,6 +1338,18 @@ "name": "symbol", "type": "string" }, + { + "description": "Start date of the data, in YYYY-MM-DD format.", + "name": "start_date", + "optional": true, + "type": "string" + }, + { + "description": "End date of the data, in YYYY-MM-DD format.", + "name": "end_date", + "optional": true, + "type": "string" + }, { "description": "Options: fmp, intrinio, defaults to fmp.", "name": "provider", @@ -1324,7 +1358,7 @@ }, { "description": "The number of data entries to return. (provider: intrinio)", - "name": "page_size", + "name": "limit", "optional": true, "type": "number" } @@ -1385,6 +1419,12 @@ "optional": true, "type": "number" }, + { + "description": "Sort the data in ascending or descending order. (provider: fmp)", + "name": "sort", + "optional": true, + "type": "string" + }, { "description": "Start date of the data, in YYYY-MM-DD format. (provider: intrinio)", "name": "start_date", @@ -1745,6 +1785,18 @@ "name": "symbol", "type": "string" }, + { + "description": "Start date of the data, in YYYY-MM-DD format.", + "name": "start_date", + "optional": true, + "type": "string" + }, + { + "description": "End date of the data, in YYYY-MM-DD format.", + "name": "end_date", + "optional": true, + "type": "string" + }, { "description": "Options: fmp, defaults to fmp.", "name": "provider", @@ -2040,6 +2092,12 @@ "optional": true, "type": "string" }, + { + "description": "The number of data entries to return. Default is 252, the number of trading days in a year.", + "name": "limit", + "optional": true, + "type": "number" + }, { "description": "Options: tiingo, defaults to tiingo.", "name": "provider", @@ -2227,6 +2285,12 @@ "name": "provider", "optional": true, "type": "string" + }, + { + "description": "Include current quarter data. (provider: fmp)", + "name": "include_current_quarter", + "optional": true, + "type": "boolean" } ], "result": { @@ -2430,7 +2494,7 @@ "name": "EQUITY.PRICE.QUOTE", "parameters": [ { - "description": "Symbol to get data for. In this case, the comma separated list of symbols.", + "description": "Symbol to get data for. This endpoint will accept multiple symbols separated by commas.", "name": "symbol", "type": "string" }, @@ -3723,7 +3787,7 @@ "type": "number" }, { - "description": "Options: benzinga, fmp, intrinio, polygon, tiingo, defaults to benzinga.", + "description": "Options: benzinga, fmp, intrinio, polygon, tiingo, ultima, defaults to benzinga.", "name": "provider", "optional": true, "type": "string" @@ -3835,6 +3899,34 @@ "dimensionality": "matrix" } }, + { + "description": "Sector News. Get news for one or more sectors.", + "helpUrl": "https://docs.openbb.co/excel/reference/news/sector", + "id": "NEWS.SECTOR", + "name": "NEWS.SECTOR", + "parameters": [ + { + "description": "A coma separated list of sectors.", + "name": "sectors", + "type": "string" + }, + { + "description": "The number of data entries to return. Here it is the no. of articles to return.", + "name": "limit", + "optional": true, + "type": "number" + }, + { + "description": "Options: ultima, defaults to ultima.", + "name": "provider", + "optional": true, + "type": "string" + } + ], + "result": { + "dimensionality": "matrix" + } + }, { "description": "World News. Global news data.", "helpUrl": "https://docs.openbb.co/excel/reference/news/world", diff --git a/website/content/excel/getting-started/basics.md b/website/content/excel/getting-started/basics.md index 08f8d0ab2d7..c38fd0ed39f 100644 --- a/website/content/excel/getting-started/basics.md +++ b/website/content/excel/getting-started/basics.md @@ -14,7 +14,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx'; -The OpenBB Excel Add-in provides direct access to the OpenBB platform, where each function implements the following pattern: +The OpenBB Add-in for Excel provides direct access to the OpenBB platform, where each function implements the following pattern: - `OBB.[MENU].[SUB_MENU].[COMMAND]` diff --git a/website/content/excel/getting-started/installation.md b/website/content/excel/getting-started/installation.md index 0b3114385bb..5a076585643 100644 --- a/website/content/excel/getting-started/installation.md +++ b/website/content/excel/getting-started/installation.md @@ -12,7 +12,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx'; ## Requirements -- The OpenBB Excel Add-in is available on the following platforms: Windows (Microsoft 365), Mac (Microsoft 365), Excel on the web. +- The OpenBB Add-in for Excel is available on the following platforms: Windows (Microsoft 365), Mac (Microsoft 365), Excel on the web. - Access to the OpenBB Terminal Pro. If you don't have access you can sign up for the waitlist [here](https://my.openbb.co/app/pro). ## Installation @@ -27,7 +27,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx'; /> -The OpenBB Excel Add-in is available on the [Microsoft AppSource](https://appsource.microsoft.com/pt-pt/product/office/wa200006381?tab=overview). It can be installed by an administrator or by individual users. +The OpenBB Add-in for Excel is available on the [Microsoft AppSource](https://appsource.microsoft.com/pt-pt/product/office/wa200006381?tab=overview). It can be installed by an administrator or by individual users. ### Individual user diff --git a/website/content/excel/openapi.json b/website/content/excel/openapi.json index 3ca189e42c3..3cdf2a3b929 100644 --- a/website/content/excel/openapi.json +++ b/website/content/excel/openapi.json @@ -650,7 +650,7 @@ ], "title": "polygon", "description": "A specific date to get data for. (provider: polygon)", - "default": "2024-01-06" + "default": "2024-02-02" }, "description": "A specific date to get data for. (provider: polygon)" }, @@ -815,6 +815,79 @@ "model": "CurrencyPairs" } }, + "/api/v1/currency/reference_rates": { + "get": { + "tags": [ + "currency" + ], + "summary": "Reference Rates", + "description": "Current, official, currency reference rates.", + "operationId": "currency_reference_rates", + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "parameters": [ + { + "name": "provider", + "in": "query", + "required": false, + "schema": { + "const": "ecb", + "default": "ecb", + "title": "Provider" + } + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OBBject_CurrencyReferenceRates_" + } + } + } + }, + "404": { + "description": "Not found" + }, + "400": { + "description": "No Results Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenBBErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenBBErrorResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "model": "CurrencyReferenceRates" + } + }, "/api/v1/derivatives/options/chains": { "get": { "tags": [ @@ -865,9 +938,9 @@ } ], "title": "intrinio", - "description": "Date for which the options chains are returned. (provider: intrinio)" + "description": "The end-of-day date for options chains data. (provider: intrinio)" }, - "description": "Date for which the options chains are returned. (provider: intrinio)" + "description": "The end-of-day date for options chains data. (provider: intrinio)" } ], "responses": { @@ -2107,6 +2180,141 @@ "model": "RiskPremium" } }, + "/api/v1/economy/balance_of_payments": { + "get": { + "tags": [ + "economy" + ], + "summary": "Balance Of Payments", + "description": "Balance of Payments Reports.", + "operationId": "economy_balance_of_payments", + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "parameters": [ + { + "name": "provider", + "in": "query", + "required": false, + "schema": { + "const": "ecb", + "default": "ecb", + "title": "Provider" + } + }, + { + "name": "report_type", + "in": "query", + "required": false, + "schema": { + "enum": [ + "main", + "summary", + "services", + "investment_income", + "direct_investment", + "portfolio_investment", + "other_investment" + ], + "type": "string", + "title": "ecb", + "description": "The report type, the level of detail in the data. (provider: ecb)", + "default": "main" + }, + "description": "The report type, the level of detail in the data. (provider: ecb)" + }, + { + "name": "frequency", + "in": "query", + "required": false, + "schema": { + "enum": [ + "monthly", + "quarterly" + ], + "type": "string", + "title": "ecb", + "description": "The frequency of the data. Monthly is valid only for ['main', 'summary']. (provider: ecb)", + "default": "monthly" + }, + "description": "The frequency of the data. Monthly is valid only for ['main', 'summary']. (provider: ecb)" + }, + { + "name": "country", + "in": "query", + "required": false, + "schema": { + "enum": [ + "brazil", + "canada", + "china", + "eu_ex_euro_area", + "eu_institutions", + "india", + "japan", + "russia", + "switzerland", + "united_kingdom", + "united_states", + "total", + null + ], + "title": "ecb", + "description": "The country/region of the data. This parameter will override the 'report_type' parameter. (provider: ecb)" + }, + "description": "The country/region of the data. This parameter will override the 'report_type' parameter. (provider: ecb)" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OBBject_List_BalanceOfPayments__" + } + } + } + }, + "404": { + "description": "Not found" + }, + "400": { + "description": "No Results Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenBBErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenBBErrorResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "model": "BalanceOfPayments" + } + }, "/api/v1/economy/fred_search": { "get": { "tags": [ @@ -2175,10 +2383,10 @@ "schema": { "anyOf": [ { - "type": "string" + "type": "integer" }, { - "type": "integer" + "type": "string" }, { "type": "null" @@ -3364,10 +3572,13 @@ { "name": "provider", "in": "query", - "required": false, + "required": true, "schema": { - "const": "fmp", - "default": "fmp", + "enum": [ + "benzinga", + "fmp" + ], + "type": "string", "title": "Provider" } }, @@ -3382,6 +3593,199 @@ }, "description": "Symbol to get data for." }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "description": "The number of data entries to return.", + "default": 100, + "title": "Limit" + }, + "description": "The number of data entries to return." + }, + { + "name": "fields", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Comma-separated list of fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields. (provider: benzinga)" + }, + "description": "Comma-separated list of fields to include in the response. See https://docs.benzinga.io/benzinga-apis/calendar/get-ratings to learn about the available fields. (provider: benzinga)" + }, + { + "name": "date", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Date for calendar data, shorthand for date_from and date_to. (provider: benzinga)", + "is_parameters": true + }, + "description": "Date for calendar data, shorthand for date_from and date_to. (provider: benzinga)" + }, + { + "name": "date_from", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Date to query from point in time. (provider: benzinga)", + "is_parameters": true + }, + "description": "Date to query from point in time. (provider: benzinga)" + }, + { + "name": "date_to", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Date to query to point in time. (provider: benzinga)", + "is_parameters": true + }, + "description": "Date to query to point in time. (provider: benzinga)" + }, + { + "name": "importance", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Importance level to filter by. (provider: benzinga)", + "is_parameters": true + }, + "description": "Importance level to filter by. (provider: benzinga)" + }, + { + "name": "updated", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Records last updated Unix timestamp (UTC). (provider: benzinga)", + "is_parameters": true + }, + "description": "Records last updated Unix timestamp (UTC). (provider: benzinga)" + }, + { + "name": "action", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "enum": [ + "Downgrades", + "Maintains", + "Reinstates", + "Reiterates", + "Upgrades", + "Assumes", + "Initiates Coverage On", + "Terminates Coverage On", + "Removes", + "Suspends", + "Firm Dissolved" + ], + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Filter by a specific action_company. (provider: benzinga)", + "is_parameters": true + }, + "description": "Filter by a specific action_company. (provider: benzinga)" + }, + { + "name": "analyst", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Comma-separated list of analyst (person) IDs. (provider: benzinga)" + }, + "description": "Comma-separated list of analyst (person) IDs. (provider: benzinga)" + }, + { + "name": "firm", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Comma-separated list of analyst firm IDs. (provider: benzinga)" + }, + "description": "Comma-separated list of analyst firm IDs. (provider: benzinga)" + }, { "name": "with_grade", "in": "query", @@ -3926,11 +4330,6 @@ "in": "query", "required": false, "schema": { - "enum": [ - "annual", - "quarter", - "ttm" - ], "type": "string", "description": "Time period of the data to return.", "default": "annual", @@ -4411,12 +4810,6 @@ "in": "query", "required": false, "schema": { - "enum": [ - "annual", - "quarter", - "ttm", - "ytd" - ], "type": "string", "description": "Time period of the data to return.", "default": "annual", @@ -4783,10 +5176,6 @@ "in": "query", "required": false, "schema": { - "enum": [ - "annual", - "quarter" - ], "type": "string", "description": "Time period of the data to return.", "default": "annual", @@ -4799,11 +5188,6 @@ "in": "query", "required": false, "schema": { - "enum": [ - "balance", - "cash", - "income" - ], "type": "string", "description": "The type of financial statement - i.e, balance, income, cash.", "default": "balance", @@ -5032,7 +5416,45 @@ "description": "Symbol to get data for." }, { - "name": "page_size", + "name": "start_date", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ], + "description": "Start date of the data, in YYYY-MM-DD format.", + "title": "Start Date" + }, + "description": "Start date of the data, in YYYY-MM-DD format." + }, + { + "name": "end_date", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ], + "description": "End date of the data, in YYYY-MM-DD format.", + "title": "End Date" + }, + "description": "End date of the data, in YYYY-MM-DD format." + }, + { + "name": "limit", "in": "query", "required": false, "schema": { @@ -5746,12 +6168,6 @@ "in": "query", "required": false, "schema": { - "enum": [ - "annual", - "quarter", - "ttm", - "ytd" - ], "type": "string", "description": "Time period of the data to return.", "default": "annual", @@ -6253,18 +6669,11 @@ "in": "query", "required": false, "schema": { - "anyOf": [ - { - "enum": [ - "annual", - "quarter" - ], - "type": "string" - }, - { - "type": "null" - } + "enum": [ + "annual", + "quarter" ], + "type": "string", "description": "Time period of the data to return.", "default": "annual", "title": "Period" @@ -6476,6 +6885,44 @@ "title": "Symbol" }, "description": "Symbol to get data for." + }, + { + "name": "start_date", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ], + "description": "Start date of the data, in YYYY-MM-DD format.", + "title": "Start Date" + }, + "description": "Start date of the data, in YYYY-MM-DD format." + }, + { + "name": "end_date", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ], + "description": "End date of the data, in YYYY-MM-DD format.", + "title": "End Date" + }, + "description": "End date of the data, in YYYY-MM-DD format." } ], "responses": { @@ -6653,12 +7100,6 @@ "in": "query", "required": false, "schema": { - "enum": [ - "annual", - "quarter", - "ttm", - "ytd" - ], "type": "string", "description": "Time period of the data to return.", "default": "annual", @@ -7436,6 +7877,22 @@ }, "description": "The number of data entries to return." }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "title": "fmp", + "description": "Sort the data in ascending or descending order. (provider: fmp)", + "default": "desc" + }, + "description": "Sort the data in ascending or descending order. (provider: fmp)" + }, { "name": "start_date", "in": "query", @@ -7787,6 +8244,25 @@ "title": "Symbol" }, "description": "Symbol to get data for." + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "description": "The number of data entries to return. Default is 252, the number of trading days in a year.", + "default": 252, + "title": "Limit" + }, + "description": "The number of data entries to return. Default is 252, the number of trading days in a year." } ], "responses": { @@ -7909,6 +8385,25 @@ "title": "Page" }, "description": "Page number of the data to fetch." + }, + { + "name": "include_current_quarter", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "Include current quarter data. (provider: fmp)", + "default": true + }, + "description": "Include current quarter data. (provider: fmp)" } ], "responses": { @@ -8012,7 +8507,7 @@ ], "title": "fmp", "description": "Include current quarter data. (provider: fmp)", - "default": false + "default": true }, "description": "Include current quarter data. (provider: fmp)" }, @@ -8436,10 +8931,10 @@ "required": true, "schema": { "type": "string", - "description": "Symbol to get data for. In this case, the comma separated list of symbols.", + "description": "Symbol to get data for. This endpoint will accept multiple symbols separated by commas.", "title": "Symbol" }, - "description": "Symbol to get data for. In this case, the comma separated list of symbols." + "description": "Symbol to get data for. This endpoint will accept multiple symbols separated by commas." }, { "name": "source", @@ -8763,21 +9258,6 @@ "schema": { "anyOf": [ { - "enum": [ - "1m", - "5m", - "10m", - "15m", - "30m", - "60m", - "1h", - "4h", - "1d", - "1W", - "1M", - "1Q", - "1Y" - ], "type": "string" }, { @@ -8838,6 +9318,9 @@ "type": "integer", "minimum": 0 }, + { + "type": "integer" + }, { "type": "null" } @@ -9875,7 +10358,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/OBBject_EquityInfo_" + "$ref": "#/components/schemas/OBBject_List_EquityInfo__" } } } @@ -12371,6 +12854,131 @@ "model": "USYieldCurve" } }, + "/api/v1/fixedincome/government/eu_yield_curve": { + "get": { + "tags": [ + "fixedincome" + ], + "summary": "Eu Yield Curve", + "description": "Euro Area Yield Curve.\n\nGets euro area yield curve data from ECB.\n\nThe graphic depiction of the relationship between the yield on bonds of the same credit quality but different\nmaturities is known as the yield curve. In the past, most market participants have constructed yield curves from\nthe observations of prices and yields in the Treasury market. Two reasons account for this tendency. First,\nTreasury securities are viewed as free of default risk, and differences in creditworthiness do not affect yield\nestimates. Second, as the most active bond market, the Treasury market offers the fewest problems of illiquidity\nor infrequent trading. The key function of the Treasury yield curve is to serve as a benchmark for pricing bonds\nand setting yields in other sectors of the debt market.\n\nIt is clear that the market\u2019s expectations of future rate changes are one important determinant of the\nyield-curve shape. For example, a steeply upward-sloping curve may indicate market expectations of near-term Fed\ntightening or of rising inflation. However, it may be too restrictive to assume that the yield differences across\nbonds with different maturities only reflect the market\u2019s rate expectations. The well-known pure expectations\nhypothesis has such an extreme implication. The pure expectations hypothesis asserts that all government bonds\nhave the same near-term expected return (as the nominally riskless short-term bond) because the return-seeking\nactivity of risk-neutral traders removes all expected return differentials across bonds.", + "operationId": "fixedincome_government_eu_yield_curve", + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "parameters": [ + { + "name": "provider", + "in": "query", + "required": false, + "schema": { + "const": "ecb", + "default": "ecb", + "title": "Provider" + } + }, + { + "name": "date", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ], + "description": "A specific date to get data for.", + "title": "Date" + }, + "description": "A specific date to get data for." + }, + { + "name": "yield_curve_type", + "in": "query", + "required": false, + "schema": { + "enum": [ + "spot_rate", + "instantaneous_forward", + "par_yield" + ], + "type": "string", + "description": "The yield curve type.", + "default": "spot_rate", + "title": "Yield Curve Type" + }, + "description": "The yield curve type." + }, + { + "name": "rating", + "in": "query", + "required": false, + "schema": { + "enum": [ + "A", + "C" + ], + "type": "string", + "title": "ecb", + "description": "The rating type. (provider: ecb)", + "default": "A" + }, + "description": "The rating type. (provider: ecb)" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OBBject_List_EUYieldCurve__" + } + } + } + }, + "404": { + "description": "Not found" + }, + "400": { + "description": "No Results Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenBBErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenBBErrorResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "model": "EUYieldCurve" + } + }, "/api/v1/fixedincome/government/treasury_rates": { "get": { "tags": [ @@ -13392,14 +14000,254 @@ "model": "SOFR" } }, + "/api/v1/index/price/historical": { + "get": { + "tags": [ + "index" + ], + "summary": "Historical", + "description": "Index Historical Price. Load stock data for a specific index.", + "operationId": "index_price_historical", + "security": [ + { + "OAuth2PasswordBearer": [] + } + ], + "parameters": [ + { + "name": "provider", + "in": "query", + "required": true, + "schema": { + "enum": [ + "fmp", + "intrinio", + "polygon" + ], + "type": "string", + "title": "Provider" + } + }, + { + "name": "symbol", + "in": "query", + "required": true, + "schema": { + "type": "string", + "description": "Symbol to get data for.", + "title": "Symbol" + }, + "description": "Symbol to get data for." + }, + { + "name": "start_date", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ], + "description": "Start date of the data, in YYYY-MM-DD format.", + "title": "Start Date" + }, + "description": "Start date of the data, in YYYY-MM-DD format." + }, + { + "name": "end_date", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ], + "description": "End date of the data, in YYYY-MM-DD format.", + "title": "End Date" + }, + "description": "End date of the data, in YYYY-MM-DD format." + }, + { + "name": "timeseries", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "Number of days to look back. (provider: fmp)" + }, + "description": "Number of days to look back. (provider: fmp)" + }, + { + "name": "interval", + "in": "query", + "required": false, + "schema": { + "enum": [ + "1min", + "5min", + "15min", + "30min", + "1hour", + "4hour", + "1day" + ], + "type": "string", + "title": "fmp", + "description": "Data granularity. (provider: fmp)", + "default": "1day" + }, + "description": "Data granularity. (provider: fmp)" + }, + { + "name": "sort", + "in": "query", + "required": false, + "schema": { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "title": "fmp,intrinio,polygon", + "description": "Sort the data in ascending or descending order. (provider: fmp);\n Sort order. (provider: intrinio);\n Sort order of the data. (provider: polygon)", + "default": "desc" + }, + "description": "Sort the data in ascending or descending order. (provider: fmp);\n Sort order. (provider: intrinio);\n Sort order of the data. (provider: polygon)" + }, + { + "name": "limit", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "title": "intrinio,polygon", + "description": "The number of data entries to return. (provider: intrinio, polygon)", + "default": 10000 + }, + "description": "The number of data entries to return. (provider: intrinio, polygon)" + }, + { + "name": "timespan", + "in": "query", + "required": false, + "schema": { + "enum": [ + "minute", + "hour", + "day", + "week", + "month", + "quarter", + "year" + ], + "type": "string", + "title": "polygon", + "description": "Timespan of the data. (provider: polygon)", + "default": "day" + }, + "description": "Timespan of the data. (provider: polygon)" + }, + { + "name": "adjusted", + "in": "query", + "required": false, + "schema": { + "type": "boolean", + "title": "polygon", + "description": "Whether the data is adjusted. (provider: polygon)", + "default": true + }, + "description": "Whether the data is adjusted. (provider: polygon)" + }, + { + "name": "multiplier", + "in": "query", + "required": false, + "schema": { + "type": "integer", + "title": "polygon", + "description": "Multiplier of the timespan. (provider: polygon)", + "default": 1 + }, + "description": "Multiplier of the timespan. (provider: polygon)" + } + ], + "responses": { + "200": { + "description": "Successful Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OBBject_List_IndexHistorical__" + } + } + } + }, + "404": { + "description": "Not found" + }, + "400": { + "description": "No Results Found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenBBErrorResponse" + } + } + } + }, + "500": { + "description": "Internal Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/OpenBBErrorResponse" + } + } + } + }, + "422": { + "description": "Validation Error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + } + } + }, + "model": "IndexHistorical" + } + }, "/api/v1/index/market": { "get": { "tags": [ "index" ], - "summary": "Market", + "summary": "This endpoint will be deprecated in the future releases. Use '/index/price/historical' instead.", "description": "Historical Market Indices.", "operationId": "index_market", + "deprecated": true, "security": [ { "OAuth2PasswordBearer": [] @@ -13714,19 +14562,13 @@ { "name": "index", "in": "query", - "required": false, + "required": true, "schema": { - "enum": [ - "nasdaq", - "sp500", - "dowjones" - ], "type": "string", - "description": "Index for which we want to fetch the constituents.", - "default": "dowjones", + "description": "Index to fetch the constituents of.", "title": "Index" }, - "description": "Index for which we want to fetch the constituents." + "description": "Index to fetch the constituents of." } ], "responses": { @@ -14396,11 +15238,18 @@ "in": "query", "required": false, "schema": { - "enum": [ - "asc", - "desc" + "anyOf": [ + { + "enum": [ + "asc", + "desc" + ], + "type": "string" + }, + { + "type": "null" + } ], - "type": "string", "title": "benzinga,polygon", "description": "Order to sort the news by. (provider: benzinga);\n Sort order of the articles. (provider: polygon)", "default": "desc" @@ -15180,8 +16029,10 @@ "type": "null" } ], + "description": "Get information on a symbol, or a comma separated list of symbols.", "title": "Q" - } + }, + "description": "Get information on a symbol, or a comma separated list of symbols." }, { "name": "type", @@ -15203,8 +16054,34 @@ "type": "null" } ], + "description": "Filter by type.", "title": "Type" - } + }, + "description": "Filter by type." + }, + { + "name": "ignore_type", + "in": "query", + "required": false, + "schema": { + "anyOf": [ + { + "enum": [ + "stock", + "etf", + "index", + "indices", + null + ] + }, + { + "type": "null" + } + ], + "description": "Comma separated list of types to ignore. (stock, etf, index, indices)", + "title": "Ignore Type" + }, + "description": "Comma separated list of types to ignore. (stock, etf, index, indices)" } ], "responses": { @@ -15253,8 +16130,10 @@ "type": "null" } ], + "description": "Search fred indices.", "title": "Q" - } + }, + "description": "Search fred indices." } ], "responses": { @@ -15297,7 +16176,7 @@ { "name": "symbol", "in": "query", - "required": true, + "required": false, "schema": { "anyOf": [ { @@ -15307,8 +16186,10 @@ "type": "null" } ], + "description": "Get UDF symbol.", "title": "Symbol" - } + }, + "description": "Get UDF symbol." } ], "responses": { @@ -15350,8 +16231,10 @@ "required": true, "schema": { "type": "string", + "description": "Search UDF symbols.", "title": "Query" - } + }, + "description": "Search UDF symbols." }, { "name": "type", @@ -15366,10 +16249,11 @@ "type": "null" } ], - "nullable": true, + "description": "Symbol type.", "default": "stock", "title": "Type" - } + }, + "description": "Symbol type." }, { "name": "exchange", @@ -15384,8 +16268,10 @@ "type": "null" } ], + "description": "Symbol exchange.", "title": "Exchange" - } + }, + "description": "Symbol exchange." }, { "name": "limit", @@ -15400,9 +16286,11 @@ "type": "null" } ], + "description": "Limit the number of results.", "default": 15, "title": "Limit" - } + }, + "description": "Limit the number of results." } ], "responses": { @@ -15684,6 +16572,1303 @@ "type": "object", "title": "AvailableIndices" }, + "BalanceOfPayments": { + "properties": { + "period": { + "type": "string", + "format": "date", + "title": "openbb", + "description": "The date representing the beginning of the reporting period. " + }, + "current_account": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Current Account Balance (Billions of EUR) " + }, + "goods": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Goods Balance (Billions of EUR) " + }, + "services": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Services Balance (Billions of EUR) " + }, + "primary_income": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Primary Income Balance (Billions of EUR) " + }, + "secondary_income": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Secondary Income Balance (Billions of EUR) " + }, + "capital_account": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Capital Account Balance (Billions of EUR) " + }, + "net_lending_to_rest_of_world": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Balance of net lending to the rest of the world (Billions of EUR) " + }, + "financial_account": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Financial Account Balance (Billions of EUR) " + }, + "direct_investment": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Direct Investment Balance (Billions of EUR) " + }, + "portfolio_investment": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Portfolio Investment Balance (Billions of EUR) " + }, + "financial_derivatives": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Financial Derivatives Balance (Billions of EUR) " + }, + "other_investment": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Other Investment Balance (Billions of EUR) " + }, + "reserve_assets": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Reserve Assets Balance (Billions of EUR) " + }, + "errors_and_ommissions": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Errors and Omissions (Billions of EUR) " + }, + "current_account_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Current Account Credits (Billions of EUR) " + }, + "current_account_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Current Account Debits (Billions of EUR) " + }, + "current_account_balance": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Current Account Balance (Billions of EUR) " + }, + "goods_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Goods Credits (Billions of EUR) " + }, + "goods_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Goods Debits (Billions of EUR) " + }, + "services_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Services Credits (Billions of EUR) " + }, + "services_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Services Debits (Billions of EUR) " + }, + "primary_income_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Primary Income Credits (Billions of EUR) " + }, + "primary_income_employee_compensation_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Primary Income Employee Compensation Credit (Billions of EUR) " + }, + "primary_income_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Primary Income Debits (Billions of EUR) " + }, + "primary_income_employee_compensation_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Primary Income Employee Compensation Debit (Billions of EUR) " + }, + "secondary_income_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Secondary Income Credits (Billions of EUR) " + }, + "secondary_income_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Secondary Income Debits (Billions of EUR) " + }, + "capital_account_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Capital Account Credits (Billions of EUR) " + }, + "capital_account_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Capital Account Debits (Billions of EUR) " + }, + "services_total_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Services Total Credit (Billions of EUR) " + }, + "services_total_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Services Total Debit (Billions of EUR) " + }, + "transport_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Transport Credit (Billions of EUR) " + }, + "transport_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Transport Debit (Billions of EUR) " + }, + "travel_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Travel Credit (Billions of EUR) " + }, + "travel_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Travel Debit (Billions of EUR) " + }, + "financial_services_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Financial Services Credit (Billions of EUR) " + }, + "financial_services_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Financial Services Debit (Billions of EUR) " + }, + "communications_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Communications Credit (Billions of EUR) " + }, + "communications_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Communications Debit (Billions of EUR) " + }, + "other_business_services_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Other Business Services Credit (Billions of EUR) " + }, + "other_business_services_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Other Business Services Debit (Billions of EUR) " + }, + "other_services_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Other Services Credit (Billions of EUR) " + }, + "other_services_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Other Services Debit (Billions of EUR) " + }, + "investment_total_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Investment Total Credit (Billions of EUR) " + }, + "investment_total_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Investment Total Debit (Billions of EUR) " + }, + "equity_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Equity Credit (Billions of EUR) " + }, + "equity_reinvested_earnings_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Equity Reinvested Earnings Credit (Billions of EUR) " + }, + "equity_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Equity Debit (Billions of EUR) " + }, + "equity_reinvested_earnings_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Equity Reinvested Earnings Debit (Billions of EUR) " + }, + "debt_instruments_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Debt Instruments Credit (Billions of EUR) " + }, + "debt_instruments_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Debt Instruments Debit (Billions of EUR) " + }, + "portfolio_investment_equity_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Portfolio Investment Equity Credit (Billions of EUR) " + }, + "portfolio_investment_equity_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Portfolio Investment Equity Debit (Billions of EUR) " + }, + "portfolio_investment_debt_instruments_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Portfolio Investment Debt Instruments Credit (Billions of EUR) " + }, + "portofolio_investment_debt_instruments_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Portfolio Investment Debt Instruments Debit (Billions of EUR) " + }, + "other_investment_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Other Investment Credit (Billions of EUR) " + }, + "other_investment_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Other Investment Debit (Billions of EUR) " + }, + "reserve_assets_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Reserve Assets Credit (Billions of EUR) " + }, + "assets_total": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Total (Billions of EUR) " + }, + "assets_equity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Equity (Billions of EUR) " + }, + "assets_debt_instruments": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Debt Instruments (Billions of EUR) " + }, + "assets_mfi": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets MFIs (Billions of EUR) " + }, + "assets_non_mfi": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Non MFIs (Billions of EUR) " + }, + "assets_direct_investment_abroad": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Direct Investment Abroad (Billions of EUR) " + }, + "liabilities_total": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Total (Billions of EUR) " + }, + "liabilities_equity": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Equity (Billions of EUR) " + }, + "liabilities_debt_instruments": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Debt Instruments (Billions of EUR) " + }, + "liabilities_mfi": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities MFIs (Billions of EUR) " + }, + "liabilities_non_mfi": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Non MFIs (Billions of EUR) " + }, + "liabilities_direct_investment_euro_area": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Direct Investment in Euro Area (Billions of EUR) " + }, + "assets_equity_and_fund_shares": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Equity and Investment Fund Shares (Billions of EUR) " + }, + "assets_equity_shares": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Equity Shares (Billions of EUR) " + }, + "assets_investment_fund_shares": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Investment Fund Shares (Billions of EUR) " + }, + "assets_debt_short_term": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Debt Short Term (Billions of EUR) " + }, + "assets_debt_long_term": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Debt Long Term (Billions of EUR) " + }, + "assets_resident_sector_eurosystem": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Resident Sector Eurosystem (Billions of EUR) " + }, + "assets_resident_sector_mfi_ex_eurosystem": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Resident Sector MFIs outside Eurosystem (Billions of EUR) " + }, + "assets_resident_sector_government": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Resident Sector Government (Billions of EUR) " + }, + "assets_resident_sector_other": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Resident Sector Other (Billions of EUR) " + }, + "liabilities_equity_and_fund_shares": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Equity and Investment Fund Shares (Billions of EUR) " + }, + "liabilities_investment_fund_shares": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Investment Fund Shares (Billions of EUR) " + }, + "liabilities_debt_short_term": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Debt Short Term (Billions of EUR) " + }, + "liabilities_debt_long_term": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Debt Long Term (Billions of EUR) " + }, + "liabilities_resident_sector_government": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Resident Sector Government (Billions of EUR) " + }, + "liabilities_resident_sector_other": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Resident Sector Other (Billions of EUR) " + }, + "assets_currency_and_deposits": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Currency and Deposits (Billions of EUR) " + }, + "assets_loans": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Loans (Billions of EUR) " + }, + "assets_trade_credit_and_advances": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Trade Credits and Advances (Billions of EUR) " + }, + "assets_eurosystem": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Eurosystem (Billions of EUR) " + }, + "assets_other_mfi_ex_eurosystem": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Other MFIs outside Eurosystem (Billions of EUR) " + }, + "assets_government": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Government (Billions of EUR) " + }, + "assets_other_sectors": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Assets Other Sectors (Billions of EUR) " + }, + "liabilities_currency_and_deposits": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Currency and Deposits (Billions of EUR) " + }, + "liabilities_loans": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Loans (Billions of EUR) " + }, + "liabilities_trade_credit_and_advances": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Trade Credits and Advances (Billions of EUR) " + }, + "liabilities_eurosystem": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Eurosystem (Billions of EUR) " + }, + "liabilities_other_mfi_ex_eurosystem": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Other MFIs outside Eurosystem (Billions of EUR) " + }, + "liabilities_government": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Government (Billions of EUR) " + }, + "liabilities_other_sectors": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Liabilities Other Sectors (Billions of EUR) " + }, + "goods_balance": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Goods Balance (Billions of EUR) " + }, + "services_balance": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Services Balance (Billions of EUR) " + }, + "primary_income_balance": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Primary Income Balance (Billions of EUR) " + }, + "investment_income_balance": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Investment Income Balance (Billions of EUR) " + }, + "investment_income_credit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Investment Income Credits (Billions of EUR) " + }, + "investment_income_debit": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Investment Income Debits (Billions of EUR) " + }, + "secondary_income_balance": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Secondary Income Balance (Billions of EUR) " + }, + "capital_account_balance": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Capital Account Balance (Billions of EUR) " + } + }, + "additionalProperties": true, + "type": "object", + "title": "BalanceOfPayments" + }, "BalanceSheet": { "properties": { "symbol": { @@ -15819,6 +18004,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -15831,6 +18019,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -15843,6 +18034,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -15879,6 +18073,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -15927,6 +18124,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -15963,6 +18163,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -15975,6 +18178,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -16023,6 +18229,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -16035,6 +18244,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -16047,6 +18259,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -16083,6 +18298,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -16095,6 +18313,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -16131,6 +18352,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -16143,6 +18367,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -16251,6 +18478,9 @@ { "type": "number" }, + { + "type": "integer" + }, { "type": "null" } @@ -16333,7 +18563,7 @@ "cash_and_due_from_banks": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16345,7 +18575,7 @@ "restricted_cash": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16357,7 +18587,7 @@ "federal_funds_sold": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16368,6 +18598,9 @@ }, "accounts_receivable": { "anyOf": [ + { + "type": "number" + }, { "type": "integer" }, @@ -16381,7 +18614,7 @@ "note_and_lease_receivable": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16393,7 +18626,7 @@ "inventories": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16405,7 +18638,7 @@ "customer_and_other_receivables": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16417,7 +18650,7 @@ "interest_bearing_deposits_at_other_banks": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16429,7 +18662,7 @@ "time_deposits_placed_and_other_short_term_investments": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16441,7 +18674,7 @@ "trading_account_securities": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16453,7 +18686,7 @@ "loans_and_leases": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16465,7 +18698,7 @@ "allowance_for_loan_and_lease_losses": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16477,7 +18710,7 @@ "current_deferred_refundable_income_taxes": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16489,7 +18722,7 @@ "loans_and_leases_net_of_allowance": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16501,7 +18734,7 @@ "accrued_investment_income": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16513,7 +18746,7 @@ "other_current_non_operating_assets": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16525,7 +18758,7 @@ "loans_held_for_sale": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16536,6 +18769,9 @@ }, "prepaid_expenses": { "anyOf": [ + { + "type": "number" + }, { "type": "integer" }, @@ -16549,7 +18785,7 @@ "plant_property_equipment_gross": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16561,7 +18797,7 @@ "accumulated_depreciation": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16573,7 +18809,7 @@ "premises_and_equipment_net": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16585,7 +18821,7 @@ "mortgage_servicing_rights": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16597,7 +18833,7 @@ "unearned_premiums_asset": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16609,7 +18845,7 @@ "non_current_note_lease_receivables": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16621,7 +18857,7 @@ "deferred_acquisition_cost": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16633,7 +18869,7 @@ "separate_account_business_assets": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16645,7 +18881,7 @@ "non_current_deferred_refundable_income_taxes": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16657,7 +18893,7 @@ "employee_benefit_assets": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16669,7 +18905,7 @@ "other_non_current_operating_assets": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16681,7 +18917,7 @@ "other_non_current_non_operating_assets": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16693,7 +18929,7 @@ "interest_bearing_deposits": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16704,6 +18940,9 @@ }, "total_non_current_assets": { "anyOf": [ + { + "type": "number" + }, { "type": "integer" }, @@ -16717,7 +18956,7 @@ "non_interest_bearing_deposits": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16729,7 +18968,7 @@ "federal_funds_purchased_and_securities_sold": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16741,7 +18980,7 @@ "bankers_acceptance_outstanding": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16753,7 +18992,7 @@ "current_deferred_payable_income_tax_liabilities": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16765,7 +19004,7 @@ "accrued_interest_payable": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16777,7 +19016,7 @@ "accrued_expenses": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16789,7 +19028,7 @@ "other_short_term_payables": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16801,7 +19040,7 @@ "customer_deposits": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16813,7 +19052,7 @@ "dividends_payable": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16825,7 +19064,7 @@ "claims_and_claim_expense": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16837,7 +19076,7 @@ "future_policy_benefits": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16849,7 +19088,7 @@ "current_employee_benefit_liabilities": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16861,7 +19100,7 @@ "unearned_premiums_liability": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16873,7 +19112,7 @@ "other_taxes_payable": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16885,7 +19124,7 @@ "policy_holder_funds": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16897,7 +19136,7 @@ "other_current_non_operating_liabilities": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16909,7 +19148,7 @@ "separate_account_business_liabilities": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16921,7 +19160,7 @@ "other_long_term_liabilities": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16933,7 +19172,7 @@ "non_current_deferred_revenue": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16945,7 +19184,7 @@ "non_current_deferred_payable_income_tax_liabilities": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16957,7 +19196,7 @@ "non_current_employee_benefit_liabilities": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16969,7 +19208,7 @@ "other_non_current_operating_liabilities": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16981,7 +19220,7 @@ "other_non_current_non_operating_liabilities": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -16993,7 +19232,7 @@ "asset_retirement_reserve_litigation_obligation": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -17005,7 +19244,7 @@ "commitments_contingencies": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -17016,6 +19255,9 @@ }, "redeemable_non_controlling_interest": { "anyOf": [ + { + "type": "number" + }, { "type": "integer" }, @@ -17029,7 +19271,7 @@ "treasury_stock": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -17041,7 +19283,7 @@ "participating_policy_holder_equity": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -17053,7 +19295,7 @@ "other_equity_adjustments": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -17065,7 +19307,7 @@ "total_preferred_common_equity": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -17077,7 +19319,7 @@ "non_controlling_interest": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -17089,7 +19331,7 @@ "total_liabilities_shareholders_equity": { "anyOf": [ { - "type": "integer" + "type": "number" }, { "type": "null" @@ -19343,6 +21585,25 @@ }, "CompanyFilings": { "properties": { + "filing_date": { + "type": "string", + "format": "date", + "title": "openbb", + "description": "The date of the filing. " + }, + "accepted_date": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Accepted date of the filing. " + }, "symbol": { "anyOf": [ { @@ -19367,32 +21628,34 @@ "title": "openbb", "description": "Central Index Key (CIK) for the requested entity. " }, - "filing_date": { - "type": "string", - "format": "date", - "title": "openbb", - "description": "Filing date of the SEC report. " - }, - "accepted_date": { - "type": "string", - "format": "date-time", - "title": "openbb", - "description": "Accepted date of the SEC report. " - }, "report_type": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "openbb", - "description": "Type of the SEC report. " + "description": "Type of filing. " }, "filing_url": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "openbb", - "description": "URL to the filing page on the SEC site. " + "description": "URL to the filing page. " }, "report_url": { "type": "string", "title": "openbb", - "description": "URL to the actual report on the SEC site. " + "description": "URL to the actual report. " }, "id": { "anyOf": [ @@ -19653,9 +21916,6 @@ "type": "object", "required": [ "filing_date", - "accepted_date", - "report_type", - "filing_url", "report_url" ], "title": "CompanyFilings" @@ -19681,10 +21941,7 @@ "image": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "type": "string" }, { "type": "null" @@ -19748,12 +22005,6 @@ }, "images": { "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, { "items": { "additionalProperties": { @@ -19762,6 +22013,18 @@ "type": "object" }, "type": "array" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "type": "string" + }, + { + "type": "null" } ], "title": "benzinga,fmp", @@ -19911,8 +22174,7 @@ "symbols", "date", "title", - "url", - "images" + "url" ], "title": "CompanyNews" }, @@ -20462,6 +22724,9 @@ "type": "integer", "exclusiveMinimum": 0.0 }, + { + "type": "integer" + }, { "type": "null" } @@ -20600,8 +22865,7 @@ "vwap": { "anyOf": [ { - "type": "number", - "exclusiveMinimum": 0.0 + "type": "number" }, { "type": "null" @@ -20904,6 +23168,394 @@ ], "title": "CurrencyPairs" }, + "CurrencyReferenceRates": { + "properties": { + "date": { + "type": "string", + "format": "date", + "title": "openbb", + "description": "The date of the data. " + }, + "EUR": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Euro. " + }, + "USD": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "US Dollar. " + }, + "JPY": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Japanese Yen. " + }, + "BGN": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Bulgarian Lev. " + }, + "CZK": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Czech Koruna. " + }, + "DKK": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Danish Krone. " + }, + "GBP": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Pound Sterling. " + }, + "HUF": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Hungarian Forint. " + }, + "PLN": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Polish Zloty. " + }, + "RON": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Romanian Leu. " + }, + "SEK": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Swedish Krona. " + }, + "CHF": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Swiss Franc. " + }, + "ISK": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Icelandic Krona. " + }, + "NOK": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Norwegian Krone. " + }, + "TRY": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Turkish Lira. " + }, + "AUD": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Australian Dollar. " + }, + "BRL": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Brazilian Real. " + }, + "CAD": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Canadian Dollar. " + }, + "CNY": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Chinese Yuan. " + }, + "HKD": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Hong Kong Dollar. " + }, + "IDR": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Indonesian Rupiah. " + }, + "ILS": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Israeli Shekel. " + }, + "INR": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Indian Rupee. " + }, + "KRW": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "South Korean Won. " + }, + "MXN": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Mexican Peso. " + }, + "MYR": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Malaysian Ringgit. " + }, + "NZD": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "New Zealand Dollar. " + }, + "PHP": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Philippine Peso. " + }, + "SGD": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Singapore Dollar. " + }, + "THB": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Thai Baht. " + }, + "ZAR": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "South African Rand. " + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "date" + ], + "title": "CurrencyReferenceRates" + }, "DiscountWindowPrimaryCreditRate": { "properties": { "date": { @@ -21008,6 +23660,33 @@ ], "title": "ESTR" }, + "EUYieldCurve": { + "properties": { + "maturity": { + "type": "string", + "title": "openbb", + "description": "Yield curve rate maturity. " + }, + "rate": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Yield curve rate. " + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "maturity" + ], + "title": "EUYieldCurve" + }, "EarningsCallTranscript": { "properties": { "symbol": { @@ -21378,8 +24057,16 @@ "EquityHistorical": { "properties": { "date": { - "type": "string", - "format": "date-time", + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "string", + "format": "date-time" + } + ], "title": "openbb", "description": "The date of the data. " }, @@ -21410,6 +24097,9 @@ }, { "type": "integer" + }, + { + "type": "null" } ], "title": "openbb", @@ -21689,8 +24379,7 @@ "open", "high", "low", - "close", - "volume" + "close" ], "title": "EquityHistorical" }, @@ -22562,44 +25251,12 @@ }, "EquityQuote": { "properties": { - "day_low": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "Lowest price of the stock in the current trading day. " - }, - "day_high": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "Highest price of the stock in the current trading day. " - }, - "date": { - "anyOf": [ - { - "type": "string", - "format": "date-time" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "The date of the data. " - }, "symbol": { + "type": "string", + "title": "openbb", + "description": "Symbol representing the entity requested in the data. " + }, + "asset_type": { "anyOf": [ { "type": "string" @@ -22608,8 +25265,8 @@ "type": "null" } ], - "title": "fmp", - "description": "Symbol of the company. (provider: fmp)" + "title": "openbb", + "description": "Type of asset - i.e, stock, ETF, etc. " }, "name": { "anyOf": [ @@ -22620,10 +25277,22 @@ "type": "null" } ], - "title": "fmp", - "description": "Name of the company. (provider: fmp)" + "title": "openbb", + "description": "Name of the company or asset. " }, - "price": { + "exchange": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The name or symbol of the venue where the data is from. " + }, + "bid": { "anyOf": [ { "type": "number" @@ -22632,10 +25301,34 @@ "type": "null" } ], - "title": "fmp", - "description": "Current trading price of the equity. (provider: fmp)" + "title": "openbb", + "description": "Price of the top bid order. " }, - "changes_percentage": { + "bid_size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "This represents the number of round lot orders at the given price. The normal round lot size is 100 shares. A size of 2 means there are 200 shares available at the given price. " + }, + "bid_exchange": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The specific trading venue where the purchase order was placed. " + }, + "ask": { "anyOf": [ { "type": "number" @@ -22644,8 +25337,315 @@ "type": "null" } ], - "title": "fmp", - "description": "Change percentage of the equity price. (provider: fmp)" + "title": "openbb", + "description": "Price of the top ask order. " + }, + "ask_size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "This represents the number of round lot orders at the given price. The normal round lot size is 100 shares. A size of 2 means there are 200 shares available at the given price. " + }, + "ask_exchange": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The specific trading venue where the sale order was placed. " + }, + "quote_conditions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Conditions or condition codes applicable to the quote. " + }, + "quote_indicators": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Indicators or indicator codes applicable to the participant quote related to the price bands for the issue, or the affect the quote has on the NBBO. " + }, + "sales_conditions": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "integer" + }, + { + "items": { + "type": "string" + }, + "type": "array" + }, + { + "items": { + "type": "integer" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Conditions or condition codes applicable to the sale. " + }, + "sequence_number": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The sequence number represents the sequence in which message events happened. These are increasing and unique per ticker symbol, but will not always be sequential (e.g., 1, 2, 6, 9, 10, 11). " + }, + "market_center": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The ID of the UTP participant that originated the message. " + }, + "participant_timestamp": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Timestamp for when the quote was generated by the exchange. " + }, + "trf_timestamp": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Timestamp for when the TRF (Trade Reporting Facility) received the message. " + }, + "sip_timestamp": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Timestamp for when the SIP (Security Information Processor) received the message from the exchange. " + }, + "last_price": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Price of the last trade. " + }, + "last_tick": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Whether the last sale was an up or down tick. " + }, + "last_size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Size of the last trade. " + }, + "last_timestamp": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Date and Time when the last price was recorded. " + }, + "open": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The open price. " + }, + "high": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The high price. " + }, + "low": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The low price. " + }, + "close": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The close price. " + }, + "volume": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The trading volume. " + }, + "exchange_volume": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Volume of shares exchanged during the trading day on the specific exchange. " + }, + "prev_close": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "" }, "change": { "anyOf": [ @@ -22656,8 +25656,21 @@ "type": "null" } ], - "title": "fmp", - "description": "Change in the equity price. (provider: fmp)" + "title": "openbb", + "description": "Change in price from previous close. " + }, + "change_percent": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Change in price as a normalized percentage. ", + "x-frontendmultiply": 100 }, "year_high": { "anyOf": [ @@ -22668,10 +25681,22 @@ "type": "null" } ], - "title": "fmp", - "description": "Highest price of the equity in the last 52 weeks. (provider: fmp)" + "title": "openbb", + "description": "The one year high (52W High). " }, "year_low": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The one year low (52W Low). " + }, + "price_avg50": { "anyOf": [ { "type": "number" @@ -22681,7 +25706,31 @@ } ], "title": "fmp", - "description": "Lowest price of the equity in the last 52 weeks. (provider: fmp)" + "description": "50 day moving average price. (provider: fmp)" + }, + "price_avg200": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "200 day moving average price. (provider: fmp)" + }, + "avg_volume": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "Average volume over the last 10 trading days. (provider: fmp)" }, "market_cap": { "anyOf": [ @@ -22695,31 +25744,7 @@ "title": "fmp", "description": "Market cap of the company. (provider: fmp)" }, - "price_avg50": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "fmp", - "description": "50 days average price of the equity. (provider: fmp)" - }, - "price_avg200": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "fmp", - "description": "200 days average price of the equity. (provider: fmp)" - }, - "volume": { + "shares_outstanding": { "anyOf": [ { "type": "integer" @@ -22729,55 +25754,7 @@ } ], "title": "fmp", - "description": "Volume of the equity in the current trading day. (provider: fmp)" - }, - "avg_volume": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "fmp", - "description": "Average volume of the equity in the last 10 trading days. (provider: fmp)" - }, - "exchange": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "fmp", - "description": "Exchange the equity is traded on. (provider: fmp)" - }, - "open": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "fmp", - "description": "Opening price of the equity in the current trading day. (provider: fmp)" - }, - "previous_close": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "fmp", - "description": "Previous closing price of the equity. (provider: fmp)" + "description": "Number of shares outstanding. (provider: fmp)" }, "eps": { "anyOf": [ @@ -22789,7 +25766,7 @@ } ], "title": "fmp", - "description": "Earnings per share of the equity. (provider: fmp)" + "description": "Earnings per share. (provider: fmp)" }, "pe": { "anyOf": [ @@ -22801,10 +25778,14 @@ } ], "title": "fmp", - "description": "Price earnings ratio of the equity. (provider: fmp)" + "description": "Price earnings ratio. (provider: fmp)" }, "earnings_announcement": { "anyOf": [ + { + "type": "string", + "format": "date-time" + }, { "type": "string" }, @@ -22813,176 +25794,31 @@ } ], "title": "fmp", - "description": "Earnings announcement date of the equity. (provider: fmp)" + "description": "Upcoming earnings announcement date. (provider: fmp)" }, - "shares_outstanding": { + "is_darkpool": { "anyOf": [ { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "fmp", - "description": "Number of shares outstanding of the equity. (provider: fmp)" - }, - "last_price": { - "anyOf": [ - { - "type": "number" + "type": "boolean" }, { "type": "null" } ], "title": "intrinio", - "description": "Price of the last trade. (provider: intrinio)" + "description": "Whether or not the current trade is from a darkpool. (provider: intrinio)" }, - "last_time": { + "source": { "anyOf": [ { - "type": "string", - "format": "date-time" + "type": "string" }, { "type": "null" } ], "title": "intrinio", - "description": "Date and Time when the last trade occurred. (provider: intrinio)" - }, - "last_size": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Size of the last trade. (provider: intrinio)" - }, - "bid_price": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Price of the top bid order. (provider: intrinio)" - }, - "bid_size": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Size of the top bid order. (provider: intrinio)" - }, - "ask_price": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Price of the top ask order. (provider: intrinio)" - }, - "ask_size": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Size of the top ask order. (provider: intrinio)" - }, - "open_price": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Open price for the trading day. (provider: intrinio)" - }, - "close_price": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Closing price for the trading day (IEX source only). (provider: intrinio)" - }, - "high_price": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "High Price for the trading day. (provider: intrinio)" - }, - "low_price": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Low Price for the trading day. (provider: intrinio)" - }, - "exchange_volume": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Number of shares exchanged during the trading day on the exchange. (provider: intrinio)" - }, - "market_volume": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Number of shares exchanged during the trading day for the whole market. (provider: intrinio)" + "description": "Source of the Intrinio data. (provider: intrinio)" }, "updated_on": { "anyOf": [ @@ -22997,97 +25833,10 @@ "title": "intrinio", "description": "Date and Time when the data was last updated. (provider: intrinio)" }, - "source": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Source of the data. (provider: intrinio)" - }, - "listing_venue": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Listing venue where the trade took place (SIP source only). (provider: intrinio)" - }, - "sales_conditions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Indicates any sales condition modifiers associated with the trade. (provider: intrinio)" - }, - "quote_conditions": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Indicates any quote condition modifiers associated with the trade. (provider: intrinio)" - }, - "market_center_code": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Market center character code. (provider: intrinio)" - }, - "is_darkpool": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Whether or not the current trade is from a darkpool. (provider: intrinio)" - }, - "messages": { - "anyOf": [ - { - "items": { - "type": "string" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "title": "intrinio", - "description": "Messages associated with the endpoint. (provider: intrinio)" - }, "security": { "anyOf": [ { - "type": "object" + "$ref": "#/components/schemas/IntrinioSecurity" }, { "type": "null" @@ -23099,6 +25848,9 @@ }, "additionalProperties": true, "type": "object", + "required": [ + "symbol" + ], "title": "EquityQuote" }, "EquityScreener": { @@ -26701,10 +29453,10 @@ "release_id": { "anyOf": [ { - "type": "string" + "type": "integer" }, { - "type": "integer" + "type": "string" }, { "type": "null" @@ -29225,14 +31977,28 @@ "description": "Symbol representing the entity requested in the data. " }, "name": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "openbb", "description": "Name of the constituent company in the index. " }, "sector": { - "type": "string", - "title": "openbb", - "description": "Sector the constituent company in the index belongs to. " + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "Sector the constituent company in the index belongs to. (provider: fmp)" }, "sub_sector": { "anyOf": [ @@ -29243,8 +32009,8 @@ "type": "null" } ], - "title": "openbb", - "description": "Sub-sector the constituent company in the index belongs to. " + "title": "fmp", + "description": "Sub-sector the constituent company in the index belongs to. (provider: fmp)" }, "headquarter": { "anyOf": [ @@ -29255,8 +32021,8 @@ "type": "null" } ], - "title": "openbb", - "description": "Location of the headquarter of the constituent company in the index. " + "title": "fmp", + "description": "Location of the headquarter of the constituent company in the index. (provider: fmp)" }, "date_first_added": { "anyOf": [ @@ -29271,13 +32037,20 @@ "type": "null" } ], - "title": "openbb", - "description": "Date the constituent company was added to the index. " + "title": "fmp", + "description": "Date the constituent company was added to the index. (provider: fmp)" }, "cik": { - "type": "integer", - "title": "openbb", - "description": "Central Index Key (CIK) for the requested entity. " + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "Central Index Key (CIK) for the requested entity. (provider: fmp)" }, "founded": { "anyOf": [ @@ -29292,20 +32065,186 @@ "type": "null" } ], - "title": "openbb", - "description": "Founding year of the constituent company in the index. " + "title": "fmp", + "description": "Founding year of the constituent company in the index. (provider: fmp)" } }, "additionalProperties": true, "type": "object", "required": [ - "symbol", - "name", - "sector", - "cik" + "symbol" ], "title": "IndexConstituents" }, + "IndexHistorical": { + "properties": { + "date": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "string", + "format": "date-time" + } + ], + "title": "openbb", + "description": "The date of the data. " + }, + "open": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The open price. " + }, + "high": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The high price. " + }, + "low": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The low price. " + }, + "close": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The close price. " + }, + "volume": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The trading volume. " + }, + "adj_close": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "The adjusted close price. (provider: fmp)" + }, + "unadjusted_volume": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "Unadjusted volume of the symbol. (provider: fmp)" + }, + "change": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "Change in the price of the symbol from the previous day. (provider: fmp)" + }, + "change_percent": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "Change % in the price of the symbol. (provider: fmp)" + }, + "label": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "Human readable format of the date. (provider: fmp)" + }, + "change_over_time": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "fmp", + "description": "Change % in the price of the symbol over a period of time. (provider: fmp)" + }, + "transactions": { + "anyOf": [ + { + "type": "integer", + "exclusiveMinimum": 0.0 + }, + { + "type": "null" + } + ], + "title": "polygon", + "description": "Number of transactions for the symbol in the time period. (provider: polygon)" + } + }, + "additionalProperties": true, + "type": "object", + "required": [ + "date" + ], + "title": "IndexHistorical" + }, "InsiderTrading": { "properties": { "symbol": { @@ -29314,15 +32253,36 @@ "description": "Symbol representing the entity requested in the data. " }, "company_cik": { - "type": "integer", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "openbb", - "description": "Company CIK of the insider trading. " + "description": "CIK number of the company. " }, "filing_date": { - "type": "string", - "format": "date-time", + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], "title": "openbb", - "description": "Filing date of the insider trading. " + "description": "Filing date of the trade. " }, "transaction_date": { "anyOf": [ @@ -29335,17 +32295,34 @@ } ], "title": "openbb", - "description": "Transaction date of the insider trading. " + "description": "Date of the transaction. " }, "owner_cik": { - "type": "integer", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "openbb", - "description": "Reporting CIK of the insider trading. " + "description": "Reporting individual's CIK. " }, "owner_name": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "openbb", - "description": "Reporting name of the insider trading. " + "description": "Name of the reporting individual. " }, "owner_title": { "anyOf": [ @@ -29357,12 +32334,19 @@ } ], "title": "openbb", - "description": "Designation of owner of the insider trading. " + "description": "The title held by the reporting individual. " }, "transaction_type": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "openbb", - "description": "Transaction type of the insider trading. " + "description": "Type of transaction being reported. " }, "acquisition_or_disposition": { "anyOf": [ @@ -29374,7 +32358,7 @@ } ], "title": "openbb", - "description": "Acquisition or disposition of the insider trading. " + "description": "Acquisition or disposition of the shares. " }, "security_type": { "anyOf": [ @@ -29386,7 +32370,7 @@ } ], "title": "openbb", - "description": "Security type of the insider trading. " + "description": "The type of security transacted. " }, "securities_owned": { "anyOf": [ @@ -29398,7 +32382,7 @@ } ], "title": "openbb", - "description": "Number of securities owned in the insider trading. " + "description": "Number of securities owned by the reporting individual. " }, "securities_transacted": { "anyOf": [ @@ -29410,7 +32394,7 @@ } ], "title": "openbb", - "description": "Securities transacted of the insider trading. " + "description": "Number of securities transacted by the reporting individual. " }, "transaction_price": { "anyOf": [ @@ -29422,12 +32406,19 @@ } ], "title": "openbb", - "description": "Price of the insider trading. " + "description": "The price of the transaction. " }, "filing_url": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "openbb", - "description": "Link of the insider trading. " + "description": "Link to the filing. " }, "form_type": { "anyOf": [ @@ -29463,7 +32454,7 @@ } ], "title": "intrinio", - "description": "Conversion/Exercise price of the insider trading. (provider: intrinio)" + "description": "Conversion/Exercise price of the shares. (provider: intrinio)" }, "deemed_execution_date": { "anyOf": [ @@ -29476,7 +32467,7 @@ } ], "title": "intrinio", - "description": "Deemed execution date of the insider trading. (provider: intrinio)" + "description": "Deemed execution date of the trade. (provider: intrinio)" }, "exercise_date": { "anyOf": [ @@ -29489,7 +32480,7 @@ } ], "title": "intrinio", - "description": "Exercise date of the insider trading. (provider: intrinio)" + "description": "Exercise date of the trade. (provider: intrinio)" }, "expiration_date": { "anyOf": [ @@ -29502,7 +32493,7 @@ } ], "title": "intrinio", - "description": "Expiration date of the insider trading. (provider: intrinio)" + "description": "Expiration date of the derivative. (provider: intrinio)" }, "underlying_security_title": { "anyOf": [ @@ -29518,6 +32509,9 @@ }, "underlying_shares": { "anyOf": [ + { + "type": "number" + }, { "type": "integer" }, @@ -29616,13 +32610,7 @@ "additionalProperties": true, "type": "object", "required": [ - "symbol", - "company_cik", - "filing_date", - "owner_cik", - "owner_name", - "transaction_type", - "filing_url" + "symbol" ], "title": "InsiderTrading" }, @@ -30373,8 +33361,7 @@ "additionalProperties": true, "type": "object", "required": [ - "id", - "shareClassFigi" + "id" ], "title": "IntrinioSecurity", "description": "Intrinio Security Data." @@ -31669,10 +34656,10 @@ "timestamp": { "anyOf": [ { - "type": "integer" + "type": "number" }, { - "type": "number" + "type": "integer" }, { "type": "null" @@ -32128,7 +35115,7 @@ "title": "OBBject[CompanyOverview]", "description": "OBBject with results of type 'CompanyOverview'." }, - "OBBject_EquityInfo_": { + "OBBject_CurrencyReferenceRates_": { "properties": { "_id": { "type": "string", @@ -32137,7 +35124,7 @@ "results": { "anyOf": [ { - "$ref": "#/components/schemas/EquityInfo" + "$ref": "#/components/schemas/CurrencyReferenceRates" }, { "type": "null" @@ -32190,8 +35177,8 @@ } }, "type": "object", - "title": "OBBject[EquityInfo]", - "description": "OBBject with results of type 'EquityInfo'." + "title": "OBBject[CurrencyReferenceRates]", + "description": "OBBject with results of type 'CurrencyReferenceRates'." }, "OBBject_EquityPeers_": { "properties": { @@ -32530,6 +35517,75 @@ "title": "OBBject[AvailableIndices]", "description": "OBBject with results of type 'AvailableIndices'." }, + "OBBject_List_BalanceOfPayments__": { + "properties": { + "_id": { + "type": "string", + "title": " Id" + }, + "results": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/BalanceOfPayments" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Results", + "description": "Serializable results." + }, + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Provider", + "description": "Provider name." + }, + "warnings": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/Warning_" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Warnings", + "description": "List of warnings." + }, + "chart": { + "anyOf": [ + { + "$ref": "#/components/schemas/Chart" + }, + { + "type": "null" + } + ], + "description": "Chart object." + }, + "extra": { + "type": "object", + "title": "Extra", + "description": "Extra info." + } + }, + "type": "object", + "title": "OBBject[BalanceOfPayments]", + "description": "OBBject with results of type 'BalanceOfPayments'." + }, "OBBject_List_BalanceSheetGrowth__": { "properties": { "_id": { @@ -33841,6 +36897,75 @@ "title": "OBBject[ESTR]", "description": "OBBject with results of type 'ESTR'." }, + "OBBject_List_EUYieldCurve__": { + "properties": { + "_id": { + "type": "string", + "title": " Id" + }, + "results": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/EUYieldCurve" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Results", + "description": "Serializable results." + }, + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Provider", + "description": "Provider name." + }, + "warnings": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/Warning_" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Warnings", + "description": "List of warnings." + }, + "chart": { + "anyOf": [ + { + "$ref": "#/components/schemas/Chart" + }, + { + "type": "null" + } + ], + "description": "Chart object." + }, + "extra": { + "type": "object", + "title": "Extra", + "description": "Extra info." + } + }, + "type": "object", + "title": "OBBject[EUYieldCurve]", + "description": "OBBject with results of type 'EUYieldCurve'." + }, "OBBject_List_EarningsCallTranscript__": { "properties": { "_id": { @@ -34117,6 +37242,75 @@ "title": "OBBject[EquityHistorical]", "description": "OBBject with results of type 'EquityHistorical'." }, + "OBBject_List_EquityInfo__": { + "properties": { + "_id": { + "type": "string", + "title": " Id" + }, + "results": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/EquityInfo" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Results", + "description": "Serializable results." + }, + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Provider", + "description": "Provider name." + }, + "warnings": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/Warning_" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Warnings", + "description": "List of warnings." + }, + "chart": { + "anyOf": [ + { + "$ref": "#/components/schemas/Chart" + }, + { + "type": "null" + } + ], + "description": "Chart object." + }, + "extra": { + "type": "object", + "title": "Extra", + "description": "Extra info." + } + }, + "type": "object", + "title": "OBBject[EquityInfo]", + "description": "OBBject with results of type 'EquityInfo'." + }, "OBBject_List_EquityNBBO__": { "properties": { "_id": { @@ -36394,6 +39588,75 @@ "title": "OBBject[IndexConstituents]", "description": "OBBject with results of type 'IndexConstituents'." }, + "OBBject_List_IndexHistorical__": { + "properties": { + "_id": { + "type": "string", + "title": " Id" + }, + "results": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/IndexHistorical" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Results", + "description": "Serializable results." + }, + "provider": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Provider", + "description": "Provider name." + }, + "warnings": { + "anyOf": [ + { + "items": { + "$ref": "#/components/schemas/Warning_" + }, + "type": "array" + }, + { + "type": "null" + } + ], + "title": "Warnings", + "description": "List of warnings." + }, + "chart": { + "anyOf": [ + { + "$ref": "#/components/schemas/Chart" + }, + { + "type": "null" + } + ], + "description": "Chart object." + }, + "extra": { + "type": "object", + "title": "Extra", + "description": "Extra info." + } + }, + "type": "object", + "title": "OBBject[IndexHistorical]", + "description": "OBBject with results of type 'IndexHistorical'." + }, "OBBject_List_InsiderTrading__": { "properties": { "_id": { @@ -38821,11 +42084,6 @@ }, "OptionsChains": { "properties": { - "contract_symbol": { - "type": "string", - "title": "openbb", - "description": "Contract symbol for the option. " - }, "symbol": { "anyOf": [ { @@ -38836,7 +42094,25 @@ } ], "title": "openbb", - "description": "Symbol representing the entity requested in the data. Here its the underlying symbol for the option. " + "description": "Symbol representing the entity requested in the data. Here, it is the underlying symbol for the option. " + }, + "contract_symbol": { + "type": "string", + "title": "openbb", + "description": "Contract symbol for the option. " + }, + "eod_date": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Date for which the options chains are returned. " }, "expiration": { "type": "string", @@ -38854,59 +42130,22 @@ "title": "openbb", "description": "Call or Put. " }, - "eod_date": { + "open_interest": { "anyOf": [ { - "type": "string", - "format": "date" + "type": "integer" }, { "type": "null" } ], "title": "openbb", - "description": "Date for which the options chains are returned. " - }, - "close": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "The close price. " - }, - "close_bid": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "The closing bid price for the option that day. " - }, - "close_ask": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "The closing ask price for the option that day. " + "description": "Open interest on the contract. " }, "volume": { "anyOf": [ { - "type": "number" + "type": "integer" }, { "type": "null" @@ -38915,6 +42154,102 @@ "title": "openbb", "description": "The trading volume. " }, + "theoretical_price": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Theoretical value of the option. " + }, + "last_trade_price": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Last trade price of the option. " + }, + "tick": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Whether the last tick was up or down in price. " + }, + "bid": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Current bid price for the option. " + }, + "bid_size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Bid size for the option. " + }, + "ask": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Current ask price for the option. " + }, + "ask_size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Ask size for the option. " + }, + "mark": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The mid-price between the latest bid and ask. " + }, "open": { "anyOf": [ { @@ -38951,18 +42286,6 @@ "title": "openbb", "description": "The opening ask price for the option that day. " }, - "open_interest": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "Open interest on the contract. " - }, "high": { "anyOf": [ { @@ -38975,54 +42298,6 @@ "title": "openbb", "description": "The high price. " }, - "low": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "The low price. " - }, - "mark": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "The mid-price between the latest bid-ask spread. " - }, - "ask_high": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "The highest ask price for the option that day. " - }, - "ask_low": { - "anyOf": [ - { - "type": "number" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "The lowest ask price for the option that day. " - }, "bid_high": { "anyOf": [ { @@ -39035,6 +42310,30 @@ "title": "openbb", "description": "The highest bid price for the option that day. " }, + "ask_high": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The highest ask price for the option that day. " + }, + "low": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The low price. " + }, "bid_low": { "anyOf": [ { @@ -39047,6 +42346,165 @@ "title": "openbb", "description": "The lowest bid price for the option that day. " }, + "ask_low": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The lowest ask price for the option that day. " + }, + "close": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The close price. " + }, + "close_size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The closing trade size for the option that day. " + }, + "close_time": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The time of the closing price for the option that day. " + }, + "close_bid": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The closing bid price for the option that day. " + }, + "close_bid_size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The closing bid size for the option that day. " + }, + "close_bid_time": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The time of the bid closing price for the option that day. " + }, + "close_ask": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The closing ask price for the option that day. " + }, + "close_ask_size": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The closing ask size for the option that day. " + }, + "close_ask_time": { + "anyOf": [ + { + "type": "string", + "format": "date-time" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The time of the ask closing price for the option that day. " + }, + "prev_close": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "" + }, + "change": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The change in the price of the option. " + }, + "change_percent": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Change, in normalizezd percentage points, of the option. " + }, "implied_volatility": { "anyOf": [ { @@ -39106,6 +42564,30 @@ ], "title": "openbb", "description": "Vega of the option. " + }, + "rho": { + "anyOf": [ + { + "type": "number" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "Rho of the option. " + }, + "exercise_style": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "intrinio", + "description": "The exercise style of the option, American or European. (provider: intrinio)" } }, "additionalProperties": true, @@ -39705,6 +43187,232 @@ "title": "openbb", "description": "News base URL of the price target. " }, + "action_company": { + "type": "string", + "enum": [ + "Downgrades", + "Maintains", + "Reinstates", + "Reiterates", + "Upgrades", + "Assumes", + "Initiates Coverage On", + "Terminates Coverage On", + "Removes", + "Suspends", + "Firm Dissolved", + "" + ], + "title": "benzinga", + "description": "Description of the change in rating from firm's last rating.Note that all of these terms are precisely defined. (provider: benzinga)" + }, + "action_pt": { + "type": "string", + "enum": [ + "Announces", + "Maintains", + "Lowers", + "Raises", + "Removes", + "Adjusts", + "" + ], + "title": "benzinga", + "description": "Description of the change in price target from firm's last price target. (provider: benzinga)" + }, + "adjusted_pt_prior": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Analyst's prior price target, adjusted to account for stock splits and stock dividends. If none are applicable, the pt_prior value is used. (provider: benzinga)" + }, + "analyst_id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Id of the analyst. (provider: benzinga)" + }, + "currency": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Currency the data is denominated in. (provider: benzinga)" + }, + "exchange": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Exchange of the price target. (provider: benzinga)" + }, + "id": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Unique ID of this entry. (provider: benzinga)" + }, + "importance": { + "anyOf": [ + { + "type": "integer", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5 + ] + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Subjective Basis of How Important Event is to Market. 5 = High (provider: benzinga)" + }, + "notes": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Notes of the price target. (provider: benzinga)" + }, + "pt_prior": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Analyst's prior price target. (provider: benzinga)" + }, + "rating_current": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "The analyst's rating for the company. (provider: benzinga)" + }, + "rating_prior": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Prior analyst rating for the company. (provider: benzinga)" + }, + "ratings_accuracy": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Ratings accuracy of the price target. (provider: benzinga)" + }, + "time": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Last updated timestamp, UTC. (provider: benzinga)" + }, + "updated": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Last updated timestamp, UTC. (provider: benzinga)" + }, + "url": { + "type": "string", + "title": "benzinga", + "description": "URL for analyst ratings page for this ticker on Benzinga.com. (provider: benzinga)" + }, + "url_calendar": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "URL for analyst ratings page for this ticker on Benzinga.com. (provider: benzinga)" + }, + "name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "benzinga", + "description": "Name of company that is subject of rating. (provider: benzinga)" + }, "new_grade": { "anyOf": [ { @@ -39849,11 +43557,48 @@ }, "RevenueBusinessLine": { "properties": { - "date": { + "period_ending": { "type": "string", "format": "date", "title": "openbb", - "description": "The date of the data. " + "description": "The end date of the reporting period. " + }, + "fiscal_period": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The fiscal period of the reporting period. " + }, + "fiscal_year": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The fiscal year of the reporting period. " + }, + "filing_date": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The filing date of the report. " }, "business_line": { "additionalProperties": { @@ -39861,24 +43606,61 @@ }, "type": "object", "title": "openbb", - "description": "Day level data containing the revenue of the business line. " + "description": "Dictionary containing the revenue of the business line. " } }, "additionalProperties": true, "type": "object", "required": [ - "date", + "period_ending", "business_line" ], "title": "RevenueBusinessLine" }, "RevenueGeographic": { "properties": { - "date": { + "period_ending": { "type": "string", "format": "date", "title": "openbb", - "description": "The date of the data. " + "description": "The end date of the reporting period. " + }, + "fiscal_period": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The fiscal period of the reporting period. " + }, + "fiscal_year": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The fiscal year of the reporting period. " + }, + "filing_date": { + "anyOf": [ + { + "type": "string", + "format": "date" + }, + { + "type": "null" + } + ], + "title": "openbb", + "description": "The filing date of the report. " }, "geographic_segment": { "additionalProperties": { @@ -39886,73 +43668,13 @@ }, "type": "object", "title": "openbb", - "description": "Day level data containing the revenue of the geographic segment. " - }, - "americas": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "Revenue from the the American segment. " - }, - "europe": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "Revenue from the the European segment. " - }, - "greater_china": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "Revenue from the the Greater China segment. " - }, - "japan": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "Revenue from the the Japan segment. " - }, - "rest_of_asia_pacific": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "title": "openbb", - "description": "Revenue from the the Rest of Asia Pacific segment. " + "description": "Dictionary of the revenue by geographic segment. " } }, "additionalProperties": true, "type": "object", "required": [ - "date", + "period_ending", "geographic_segment" ], "title": "RevenueGeographic" @@ -41289,13 +45011,20 @@ "description": "Title of the news. " }, "images": { - "items": { - "additionalProperties": { - "type": "string" + "anyOf": [ + { + "items": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "type": "array" }, - "type": "object" - }, - "type": "array", + { + "type": "null" + } + ], "title": "openbb", "description": "Images associated with the news. " }, diff --git a/website/content/excel/templates.mdx b/website/content/excel/templates.mdx index d63e1c84264..168fdf7d2c5 100644 --- a/website/content/excel/templates.mdx +++ b/website/content/excel/templates.mdx @@ -1,7 +1,7 @@ --- title: Templates sidebar_position: 4 -description: OpenBB Excel Add-In offered by OpenBB. These templates are designed to help you perform a variety of tasks, from equity analysis to economic analysis. They can be used as-is or customized to suit your needs. +description: OpenBB Add-In for Excel offered by OpenBB. These templates are designed to help you perform a variety of tasks, from equity analysis to economic analysis. They can be used as-is or customized to suit your needs. keywords: - Microsoft Excel - Add-in @@ -14,7 +14,7 @@ import HeadTitle from '@site/src/components/General/HeadTitle.tsx'; -OpenBB Excel Add-In offered by OpenBB. These templates are designed to help you perform a variety of tasks, from equity analysis to economic analysis. They can be used as-is or customized to suit your needs. +OpenBB Add-In for Excel offered by OpenBB. These templates are designed to help you perform a variety of tasks, from equity analysis to economic analysis. They can be used as-is or customized to suit your needs. These can be downloaded in the [OpenBB Hub](https://my.openbb.co). diff --git a/website/content/pro/main-menu/data-connectors/integrate-your-own-backend.md b/website/content/pro/main-menu/data-connectors/integrate-your-own-backend.md index e701f4295df..a315d7206f9 100644 --- a/website/content/pro/main-menu/data-connectors/integrate-your-own-backend.md +++ b/website/content/pro/main-menu/data-connectors/integrate-your-own-backend.md @@ -55,4 +55,3 @@ The language-agnostic API approach offers flexibility by allowing you to use the ### Quick Start with Python and FastAPI Our team has created several examples that you can use to quickly get started with Python and FastAPI. For more information, check [this open source repository](https://github.com/OpenBB-finance/backend-for-terminal-pro/tree/main) for examples. -e diff --git a/website/generate_excel_markdown.py b/website/generate_excel_markdown.py index 90ae11d0953..f7c38e0ef7e 100644 --- a/website/generate_excel_markdown.py +++ b/website/generate_excel_markdown.py @@ -33,6 +33,9 @@ class CommandLib: # These examples will be generated in the core, but we keep them here meanwhile EXAMPLE_PARAMS: Dict[str, Dict] = { + "/byod": { + "widget": '"widget_name"', + }, "crypto": { "symbol": '"BTCUSD"', "start_date": '"2023-01-01"', @@ -200,7 +203,12 @@ class CommandLib: def _get_data(self, cmd: str) -> dict: """Get the data of the command from the openapi.""" - model = self.openapi["paths"][f"/api/v1{cmd}"]["get"]["model"] + model = ( + self.openapi.get("paths", {}) + .get(f"/api/v1{cmd}", {}) + .get("get", {}) + .get("model") + ) if model: schema = self.openapi["components"]["schemas"][model]["properties"] data = {} @@ -324,53 +332,58 @@ class Editor: return description def get_syntax() -> str: - sig = cmd_info["signature"] - syntax = "## Syntax\n\n" - syntax += f"```{self.interface} wordwrap\n" - syntax += f"{sig}\n" - syntax += "```\n\n" - return syntax + if sig := cmd_info["signature"]: + syntax = "## Syntax\n\n" + syntax += f"```{self.interface} wordwrap\n" + syntax += f"{sig}\n" + syntax += "```\n\n" + return syntax + return "" def get_parameters() -> str: - parameters = "## Parameters\n\n" - parameters += "| Name | Type | Description | Required |\n" - parameters += "| ---- | ---- | ----------- | -------- |\n" - for field_name, field_info in cmd_info["parameters"].items(): - name = field_name - type_ = field_info["type"] - description = field_info["description"] - required = field_info["required"] - required_str = str(required).title() - if required: - parameters += f"| **{name}** | **{type_}** | **{description}** | **{required_str}** |\n" - else: - parameters += ( - f"| {name} | {type_} | {description} | {required_str} |\n" - ) - - parameters += "\n" - return parameters + if parameter_schema := cmd_info["parameters"]: + parameters = "## Parameters\n\n" + parameters += "| Name | Type | Description | Required |\n" + parameters += "| ---- | ---- | ----------- | -------- |\n" + for field_name, field_info in parameter_schema.items(): + name = field_name + type_ = field_info["type"] + description = field_info["description"] + required = field_info["required"] + required_str = str(required).title() + if required: + parameters += f"| **{name}** | **{type_}** | **{description}** | **{required_str}** |\n" + else: + parameters += ( + f"| {name} | {type_} | {description} | {required_str} |\n" + ) + parameters += "\n" + return parameters + return "" def get_return_data() -> str: - data = "## Return Data\n\n" - data += "| Name | Description |\n" - data += "| ---- | ----------- |\n" - for field_name, field_info in cmd_info["data"].items(): - name = field_name - description = field_info["description"] - data += f"| {name} | {description} |\n" - return data + if data_schema := cmd_info["data"]: + data = "## Return Data\n\n" + data += "| Name | Description |\n" + data += "| ---- | ----------- |\n" + for field_name, field_info in data_schema.items(): + name = field_name + description = field_info["description"] + data += f"| {name} | {description} |\n" + return data + return "" def get_examples() -> str: - examples = "### Example\n\n" + if cmd_examples := cmd_info["examples"]: + examples = "### Example\n\n" + for _, v in cmd_examples.items(): + # examples += f"### {k}\n\n" + examples += f"```{self.interface} wordwrap\n" + examples += f"{v}\n" + examples += "```\n\n" - for _, v in cmd_info["examples"].items(): - # examples += f"### {k}\n\n" - examples += f"```{self.interface} wordwrap\n" - examples += f"{v}\n" - examples += "```\n\n" - - return examples + return examples + return "" content = get_header() content += get_head_title() diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index 844d4d31066..06246ef609d 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -53,10 +53,10 @@ export default function Home(): JSX.Element { className="!bg-grey-900 bg-[url('/img/excelbg.png')] bg-no-repeat shadow-sm group !no-underline text-white dark:hover:border-white hover:border-grey-600/80 relative w-full h-[238px] max-w-full p-8 rounded flex flex-col items-start justify-start border border-grey-300 hover:!text-white" >

- OpenBB Excel Add-In + OpenBB Add-In for Excel

- The OpenBB Excel Add-In allows access to the same data as the OpenBB Terminal Pro, but through Excel. + The OpenBB Add-In for Excel allows access to the same data as the OpenBB Terminal Pro, but through Excel.

Date: Mon, 5 Feb 2024 11:53:00 -0800 Subject: [PATCH 2/7] Feature/ex-dividend: Renames "date" columns as "ex_dividend_date" for Dividend Calendar and Historical Dividends (#6006) * date -> ex_dividend_date * nasdaq historical dividends * black * pylint * intrinio alias_dict * dividend_currency -> currency * yfinance field name --------- Co-authored-by: Igor Radovanovic <74266147+IgorWounds@users.noreply.github.com> --- .../standard_models/calendar_dividend.py | 6 +- .../standard_models/historical_dividends.py | 7 +- .../equity/integration/test_equity_api.py | 8 + .../equity/integration/test_equity_python.py | 8 + .../openbb_fmp/models/calendar_dividend.py | 3 +- .../openbb_fmp/models/historical_dividends.py | 8 +- .../models/historical_dividends.py | 17 +- .../nasdaq/openbb_nasdaq/__init__.py | 2 + .../openbb_nasdaq/models/calendar_dividend.py | 11 +- .../models/historical_dividends.py | 156 ++++++++++++++++++ ...t_nasdaq_historical_dividends_fetcher.yaml | 100 +++++++++++ .../nasdaq/tests/test_nasdaq_fetchers.py | 10 ++ .../models/historical_dividends.py | 4 +- 13 files changed, 323 insertions(+), 17 deletions(-) create mode 100644 openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py create mode 100644 openbb_platform/providers/nasdaq/tests/record/http/test_nasdaq_fetchers/test_nasdaq_historical_dividends_fetcher.yaml diff --git a/openbb_platform/core/openbb_core/provider/standard_models/calendar_dividend.py b/openbb_platform/core/openbb_core/provider/standard_models/calendar_dividend.py index b19fa036ca7..83790431c74 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/calendar_dividend.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/calendar_dividend.py @@ -27,12 +27,12 @@ class CalendarDividendQueryParams(QueryParams): class CalendarDividendData(Data): """Dividend Calendar Data.""" - date: dateType = Field( - description=DATA_DESCRIPTIONS.get("date", "") + " (Ex-Dividend)" + ex_dividend_date: dateType = Field( + description="The ex-dividend date - the date on which the stock begins trading without rights to the dividend." ) symbol: str = Field(description=DATA_DESCRIPTIONS.get("symbol", "")) amount: Optional[float] = Field( - default=None, description="Dividend amount, per-share." + default=None, description="The dividend amount per share." ) name: Optional[str] = Field(default=None, description="Name of the entity.") record_date: Optional[dateType] = Field( diff --git a/openbb_platform/core/openbb_core/provider/standard_models/historical_dividends.py b/openbb_platform/core/openbb_core/provider/standard_models/historical_dividends.py index 6e9a4e5ed74..7addeee360c 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/historical_dividends.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/historical_dividends.py @@ -8,7 +8,6 @@ from pydantic import Field, field_validator from openbb_core.provider.abstract.data import Data from openbb_core.provider.abstract.query_params import QueryParams from openbb_core.provider.utils.descriptions import ( - DATA_DESCRIPTIONS, QUERY_DESCRIPTIONS, ) @@ -35,5 +34,7 @@ class HistoricalDividendsQueryParams(QueryParams): class HistoricalDividendsData(Data): """Historical Dividends Data.""" - date: dateType = Field(description=DATA_DESCRIPTIONS.get("date", "")) - dividend: float = Field(description="Dividend of the historical dividends.") + ex_dividend_date: dateType = Field( + description="The ex-dividend date - the date on which the stock begins trading without rights to the dividend." + ) + amount: float = Field(description="The dividend amount per share.") diff --git a/openbb_platform/extensions/equity/integration/test_equity_api.py b/openbb_platform/extensions/equity/integration/test_equity_api.py index 6afa8577124..9ec9e781119 100644 --- a/openbb_platform/extensions/equity/integration/test_equity_api.py +++ b/openbb_platform/extensions/equity/integration/test_equity_api.py @@ -313,6 +313,14 @@ def test_equity_fundamental_historical_splits(params, headers): "provider": "fmp", } ), + ( + { + "symbol": "AAPL", + "start_date": "2021-01-01", + "end_date": "2023-06-06", + "provider": "nasdaq", + } + ), ( { "symbol": "AAPL", diff --git a/openbb_platform/extensions/equity/integration/test_equity_python.py b/openbb_platform/extensions/equity/integration/test_equity_python.py index 1990dce553f..2e866217ef2 100644 --- a/openbb_platform/extensions/equity/integration/test_equity_python.py +++ b/openbb_platform/extensions/equity/integration/test_equity_python.py @@ -290,6 +290,14 @@ def test_equity_fundamental_historical_splits(params, obb): "provider": "fmp", } ), + ( + { + "symbol": "AAPL", + "start_date": "2021-01-01", + "end_date": "2023-06-06", + "provider": "nasdaq", + } + ), ( { "symbol": "AAPL", diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/calendar_dividend.py b/openbb_platform/providers/fmp/openbb_fmp/models/calendar_dividend.py index da8eb137e7b..a0ba0f63f00 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/calendar_dividend.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/calendar_dividend.py @@ -30,6 +30,7 @@ class FMPCalendarDividendData(CalendarDividendData): __alias_dict__ = { "amount": "dividend", + "ex_dividend_date": "date", "record_date": "recordDate", "payment_date": "paymentDate", "declaration_date": "declarationDate", @@ -45,7 +46,7 @@ class FMPCalendarDividendData(CalendarDividendData): ) @field_validator( - "date", + "ex_dividend_date", "record_date", "payment_date", "declaration_date", diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/historical_dividends.py b/openbb_platform/providers/fmp/openbb_fmp/models/historical_dividends.py index bfd7ac6b1a3..7e7c1dea0c0 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/historical_dividends.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/historical_dividends.py @@ -27,6 +27,11 @@ class FMPHistoricalDividendsQueryParams(HistoricalDividendsQueryParams): class FMPHistoricalDividendsData(HistoricalDividendsData): """FMP Historical Dividends Data.""" + __alias_dict__ = { + "ex_dividend_date": "date", + "amount": "dividend", + } + label: str = Field(description="Label of the historical dividends.") adj_dividend: float = Field( description="Adjusted dividend of the historical dividends." @@ -48,6 +53,7 @@ class FMPHistoricalDividendsData(HistoricalDividendsData): "declaration_date", "record_date", "payment_date", + "ex_dividend_date", mode="before", check_fields=False, ) @@ -99,7 +105,7 @@ class FMPHistoricalDividendsFetcher( query: FMPHistoricalDividendsQueryParams, data: List[Dict], **kwargs: Any ) -> List[FMPHistoricalDividendsData]: """Return the transformed data.""" - result = [] + result: List[FMPHistoricalDividendsData] = [] for d in data: if "date" in d: dt = parser.parse(str(d["date"])).date() diff --git a/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_dividends.py b/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_dividends.py index 1def57e15ea..4d0b95c5d3e 100644 --- a/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_dividends.py +++ b/openbb_platform/providers/intrinio/openbb_intrinio/models/historical_dividends.py @@ -33,16 +33,25 @@ class IntrinioHistoricalDividendsQueryParams(HistoricalDividendsQueryParams): class IntrinioHistoricalDividendsData(HistoricalDividendsData): """Intrinio Historical Dividends Data.""" - factor: float = Field( + __alias_dict__ = { + "ex_dividend_date": "date", + "amount": "dividend", + "currency": "dividend_currency", + } + + factor: Optional[float] = Field( + default=None, description=( "factor by which to multiply stock prices before this date, " "in order to calculate historically-adjusted stock prices." ), ) - dividend_currency: Optional[str] = Field( - default=None, description="The currency of the dividend." + currency: Optional[str] = Field( + default=None, + description="The currency in which the dividend is paid.", ) - split_ratio: float = Field( + split_ratio: Optional[float] = Field( + default=None, description="The ratio of the stock split, if a stock split occurred.", ) diff --git a/openbb_platform/providers/nasdaq/openbb_nasdaq/__init__.py b/openbb_platform/providers/nasdaq/openbb_nasdaq/__init__.py index 1795171cb17..ffa9192ebe7 100644 --- a/openbb_platform/providers/nasdaq/openbb_nasdaq/__init__.py +++ b/openbb_platform/providers/nasdaq/openbb_nasdaq/__init__.py @@ -8,6 +8,7 @@ from openbb_nasdaq.models.cot import NasdaqCotFetcher from openbb_nasdaq.models.cot_search import NasdaqCotSearchFetcher from openbb_nasdaq.models.economic_calendar import NasdaqEconomicCalendarFetcher from openbb_nasdaq.models.equity_search import NasdaqEquitySearchFetcher +from openbb_nasdaq.models.historical_dividends import NasdaqHistoricalDividendsFetcher from openbb_nasdaq.models.lbma_fixing import NasdaqLbmaFixingFetcher from openbb_nasdaq.models.sp500_multiples import NasdaqSP500MultiplesFetcher from openbb_nasdaq.models.top_retail import NasdaqTopRetailFetcher @@ -27,6 +28,7 @@ unmatched technology, insights and markets expertise.""", "COTSearch": NasdaqCotSearchFetcher, "EconomicCalendar": NasdaqEconomicCalendarFetcher, "EquitySearch": NasdaqEquitySearchFetcher, + "HistoricalDividends": NasdaqHistoricalDividendsFetcher, "LbmaFixing": NasdaqLbmaFixingFetcher, "SP500Multiples": NasdaqSP500MultiplesFetcher, "TopRetail": NasdaqTopRetailFetcher, diff --git a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/calendar_dividend.py b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/calendar_dividend.py index c1d16980394..1e96673b9d2 100644 --- a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/calendar_dividend.py +++ b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/calendar_dividend.py @@ -1,5 +1,6 @@ """Nasdaq Dividend Calendar Model.""" +# pylint: disable=unused-argument from concurrent.futures import ThreadPoolExecutor from datetime import datetime, timedelta from typing import Any, Dict, List, Optional @@ -26,7 +27,7 @@ class NasdaqCalendarDividendData(CalendarDividendData): __alias_dict__ = { "name": "companyName", - "date": "dividend_Ex_Date", + "ex_dividend_date": "dividend_Ex_Date", "payment_date": "payment_Date", "record_date": "record_Date", "declaration_date": "announcement_Date", @@ -40,13 +41,14 @@ class NasdaqCalendarDividendData(CalendarDividendData): ) @field_validator( - "date", + "ex_dividend_date", "record_date", "payment_date", "declaration_date", mode="before", check_fields=False, ) + @classmethod def validate_date(cls, v: str): v = v.replace("N/A", "") return datetime.strptime(v, "%m/%d/%Y").date() if v else None @@ -115,4 +117,7 @@ class NasdaqCalendarDividendFetcher( **kwargs: Any, # pylint: disable=unused-argument ) -> List[NasdaqCalendarDividendData]: """Return the transformed data.""" - return [NasdaqCalendarDividendData.model_validate(d) for d in data] + return [ + NasdaqCalendarDividendData.model_validate(d) + for d in sorted(data, key=lambda x: x["dividend_Ex_Date"], reverse=True) + ] diff --git a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py new file mode 100644 index 00000000000..3754a92964c --- /dev/null +++ b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/historical_dividends.py @@ -0,0 +1,156 @@ +"""Nasdaq Historical Dividends Model.""" + +# pylint: disable=unused-argument +import asyncio +import warnings +from datetime import ( + date as dateType, + datetime, +) +from typing import Any, Dict, List, Optional + +from dateutil import parser +from openbb_core.provider.abstract.fetcher import Fetcher +from openbb_core.provider.standard_models.historical_dividends import ( + HistoricalDividendsData, + HistoricalDividendsQueryParams, +) +from openbb_core.provider.utils.errors import EmptyDataError +from openbb_core.provider.utils.helpers import amake_request +from openbb_nasdaq.utils.helpers import IPO_HEADERS +from pydantic import Field, field_validator + +_warn = warnings.warn + + +class NasdaqHistoricalDividendsQueryParams(HistoricalDividendsQueryParams): + """Nasdaq Historical Dividends Query Params.""" + + +class NasdaqHistoricalDividendsData(HistoricalDividendsData): + """Nasdaq Historical Dividends Data.""" + + __alias_dict__ = { + "ex_dividend_date": "exOrEffDate", + "declaration_date": "declarationDate", + "record_date": "recordDate", + "payment_date": "paymentDate", + "dividend_type": "type", + } + + dividend_type: Optional[str] = Field( + default=None, + description="The type of dividend - i.e., cash, stock.", + ) + currency: Optional[str] = Field( + default=None, + description="The currency in which the dividend is paid.", + ) + record_date: Optional[dateType] = Field( + default=None, + description="The record date of ownership for eligibility.", + ) + payment_date: Optional[dateType] = Field( + default=None, + description="The payment date of the dividend.", + ) + declaration_date: Optional[dateType] = Field( + default=None, + description="Declaration date of the dividend.", + ) + + @field_validator( + "ex_dividend_date", + "declaration_date", + "record_date", + "payment_date", + mode="before", + check_fields=False, + ) + @classmethod + def validate_date(cls, v: str): + """Validate the date if available is a date object.""" + v = v.replace("N/A", "") + if not v: + return None + return datetime.strptime(v, "%m/%d/%Y").date().strftime("%Y-%m-%d") + + @field_validator("amount", mode="before", check_fields=False) + @classmethod + def validate_amount(cls, v: str): + """Validate the amount if available is a float.""" + v = v.replace("$", "").replace("N/A", "") + if not v: + return None + return float(v) + + +class NasdaqHistoricalDividendsFetcher( + Fetcher[NasdaqHistoricalDividendsQueryParams, List[NasdaqHistoricalDividendsData]] +): + """Nasdaq Historical Dividends Fetcher.""" + + @staticmethod + def transform_query(params: Dict[str, Any]) -> NasdaqHistoricalDividendsQueryParams: + """Transform the params to the provider-specific query.""" + return NasdaqHistoricalDividendsQueryParams(**params) + + @staticmethod + async def aextract_data( + query: NasdaqHistoricalDividendsQueryParams, + credentials: Optional[Dict[str, str]], + **kwargs: Any, + ) -> List[Dict]: + """Extract the raw data.""" + results = [] + symbols = query.symbol.split(",") + + async def get_one(symbol): + """Response Callback.""" + data = [] + asset_class = "stocks" + url = f"https://api.nasdaq.com/api/quote/{symbol}/dividends?assetclass={asset_class}" + + response = await amake_request( + url, + headers=IPO_HEADERS, + ) + if response.get("status").get("rCode") == 400: + response = await amake_request( + url.replace("stocks", "etf"), + headers=IPO_HEADERS, + ) + if response.get("status").get("rCode") == 200: + data = response.get("data").get("dividends").get("rows") + + if data: + if len(symbols) > 1: + for d in data: + d["symbol"] = symbol + results.extend(data) + if not data: + _warn(f"No data found for {symbol}") + + tasks = [get_one(symbol) for symbol in symbols] + + await asyncio.gather(*tasks) + if results: + return results + raise EmptyDataError() + + @staticmethod + def transform_data( + query: NasdaqHistoricalDividendsQueryParams, + data: List[Dict], + **kwargs: Any, + ) -> List[NasdaqHistoricalDividendsData]: + """Return the transformed data.""" + results: List[NasdaqHistoricalDividendsData] = [] + for d in data: + dt = parser.parse(str(d["exOrEffDate"])).date() + if query.start_date and query.start_date > dt: + continue + if query.end_date and query.end_date < dt: + continue + results.append(NasdaqHistoricalDividendsData(**d)) + return results diff --git a/openbb_platform/providers/nasdaq/tests/record/http/test_nasdaq_fetchers/test_nasdaq_historical_dividends_fetcher.yaml b/openbb_platform/providers/nasdaq/tests/record/http/test_nasdaq_fetchers/test_nasdaq_historical_dividends_fetcher.yaml new file mode 100644 index 00000000000..e75da76b7cb --- /dev/null +++ b/openbb_platform/providers/nasdaq/tests/record/http/test_nasdaq_fetchers/test_nasdaq_historical_dividends_fetcher.yaml @@ -0,0 +1,100 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json, text/plain, */* + Accept-Encoding: + - gzip + Accept-Language: + - en-CA,en-US;q=0.7,en;q=0.3 + Connection: + - keep-alive + Host: + - api.nasdaq.com + Origin: + - https://www.nasdaq.com + Referer: + - https://www.nasdaq.com/ + method: GET + uri: https://api.nasdaq.com/api/quote/AAPL/dividends?assetclass=stocks + response: + body: + string: !!binary | + H4sIAAAAAAAAAK2aTW/jNhCG/0ogtDfXJilRlnILNln00u5iuy1QFHvQxko3gGMH/kiTLvzfq6E5 + tFQNlfFEp8Qa8tWTmdekRsz3ZFHtquTye7K4f7pf1KvFz3W1qDd/VMt9vU0u//qeLKuv9TK5TG6e + f7r2Yy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fMBDS8DMY74wigiWfQ + nJNB7Iy1lQDi2xk3m+xJXITuSVyI3RnLAMGDmgQM62sfMGzTPEDfGQsBs1gGw/pKAOI2zQM0rBJn + 8Z4kAmiiJQ7bNAsQG2OdSQBdFXF2by8Okb4HUwyx+2IZIEw1JGBY7PqAYZvmAfq+eBAwnZoy6sGU + BsTFjgDEbZoHaBglTqevvJwhAE20xGGbZgEGDw69Ro8C4htCTZ6UaIxE+mLuSYkqxIDgwZQEDH0x + fVJi+YD+1ccgoJnm8RJHAE00g6Ht5B5ENHuBLsvhdVDTC/WvsyuitifBLtlxNOshPx8TqSMoQ7Lw + zDEmUltQhuS+yWMitQVFSPDdLUBheEc4y0snQbGX7JhIHUGxl+ajIrUFpV5S4yK1BcVeKkFh+AT3 + PC8FwbetS2MhdQTFXipGRWoLitclMypSW1DqpVSBwvBJ7FleOgmKvTQfE6kjKEPK4e3YmEhtQbGX + slGR2oJv2+OGT1QFe1z/JPUML5VjInUExeuSGhWpLSj2kh0VqS0o9pJb/4fPRc/zUhCUeumY51eQ + 9BleOgmKvaRHRWoLir3EKRwfyby1cFB6WP+L4fNNPlJHUOwlzUBS53hJvw3JwlunMZHagmIvcQrH + RzJvLRy28MXwOSUfqSPIQfpyOEySh3q7rf6u8f+Ot7tqt3f/drx5t140l41Sk+Qr/P5Ld+SifqqX + 68d607l+OPwHWZhG6SguAAA= + headers: + Access-Control-Allow-Origin: + - https://www.nasdaq.com + Cache-Control: + - max-age=0, no-cache, no-store + Connection: + - keep-alive + Content-Encoding: + - gzip + Content-Length: + - '1442' + Content-Type: + - application/json; charset=utf-8 + Date: + - Sun, 28 Jan 2024 01:33:24 GMT + Expires: + - Sun, 28 Jan 2024 01:33:24 GMT + Pragma: + - no-cache + Server: + - Kestrel + Set-Cookie: + - ak_bmsc=D814B8E13C27CB46A5C31FDFF508A2DD~000000000000000000000000000000~YAAQD6MAF7gsfjqNAQAAxSqzTRYZaYQlf5VY/MEzu8m19srQM7M9z1C2q6lrQDVzNdGuUnQhAXdlZrf9cpvIHkanLPt8/S1r1fV1+jMw1z21kB2SXFtsBaUB9zq1a2Gi2OcyyB0u/2EucnGGJfAYzP47lQBxwelZzIo/rhrp1sx/uaimm0ih8TaPsfUrRSRqgLI9GVbAgA1sLlDBvsbDPNRuKDNGz3eAI5NtmG85P3Du5dS2izz5X3RxSm3Ld07nD1zOVpBoUJkFfIuSQrQFQkOxBwAd8mpAyEHbfjnNNkqLGWw58zBG1S8taYPNX0bzy0qubakjMBD/pSn8tLinbEbtm+N9nQ5aiwCFmSMFuTgg8H37QFgnf5026avJvNLbNd8PU6RrgH9/dN5LKUT8WdrFtC2N6Q==; + Domain=.nasdaq.com; Path=/; Expires=Sun, 28 Jan 2024 03:33:24 GMT; Max-Age=7200; + HttpOnly + Strict-Transport-Security: + - max-age=86400 + Vary: + - Accept-Encoding + X-EdgeConnect-MidMile-RTT: + - '0' + - '43' + - '0' + - '3' + X-EdgeConnect-Origin-MEX-Latency: + - '49' + - '49' + - '49' + - '49' + gid: + - '203' + lang: + - en + rid: + - e93e6a09-7709-403a-aaa8-208566eb1d7a + srctype: + - default + status: + code: 200 + message: OK +version: 1 diff --git a/openbb_platform/providers/nasdaq/tests/test_nasdaq_fetchers.py b/openbb_platform/providers/nasdaq/tests/test_nasdaq_fetchers.py index 481eb18bbe3..095763d5015 100644 --- a/openbb_platform/providers/nasdaq/tests/test_nasdaq_fetchers.py +++ b/openbb_platform/providers/nasdaq/tests/test_nasdaq_fetchers.py @@ -9,6 +9,7 @@ from openbb_nasdaq.models.cot import NasdaqCotFetcher from openbb_nasdaq.models.cot_search import NasdaqCotSearchFetcher from openbb_nasdaq.models.economic_calendar import NasdaqEconomicCalendarFetcher from openbb_nasdaq.models.equity_search import NasdaqEquitySearchFetcher +from openbb_nasdaq.models.historical_dividends import NasdaqHistoricalDividendsFetcher from openbb_nasdaq.models.lbma_fixing import NasdaqLbmaFixingFetcher from openbb_nasdaq.models.sp500_multiples import NasdaqSP500MultiplesFetcher from openbb_nasdaq.models.top_retail import NasdaqTopRetailFetcher @@ -126,6 +127,15 @@ def test_nasdaq_calendar_earnings_fetcher(credentials=test_credentials): assert result is None +@pytest.mark.record_http +def test_nasdaq_historical_dividends_fetcher(credentials=test_credentials): + params = {"symbol": "AAPL"} + + fetcher = NasdaqHistoricalDividendsFetcher() + result = fetcher.test(params, credentials) + assert result is None + + @pytest.mark.record_http def test_nasdaq_lbma_fixing_fetcher(credentials=test_credentials): params = {"asset": "gold"} diff --git a/openbb_platform/providers/yfinance/openbb_yfinance/models/historical_dividends.py b/openbb_platform/providers/yfinance/openbb_yfinance/models/historical_dividends.py index 174ebb4dcbe..f1a29e1cd22 100644 --- a/openbb_platform/providers/yfinance/openbb_yfinance/models/historical_dividends.py +++ b/openbb_platform/providers/yfinance/openbb_yfinance/models/historical_dividends.py @@ -54,8 +54,8 @@ class YFinanceHistoricalDividendsFetcher( raise ValueError(f"No dividend data found for {symbol}") except Exception as e: raise RuntimeError(f"Error getting data for {symbol}: {e}") from e - ticker.index.name = "date" - ticker.name = "dividend" # type: ignore + ticker.index.name = "ex_dividend_date" + ticker.name = "amount" # type: ignore if query.start_date is not None: ticker = ticker[ticker.index.astype(str) >= query.start_date.strftime("%Y-%m-%d")] # type: ignore if query.end_date is not None: From 7c953d5964b1a5b5427dc2b2d188ccaed66acbdb Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:53:17 -0800 Subject: [PATCH 3/7] [BugFix] - Adds a timezone to the Unix timestamp conversion to correct localization errors. (#6023) * fix: remove specific imports * make polygon historical tz-aware * undo including that commit * that PR wasn't supposed to be there. * pylint unused argument * fix polygon crypto historical intervals * pylint * new cassette * fix the rest of the polygon historical price query params * black * pylint.. * integration test param * appease daylight savings handling * paginate for crypto currency and index * black * raise EmptyDataError when no results instead of returning an empty list * ruff --------- Co-authored-by: Diogo Sousa --- .../crypto/integration/test_crypto_api.py | 8 +- .../crypto/integration/test_crypto_python.py | 8 +- .../currency/integration/test_currency_api.py | 8 +- .../integration/test_currency_python.py | 8 +- .../index/integration/test_index_api.py | 10 +- .../index/integration/test_index_python.py | 10 +- .../models/crypto_historical.py | 106 ++++++++++++---- .../models/currency_historical.py | 106 ++++++++++++---- .../models/equity_historical.py | 18 ++- .../openbb_polygon/models/index_historical.py | 113 ++++++++++++++---- .../openbb_polygon/models/market_snapshots.py | 30 ++--- ...est_polygon_crypto_historical_fetcher.yaml | 30 ++--- ...t_polygon_currency_historical_fetcher.yaml | 26 ++-- ...test_polygon_index_historical_fetcher.yaml | 88 +++++++------- 14 files changed, 377 insertions(+), 192 deletions(-) diff --git a/openbb_platform/extensions/crypto/integration/test_crypto_api.py b/openbb_platform/extensions/crypto/integration/test_crypto_api.py index 111f9d08a0b..97ff10da864 100644 --- a/openbb_platform/extensions/crypto/integration/test_crypto_api.py +++ b/openbb_platform/extensions/crypto/integration/test_crypto_api.py @@ -71,11 +71,9 @@ def test_crypto_search(params, headers): ), ( { - "multiplier": 1, - "timespan": "minute", + "interval": "1m", "sort": "desc", "limit": 49999, - "adjusted": True, "provider": "polygon", "symbol": "BTCUSD", "start_date": "2023-01-01", @@ -84,11 +82,9 @@ def test_crypto_search(params, headers): ), ( { - "multiplier": 1, - "timespan": "day", + "interval": "1d", "sort": "desc", "limit": 49999, - "adjusted": True, "provider": "polygon", "symbol": "BTCUSD", "start_date": "2023-01-01", diff --git a/openbb_platform/extensions/crypto/integration/test_crypto_python.py b/openbb_platform/extensions/crypto/integration/test_crypto_python.py index 5a46fa9e988..e8d3ba097a5 100644 --- a/openbb_platform/extensions/crypto/integration/test_crypto_python.py +++ b/openbb_platform/extensions/crypto/integration/test_crypto_python.py @@ -65,11 +65,9 @@ def test_crypto_search(params, obb): ), ( { - "multiplier": 1, - "timespan": "minute", + "interval": "1m", "sort": "desc", "limit": 49999, - "adjusted": True, "provider": "polygon", "symbol": "BTCUSD", "start_date": "2023-01-01", @@ -78,11 +76,9 @@ def test_crypto_search(params, obb): ), ( { - "multiplier": 1, - "timespan": "day", + "interval": "1d", "sort": "desc", "limit": 49999, - "adjusted": True, "provider": "polygon", "symbol": "BTCUSD", "start_date": "2023-01-01", diff --git a/openbb_platform/extensions/currency/integration/test_currency_api.py b/openbb_platform/extensions/currency/integration/test_currency_api.py index 574fd9cac62..d5dea2303af 100644 --- a/openbb_platform/extensions/currency/integration/test_currency_api.py +++ b/openbb_platform/extensions/currency/integration/test_currency_api.py @@ -81,11 +81,9 @@ def test_currency_search(params, headers): ), ( { - "multiplier": 1, - "timespan": "minute", + "interval": "1m", "sort": "desc", "limit": 49999, - "adjusted": True, "provider": "polygon", "symbol": "EURUSD", "start_date": "2023-01-01", @@ -94,11 +92,9 @@ def test_currency_search(params, headers): ), ( { - "multiplier": 1, - "timespan": "day", + "interval": "1d", "sort": "desc", "limit": 49999, - "adjusted": True, "provider": "polygon", "symbol": "EURUSD", "start_date": "2023-01-01", diff --git a/openbb_platform/extensions/currency/integration/test_currency_python.py b/openbb_platform/extensions/currency/integration/test_currency_python.py index 223b0b1ed60..329f017eb2c 100644 --- a/openbb_platform/extensions/currency/integration/test_currency_python.py +++ b/openbb_platform/extensions/currency/integration/test_currency_python.py @@ -76,11 +76,9 @@ def test_currency_search(params, obb): ), ( { - "multiplier": 1, - "timespan": "minute", + "interval": "1m", "sort": "desc", "limit": 49999, - "adjusted": True, "provider": "polygon", "symbol": "EURUSD", "start_date": "2023-01-01", @@ -89,11 +87,9 @@ def test_currency_search(params, obb): ), ( { - "multiplier": 1, - "timespan": "day", + "interval": "1d", "sort": "desc", "limit": 49999, - "adjusted": True, "provider": "polygon", "symbol": "EURUSD", "start_date": "2023-01-01", diff --git a/openbb_platform/extensions/index/integration/test_index_api.py b/openbb_platform/extensions/index/integration/test_index_api.py index 9b811f561c1..dff0265d57a 100644 --- a/openbb_platform/extensions/index/integration/test_index_api.py +++ b/openbb_platform/extensions/index/integration/test_index_api.py @@ -90,30 +90,24 @@ def test_index_constituents(params, headers): ), ( { - "timespan": "minute", "sort": "desc", "limit": 49999, - "adjusted": True, - "multiplier": 1, + "interval": "1m", "provider": "polygon", "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", - "interval": None, } ), ( { - "timespan": "day", + "interval": "1d", "sort": "desc", "limit": 49999, - "adjusted": True, - "multiplier": 1, "provider": "polygon", "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", - "interval": None, } ), ( diff --git a/openbb_platform/extensions/index/integration/test_index_python.py b/openbb_platform/extensions/index/integration/test_index_python.py index 30e4631dbc6..600a1279d7e 100644 --- a/openbb_platform/extensions/index/integration/test_index_python.py +++ b/openbb_platform/extensions/index/integration/test_index_python.py @@ -86,30 +86,24 @@ def test_index_constituents(params, obb): ), ( { - "timespan": "minute", + "interval": "1m", "sort": "desc", "limit": 49999, - "adjusted": True, - "multiplier": 1, "provider": "polygon", "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", - "interval": None, } ), ( { - "timespan": "day", + "interval": "1d", "sort": "desc", "limit": 49999, - "adjusted": True, - "multiplier": 1, "provider": "polygon", "symbol": "NDX", "start_date": "2023-01-01", "end_date": "2023-06-06", - "interval": None, } ), ( diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py index c7ae932f62c..96f2918b4d1 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/crypto_historical.py @@ -1,5 +1,8 @@ """Polygon Crypto Historical Price Model.""" +# pylint: disable=unused-argument,protected-access,line-too-long + +import warnings from datetime import datetime from typing import Any, Dict, List, Literal, Optional @@ -10,8 +13,21 @@ from openbb_core.provider.standard_models.crypto_historical import ( CryptoHistoricalQueryParams, ) from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS -from openbb_polygon.utils.helpers import get_data_many -from pydantic import Field, PositiveInt +from openbb_core.provider.utils.errors import EmptyDataError +from openbb_core.provider.utils.helpers import ( + ClientResponse, + ClientSession, + amake_requests, +) +from pydantic import ( + Field, + PositiveInt, + PrivateAttr, + model_validator, +) +from pytz import timezone + +_warn = warnings.warn class PolygonCryptoHistoricalQueryParams(CryptoHistoricalQueryParams): @@ -20,11 +36,8 @@ class PolygonCryptoHistoricalQueryParams(CryptoHistoricalQueryParams): Source: https://polygon.io/docs/crypto/get_v2_aggs_ticker__cryptoticker__range__multiplier___timespan___from___to """ - multiplier: PositiveInt = Field( - default=1, description="Multiplier of the timespan." - ) - timespan: Literal["minute", "hour", "day", "week", "month", "quarter", "year"] = ( - Field(default="day", description="Timespan of the data.") + interval: str = Field( + default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") ) sort: Literal["asc", "desc"] = Field( default="desc", description="Sort order of the data." @@ -32,7 +45,28 @@ class PolygonCryptoHistoricalQueryParams(CryptoHistoricalQueryParams): limit: PositiveInt = Field( default=49999, description=QUERY_DESCRIPTIONS.get("limit", "") ) - adjusted: bool = Field(default=True, description="Whether the data is adjusted.") + _multiplier: PositiveInt = PrivateAttr(default=None) + _timespan: str = PrivateAttr(default=None) + + @model_validator(mode="after") + @classmethod + def get_api_interval_params(cls, values: "PolygonCryptoHistoricalQueryParams"): + """Get the multiplier and timespan parameters for the Polygon API.""" + intervals = { + "s": "second", + "m": "minute", + "h": "hour", + "d": "day", + "W": "week", + "M": "month", + "Q": "quarter", + "Y": "year", + } + + values._multiplier = int(values.interval[:-1]) + values._timespan = intervals[values.interval[-1]] + + return values class PolygonCryptoHistoricalData(CryptoHistoricalData): @@ -84,28 +118,56 @@ class PolygonCryptoHistoricalFetcher( query: PolygonCryptoHistoricalQueryParams, credentials: Optional[Dict[str, str]], **kwargs: Any, - ) -> dict: + ) -> List[Dict]: """Extract raw data from the Polygon endpoint.""" api_key = credentials.get("polygon_api_key") if credentials else "" - request_url = ( - f"https://api.polygon.io/v2/aggs/ticker/" - f"X:{query.symbol}/range/{query.multiplier}/{query.timespan}/" - f"{query.start_date}/{query.end_date}?adjusted={query.adjusted}" - f"&sort={query.sort}&limit={query.limit}&apiKey={api_key}" - ) - data = await get_data_many(request_url, "results", **kwargs) + urls = [ + ( + "https://api.polygon.io/v2/aggs/ticker/" + f"X:{symbol.upper()}/range/{query._multiplier}/{query._timespan}/" + f"{query.start_date}/{query.end_date}?" + f"&sort={query.sort}&limit={query.limit}&apiKey={api_key}" + ) + for symbol in query.symbol.split(",") + ] - for d in data: - d["t"] = datetime.fromtimestamp(d["t"] / 1000) - if query.timespan not in ["minute", "hour"]: - d["t"] = d["t"].date() + async def callback( + response: ClientResponse, session: ClientSession + ) -> List[Dict]: + data = await response.json() - return data + symbol = response.url.parts[4] + next_url = data.get("next_url", None) + results: list = data.get("results", []) + + while next_url: + url = f"{next_url}&apiKey={api_key}" + data = await session.get_json(url) + results.extend(data.get("results", [])) + next_url = data.get("next_url", None) + + for r in results: + r["t"] = datetime.fromtimestamp(r["t"] / 1000, tz=timezone("UTC")) + if query._timespan not in ["second", "minute", "hour"]: + r["t"] = r["t"].date() + else: + r["t"] = r["t"].strftime("%Y-%m-%dT%H:%M:%S%z") + if "," in query.symbol: + r["symbol"] = symbol.replace("X:", "") + + if results == []: + _warn(f"Symbol Error: No data found for {symbol.replace('X:', '')}") + + return results + + return await amake_requests(urls, callback, **kwargs) @staticmethod def transform_data( - query: PolygonCryptoHistoricalQueryParams, data: dict, **kwargs: Any + query: PolygonCryptoHistoricalQueryParams, data: List[Dict], **kwargs: Any ) -> List[PolygonCryptoHistoricalData]: """Transform the data.""" + if not data: + raise EmptyDataError() return [PolygonCryptoHistoricalData.model_validate(d) for d in data] diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py index b0b9611e1f2..4b5c0acb436 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/currency_historical.py @@ -1,5 +1,8 @@ """Polygon Currency Historical Price Model.""" +# pylint: disable=unused-argument,protected-access,line-too-long + +import warnings from datetime import datetime from typing import Any, Dict, List, Literal, Optional @@ -10,8 +13,21 @@ from openbb_core.provider.standard_models.currency_historical import ( CurrencyHistoricalQueryParams, ) from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS -from openbb_polygon.utils.helpers import get_data_many -from pydantic import Field, PositiveInt +from openbb_core.provider.utils.errors import EmptyDataError +from openbb_core.provider.utils.helpers import ( + ClientResponse, + ClientSession, + amake_requests, +) +from pydantic import ( + Field, + PositiveInt, + PrivateAttr, + model_validator, +) +from pytz import timezone + +_warn = warnings.warn class PolygonCurrencyHistoricalQueryParams(CurrencyHistoricalQueryParams): @@ -20,11 +36,8 @@ class PolygonCurrencyHistoricalQueryParams(CurrencyHistoricalQueryParams): Source: https://polygon.io/docs/forex/get_v2_aggs_ticker__forexticker__range__multiplier___timespan___from___to """ - multiplier: PositiveInt = Field( - default=1, description="Multiplier of the timespan." - ) - timespan: Literal["minute", "hour", "day", "week", "month", "quarter", "year"] = ( - Field(default="day", description="Timespan of the data.") + interval: str = Field( + default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") ) sort: Literal["asc", "desc"] = Field( default="desc", description="Sort order of the data." @@ -32,7 +45,28 @@ class PolygonCurrencyHistoricalQueryParams(CurrencyHistoricalQueryParams): limit: PositiveInt = Field( default=49999, description=QUERY_DESCRIPTIONS.get("limit", "") ) - adjusted: bool = Field(default=True, description="Whether the data is adjusted.") + _multiplier: PositiveInt = PrivateAttr(default=None) + _timespan: str = PrivateAttr(default=None) + + @model_validator(mode="after") + @classmethod + def get_api_interval_params(cls, values: "PolygonCurrencyHistoricalQueryParams"): + """Get the multiplier and timespan parameters for the Polygon API.""" + intervals = { + "s": "second", + "m": "minute", + "h": "hour", + "d": "day", + "W": "week", + "M": "month", + "Q": "quarter", + "Y": "year", + } + + values._multiplier = int(values.interval[:-1]) + values._timespan = intervals[values.interval[-1]] + + return values class PolygonCurrencyHistoricalData(CurrencyHistoricalData): @@ -81,28 +115,56 @@ class PolygonCurrencyHistoricalFetcher( query: PolygonCurrencyHistoricalQueryParams, credentials: Optional[Dict[str, str]], **kwargs: Any, - ) -> dict: + ) -> List[Dict]: """Return the raw data from the polygon endpoint.""" api_key = credentials.get("polygon_api_key") if credentials else "" - request_url = ( - f"https://api.polygon.io/v2/aggs/ticker/" - f"C:{query.symbol}/range/{query.multiplier}/{query.timespan}/" - f"{query.start_date}/{query.end_date}?adjusted={query.adjusted}" - f"&sort={query.sort}&limit={query.limit}&apiKey={api_key}" - ) - data = await get_data_many(request_url, "results", **kwargs) + urls = [ + ( + "https://api.polygon.io/v2/aggs/ticker/" + f"C:{symbol.upper()}/range/{query._multiplier}/{query._timespan}/" + f"{query.start_date}/{query.end_date}?" + f"&sort={query.sort}&limit={query.limit}&apiKey={api_key}" + ) + for symbol in query.symbol.split(",") + ] - for d in data: - d["t"] = datetime.fromtimestamp(d["t"] / 1000) - if query.timespan not in ["minute", "hour"]: - d["t"] = d["t"].date() + async def callback( + response: ClientResponse, session: ClientSession + ) -> List[Dict]: + data = await response.json() - return data + symbol = response.url.parts[4] + next_url = data.get("next_url", None) + results: list = data.get("results", []) + + while next_url: + url = f"{next_url}&apiKey={api_key}" + data = await session.get_json(url) + results.extend(data.get("results", [])) + next_url = data.get("next_url", None) + + for r in results: + r["t"] = datetime.fromtimestamp(r["t"] / 1000, tz=timezone("UTC")) + if query._timespan not in ["second", "minute", "hour"]: + r["t"] = r["t"].date() + else: + r["t"] = r["t"].strftime("%Y-%m-%dT%H:%M:%S%z") + if "," in query.symbol: + r["symbol"] = symbol + + if results == []: + _warn(f"Symbol Error: No data found for {symbol.replace('C:', '')}") + + return results + + return await amake_requests(urls, callback, **kwargs) @staticmethod def transform_data( - query: PolygonCurrencyHistoricalQueryParams, data: dict, **kwargs: Any + query: PolygonCurrencyHistoricalQueryParams, data: List[Dict], **kwargs: Any ) -> List[PolygonCurrencyHistoricalData]: """Return the transformed data.""" + if not data: + raise EmptyDataError() return [PolygonCurrencyHistoricalData.model_validate(d) for d in data] diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py index 38980590b6f..a74aac6f64f 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/equity_historical.py @@ -1,5 +1,8 @@ """Polygon Equity Historical Price Model.""" +# pylint: disable=unused-argument + +import warnings from datetime import datetime from typing import Any, Dict, List, Literal, Optional @@ -10,6 +13,7 @@ from openbb_core.provider.standard_models.equity_historical import ( EquityHistoricalQueryParams, ) from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS +from openbb_core.provider.utils.errors import EmptyDataError from openbb_core.provider.utils.helpers import ( ClientResponse, ClientSession, @@ -21,6 +25,9 @@ from pydantic import ( PrivateAttr, model_validator, ) +from pytz import timezone + +_warn = warnings.warn class PolygonEquityHistoricalQueryParams(EquityHistoricalQueryParams): @@ -143,12 +150,19 @@ class PolygonEquityHistoricalFetcher( next_url = data.get("next_url", None) for r in results: - r["t"] = datetime.fromtimestamp(r["t"] / 1000) + r["t"] = datetime.fromtimestamp( + r["t"] / 1000, tz=timezone("America/New_York") + ) if query._timespan not in ["second", "minute", "hour"]: r["t"] = r["t"].date() + else: + r["t"] = r["t"].strftime("%Y-%m-%dT%H:%M:%S") if "," in query.symbol: r["symbol"] = symbol + if results == []: + _warn(f"Symbol Error: No data found for {symbol}") + return results return await amake_requests(urls, callback, **kwargs) @@ -160,4 +174,6 @@ class PolygonEquityHistoricalFetcher( **kwargs: Any, ) -> List[PolygonEquityHistoricalData]: """Transform the data from the Polygon endpoint.""" + if not data: + raise EmptyDataError() return [PolygonEquityHistoricalData.model_validate(d) for d in data] diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py b/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py index 31a38b5261c..adc57bfa2c6 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/index_historical.py @@ -1,5 +1,8 @@ """Polygon Index Historical Model.""" +# pylint: disable=unused-argument,protected-access,line-too-long + +import warnings from datetime import datetime from typing import Any, Dict, List, Literal, Optional @@ -9,8 +12,22 @@ from openbb_core.provider.standard_models.index_historical import ( IndexHistoricalData, IndexHistoricalQueryParams, ) -from openbb_polygon.utils.helpers import get_data_many -from pydantic import Field, PositiveInt +from openbb_core.provider.utils.descriptions import QUERY_DESCRIPTIONS +from openbb_core.provider.utils.errors import EmptyDataError +from openbb_core.provider.utils.helpers import ( + ClientResponse, + ClientSession, + amake_requests, +) +from pydantic import ( + Field, + PositiveInt, + PrivateAttr, + model_validator, +) +from pytz import timezone + +_warn = warnings.warn class PolygonIndexHistoricalQueryParams(IndexHistoricalQueryParams): @@ -19,13 +36,37 @@ class PolygonIndexHistoricalQueryParams(IndexHistoricalQueryParams): Source: https://polygon.io/docs/indices/getting-started """ - timespan: Literal["minute", "hour", "day", "week", "month", "quarter", "year"] = ( - Field(default="day", description="Timespan of the data.") + interval: str = Field( + default="1d", description=QUERY_DESCRIPTIONS.get("interval", "") ) - adjusted: bool = Field(default=True, description="Whether the data is adjusted.") - multiplier: PositiveInt = Field( - default=1, description="Multiplier of the timespan." + sort: Literal["asc", "desc"] = Field( + default="desc", description="Sort order of the data." ) + limit: PositiveInt = Field( + default=49999, description=QUERY_DESCRIPTIONS.get("limit", "") + ) + _multiplier: PositiveInt = PrivateAttr(default=None) + _timespan: str = PrivateAttr(default=None) + + @model_validator(mode="after") + @classmethod + def get_api_interval_params(cls, values: "PolygonIndexHistoricalQueryParams"): + """Get the multiplier and timespan parameters for the Polygon API.""" + intervals = { + "s": "second", + "m": "minute", + "h": "hour", + "d": "day", + "W": "week", + "M": "month", + "Q": "quarter", + "Y": "year", + } + + values._multiplier = int(values.interval[:-1]) + values._timespan = intervals[values.interval[-1]] + + return values class PolygonIndexHistoricalData(IndexHistoricalData): @@ -74,30 +115,60 @@ class PolygonIndexHistoricalFetcher( query: PolygonIndexHistoricalQueryParams, credentials: Optional[Dict[str, str]], **kwargs: Any, - ) -> dict: + ) -> List[Dict]: """Extract raw data from the Polygon endpoint.""" api_key = credentials.get("polygon_api_key") if credentials else "" - request_url = ( - f"https://api.polygon.io/v2/aggs/ticker/" - f"I:{query.symbol}/range/{query.multiplier}/{query.timespan}/" - f"{query.start_date}/{query.end_date}?adjusted={query.adjusted}" - f"&sort={query.sort}&limit={query.limit}&apiKey={api_key}" - ) - data = await get_data_many(request_url, "results", **kwargs) + urls = [ + ( + "https://api.polygon.io/v2/aggs/ticker/" + f"I:{symbol.upper()}/range/{query._multiplier}/{query._timespan}/" + f"{query.start_date}/{query.end_date}?" + f"&sort={query.sort}&limit={query.limit}&apiKey={api_key}" + ) + for symbol in query.symbol.split(",") + ] - for d in data: - d["t"] = datetime.fromtimestamp(d["t"] / 1000) - if query.timespan not in ["minute", "hour"]: - d["t"] = d["t"].date() + async def callback( + response: ClientResponse, session: ClientSession + ) -> List[Dict]: + data = await response.json() - return data + symbol = response.url.parts[4] + next_url = data.get("next_url", None) + results: list = data.get("results", []) + + while next_url: + url = f"{next_url}&apiKey={api_key}" + data = await session.get_json(url) + results.extend(data.get("results", [])) + next_url = data.get("next_url", None) + + for r in results: + r["t"] = datetime.fromtimestamp( + r["t"] / 1000, tz=timezone("America/New_York") + ) + if query._timespan not in ["second", "minute", "hour"]: + r["t"] = r["t"].date() + else: + r["t"] = r["t"].strftime("%Y-%m-%dT%H:%M:%S") + if "," in query.symbol: + r["symbol"] = symbol + + if results == []: + _warn(f"Symbol Error: No data found for {symbol.replace('I:', '')}") + + return results + + return await amake_requests(urls, callback, **kwargs) @staticmethod def transform_data( query: PolygonIndexHistoricalQueryParams, - data: dict, + data: List[Dict], **kwargs: Any, ) -> List[PolygonIndexHistoricalData]: """Transform the data.""" + if not data: + raise EmptyDataError() return [PolygonIndexHistoricalData.model_validate(d) for d in data] diff --git a/openbb_platform/providers/polygon/openbb_polygon/models/market_snapshots.py b/openbb_platform/providers/polygon/openbb_polygon/models/market_snapshots.py index 5737b7ab7c8..bba381c00a2 100644 --- a/openbb_platform/providers/polygon/openbb_polygon/models/market_snapshots.py +++ b/openbb_platform/providers/polygon/openbb_polygon/models/market_snapshots.py @@ -1,15 +1,17 @@ """Polygon Market Snapshots Model.""" +# pylint: disable=unused-argument + from datetime import datetime from typing import Any, Dict, List, Optional -import pandas as pd from openbb_core.provider.abstract.fetcher import Fetcher from openbb_core.provider.standard_models.market_snapshots import ( MarketSnapshotsData, MarketSnapshotsQueryParams, ) from openbb_polygon.utils.helpers import get_data_many +from pandas import to_datetime from pydantic import Field, field_validator @@ -23,23 +25,23 @@ class PolygonMarketSnapshotsQueryParams(MarketSnapshotsQueryParams): class PolygonMarketSnapshotsData(MarketSnapshotsData): """Polygon Market Snapshots Data.""" - vwap: float = Field( + vwap: Optional[float] = Field( description="The volume weighted average price of the stock on the current trading day.", default=None, ) - prev_open: float = Field( + prev_open: Optional[float] = Field( description="The previous trading session opening price.", default=None ) - prev_high: float = Field( + prev_high: Optional[float] = Field( description="The previous trading session high price.", default=None ) - prev_low: float = Field( + prev_low: Optional[float] = Field( description="The previous trading session low price.", default=None ) - prev_volume: float = Field( + prev_volume: Optional[float] = Field( description="The previous trading session volume.", default=None ) - prev_vwap: float = Field( + prev_vwap: Optional[float] = Field( description="The previous trading session VWAP.", default=None ) last_updated: Optional[datetime] = Field( @@ -79,9 +81,7 @@ class PolygonMarketSnapshotsData(MarketSnapshotsData): def date_validate(cls, v): """Return formatted datetime.""" return ( - pd.to_datetime(v, unit="ns", origin="unix", utc=True).tz_convert( - "US/Eastern" - ) + to_datetime(v, unit="ns", origin="unix", utc=True).tz_convert("US/Eastern") if v else None ) @@ -120,7 +120,7 @@ class PolygonMarketSnapshotsFetcher( **kwargs: Any, ) -> List[PolygonMarketSnapshotsData]: """Return the transformed data.""" - processed_data = [] + processed_data: List[PolygonMarketSnapshotsData] = [] # Process and flatten the response from a nested dictionary for item in data: @@ -129,7 +129,7 @@ class PolygonMarketSnapshotsFetcher( day_data = item.get("day", {}) prev_day = item.get("prevDay", {}) - market_data: Dict[str, List[Any]] = { + market_data: Dict = { "symbol": item["ticker"], "bid": last_quote.get("p"), "ask": last_quote.get("P"), @@ -158,6 +158,8 @@ class PolygonMarketSnapshotsFetcher( "last_trade_timestamp": last_trade.get("t"), } - processed_data.append(market_data) + processed_data.append( + PolygonMarketSnapshotsData.model_validate(market_data) + ) - return [PolygonMarketSnapshotsData.model_validate(d) for d in processed_data] + return processed_data diff --git a/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_crypto_historical_fetcher.yaml b/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_crypto_historical_fetcher.yaml index ad6818c557a..ce8f46b4411 100644 --- a/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_crypto_historical_fetcher.yaml +++ b/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_crypto_historical_fetcher.yaml @@ -3,27 +3,27 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive method: GET - uri: https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/range/1/day/2023-01-01/2023-01-10?adjusted=True&apiKey=MOCK_API_KEY&limit=49999&sort=desc + uri: https://api.polygon.io/v2/aggs/ticker/X:BTCUSD/range/1/day/2023-01-01/2023-01-10?apiKey=MOCK_API_KEY&limit=49999&sort=desc response: body: string: !!binary | - H4sIAAAAAAAA/0zUz2rDRhAG8HfZsxjm/+zo2PTWQw9toVBKcWyFpA0JseWUEvLuRZZ2Zd/WCP/8 - zXzarzK/HP+ZzmUsv48//Prw2y8/lqF8XKfzfw/v17e5jIRDOU+X6+t8ufvmcPr7epmnUxnn83Xq - T5Txj6/yWUaurAzImRHhpuJD+fy3jBRCAuYhQ3lfjhQBqUM5Lgd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SBA+UHbi4Dzi1QHZ0/QNee9TM3NEwBBxr5Qx/apJkmGGPWuIIxC7OJoSeQxWDyvBdda8R + NVVBeY+K2FVXgzzUKHwqkxFnVleJUYEry0zX5mykJwJK6SBzBF157TtN6tO1KvBD3ME9ZzhjXykZ + cQGvIEqVigy0GIxwoGSDdFj7tpEonVQGOxbqFE81EkuunpJYEEHITETIi4dpWmA6gppwN4keHf24 + zVN3U9cS76AJ8fPbwmL69ufUbstpud/a3H7+qa3X1Lf75bb89enc5san0+n9+w8ZLyImcjaWiFN+ + MCY6n9nb1F76jff2fwAAAP//OenW5ykFAAA= headers: Connection: - keep-alive @@ -34,7 +34,7 @@ interactions: Content-Type: - application/json Date: - - Tue, 26 Sep 2023 19:08:18 GMT + - Fri, 02 Feb 2024 00:32:56 GMT Server: - nginx/1.19.2 Strict-Transport-Security: @@ -42,7 +42,7 @@ interactions: Vary: - Accept-Encoding X-Request-Id: - - 1e243e29bd49ba1ad01f4c6fcc163f16 + - 2aaabbf87c33533d52377a8f5211dd26 status: code: 200 message: OK diff --git a/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_currency_historical_fetcher.yaml b/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_currency_historical_fetcher.yaml index 1aa8571e38b..a706bc34071 100644 --- a/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_currency_historical_fetcher.yaml +++ b/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_currency_historical_fetcher.yaml @@ -3,35 +3,35 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - gzip, deflate Connection: - keep-alive method: GET - uri: https://api.polygon.io/v2/aggs/ticker/C:EURUSD/range/1/day/2023-01-01/2023-01-10?adjusted=True&apiKey=MOCK_API_KEY&limit=49999&sort=desc + uri: https://api.polygon.io/v2/aggs/ticker/C:EURUSD/range/1/day/2023-01-01/2023-01-10?apiKey=MOCK_API_KEY&limit=49999&sort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elmvfa6OhDaHjaHVUBVXalVo + xGgG0V5V9aUyS9uOvarW1NirSoI6hH2FVgEOTco9bEmxh63Z3po9NdFkA3DAIWykyzcH2z7vxwYT + fPoI5Zm/HOu2f384wQSCeZ7lXu4wzUsOeLeEOablfuE087oSOFjaP8blbwAAAP//JClhEWkEAAA= headers: Connection: - keep-alive Content-Encoding: - gzip Content-Length: - - '453' + - '455' Content-Type: - application/json Date: - - Tue, 26 Sep 2023 19:08:19 GMT + - Fri, 02 Feb 2024 00:32:57 GMT Server: - nginx/1.19.2 Strict-Transport-Security: @@ -39,7 +39,7 @@ interactions: Vary: - Accept-Encoding X-Request-Id: - - 5ee6b475a84f16a6ddfb3ba23fe99fc5 + - 619aa6f6b18ac931bc3a48cfc58a5ee2 status: code: 200 message: OK diff --git a/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml b/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml index 84afa7c8c45..5d27a705e3e 100644 --- a/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml +++ b/openbb_platform/providers/polygon/tests/record/http/test_polygon_fetchers/test_polygon_index_historical_fetcher.yaml @@ -9,51 +9,51 @@ interactions: Connection: - keep-alive method: GET - uri: https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/2023-01-01/2023-05-10?adjusted=True&apiKey=MOCK_API_KEY&limit=10000&sort=asc + uri: https://api.polygon.io/v2/aggs/ticker/I:NDX/range/1/day/2023-01-01/2023-05-10?apiKey=MOCK_API_KEY&limit=49999&sort=desc response: body: string: !!binary | - H4sIAAAAAAAA/2RYTYsk6c38L3VuhKTQZ1/f92IM9tVgjNntaTOLBy8703Mwy/53o6x6nuzOmWNN - V0ZKCkWE6vfb2y8v/379enu+/en5L///t9vT7bfvr1//+3+/fv/P2+3Z7en29fXb9y9v327Pf//9 - 9uvtWZTLKdKgyVUcT7eX49MI0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j4uqTnHSzArZ7yowdmUqqlsFnFfL0E1VbTapIXe61VrWm+oMUeH5QSzPE3xta4OqlKL7sr1 + 9URt4pa3pSYk7uOS88TxabDAsGWjzK/X5JgiB4pdM1cPVSXIbI5PX/6vaqBJKqcY1hINYaVRT1Nh + yGNaGtdj0thImo21hFeQ14nRAua00LTeVTnNWkwA9PWtS8WY5l/WmfofVUleTXn+fkKtRIitIK/n + l6Zyd1fJ9aFm/IkK4/3WDzHUBkUGS9jksI3FdTVlESZwaGUUNtb5/UoZOdEX2IwXUvgsXPu+u7iD + 1CVSw003C1F6Ma+Tb9yzmaKpulhYU0FZGYxxZ7w010hJp3g8WPjhCXcs2PWenJXHMEknsuVioU00 + i9E33vrE4eSYizS5dHGQkwJVMufsQzKQwVfJcCH43PdqueKasivJyPbIa60Oik/mt9H3atuaoSNl + 3KlR4Xu3sNTpzbR4srUMOXDGvVesAKHmRB1T2FhxnvkyMboFW5+cUobfjXxYMhwXS5ZGE7pdHezY + +jTqENJdvC4GZal5/7S09NwNHBmoYK1648eYpHzV96CEm4KrtkdyJimkZvNSdBeVpGKVKoje+s6T + ITEJ0iM3FPs67/5xO76//PTy4/vxdPz1z8ft+Pb824/n7y///PnL8XTIT5/A3vz86fO/njP8y/On + yC85R4l/aXw5bsfn9RX8j/8FAAD//5lL1vwoFwAA headers: Connection: - keep-alive @@ -62,7 +62,7 @@ interactions: Content-Type: - application/json Date: - - Mon, 05 Feb 2024 12:25:28 GMT + - Fri, 02 Feb 2024 00:35:30 GMT Server: - nginx/1.19.2 Strict-Transport-Security: @@ -72,7 +72,7 @@ interactions: Vary: - Accept-Encoding X-Request-Id: - - cd19fc998cee9a09eb5d7417c90d450b + - 1ab70490ebcfe654deb56d619924d97d status: code: 200 message: OK From b5f41fe411ea2895da1e16ff307f324514154c24 Mon Sep 17 00:00:00 2001 From: Henrique Joaquim Date: Mon, 5 Feb 2024 23:28:57 +0000 Subject: [PATCH 4/7] Hotfix/wrong pydantic validator (#6037) * format w new black * Revert "format w new black" This reverts commit 74b9619cc6b565f85aef1e89fc01900b86c8b991. * Use field_validator instead --- .../providers/fmp/openbb_fmp/models/index_historical.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py b/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py index eb0731f3bc0..01de38af1a8 100644 --- a/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py +++ b/openbb_platform/providers/fmp/openbb_fmp/models/index_historical.py @@ -12,7 +12,7 @@ from openbb_core.provider.standard_models.index_historical import ( from openbb_core.provider.utils.descriptions import DATA_DESCRIPTIONS from openbb_core.provider.utils.helpers import get_querystring from openbb_fmp.utils.helpers import get_data_many -from pydantic import Field, NonNegativeInt, validator +from pydantic import Field, NonNegativeInt, field_validator class FMPIndexHistoricalQueryParams(IndexHistoricalQueryParams): @@ -30,7 +30,7 @@ class FMPIndexHistoricalQueryParams(IndexHistoricalQueryParams): Field(default="1day", description="Data granularity.") ) - @validator("interval") + @field_validator("interval") @classmethod def map_interval(cls, v): """Map the interval from standard to the FMP format.""" From d6742378c64ab583b26dd42a762f0d414b73d7ed Mon Sep 17 00:00:00 2001 From: teh_coderer Date: Tue, 6 Feb 2024 04:46:21 -0500 Subject: [PATCH 5/7] fix openapi schema fields `to_snake` (#6036) --- .../core/openbb_core/app/router.py | 22 +++++++------- .../core/openbb_core/provider/registry_map.py | 29 ++++++++++++++----- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/openbb_platform/core/openbb_core/app/router.py b/openbb_platform/core/openbb_core/app/router.py index bb626caba4d..6e2e23de9b7 100644 --- a/openbb_platform/core/openbb_core/app/router.py +++ b/openbb_platform/core/openbb_core/app/router.py @@ -46,7 +46,7 @@ def model_t_discriminator(v: Any) -> str: if isinstance(v, dict): return v.get("provider", "openbb") - if isinstance(v, list): + if isinstance(v, list) and v: return model_t_discriminator(v[0]) return getattr(v, "provider", "openbb") @@ -397,7 +397,7 @@ class SignatureInspector: Also updates __name__ and __doc__ for API schemas. """ - union_models = [Annotated[None, Tag("openbb")]] + union_models = [Annotated[Union[list, dict], Tag("openbb")]] for provider, return_type in return_map.items(): union_models.append(Annotated[return_type, Tag(provider)]) @@ -406,15 +406,17 @@ class SignatureInspector: f"OBBject_{model}", __base__=OBBject, results=( - Annotated[ - Union[tuple(union_models)], # type: ignore - Field( - ..., - description="Serializable results.", - discriminator=Discriminator(model_t_discriminator), - ), + Optional[ + Annotated[ + Union[tuple(union_models)], # type: ignore + Field( + None, + description="Serializable results.", + discriminator=Discriminator(model_t_discriminator), + ), + ] ], - Field(..., description="Serializable results."), + Field(None, description="Serializable results."), ), ) diff --git a/openbb_platform/core/openbb_core/provider/registry_map.py b/openbb_platform/core/openbb_core/provider/registry_map.py index ff9b710a3b8..5a2cd8e7c51 100644 --- a/openbb_platform/core/openbb_core/provider/registry_map.py +++ b/openbb_platform/core/openbb_core/provider/registry_map.py @@ -113,17 +113,30 @@ class RegistryMap: """Extract info (fields and docstring) from fetcher query params or data.""" model: BaseModel = RegistryMap._get_model(fetcher, "data") - class DataModel(model): - model_config = ConfigDict(alias_generator=alias_generators.to_snake) + fields = {} + for field_name, field in model.model_fields.items(): + field.alias_priority = None + fields[field_name] = (field.annotation, field) - provider: Literal[provider_str, "openbb"] = Field( # type: ignore - default=provider_str, - description="The data provider for the data.", - exclude=True, - ) + fields.pop("provider", None) return create_model( - model.__name__, __base__=DataModel, __module__=model.__module__ + model.__name__.replace("Data", ""), + __doc__=model.__doc__, + __config__=ConfigDict( + extra="allow", + alias_generator=alias_generators.to_snake, + populate_by_name=True, + ), + provider=( + Literal[provider_str, "openbb"], # type: ignore + Field( + default=provider_str, + description="The data provider for the data.", + exclude=True, + ), + ), + **fields, ) @staticmethod From 1cff417f1062fb9f9722d2d69f8f7651c924afeb Mon Sep 17 00:00:00 2001 From: montezdesousa <79287829+montezdesousa@users.noreply.github.com> Date: Tue, 6 Feb 2024 12:48:11 +0000 Subject: [PATCH 6/7] Fix data connectors link typo (#6038) --- website/content/excel/{data-conectors.md => data-connectors.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename website/content/excel/{data-conectors.md => data-connectors.md} (100%) diff --git a/website/content/excel/data-conectors.md b/website/content/excel/data-connectors.md similarity index 100% rename from website/content/excel/data-conectors.md rename to website/content/excel/data-connectors.md From 6eb097c31c7406cca9d890f3edb5dd3215bb2680 Mon Sep 17 00:00:00 2001 From: Henrique Joaquim Date: Tue, 6 Feb 2024 13:54:51 +0000 Subject: [PATCH 7/7] [BugFix] - Improve Standardization - `EquitySearch` (#6033) * format w new black * Revert "format w new black" This reverts commit 74b9619cc6b565f85aef1e89fc01900b86c8b991. * small adjustment on the test * index historical * adjust tests accordingly * keep the test skipped * match tests w python * use cache as std field * fix tests * fix tests * use_cache as std * adjust tests * keep the skip * re-record test * black --- .../provider/standard_models/equity_search.py | 4 ++ .../equity/integration/test_equity_api.py | 10 +++- .../equity/integration/test_equity_python.py | 10 +++- .../cboe/openbb_cboe/models/equity_search.py | 6 --- .../test_intrinio_equity_search_fetcher.yaml | 49 ++++++++++--------- .../openbb_nasdaq/models/equity_search.py | 11 ++--- .../sec/openbb_sec/models/equity_search.py | 4 -- 7 files changed, 51 insertions(+), 43 deletions(-) diff --git a/openbb_platform/core/openbb_core/provider/standard_models/equity_search.py b/openbb_platform/core/openbb_core/provider/standard_models/equity_search.py index 8ec02ceeb80..195e99dbeef 100644 --- a/openbb_platform/core/openbb_core/provider/standard_models/equity_search.py +++ b/openbb_platform/core/openbb_core/provider/standard_models/equity_search.py @@ -16,6 +16,10 @@ class EquitySearchQueryParams(QueryParams): is_symbol: bool = Field( description="Whether to search by ticker symbol.", default=False ) + use_cache: Optional[bool] = Field( + default=True, + description="Whether to use the cache or not.", + ) class EquitySearchData(Data): diff --git a/openbb_platform/extensions/equity/integration/test_equity_api.py b/openbb_platform/extensions/equity/integration/test_equity_api.py index 9ec9e781119..c34badc62a5 100644 --- a/openbb_platform/extensions/equity/integration/test_equity_api.py +++ b/openbb_platform/extensions/equity/integration/test_equity_api.py @@ -1212,7 +1212,15 @@ def test_equity_fundamental_latest_attributes(params, headers): ({"query": "AAPl", "is_symbol": True, "provider": "cboe", "use_cache": False}), ({"query": "Apple", "provider": "sec", "use_cache": False, "is_fund": False}), ({"query": "", "provider": "nasdaq", "use_cache": False, "is_etf": True}), - ({"query": "gold", "provider": "intrinio", "active": True, "limit": 100}), + ( + { + "query": "gold", + "provider": "intrinio", + "active": True, + "limit": 100, + "use_cache": None, + } + ), ], ) @pytest.mark.integration diff --git a/openbb_platform/extensions/equity/integration/test_equity_python.py b/openbb_platform/extensions/equity/integration/test_equity_python.py index 2e866217ef2..7c97baaea18 100644 --- a/openbb_platform/extensions/equity/integration/test_equity_python.py +++ b/openbb_platform/extensions/equity/integration/test_equity_python.py @@ -1150,7 +1150,15 @@ def test_equity_fundamental_latest_attributes(params, obb): ({"query": "AAPL", "is_symbol": True, "provider": "cboe", "use_cache": False}), ({"query": "Apple", "provider": "sec", "use_cache": False, "is_fund": False}), ({"query": "", "provider": "nasdaq", "use_cache": False, "is_etf": True}), - ({"query": "gold", "provider": "intrinio", "active": True, "limit": 100}), + ( + { + "query": "gold", + "provider": "intrinio", + "active": True, + "limit": 100, + "use_cache": None, + } + ), ], ) @pytest.mark.integration diff --git a/openbb_platform/providers/cboe/openbb_cboe/models/equity_search.py b/openbb_platform/providers/cboe/openbb_cboe/models/equity_search.py index 428a7d92023..a67f1453bd2 100644 --- a/openbb_platform/providers/cboe/openbb_cboe/models/equity_search.py +++ b/openbb_platform/providers/cboe/openbb_cboe/models/equity_search.py @@ -17,12 +17,6 @@ class CboeEquitySearchQueryParams(EquitySearchQueryParams): Source: https://www.cboe.com/ """ - use_cache: bool = Field( - default=True, - description="When True, the company directory of optionable tickers will be cached for 24 hours." - + " Set as False to bypass.", - ) - class CboeEquitySearchData(EquitySearchData): """CBOE Equity Search Data.""" diff --git a/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_equity_search_fetcher.yaml b/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_equity_search_fetcher.yaml index 292cee77eb4..5dcb8c6f8d5 100644 --- a/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_equity_search_fetcher.yaml +++ b/openbb_platform/providers/intrinio/tests/record/http/test_intrinio_fetchers/test_intrinio_equity_search_fetcher.yaml @@ -3,36 +3,37 @@ interactions: body: null headers: Accept: - - '*/*' + - application/json Accept-Encoding: - - gzip, deflate, br + - gzip, deflate Connection: - keep-alive method: GET - uri: https://api-v2.intrinio.com/companies/search?active=True&api_key=MOCK_API_KEY&page_size=100&query=gold + uri: https://api-v2.intrinio.com/companies/search?active=True&api_key=MOCK_API_KEY&page_size=100&query=gold&use_cache=True response: body: string: !!binary | - H4sIAHb8b2UAA4yWW3PiOBCF/wrF8+yWkGxZnjdfQAFsY2wuhq2tKQMujyfEJlwSYGr++4rNZlCL - YnHewOFT6/ic7v7ZXFYvm7Qssl3z618/m8Wq+fXy1bfF+bW/yJtfmvti+Zxtxbd84Lnic5m+ZOKT - bUVR1+k3Lt82nEEUikfrrBBP0EDr20OnN08YHve5Y08MIh4ui+fLQ/Fn6JSZWvPXF+m4c3vS3pzk - 47rWOLkeV/zBUINX61XDqbabPz8PKw/rtYRuMZ2YFCvoV1tfAHQw4V7nyg4mV/I9MEUGQ4YC9rNX - dgZgLikUZO8f3G65/C2OrpkEIZ0jHjhPIXqinkmBOOxyGIUH5RkbTMENxrE1vp40jh9eACFsIJMo - 3NkPGiQytz/irqRMHz9WRme3kifT43oGlBlFUSKBR0F06xyVrBG9ZZpKyS7N3gA59i0ukePqJa1h - FEPAEYLs08LdWkCOiTV2JPakeKvFxgRpqld6Ln8HcfKTmF/RfnY87D7Y4/gemOg6NRTwibylQyhI - xOeSHvt0W6NmTWSH6Gpwtu4rsF00a8dXdFTssjporDGqxP20Cn60gdRekMiv0SvKw/Gx+RBjwo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z7fnp/2Xuqn1TYy4FYAp6 + iFAaQRQSpDbFrsZ2UnntD8cLU7jTkLhtTrBhWeQPTGyqbLuTm06vvxQnyIif1qNit09v+/C7D+DY + eRoE/shuY1fF4q8ijBCUh2ynp9tiXmLS5e5g7dJyX6tdsLVMl2/SX2/EdmRFvkCPiN+lNYa4AQFQ + ZTqcZJ5AD0JhiAcvq6Kss1LqJoJIyu7R7wWpuCKE3SdhFS6rbVVHGYQVLPefbLE0RWVaEeWEGbS8 + yHo8ydkqrALG/pd9Mzvsv63TPLv816/fAAAA//8DANBYgPZ5DwAA headers: Connection: - keep-alive @@ -41,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Wed, 06 Dec 2023 04:45:42 GMT + - Mon, 05 Feb 2024 16:07:58 GMT Transfer-Encoding: - chunked Vary: diff --git a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/equity_search.py b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/equity_search.py index ce5d6d74c66..77ada033b51 100644 --- a/openbb_platform/providers/nasdaq/openbb_nasdaq/models/equity_search.py +++ b/openbb_platform/providers/nasdaq/openbb_nasdaq/models/equity_search.py @@ -33,10 +33,6 @@ class NasdaqEquitySearchQueryParams(EquitySearchQueryParams): default=None, description="If True, returns ETFs.", ) - use_cache: Optional[bool] = Field( - default=True, - description="If True, caches the symbol directory for one day.", - ) class NasdaqEquitySearchData(EquitySearchData): @@ -108,16 +104,17 @@ class NasdaqEquitySearchFetcher( @staticmethod def transform_query(params: Dict[str, Any]) -> NasdaqEquitySearchQueryParams: + """Transform the query parameters.""" return NasdaqEquitySearchQueryParams(**params) + # pylint: disable=unused-argument @staticmethod - async def extract_data( + async def aextract_data( query: NasdaqEquitySearchQueryParams, credentials: Optional[Dict[str, str]], **kwargs: Any, ) -> str: """Extract data from Nasdaq.""" - url = "https://www.nasdaqtrader.com/dynamic/SymDir/nasdaqtraded.txt" def fetch_data(): @@ -133,6 +130,7 @@ class NasdaqEquitySearchFetcher( loop = asyncio.get_running_loop() return await loop.run_in_executor(None, fetch_data) + # pylint: disable=unused-argument @staticmethod def transform_data( query: NasdaqEquitySearchQueryParams, @@ -140,7 +138,6 @@ class NasdaqEquitySearchFetcher( **kwargs: Any, ) -> List[NasdaqEquitySearchData]: """Transform the data and filter the results.""" - directory = read_csv(StringIO(data), sep="|").iloc[:-1] if query.is_etf is True: diff --git a/openbb_platform/providers/sec/openbb_sec/models/equity_search.py b/openbb_platform/providers/sec/openbb_sec/models/equity_search.py index 0438bc694f1..9a3b49409af 100644 --- a/openbb_platform/providers/sec/openbb_sec/models/equity_search.py +++ b/openbb_platform/providers/sec/openbb_sec/models/equity_search.py @@ -25,10 +25,6 @@ class SecEquitySearchQueryParams(EquitySearchQueryParams): default=False, description="Whether to direct the search to the list of mutual funds and ETFs.", ) - use_cache: bool = Field( - default=True, - description="Whether to use the cache or not. Company names, tickers, and CIKs are cached for seven days.", - ) class SecEquitySearchData(EquitySearchData):