From 0f5d86e0ba691bb69bcbc28e140b65a714652fd5 Mon Sep 17 00:00:00 2001 From: eddiechayes Date: Thu, 28 Mar 2024 16:26:09 -0700 Subject: [PATCH] pseo: add globalpredictions --- ...-custom-request_globalpredictions.com.yaml | 232 +++ sdks/db/category-cache.yaml | 1 + sdks/db/custom-request-last-fetched.yaml | 1 + .../globalpredictions.com.yaml | 1536 ++++++++++++++++ .../global-predictions-inc-fixed-spec.yaml | 1562 +++++++++++++++++ .../global-predictions-inc-fixed-spec.yaml | 1554 ++++++++++++++++ .../global-predictions-inc.json | 3 + .../global-predictions-inc/openapi.yaml | 1536 ++++++++++++++++ .../globalpredictions.com.yaml | 20 + .../global-predictions-inc-progress.yaml | 54 + ...-custom-request_globalpredictions.com.json | 395 +++++ ...-custom-request_globalpredictions.com.json | 25 + sdks/publish.yaml | 24 + sdks/src/collect-from-custom-requests.ts | 4 + 14 files changed, 6947 insertions(+) create mode 100644 sdks/db/cached-method-objects/from-custom-request_globalpredictions.com.yaml create mode 100644 sdks/db/custom-request-specs/globalpredictions.com.yaml create mode 100644 sdks/db/fixed-specs-cache/global-predictions-inc-fixed-spec.yaml create mode 100644 sdks/db/fixed-specs/global-predictions-inc-fixed-spec.yaml create mode 100644 sdks/db/generate-repository-description-cache/global-predictions-inc.json create mode 100644 sdks/db/intermediate-fixed-specs/global-predictions-inc/openapi.yaml create mode 100644 sdks/db/processed-custom-request-cache/globalpredictions.com.yaml create mode 100644 sdks/db/progress/global-predictions-inc-progress.yaml create mode 100644 sdks/db/published/from-custom-request_globalpredictions.com.json create mode 100644 sdks/db/spec-data/from-custom-request_globalpredictions.com.json diff --git a/sdks/db/cached-method-objects/from-custom-request_globalpredictions.com.yaml b/sdks/db/cached-method-objects/from-custom-request_globalpredictions.com.yaml new file mode 100644 index 0000000000..193d4b1125 --- /dev/null +++ b/sdks/db/cached-method-objects/from-custom-request_globalpredictions.com.yaml @@ -0,0 +1,232 @@ +hash: 77693daad9c9e763217e927807831b04f85aa9896e285285fb5fb1a617ccc70c +methodObjects: + - url: /v1/influential_drivers + method: getTopDriversBySeries + httpMethod: get + tag: Knowledge Graph + typeScriptTag: knowledgeGraph + description: Influential Drivers + parameters: + - name: seriesName + schema: string + required: true + description: Series name for which the most influential drivers will be returned + example: SERIES_NAME + responses: + - statusCode: '200' + description: '' + - statusCode: '400' + description: Bad Request + - url: /v1/history + method: getFullHistory + httpMethod: get + tag: Data Series + typeScriptTag: dataSeries + description: History + parameters: + - name: seriesName + schema: string + description: The series name to get the history + responses: + - statusCode: '200' + description: '' + - statusCode: '400' + description: Bad Request + - url: /v1/forecast + method: getForecastData + httpMethod: get + tag: Data Series + typeScriptTag: dataSeries + description: Forecast + parameters: + - name: seriesName + schema: string + description: The series name to get the forecast + responses: + - statusCode: '200' + description: '' + - statusCode: '400' + description: Bad Request + - url: /v1/anomalies + method: listEconomicAnomalies + httpMethod: get + tag: World Monitoring + typeScriptTag: worldMonitoring + description: Anomalies + parameters: [] + responses: + - statusCode: '200' + description: '' + - statusCode: '400' + description: Bad Request + - url: /v1/all_series_types + method: getAllTypes + httpMethod: get + tag: Data Series + typeScriptTag: dataSeries + description: Series Types + parameters: [] + responses: + - statusCode: '200' + description: '' + - statusCode: '400' + description: Bad Request + - url: /v1/all_series_names + method: getAllNames + httpMethod: get + tag: Data Series + typeScriptTag: dataSeries + description: Series Names + parameters: + - name: seriesType + schema: string + description: The series type for which the series names are returned + responses: + - statusCode: '200' + description: '' + - statusCode: '400' + description: Bad Request + - url: /v1/get_portfolio + method: getSecuritiesAmounts + httpMethod: get + tag: Portfolio Management + typeScriptTag: portfolioManagement + description: Get Portfolio + parameters: + - name: portfolioId + schema: integer + required: true + description: The portfolio id for the portfolio to retrieve + example: 0 + responses: + - statusCode: '200' + description: portfolio for the user + - statusCode: '400' + description: Bad Request + - url: /v1/update_portfolio + method: updatePortfolio + httpMethod: post + tag: Portfolio Management + typeScriptTag: portfolioManagement + description: Update portfolio + parameters: + - name: portfolio + schema: array + description: '' + - name: portfolio_id + schema: number + description: '' + - name: investor_preference + schema: string + description: '' + responses: + - statusCode: '200' + description: '' + - statusCode: '400' + description: Bad Request + - url: /v1/get_recommendations + method: computeRecommendations + httpMethod: get + tag: Portfolio Management + typeScriptTag: portfolioManagement + description: Portfolio Recommendations + parameters: + - name: portfolioId + schema: integer + required: true + description: The portfolio id for the portfolio to get recommendations for + example: 0 + responses: + - statusCode: '200' + description: Recommendations + - statusCode: '400' + description: Bad Request + - url: /v1/get_portfolio_score + method: computePortfolioScore + httpMethod: get + tag: Portfolio Management + typeScriptTag: portfolioManagement + description: Portfolio Score + parameters: + - name: portfolioDict + schema: string + required: true + description: >- + A stringified + (https://portfoliopilot.com/static/external_api/documentation.html + portfolio dict (key=ticker, value=amount) to calculate the portfolio + score for + example: PORTFOLIO_DICT + responses: + - statusCode: '200' + description: Portfolio Score + - statusCode: '400' + description: Bad Request + - url: /v1/get_portfolio_performance_stats + method: computePerformanceStats + httpMethod: get + tag: Portfolio Management + typeScriptTag: portfolioManagement + description: Portfolio Performance Stats + parameters: + - name: portfolioDict + schema: string + required: true + description: >- + A stringified + (https://portfoliopilot.com/static/external_api/documentation.html + portfolio dict (key=ticker, value=amount) to calculate the portfolio + score for + example: PORTFOLIO_DICT + responses: + - statusCode: '200' + description: Portfolio Performance Stats + - statusCode: '400' + description: Bad Request + - url: /v1/get_portfolio_assessment + method: getAssessmentData + httpMethod: get + tag: Portfolio Management + typeScriptTag: portfolioManagement + description: Get Portfolio Assessment + parameters: + - name: portfolioDict + schema: string + required: true + description: >- + A stringified + (https://portfoliopilot.com/static/external_api/documentation.html + portfolio dict (key=ticker, value=amount) to calculate the portfolio + score for + example: PORTFOLIO_DICT + - name: targetRisk + schema: string + required: false + description: The target risk level for the portfolio. + responses: + - statusCode: '200' + description: '' + - statusCode: '400' + description: Bad Request + - url: /v1/get_portfolio_insights + method: getInsights + httpMethod: get + tag: Portfolio Management + typeScriptTag: portfolioManagement + description: Get Portfolio Insights + parameters: + - name: portfolioDict + schema: string + required: true + description: >- + A stringified + (https://portfoliopilot.com/static/external_api/documentation.html + portfolio dict (key=ticker, value=amount) to generate insights + example: PORTFOLIO_DICT + responses: + - statusCode: '200' + description: '' + - statusCode: '400' + description: Bad Request +numberOfSchemas: 24 +apiDescription: Global Predictions external api diff --git a/sdks/db/category-cache.yaml b/sdks/db/category-cache.yaml index 9c5efb3386..a6c0f8c481 100644 --- a/sdks/db/category-cache.yaml +++ b/sdks/db/category-cache.yaml @@ -264,3 +264,4 @@ apis: Podium-undefined: Reviews Brevo-undefined: CRM (Customer Relationship Management) Belvo-undefined: Finance + Global Predictions Inc-undefined: AI Tools diff --git a/sdks/db/custom-request-last-fetched.yaml b/sdks/db/custom-request-last-fetched.yaml index 93cb31a33c..856c7a9bba 100644 --- a/sdks/db/custom-request-last-fetched.yaml +++ b/sdks/db/custom-request-last-fetched.yaml @@ -244,3 +244,4 @@ lastUpdated: podium.com: 2024-03-28T23:11:05.907Z brevo.com: 2024-03-28T23:17:22.210Z belvo.com: 2024-03-28T23:22:05.031Z + globalpredictions.com: 2024-03-28T23:21:28.988Z diff --git a/sdks/db/custom-request-specs/globalpredictions.com.yaml b/sdks/db/custom-request-specs/globalpredictions.com.yaml new file mode 100644 index 0000000000..bc79af1dca --- /dev/null +++ b/sdks/db/custom-request-specs/globalpredictions.com.yaml @@ -0,0 +1,1536 @@ +openapi: 3.0.0 +info: + title: Global Predictions API + version: 1.0.0 + contact: + email: support@globalpredictions.com + description: Global Predictions external api +tags: + - name: Portfolio Management + description: >- + Update and access individual portfolios and their associated scores, + recommendations, and performance metrics + - name: Knowledge Graph + description: >- + Access the massive Global Predictions Knowledge Graph which contains over + 50,000 nodes and millions of relationships representing the global economy + - name: Data Series + description: >- + Access individual time series, historical or forecasted, from the large + Global Predictions data library + - name: World Monitoring + description: >- + Access individual time series, historical or forecasted, from the large + Global Predictions data library +paths: + /v1/influential_drivers: + get: + summary: Influential Drivers + description: List of top 10 most influential drivers (given by series_name type) + parameters: + - name: series_name + in: query + required: true + schema: + type: string + description: Series name for which the most influential drivers will be returned + - $ref: '#/components/parameters/ApiKey' + tags: + - Knowledge Graph + operationId: get_influential_drivers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/InfluentialDrivers' + examples: + Example: + description: Influential Drivers output + value: + - United States CPI + - Real Estate Index + - South Korea Building Permits + - United States GDP + - Information Technology Index + - Communication Services Index + - Consumer Discretionary Index + - Financials Index + - China GDP + - United States Change in Confirmed Covid Cases + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/influential_drivers" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/history: + parameters: [] + get: + summary: History + operationId: get-history + tags: + - Data Series + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/History' + examples: + Example: + description: History output which contains array of Date, Val + value: + - date: '2015-01-01' + val: 42.8 + - date: '2015-02-01' + val: 43.7 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + description: >- + JSON representing the full history of the given series at the frequency + available + parameters: + - schema: + type: string + in: query + name: series_name + description: The series name to get the history + - $ref: '#/components/parameters/ApiKey' + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/history" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/forecast: + get: + tags: + - Data Series + summary: Forecast + operationId: get-forecast + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Forecast' + examples: + Example: + description: Forecast output which contains array of Date, Val, High, Low + value: + - date: '2021-01-01' + val: 88.2 + high: 92.2 + low: 84.2 + - date: '2021-02-01' + val: 89.4 + high: 93.4 + low: 85.4 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + description: >- + JSON representing a 2-12 month forecast starting from the last history + date available, forecasted at the same frequency as the historical data + parameters: + - schema: + type: string + in: query + name: series_name + description: The series name to get the forecast + - $ref: '#/components/parameters/ApiKey' + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/forecast" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/anomalies: + get: + tags: + - World Monitoring + summary: Anomalies + operationId: get-anomalies + parameters: + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Anomalies' + examples: + Example: + description: Anomalies output + value: + - United States CPI + - Real Estate Index + - South Korea Building Permits + - United States GDP + - Information Technology Index + - Communication Services Index + - Consumer Discretionary Index + - Financials Index + - China GDP + - Clear Shares OCIO ETF + - IQ Hedge Multi-Strategy Tracker ETF + - RPAR Risk Parity ETF + - Taiwan GDP + - Vanguard Energy ETF + - Vanguard Value ETF + - Ability Inc + - United States Inter Bank Rate + - Invesco Senior Loan ETF + - India GDP + - Taiwan Total Investment + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + description: >- + List of series with discovered economic anomalies which have occurred in + the last 3 months + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: |- + import requests + + url = "https://portfoliopilot.com/api/v1/anomalies" + + querystring = {"api_key":"SOME_STRING_VALUE"} + + response = requests.request("GET", url, params=querystring) + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE") + .asString(); + /v1/all_series_types: + get: + tags: + - Data Series + summary: Series Types + operationId: get-series-types + parameters: + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesTypeWithCategories' + examples: + Example: + description: Series Type with their associated categories + value: + - series_type: Financial Market + category: Currencies + - series_type: Macroeconomics + category: Central Government Debt + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series_types not found + description: Retrieve all series types and their associated categories + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: |- + import requests + + url = "https://portfoliopilot.com/api/v1/all_series_types" + + querystring = {"api_key":"SOME_STRING_VALUE"} + + response = requests.request("GET", url, params=querystring) + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE") + .asString(); + /v1/all_series_names: + get: + tags: + - Data Series + summary: Series Names + operationId: get-series-names + parameters: + - schema: + type: string + in: query + name: series_type + description: The series type for which the series names are returned + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesNames' + examples: + Example: + description: All available time series names within a given series type + value: + - Global X Education ETF + - Vanguard 500 ETF + - iShares Asia 50 ETF + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: series_type is invalid + description: Retrieve all available time series within a given series type + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/all_series_names" + + + querystring = + {"series_type":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio: + get: + tags: + - Portfolio Management + summary: Get Portfolio + operationId: get-portfolio + parameters: + - schema: + type: integer + in: query + name: portfolio_id + required: true + description: The portfolio id for the portfolio to retrieve + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Portfolio' + examples: + Example: + description: List of all securities for the given portfolio id + value: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + description: >- + Retrieve all securities and their associated amounts for a given + portfolio id + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio" + + + querystring = + {"portfolio_id":"SOME_INTEGER_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/update_portfolio: + post: + tags: + - Portfolio Management + summary: Update portfolio + operationId: update-portfolio + requestBody: + content: + application/json: + schema: + type: object + properties: + portfolio: + $ref: '#/components/schemas/Portfolio' + portfolio_id: + type: number + investor_preference: + type: string + example: + - portfolio: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + portfolio_id: 102 + investor_preference: aggressive + parameters: + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: string + examples: + Example: + description: Portfolio updated successfully + value: + - success: ok + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: >- + portfolio or portfolio_id or investor_preference is + invalid + description: >- + Create or update the portfolio for the given id with the given list of + tickers and amounts + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE'; + + + let options = { + method: 'POST', + headers: {'content-type': 'application/json'}, + body: '[{"portfolio":[{"security_name":"Vanguard 500 ETF","ticker":"VOO","amount":20000,"weight":12.2}],"portfolio_id":102,"investor_preference":"aggressive"}]' + }; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/update_portfolio" + + + querystring = {"api_key":"SOME_STRING_VALUE"} + + + payload = [ + { + "portfolio": [ + { + "security_name": "Vanguard 500 ETF", + "ticker": "VOO", + "amount": 20000, + "weight": 12.2 + } + ], + "portfolio_id": 102, + "investor_preference": "aggressive" + } + ] + + headers = {"content-type": "application/json"} + + + response = requests.request("POST", url, json=payload, + headers=headers, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request POST \ + --url 'https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE' \ + --header 'content-type: application/json' \ + --data '[{"portfolio":[{"security_name":"Vanguard 500 ETF","ticker":"VOO","amount":20000,"weight":12.2}],"portfolio_id":102,"investor_preference":"aggressive"}]' + - lang: Java + source: >- + HttpResponse response = + Unirest.post("https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE") + .header("content-type", "application/json") + .body("[{\"portfolio\":[{\"security_name\":\"Vanguard 500 ETF\",\"ticker\":\"VOO\",\"amount\":20000,\"weight\":12.2}],\"portfolio_id\":102,\"investor_preference\":\"aggressive\"}]") + .asString(); + /v1/get_recommendations: + get: + tags: + - Portfolio Management + summary: Portfolio Recommendations + operationId: get-recommendations + parameters: + - schema: + type: integer + in: query + name: portfolio_id + required: true + description: The portfolio id for the portfolio to get recommendations for + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Recommendations' + examples: + Example: + description: All computed recommendations for the given portfolio id + value: + Example: + - recommendation_type: Diversification + key: Diversification-US Mid Cap Equities + benefit: 10 + recommendation: >- + Diversify your portfolio and decrease overall risk by + adding securities where you have low asset class + exposure + problem: >- + Your exposure to US Mid Cap Equities is lower than the + system recommendation for you, increase exposure to + reduce overall aggregated portfolio risk appropriately + suggested_changes: + - security_name: Global X CleanTech ETF + ticker: CTEC + amount: 12000 + weight: 24.6 + Example-2: + - recommendation_type: Factor Exposure + key: Factor Exposure-Core Inflation + benefit: 4.3222 + recommendation: >- + Improve your portfolio sensitivity to upside surprises + in Core Inflation + problem: >- + If Core Inflation surprises significantly to the + upside (which happens 2.5% of the time) your portfolio + could decrease by -6.3% or more. + suggested_changes: + - security_name: Hubspot Inc + ticker: HUBS + amount: -6400 + weight: 3.4 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + description: Compute and return all recommendations for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_recommendations" + + + querystring = + {"portfolio_id":"SOME_INTEGER_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_score: + get: + tags: + - Portfolio Management + summary: Portfolio Score + operationId: get-portfolio-score + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioScore' + examples: + Example: + description: >- + The computed Portfolio Score and score components for a + given portfolio + value: + - portfolio_score: 720 + score_remark: Good + percentile_rank: 81 + risk_match_score: 10 + sharpe_ratio_score: 5.4 + downside_protection_score: 6.1 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_dict is invalid + description: Compute and return the portfolio score and associated sub-scores + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_score" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_performance_stats: + get: + tags: + - Portfolio Management + summary: Portfolio Performance Stats + operationId: get-portfolio-performance-stats + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioPerformanceStats' + examples: + Example: + description: >- + The computed performance statistics for the given portfolio + id + value: + - returns: 6.3 + risk: 9.1 + sharpe_ratio: 0.69 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + description: Compute and return the performance statistics for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = + "https://portfoliopilot.com/api/v1/get_portfolio_performance_stats" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_assessment: + get: + tags: + - Portfolio Management + summary: Get Portfolio Assessment + operationId: get-portfolio-assessment + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + - name: target_risk + in: query + required: false + description: The target risk level for the portfolio. + schema: + type: string + enum: + - conservative + - moderately_conservative + - moderately_aggressive + - aggressive + - very_aggressive + - generic + - extreme + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: Portfolio assessment data + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioAssessmentResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + description: Get portfolio assessment data for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_assessment" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","target_risk":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_insights: + get: + tags: + - Portfolio Management + summary: Get Portfolio Insights + operationId: get-portfolio-insights + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to generate insights + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: Portfolio Insights list + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioInsights' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + description: Get portfolio insights for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_insights" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); +externalDocs: + url: https://www.globalpredictions.com +security: + - api_key: [] +servers: + - url: https://portfoliopilot.com/api + description: Global predictions URL +components: + links: {} + callbacks: {} + schemas: + InfluentialDrivers: + type: array + description: '' + x-examples: + Example: + - United States GDP + - United States CPI + - Apple Inc + items: + type: string + HistoryObject: + type: object + properties: + date: + type: string + val: + type: number + required: + - date + - val + x-examples: + Example: + - date: '2015-01-01' + val: 42.8 + - date: '2015-02-01' + val: 43.7 + History: + type: array + description: '' + items: + $ref: '#/components/schemas/HistoryObject' + ForecastObject: + type: object + description: '' + required: + - date + - val + - high + - low + properties: + date: + type: string + val: + type: number + high: + type: number + low: + type: number + x-examples: + example-1: + - date: '2021-01-01' + val: 88.2 + high: 92.2 + low: 84.2 + - date: '2021-02-01' + val: 89.4 + high: 93.4 + low: 85.4 + Forecast: + type: array + description: '' + items: + $ref: '#/components/schemas/ForecastObject' + Anomalies: + type: array + description: '' + x-examples: + example-1: + - United States CPI + - Real Estate Index + - South Korea Building Permits + items: + type: string + SeriesTypeWithCategory: + type: object + description: '' + properties: + series_type: + type: string + category: + type: string + SeriesTypeWithCategories: + type: array + description: '' + items: + $ref: '#/components/schemas/SeriesTypeWithCategory' + BadRequest: + type: object + description: Bad Request + required: + - status_code + - error + - message + properties: + status_code: + type: number + error: + type: string + message: + type: string + SeriesNames: + type: array + description: '' + x-examples: + Example: + - Global X Education ETF + - Vanguard 500 ETF + - iShares Asia 50 ETF + items: + type: string + Investment: + type: object + description: Investment of user + required: + - security_name + - ticker + - amount + - weight + properties: + security_name: + type: string + ticker: + type: string + amount: + type: number + weight: + type: number + x-examples: + Example: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + Portfolio: + type: array + description: portfolio for the user + x-examples: + Example: null + items: + $ref: '#/components/schemas/Investment' + Recommendation: + type: object + required: + - recommendation_type + - key + - recommendation + - problem + - suggested_changes + - benefit + properties: + recommendation_type: + type: string + key: + type: string + recommendation: + type: string + problem: + type: string + suggested_changes: + type: array + items: + $ref: '#/components/schemas/Investment' + benefit: + type: number + x-examples: + Example: + - recommendation_type: Diversification + key: Diversification-US Mid Cap Equities + benefit: 10 + recommendation: >- + Diversify your portfolio and decrease overall risk by adding + securities where you have low asset class exposure + problem: >- + Your exposure to US Mid Cap Equities is lower than the system + recommendation for you, increase exposure to reduce overall + aggregated portfolio risk appropriately + suggested_changes: + - security_name: Global X CleanTech ETF + ticker: CTEC + amount: 12000 + weight: 24.6 + Example-2: + - recommendation_type: Factor Exposure + key: Factor Exposure-Core Inflation + benefit: 4.3222 + recommendation: >- + Improve your portfolio sensitivity to upside surprises in Core + Inflation + problem: >- + If Core Inflation surprises significantly to the upside (which + happens 2.5% of the time) your portfolio could decrease by -6.3% + or more. + suggested_changes: + - security_name: Hubspot Inc + ticker: HUBS + amount: -6400 + weight: 3.4 + Recommendations: + type: array + description: Recommendations + x-examples: + Example: null + items: + $ref: '#/components/schemas/Recommendation' + PortfolioScore: + type: object + description: Portfolio Score + x-examples: + Example: + - portfolio_score: 720 + score_remark: Good + percentile_rank: 81 + risk_match_score: 10 + sharpe_ratio_score: 5.4 + downside_protection_score: 6.1 + properties: + portfolio_score: + type: number + score_remark: + type: string + percentile_rank: + type: number + risk_match_score: + type: number + sharpe_ratio_score: + type: number + downside_protection_score: + type: number + PortfolioAssessmentResponse: + type: object + properties: + portfolio_score: + type: number + score_remark: + type: string + percentile_rank: + type: number + risk_match_score: + type: number + sharpe_ratio_score: + type: number + downside_protection_score: + type: number + score_result: + $ref: '#/components/schemas/ScoreResult' + downside_component_statuses: + type: array + items: + $ref: '#/components/schemas/DownsideComponentStatus' + sharpe_ratio_analysis: + $ref: '#/components/schemas/SharpeRatioComponentStatus' + PortfolioInsights: + type: array + items: + type: string + ScoreResult: + type: object + properties: + risk_match_component_status: + $ref: '#/components/schemas/RiskMatchComponentStatus' + RiskMatchComponentStatus: + type: object + properties: + target_risk: + type: number + portfolio_risk: + type: number + DownsideComponentStatus: + type: object + properties: + name: + type: string + score: + type: number + status: + type: string + is_significant: + type: boolean + SharpeRatioComponentStatus: + type: object + properties: + sharpe_ratio_contribution: + type: object + additionalProperties: + type: number + portfolio_sharpe_ratio: + type: number + PortfolioPerformanceStats: + type: object + description: Portfolio Performance Stats + x-examples: + Example: + - returns: 6.3 + risk: 9.1 + sharpe_ratio: 0.69 + properties: + returns: + type: number + risk: + type: number + sharpe_ratio: + type: number + parameters: + ApiKey: + name: api_key + in: query + required: true + schema: + type: string + description: api_key for making the request. + securitySchemes: + api_key: + type: apiKey + name: api_key + in: query diff --git a/sdks/db/fixed-specs-cache/global-predictions-inc-fixed-spec.yaml b/sdks/db/fixed-specs-cache/global-predictions-inc-fixed-spec.yaml new file mode 100644 index 0000000000..b3b7d84a63 --- /dev/null +++ b/sdks/db/fixed-specs-cache/global-predictions-inc-fixed-spec.yaml @@ -0,0 +1,1562 @@ +publishJson: + company: Global Predictions Inc + serviceName: false + sdkName: global-predictions-inc-{language}-sdk + clientName: GlobalPredictionsInc + metaDescription: >- + Global Predictions is building an AI-powered WealthOS, a full-stack solution + for financial advice and personalized recommendations built on top of our + proprietary Economic Insights Engine. We power fintech solutions for + millions of people through the GP API and customized insights. Our flagship + product is PortfolioPilot for individuals, the world's best financial + advisor, with over $6.2B assets on platform. + + + Please read our important disclosures: + https://www.globalpredictions.com/disclosures + apiStatusUrls: inherit + homepage: www.globalpredictions.com/ + developerDocumentation: portfoliopilot.com/static/external_api/documentation.html + categories: + - ai + - financial_services + - fintech + - financial_technology +rawSpecString: | + openapi: 3.0.0 + info: + title: Global Predictions API + version: 1.0.0 + contact: + email: support@globalpredictions.com + description: Global Predictions external api + tags: + - name: Portfolio Management + description: >- + Update and access individual portfolios and their associated scores, + recommendations, and performance metrics + - name: Knowledge Graph + description: >- + Access the massive Global Predictions Knowledge Graph which contains over + 50,000 nodes and millions of relationships representing the global economy + - name: Data Series + description: >- + Access individual time series, historical or forecasted, from the large + Global Predictions data library + - name: World Monitoring + description: >- + Access individual time series, historical or forecasted, from the large + Global Predictions data library + paths: + /v1/influential_drivers: + get: + summary: Influential Drivers + description: List of top 10 most influential drivers (given by series_name type) + parameters: + - name: series_name + in: query + required: true + schema: + type: string + description: Series name for which the most influential drivers will be returned + - $ref: '#/components/parameters/ApiKey' + tags: + - Knowledge Graph + operationId: get_influential_drivers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/InfluentialDrivers' + examples: + Example: + description: Influential Drivers output + value: + - United States CPI + - Real Estate Index + - South Korea Building Permits + - United States GDP + - Information Technology Index + - Communication Services Index + - Consumer Discretionary Index + - Financials Index + - China GDP + - United States Change in Confirmed Covid Cases + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/influential_drivers" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/history: + parameters: [] + get: + summary: History + operationId: get-history + tags: + - Data Series + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/History' + examples: + Example: + description: History output which contains array of Date, Val + value: + - date: '2015-01-01' + val: 42.8 + - date: '2015-02-01' + val: 43.7 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + description: >- + JSON representing the full history of the given series at the frequency + available + parameters: + - schema: + type: string + in: query + name: series_name + description: The series name to get the history + - $ref: '#/components/parameters/ApiKey' + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/history" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/forecast: + get: + tags: + - Data Series + summary: Forecast + operationId: get-forecast + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Forecast' + examples: + Example: + description: Forecast output which contains array of Date, Val, High, Low + value: + - date: '2021-01-01' + val: 88.2 + high: 92.2 + low: 84.2 + - date: '2021-02-01' + val: 89.4 + high: 93.4 + low: 85.4 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + description: >- + JSON representing a 2-12 month forecast starting from the last history + date available, forecasted at the same frequency as the historical data + parameters: + - schema: + type: string + in: query + name: series_name + description: The series name to get the forecast + - $ref: '#/components/parameters/ApiKey' + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/forecast" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/anomalies: + get: + tags: + - World Monitoring + summary: Anomalies + operationId: get-anomalies + parameters: + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Anomalies' + examples: + Example: + description: Anomalies output + value: + - United States CPI + - Real Estate Index + - South Korea Building Permits + - United States GDP + - Information Technology Index + - Communication Services Index + - Consumer Discretionary Index + - Financials Index + - China GDP + - Clear Shares OCIO ETF + - IQ Hedge Multi-Strategy Tracker ETF + - RPAR Risk Parity ETF + - Taiwan GDP + - Vanguard Energy ETF + - Vanguard Value ETF + - Ability Inc + - United States Inter Bank Rate + - Invesco Senior Loan ETF + - India GDP + - Taiwan Total Investment + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + description: >- + List of series with discovered economic anomalies which have occurred in + the last 3 months + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: |- + import requests + + url = "https://portfoliopilot.com/api/v1/anomalies" + + querystring = {"api_key":"SOME_STRING_VALUE"} + + response = requests.request("GET", url, params=querystring) + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE") + .asString(); + /v1/all_series_types: + get: + tags: + - Data Series + summary: Series Types + operationId: get-series-types + parameters: + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesTypeWithCategories' + examples: + Example: + description: Series Type with their associated categories + value: + - series_type: Financial Market + category: Currencies + - series_type: Macroeconomics + category: Central Government Debt + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series_types not found + description: Retrieve all series types and their associated categories + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: |- + import requests + + url = "https://portfoliopilot.com/api/v1/all_series_types" + + querystring = {"api_key":"SOME_STRING_VALUE"} + + response = requests.request("GET", url, params=querystring) + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE") + .asString(); + /v1/all_series_names: + get: + tags: + - Data Series + summary: Series Names + operationId: get-series-names + parameters: + - schema: + type: string + in: query + name: series_type + description: The series type for which the series names are returned + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesNames' + examples: + Example: + description: All available time series names within a given series type + value: + - Global X Education ETF + - Vanguard 500 ETF + - iShares Asia 50 ETF + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: series_type is invalid + description: Retrieve all available time series within a given series type + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/all_series_names" + + + querystring = + {"series_type":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio: + get: + tags: + - Portfolio Management + summary: Get Portfolio + operationId: get-portfolio + parameters: + - schema: + type: integer + in: query + name: portfolio_id + required: true + description: The portfolio id for the portfolio to retrieve + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Portfolio' + examples: + Example: + description: List of all securities for the given portfolio id + value: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + description: >- + Retrieve all securities and their associated amounts for a given + portfolio id + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio" + + + querystring = + {"portfolio_id":"SOME_INTEGER_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/update_portfolio: + post: + tags: + - Portfolio Management + summary: Update portfolio + operationId: update-portfolio + requestBody: + content: + application/json: + schema: + type: object + properties: + portfolio: + $ref: '#/components/schemas/Portfolio' + portfolio_id: + type: number + investor_preference: + type: string + example: + - portfolio: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + portfolio_id: 102 + investor_preference: aggressive + parameters: + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: string + examples: + Example: + description: Portfolio updated successfully + value: + - success: ok + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: >- + portfolio or portfolio_id or investor_preference is + invalid + description: >- + Create or update the portfolio for the given id with the given list of + tickers and amounts + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE'; + + + let options = { + method: 'POST', + headers: {'content-type': 'application/json'}, + body: '[{"portfolio":[{"security_name":"Vanguard 500 ETF","ticker":"VOO","amount":20000,"weight":12.2}],"portfolio_id":102,"investor_preference":"aggressive"}]' + }; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/update_portfolio" + + + querystring = {"api_key":"SOME_STRING_VALUE"} + + + payload = [ + { + "portfolio": [ + { + "security_name": "Vanguard 500 ETF", + "ticker": "VOO", + "amount": 20000, + "weight": 12.2 + } + ], + "portfolio_id": 102, + "investor_preference": "aggressive" + } + ] + + headers = {"content-type": "application/json"} + + + response = requests.request("POST", url, json=payload, + headers=headers, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request POST \ + --url 'https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE' \ + --header 'content-type: application/json' \ + --data '[{"portfolio":[{"security_name":"Vanguard 500 ETF","ticker":"VOO","amount":20000,"weight":12.2}],"portfolio_id":102,"investor_preference":"aggressive"}]' + - lang: Java + source: >- + HttpResponse response = + Unirest.post("https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE") + .header("content-type", "application/json") + .body("[{\"portfolio\":[{\"security_name\":\"Vanguard 500 ETF\",\"ticker\":\"VOO\",\"amount\":20000,\"weight\":12.2}],\"portfolio_id\":102,\"investor_preference\":\"aggressive\"}]") + .asString(); + /v1/get_recommendations: + get: + tags: + - Portfolio Management + summary: Portfolio Recommendations + operationId: get-recommendations + parameters: + - schema: + type: integer + in: query + name: portfolio_id + required: true + description: The portfolio id for the portfolio to get recommendations for + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Recommendations' + examples: + Example: + description: All computed recommendations for the given portfolio id + value: + Example: + - recommendation_type: Diversification + key: Diversification-US Mid Cap Equities + benefit: 10 + recommendation: >- + Diversify your portfolio and decrease overall risk by + adding securities where you have low asset class + exposure + problem: >- + Your exposure to US Mid Cap Equities is lower than the + system recommendation for you, increase exposure to + reduce overall aggregated portfolio risk appropriately + suggested_changes: + - security_name: Global X CleanTech ETF + ticker: CTEC + amount: 12000 + weight: 24.6 + Example-2: + - recommendation_type: Factor Exposure + key: Factor Exposure-Core Inflation + benefit: 4.3222 + recommendation: >- + Improve your portfolio sensitivity to upside surprises + in Core Inflation + problem: >- + If Core Inflation surprises significantly to the + upside (which happens 2.5% of the time) your portfolio + could decrease by -6.3% or more. + suggested_changes: + - security_name: Hubspot Inc + ticker: HUBS + amount: -6400 + weight: 3.4 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + description: Compute and return all recommendations for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_recommendations" + + + querystring = + {"portfolio_id":"SOME_INTEGER_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_score: + get: + tags: + - Portfolio Management + summary: Portfolio Score + operationId: get-portfolio-score + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioScore' + examples: + Example: + description: >- + The computed Portfolio Score and score components for a + given portfolio + value: + - portfolio_score: 720 + score_remark: Good + percentile_rank: 81 + risk_match_score: 10 + sharpe_ratio_score: 5.4 + downside_protection_score: 6.1 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_dict is invalid + description: Compute and return the portfolio score and associated sub-scores + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_score" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_performance_stats: + get: + tags: + - Portfolio Management + summary: Portfolio Performance Stats + operationId: get-portfolio-performance-stats + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioPerformanceStats' + examples: + Example: + description: >- + The computed performance statistics for the given portfolio + id + value: + - returns: 6.3 + risk: 9.1 + sharpe_ratio: 0.69 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + description: Compute and return the performance statistics for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = + "https://portfoliopilot.com/api/v1/get_portfolio_performance_stats" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_assessment: + get: + tags: + - Portfolio Management + summary: Get Portfolio Assessment + operationId: get-portfolio-assessment + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + - name: target_risk + in: query + required: false + description: The target risk level for the portfolio. + schema: + type: string + enum: + - conservative + - moderately_conservative + - moderately_aggressive + - aggressive + - very_aggressive + - generic + - extreme + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: Portfolio assessment data + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioAssessmentResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + description: Get portfolio assessment data for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_assessment" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","target_risk":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_insights: + get: + tags: + - Portfolio Management + summary: Get Portfolio Insights + operationId: get-portfolio-insights + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to generate insights + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: Portfolio Insights list + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioInsights' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + description: Get portfolio insights for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_insights" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + externalDocs: + url: https://www.globalpredictions.com + security: + - api_key: [] + servers: + - url: https://portfoliopilot.com/api + description: Global predictions URL + components: + links: {} + callbacks: {} + schemas: + InfluentialDrivers: + type: array + description: '' + x-examples: + Example: + - United States GDP + - United States CPI + - Apple Inc + items: + type: string + HistoryObject: + type: object + properties: + date: + type: string + val: + type: number + required: + - date + - val + x-examples: + Example: + - date: '2015-01-01' + val: 42.8 + - date: '2015-02-01' + val: 43.7 + History: + type: array + description: '' + items: + $ref: '#/components/schemas/HistoryObject' + ForecastObject: + type: object + description: '' + required: + - date + - val + - high + - low + properties: + date: + type: string + val: + type: number + high: + type: number + low: + type: number + x-examples: + example-1: + - date: '2021-01-01' + val: 88.2 + high: 92.2 + low: 84.2 + - date: '2021-02-01' + val: 89.4 + high: 93.4 + low: 85.4 + Forecast: + type: array + description: '' + items: + $ref: '#/components/schemas/ForecastObject' + Anomalies: + type: array + description: '' + x-examples: + example-1: + - United States CPI + - Real Estate Index + - South Korea Building Permits + items: + type: string + SeriesTypeWithCategory: + type: object + description: '' + properties: + series_type: + type: string + category: + type: string + SeriesTypeWithCategories: + type: array + description: '' + items: + $ref: '#/components/schemas/SeriesTypeWithCategory' + BadRequest: + type: object + description: Bad Request + required: + - status_code + - error + - message + properties: + status_code: + type: number + error: + type: string + message: + type: string + SeriesNames: + type: array + description: '' + x-examples: + Example: + - Global X Education ETF + - Vanguard 500 ETF + - iShares Asia 50 ETF + items: + type: string + Investment: + type: object + description: Investment of user + required: + - security_name + - ticker + - amount + - weight + properties: + security_name: + type: string + ticker: + type: string + amount: + type: number + weight: + type: number + x-examples: + Example: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + Portfolio: + type: array + description: portfolio for the user + x-examples: + Example: null + items: + $ref: '#/components/schemas/Investment' + Recommendation: + type: object + required: + - recommendation_type + - key + - recommendation + - problem + - suggested_changes + - benefit + properties: + recommendation_type: + type: string + key: + type: string + recommendation: + type: string + problem: + type: string + suggested_changes: + type: array + items: + $ref: '#/components/schemas/Investment' + benefit: + type: number + x-examples: + Example: + - recommendation_type: Diversification + key: Diversification-US Mid Cap Equities + benefit: 10 + recommendation: >- + Diversify your portfolio and decrease overall risk by adding + securities where you have low asset class exposure + problem: >- + Your exposure to US Mid Cap Equities is lower than the system + recommendation for you, increase exposure to reduce overall + aggregated portfolio risk appropriately + suggested_changes: + - security_name: Global X CleanTech ETF + ticker: CTEC + amount: 12000 + weight: 24.6 + Example-2: + - recommendation_type: Factor Exposure + key: Factor Exposure-Core Inflation + benefit: 4.3222 + recommendation: >- + Improve your portfolio sensitivity to upside surprises in Core + Inflation + problem: >- + If Core Inflation surprises significantly to the upside (which + happens 2.5% of the time) your portfolio could decrease by -6.3% + or more. + suggested_changes: + - security_name: Hubspot Inc + ticker: HUBS + amount: -6400 + weight: 3.4 + Recommendations: + type: array + description: Recommendations + x-examples: + Example: null + items: + $ref: '#/components/schemas/Recommendation' + PortfolioScore: + type: object + description: Portfolio Score + x-examples: + Example: + - portfolio_score: 720 + score_remark: Good + percentile_rank: 81 + risk_match_score: 10 + sharpe_ratio_score: 5.4 + downside_protection_score: 6.1 + properties: + portfolio_score: + type: number + score_remark: + type: string + percentile_rank: + type: number + risk_match_score: + type: number + sharpe_ratio_score: + type: number + downside_protection_score: + type: number + PortfolioAssessmentResponse: + type: object + properties: + portfolio_score: + type: number + score_remark: + type: string + percentile_rank: + type: number + risk_match_score: + type: number + sharpe_ratio_score: + type: number + downside_protection_score: + type: number + score_result: + $ref: '#/components/schemas/ScoreResult' + downside_component_statuses: + type: array + items: + $ref: '#/components/schemas/DownsideComponentStatus' + sharpe_ratio_analysis: + $ref: '#/components/schemas/SharpeRatioComponentStatus' + PortfolioInsights: + type: array + items: + type: string + ScoreResult: + type: object + properties: + risk_match_component_status: + $ref: '#/components/schemas/RiskMatchComponentStatus' + RiskMatchComponentStatus: + type: object + properties: + target_risk: + type: number + portfolio_risk: + type: number + DownsideComponentStatus: + type: object + properties: + name: + type: string + score: + type: number + status: + type: string + is_significant: + type: boolean + SharpeRatioComponentStatus: + type: object + properties: + sharpe_ratio_contribution: + type: object + additionalProperties: + type: number + portfolio_sharpe_ratio: + type: number + PortfolioPerformanceStats: + type: object + description: Portfolio Performance Stats + x-examples: + Example: + - returns: 6.3 + risk: 9.1 + sharpe_ratio: 0.69 + properties: + returns: + type: number + risk: + type: number + sharpe_ratio: + type: number + parameters: + ApiKey: + name: api_key + in: query + required: true + schema: + type: string + description: api_key for making the request. + securitySchemes: + api_key: + type: apiKey + name: api_key + in: query +konfigCliVersion: 1.38.34 diff --git a/sdks/db/fixed-specs/global-predictions-inc-fixed-spec.yaml b/sdks/db/fixed-specs/global-predictions-inc-fixed-spec.yaml new file mode 100644 index 0000000000..b024de6245 --- /dev/null +++ b/sdks/db/fixed-specs/global-predictions-inc-fixed-spec.yaml @@ -0,0 +1,1554 @@ +openapi: 3.0.0 +info: + title: Global Predictions API + description: Global Predictions external api + version: 1.0.0 + contact: + email: support@globalpredictions.com +servers: + - description: Global predictions URL + url: https://portfoliopilot.com/api +tags: + - description: >- + Update and access individual portfolios and their associated scores, + recommendations, and performance metrics + name: Portfolio Management + - description: >- + Access individual time series, historical or forecasted, from the large + Global Predictions data library + name: Data Series + - description: >- + Access the massive Global Predictions Knowledge Graph which contains over + 50,000 nodes and millions of relationships representing the global economy + name: Knowledge Graph + - description: >- + Access individual time series, historical or forecasted, from the large + Global Predictions data library + name: World Monitoring +paths: + /v1/influential_drivers: + get: + tags: + - Knowledge Graph + summary: Influential Drivers + operationId: KnowledgeGraph_getTopDriversBySeries + security: + - api_key: [] + description: List of top 10 most influential drivers (given by series_name type) + parameters: + - description: Series name for which the most influential drivers will be returned + name: series_name + in: query + required: true + schema: + type: string + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/InfluentialDrivers' + examples: + Example: + description: Influential Drivers output + value: + - United States CPI + - Real Estate Index + - South Korea Building Permits + - United States GDP + - Information Technology Index + - Communication Services Index + - Consumer Discretionary Index + - Financials Index + - China GDP + - United States Change in Confirmed Covid Cases + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/influential_drivers" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/history: + parameters: [] + get: + tags: + - Data Series + summary: History + operationId: DataSeries_getFullHistory + security: + - api_key: [] + description: >- + JSON representing the full history of the given series at the frequency + available + parameters: + - description: The series name to get the history + schema: + type: string + in: query + name: series_name + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/History' + examples: + Example: + description: History output which contains array of Date, Val + value: + - date: '2015-01-01' + val: 42.8 + - date: '2015-02-01' + val: 43.7 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/history" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/forecast: + get: + tags: + - Data Series + summary: Forecast + operationId: DataSeries_getForecastData + security: + - api_key: [] + description: >- + JSON representing a 2-12 month forecast starting from the last history + date available, forecasted at the same frequency as the historical data + parameters: + - description: The series name to get the forecast + schema: + type: string + in: query + name: series_name + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Forecast' + examples: + Example: + description: Forecast output which contains array of Date, Val, High, Low + value: + - date: '2021-01-01' + val: 88.2 + high: 92.2 + low: 84.2 + - date: '2021-02-01' + val: 89.4 + high: 93.4 + low: 85.4 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/forecast" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/anomalies: + get: + tags: + - World Monitoring + summary: Anomalies + operationId: WorldMonitoring_listEconomicAnomalies + security: + - api_key: [] + description: >- + List of series with discovered economic anomalies which have occurred in + the last 3 months + parameters: [] + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Anomalies' + examples: + Example: + description: Anomalies output + value: + - United States CPI + - Real Estate Index + - South Korea Building Permits + - United States GDP + - Information Technology Index + - Communication Services Index + - Consumer Discretionary Index + - Financials Index + - China GDP + - Clear Shares OCIO ETF + - IQ Hedge Multi-Strategy Tracker ETF + - RPAR Risk Parity ETF + - Taiwan GDP + - Vanguard Energy ETF + - Vanguard Value ETF + - Ability Inc + - United States Inter Bank Rate + - Invesco Senior Loan ETF + - India GDP + - Taiwan Total Investment + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: |- + import requests + + url = "https://portfoliopilot.com/api/v1/anomalies" + + querystring = {"api_key":"SOME_STRING_VALUE"} + + response = requests.request("GET", url, params=querystring) + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE") + .asString(); + /v1/all_series_types: + get: + tags: + - Data Series + summary: Series Types + operationId: DataSeries_getAllTypes + security: + - api_key: [] + description: Retrieve all series types and their associated categories + parameters: [] + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesTypeWithCategories' + examples: + Example: + description: Series Type with their associated categories + value: + - series_type: Financial Market + category: Currencies + - series_type: Macroeconomics + category: Central Government Debt + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series_types not found + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: |- + import requests + + url = "https://portfoliopilot.com/api/v1/all_series_types" + + querystring = {"api_key":"SOME_STRING_VALUE"} + + response = requests.request("GET", url, params=querystring) + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE") + .asString(); + /v1/all_series_names: + get: + tags: + - Data Series + summary: Series Names + operationId: DataSeries_getAllNames + security: + - api_key: [] + description: Retrieve all available time series within a given series type + parameters: + - description: The series type for which the series names are returned + schema: + type: string + in: query + name: series_type + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesNames' + examples: + Example: + description: All available time series names within a given series type + value: + - Global X Education ETF + - Vanguard 500 ETF + - iShares Asia 50 ETF + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: series_type is invalid + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/all_series_names" + + + querystring = + {"series_type":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio: + get: + tags: + - Portfolio Management + summary: Get Portfolio + operationId: PortfolioManagement_getSecuritiesAmounts + security: + - api_key: [] + description: >- + Retrieve all securities and their associated amounts for a given + portfolio id + parameters: + - description: The portfolio id for the portfolio to retrieve + schema: + type: integer + in: query + name: portfolio_id + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Portfolio' + examples: + Example: + description: List of all securities for the given portfolio id + value: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio" + + + querystring = + {"portfolio_id":"SOME_INTEGER_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/update_portfolio: + post: + tags: + - Portfolio Management + summary: Update portfolio + operationId: PortfolioManagement_updatePortfolio + security: + - api_key: [] + description: >- + Create or update the portfolio for the given id with the given list of + tickers and amounts + parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioManagementUpdatePortfolioRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: >- + #/components/schemas/PortfolioManagementUpdatePortfolioResponse + examples: + Example: + description: Portfolio updated successfully + value: + - success: ok + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: >- + portfolio or portfolio_id or investor_preference is + invalid + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE'; + + + let options = { + method: 'POST', + headers: {'content-type': 'application/json'}, + body: '[{"portfolio":[{"security_name":"Vanguard 500 ETF","ticker":"VOO","amount":20000,"weight":12.2}],"portfolio_id":102,"investor_preference":"aggressive"}]' + }; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/update_portfolio" + + + querystring = {"api_key":"SOME_STRING_VALUE"} + + + payload = [ + { + "portfolio": [ + { + "security_name": "Vanguard 500 ETF", + "ticker": "VOO", + "amount": 20000, + "weight": 12.2 + } + ], + "portfolio_id": 102, + "investor_preference": "aggressive" + } + ] + + headers = {"content-type": "application/json"} + + + response = requests.request("POST", url, json=payload, + headers=headers, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request POST \ + --url 'https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE' \ + --header 'content-type: application/json' \ + --data '[{"portfolio":[{"security_name":"Vanguard 500 ETF","ticker":"VOO","amount":20000,"weight":12.2}],"portfolio_id":102,"investor_preference":"aggressive"}]' + - lang: Java + source: >- + HttpResponse response = + Unirest.post("https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE") + .header("content-type", "application/json") + .body("[{\"portfolio\":[{\"security_name\":\"Vanguard 500 ETF\",\"ticker\":\"VOO\",\"amount\":20000,\"weight\":12.2}],\"portfolio_id\":102,\"investor_preference\":\"aggressive\"}]") + .asString(); + /v1/get_recommendations: + get: + tags: + - Portfolio Management + summary: Portfolio Recommendations + operationId: PortfolioManagement_computeRecommendations + security: + - api_key: [] + description: Compute and return all recommendations for a given portfolio + parameters: + - description: The portfolio id for the portfolio to get recommendations for + schema: + type: integer + in: query + name: portfolio_id + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Recommendations' + examples: + Example: + description: All computed recommendations for the given portfolio id + value: + Example: + - recommendation_type: Diversification + key: Diversification-US Mid Cap Equities + benefit: 10 + recommendation: >- + Diversify your portfolio and decrease overall risk by + adding securities where you have low asset class + exposure + problem: >- + Your exposure to US Mid Cap Equities is lower than the + system recommendation for you, increase exposure to + reduce overall aggregated portfolio risk appropriately + suggested_changes: + - security_name: Global X CleanTech ETF + ticker: CTEC + amount: 12000 + weight: 24.6 + Example-2: + - recommendation_type: Factor Exposure + key: Factor Exposure-Core Inflation + benefit: 4.3222 + recommendation: >- + Improve your portfolio sensitivity to upside surprises + in Core Inflation + problem: >- + If Core Inflation surprises significantly to the + upside (which happens 2.5% of the time) your portfolio + could decrease by -6.3% or more. + suggested_changes: + - security_name: Hubspot Inc + ticker: HUBS + amount: -6400 + weight: 3.4 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_recommendations" + + + querystring = + {"portfolio_id":"SOME_INTEGER_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_score: + get: + tags: + - Portfolio Management + summary: Portfolio Score + operationId: PortfolioManagement_computePortfolioScore + security: + - api_key: [] + description: Compute and return the portfolio score and associated sub-scores + parameters: + - description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + schema: + type: string + in: query + name: portfolio_dict + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioScore' + examples: + Example: + description: >- + The computed Portfolio Score and score components for a + given portfolio + value: + - portfolio_score: 720 + score_remark: Good + percentile_rank: 81 + risk_match_score: 10 + sharpe_ratio_score: 5.4 + downside_protection_score: 6.1 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_dict is invalid + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_score" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_performance_stats: + get: + tags: + - Portfolio Management + summary: Portfolio Performance Stats + operationId: PortfolioManagement_computePerformanceStats + security: + - api_key: [] + description: Compute and return the performance statistics for a given portfolio + parameters: + - description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + schema: + type: string + in: query + name: portfolio_dict + required: true + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioPerformanceStats' + examples: + Example: + description: >- + The computed performance statistics for the given portfolio + id + value: + - returns: 6.3 + risk: 9.1 + sharpe_ratio: 0.69 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = + "https://portfoliopilot.com/api/v1/get_portfolio_performance_stats" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_assessment: + get: + tags: + - Portfolio Management + summary: Get Portfolio Assessment + operationId: PortfolioManagement_getAssessmentData + security: + - api_key: [] + description: Get portfolio assessment data for a given portfolio + parameters: + - description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + schema: + type: string + in: query + name: portfolio_dict + required: true + - description: The target risk level for the portfolio. + name: target_risk + in: query + required: false + schema: + type: string + enum: + - conservative + - moderately_conservative + - moderately_aggressive + - aggressive + - very_aggressive + - generic + - extreme + responses: + '200': + description: Portfolio assessment data + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioAssessmentResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_assessment" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","target_risk":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_insights: + get: + tags: + - Portfolio Management + summary: Get Portfolio Insights + operationId: PortfolioManagement_getInsights + security: + - api_key: [] + description: Get portfolio insights for a given portfolio + parameters: + - description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to generate insights + schema: + type: string + in: query + name: portfolio_dict + required: true + responses: + '200': + description: Portfolio Insights list + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioInsights' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_insights" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); +components: + parameters: + ApiKey: + description: api_key for making the request. + name: api_key + in: query + required: true + schema: + type: string + links: {} + callbacks: {} + schemas: + InfluentialDrivers: + description: '' + type: array + x-examples: + Example: + - United States GDP + - United States CPI + - Apple Inc + items: + type: string + HistoryObject: + type: object + properties: + date: + type: string + val: + type: number + required: + - date + - val + x-examples: + Example: + - date: '2015-01-01' + val: 42.8 + - date: '2015-02-01' + val: 43.7 + History: + description: '' + type: array + items: + $ref: '#/components/schemas/HistoryObject' + ForecastObject: + description: '' + type: object + required: + - date + - val + - high + - low + properties: + date: + type: string + val: + type: number + high: + type: number + low: + type: number + x-examples: + example-1: + - date: '2021-01-01' + val: 88.2 + high: 92.2 + low: 84.2 + - date: '2021-02-01' + val: 89.4 + high: 93.4 + low: 85.4 + Forecast: + description: '' + type: array + items: + $ref: '#/components/schemas/ForecastObject' + Anomalies: + description: '' + type: array + x-examples: + example-1: + - United States CPI + - Real Estate Index + - South Korea Building Permits + items: + type: string + SeriesTypeWithCategory: + description: '' + type: object + properties: + series_type: + type: string + category: + type: string + SeriesTypeWithCategories: + description: '' + type: array + items: + $ref: '#/components/schemas/SeriesTypeWithCategory' + BadRequest: + description: Bad Request + type: object + required: + - status_code + - error + - message + properties: + status_code: + type: number + error: + type: string + message: + type: string + SeriesNames: + description: '' + type: array + x-examples: + Example: + - Global X Education ETF + - Vanguard 500 ETF + - iShares Asia 50 ETF + items: + type: string + Investment: + description: Investment of user + type: object + required: + - security_name + - ticker + - amount + - weight + properties: + security_name: + type: string + ticker: + type: string + amount: + type: number + weight: + type: number + x-examples: + Example: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + Portfolio: + description: portfolio for the user + type: array + x-examples: + Example: null + items: + $ref: '#/components/schemas/Investment' + Recommendation: + type: object + required: + - recommendation_type + - key + - recommendation + - problem + - suggested_changes + - benefit + properties: + recommendation_type: + type: string + key: + type: string + recommendation: + type: string + problem: + type: string + suggested_changes: + type: array + items: + $ref: '#/components/schemas/Investment' + benefit: + type: number + x-examples: + Example: + - recommendation_type: Diversification + key: Diversification-US Mid Cap Equities + benefit: 10 + recommendation: >- + Diversify your portfolio and decrease overall risk by adding + securities where you have low asset class exposure + problem: >- + Your exposure to US Mid Cap Equities is lower than the system + recommendation for you, increase exposure to reduce overall + aggregated portfolio risk appropriately + suggested_changes: + - security_name: Global X CleanTech ETF + ticker: CTEC + amount: 12000 + weight: 24.6 + Example-2: + - recommendation_type: Factor Exposure + key: Factor Exposure-Core Inflation + benefit: 4.3222 + recommendation: >- + Improve your portfolio sensitivity to upside surprises in Core + Inflation + problem: >- + If Core Inflation surprises significantly to the upside (which + happens 2.5% of the time) your portfolio could decrease by -6.3% + or more. + suggested_changes: + - security_name: Hubspot Inc + ticker: HUBS + amount: -6400 + weight: 3.4 + Recommendations: + description: Recommendations + type: array + x-examples: + Example: null + items: + $ref: '#/components/schemas/Recommendation' + PortfolioScore: + description: Portfolio Score + type: object + x-examples: + Example: + - portfolio_score: 720 + score_remark: Good + percentile_rank: 81 + risk_match_score: 10 + sharpe_ratio_score: 5.4 + downside_protection_score: 6.1 + properties: + portfolio_score: + type: number + score_remark: + type: string + percentile_rank: + type: number + risk_match_score: + type: number + sharpe_ratio_score: + type: number + downside_protection_score: + type: number + PortfolioAssessmentResponse: + type: object + properties: + portfolio_score: + type: number + score_remark: + type: string + percentile_rank: + type: number + risk_match_score: + type: number + sharpe_ratio_score: + type: number + downside_protection_score: + type: number + score_result: + $ref: '#/components/schemas/ScoreResult' + downside_component_statuses: + type: array + items: + $ref: '#/components/schemas/DownsideComponentStatus' + sharpe_ratio_analysis: + $ref: '#/components/schemas/SharpeRatioComponentStatus' + PortfolioInsights: + type: array + items: + type: string + ScoreResult: + type: object + properties: + risk_match_component_status: + $ref: '#/components/schemas/RiskMatchComponentStatus' + RiskMatchComponentStatus: + type: object + properties: + target_risk: + type: number + portfolio_risk: + type: number + DownsideComponentStatus: + type: object + properties: + name: + type: string + score: + type: number + status: + type: string + is_significant: + type: boolean + SharpeRatioComponentStatus: + type: object + properties: + sharpe_ratio_contribution: + type: object + additionalProperties: + type: number + portfolio_sharpe_ratio: + type: number + PortfolioPerformanceStats: + description: Portfolio Performance Stats + type: object + x-examples: + Example: + - returns: 6.3 + risk: 9.1 + sharpe_ratio: 0.69 + properties: + returns: + type: number + risk: + type: number + sharpe_ratio: + type: number + PortfolioManagementUpdatePortfolioRequest: + type: object + properties: + portfolio: + $ref: '#/components/schemas/Portfolio' + portfolio_id: + type: number + investor_preference: + type: string + example: + - portfolio: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + portfolio_id: 102 + investor_preference: aggressive + PortfolioManagementUpdatePortfolioResponse: + type: object + properties: + success: + type: string + securitySchemes: + api_key: + type: apiKey + name: api_key + in: query +security: + - api_key: [] +externalDocs: + url: https://www.globalpredictions.com diff --git a/sdks/db/generate-repository-description-cache/global-predictions-inc.json b/sdks/db/generate-repository-description-cache/global-predictions-inc.json new file mode 100644 index 0000000000..c28867b4be --- /dev/null +++ b/sdks/db/generate-repository-description-cache/global-predictions-inc.json @@ -0,0 +1,3 @@ +{ + "Global Predictions is building an AI-powered WealthOS, a full-stack solution for financial advice and personalized recommendations built on top of our proprietary Economic Insights Engine. We power fintech solutions for millions of people through the GP API and customized insights. Our flagship product is PortfolioPilot for individuals, the world's best financial advisor, with over $6.2B assets on platform.\n\nPlease read our important disclosures: https://www.globalpredictions.com/disclosures": "Building AI-powered WealthOS for financial advice with Economic Insights Engine. Providing fintech solutions through GP API and PortfolioPilot, the world's best financial advisor. Global Predictions Inc's {language} SDK generated by Konfig (https://konfigthis.com/)." +} \ No newline at end of file diff --git a/sdks/db/intermediate-fixed-specs/global-predictions-inc/openapi.yaml b/sdks/db/intermediate-fixed-specs/global-predictions-inc/openapi.yaml new file mode 100644 index 0000000000..bc79af1dca --- /dev/null +++ b/sdks/db/intermediate-fixed-specs/global-predictions-inc/openapi.yaml @@ -0,0 +1,1536 @@ +openapi: 3.0.0 +info: + title: Global Predictions API + version: 1.0.0 + contact: + email: support@globalpredictions.com + description: Global Predictions external api +tags: + - name: Portfolio Management + description: >- + Update and access individual portfolios and their associated scores, + recommendations, and performance metrics + - name: Knowledge Graph + description: >- + Access the massive Global Predictions Knowledge Graph which contains over + 50,000 nodes and millions of relationships representing the global economy + - name: Data Series + description: >- + Access individual time series, historical or forecasted, from the large + Global Predictions data library + - name: World Monitoring + description: >- + Access individual time series, historical or forecasted, from the large + Global Predictions data library +paths: + /v1/influential_drivers: + get: + summary: Influential Drivers + description: List of top 10 most influential drivers (given by series_name type) + parameters: + - name: series_name + in: query + required: true + schema: + type: string + description: Series name for which the most influential drivers will be returned + - $ref: '#/components/parameters/ApiKey' + tags: + - Knowledge Graph + operationId: get_influential_drivers + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/InfluentialDrivers' + examples: + Example: + description: Influential Drivers output + value: + - United States CPI + - Real Estate Index + - South Korea Building Permits + - United States GDP + - Information Technology Index + - Communication Services Index + - Consumer Discretionary Index + - Financials Index + - China GDP + - United States Change in Confirmed Covid Cases + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/influential_drivers" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/influential_drivers?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/history: + parameters: [] + get: + summary: History + operationId: get-history + tags: + - Data Series + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/History' + examples: + Example: + description: History output which contains array of Date, Val + value: + - date: '2015-01-01' + val: 42.8 + - date: '2015-02-01' + val: 43.7 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + description: >- + JSON representing the full history of the given series at the frequency + available + parameters: + - schema: + type: string + in: query + name: series_name + description: The series name to get the history + - $ref: '#/components/parameters/ApiKey' + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/history" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/history?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/forecast: + get: + tags: + - Data Series + summary: Forecast + operationId: get-forecast + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Forecast' + examples: + Example: + description: Forecast output which contains array of Date, Val, High, Low + value: + - date: '2021-01-01' + val: 88.2 + high: 92.2 + low: 84.2 + - date: '2021-02-01' + val: 89.4 + high: 93.4 + low: 85.4 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + description: >- + JSON representing a 2-12 month forecast starting from the last history + date available, forecasted at the same frequency as the historical data + parameters: + - schema: + type: string + in: query + name: series_name + description: The series name to get the forecast + - $ref: '#/components/parameters/ApiKey' + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/forecast" + + + querystring = + {"series_name":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/forecast?series_name=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/anomalies: + get: + tags: + - World Monitoring + summary: Anomalies + operationId: get-anomalies + parameters: + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Anomalies' + examples: + Example: + description: Anomalies output + value: + - United States CPI + - Real Estate Index + - South Korea Building Permits + - United States GDP + - Information Technology Index + - Communication Services Index + - Consumer Discretionary Index + - Financials Index + - China GDP + - Clear Shares OCIO ETF + - IQ Hedge Multi-Strategy Tracker ETF + - RPAR Risk Parity ETF + - Taiwan GDP + - Vanguard Energy ETF + - Vanguard Value ETF + - Ability Inc + - United States Inter Bank Rate + - Invesco Senior Loan ETF + - India GDP + - Taiwan Total Investment + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series doesn't exist + description: >- + List of series with discovered economic anomalies which have occurred in + the last 3 months + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: |- + import requests + + url = "https://portfoliopilot.com/api/v1/anomalies" + + querystring = {"api_key":"SOME_STRING_VALUE"} + + response = requests.request("GET", url, params=querystring) + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/anomalies?api_key=SOME_STRING_VALUE") + .asString(); + /v1/all_series_types: + get: + tags: + - Data Series + summary: Series Types + operationId: get-series-types + parameters: + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesTypeWithCategories' + examples: + Example: + description: Series Type with their associated categories + value: + - series_type: Financial Market + category: Currencies + - series_type: Macroeconomics + category: Central Government Debt + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: Series_types not found + description: Retrieve all series types and their associated categories + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: |- + import requests + + url = "https://portfoliopilot.com/api/v1/all_series_types" + + querystring = {"api_key":"SOME_STRING_VALUE"} + + response = requests.request("GET", url, params=querystring) + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/all_series_types?api_key=SOME_STRING_VALUE") + .asString(); + /v1/all_series_names: + get: + tags: + - Data Series + summary: Series Names + operationId: get-series-names + parameters: + - schema: + type: string + in: query + name: series_type + description: The series type for which the series names are returned + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SeriesNames' + examples: + Example: + description: All available time series names within a given series type + value: + - Global X Education ETF + - Vanguard 500 ETF + - iShares Asia 50 ETF + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: series_type is invalid + description: Retrieve all available time series within a given series type + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/all_series_names" + + + querystring = + {"series_type":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/all_series_names?series_type=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio: + get: + tags: + - Portfolio Management + summary: Get Portfolio + operationId: get-portfolio + parameters: + - schema: + type: integer + in: query + name: portfolio_id + required: true + description: The portfolio id for the portfolio to retrieve + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Portfolio' + examples: + Example: + description: List of all securities for the given portfolio id + value: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + description: >- + Retrieve all securities and their associated amounts for a given + portfolio id + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio" + + + querystring = + {"portfolio_id":"SOME_INTEGER_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/update_portfolio: + post: + tags: + - Portfolio Management + summary: Update portfolio + operationId: update-portfolio + requestBody: + content: + application/json: + schema: + type: object + properties: + portfolio: + $ref: '#/components/schemas/Portfolio' + portfolio_id: + type: number + investor_preference: + type: string + example: + - portfolio: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + portfolio_id: 102 + investor_preference: aggressive + parameters: + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + success: + type: string + examples: + Example: + description: Portfolio updated successfully + value: + - success: ok + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: >- + portfolio or portfolio_id or investor_preference is + invalid + description: >- + Create or update the portfolio for the given id with the given list of + tickers and amounts + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE'; + + + let options = { + method: 'POST', + headers: {'content-type': 'application/json'}, + body: '[{"portfolio":[{"security_name":"Vanguard 500 ETF","ticker":"VOO","amount":20000,"weight":12.2}],"portfolio_id":102,"investor_preference":"aggressive"}]' + }; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/update_portfolio" + + + querystring = {"api_key":"SOME_STRING_VALUE"} + + + payload = [ + { + "portfolio": [ + { + "security_name": "Vanguard 500 ETF", + "ticker": "VOO", + "amount": 20000, + "weight": 12.2 + } + ], + "portfolio_id": 102, + "investor_preference": "aggressive" + } + ] + + headers = {"content-type": "application/json"} + + + response = requests.request("POST", url, json=payload, + headers=headers, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request POST \ + --url 'https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE' \ + --header 'content-type: application/json' \ + --data '[{"portfolio":[{"security_name":"Vanguard 500 ETF","ticker":"VOO","amount":20000,"weight":12.2}],"portfolio_id":102,"investor_preference":"aggressive"}]' + - lang: Java + source: >- + HttpResponse response = + Unirest.post("https://portfoliopilot.com/api/v1/update_portfolio?api_key=SOME_STRING_VALUE") + .header("content-type", "application/json") + .body("[{\"portfolio\":[{\"security_name\":\"Vanguard 500 ETF\",\"ticker\":\"VOO\",\"amount\":20000,\"weight\":12.2}],\"portfolio_id\":102,\"investor_preference\":\"aggressive\"}]") + .asString(); + /v1/get_recommendations: + get: + tags: + - Portfolio Management + summary: Portfolio Recommendations + operationId: get-recommendations + parameters: + - schema: + type: integer + in: query + name: portfolio_id + required: true + description: The portfolio id for the portfolio to get recommendations for + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Recommendations' + examples: + Example: + description: All computed recommendations for the given portfolio id + value: + Example: + - recommendation_type: Diversification + key: Diversification-US Mid Cap Equities + benefit: 10 + recommendation: >- + Diversify your portfolio and decrease overall risk by + adding securities where you have low asset class + exposure + problem: >- + Your exposure to US Mid Cap Equities is lower than the + system recommendation for you, increase exposure to + reduce overall aggregated portfolio risk appropriately + suggested_changes: + - security_name: Global X CleanTech ETF + ticker: CTEC + amount: 12000 + weight: 24.6 + Example-2: + - recommendation_type: Factor Exposure + key: Factor Exposure-Core Inflation + benefit: 4.3222 + recommendation: >- + Improve your portfolio sensitivity to upside surprises + in Core Inflation + problem: >- + If Core Inflation surprises significantly to the + upside (which happens 2.5% of the time) your portfolio + could decrease by -6.3% or more. + suggested_changes: + - security_name: Hubspot Inc + ticker: HUBS + amount: -6400 + weight: 3.4 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + description: Compute and return all recommendations for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_recommendations" + + + querystring = + {"portfolio_id":"SOME_INTEGER_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_recommendations?portfolio_id=SOME_INTEGER_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_score: + get: + tags: + - Portfolio Management + summary: Portfolio Score + operationId: get-portfolio-score + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioScore' + examples: + Example: + description: >- + The computed Portfolio Score and score components for a + given portfolio + value: + - portfolio_score: 720 + score_remark: Good + percentile_rank: 81 + risk_match_score: 10 + sharpe_ratio_score: 5.4 + downside_protection_score: 6.1 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_dict is invalid + description: Compute and return the portfolio score and associated sub-scores + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_score" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_score?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_performance_stats: + get: + tags: + - Portfolio Management + summary: Portfolio Performance Stats + operationId: get-portfolio-performance-stats + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioPerformanceStats' + examples: + Example: + description: >- + The computed performance statistics for the given portfolio + id + value: + - returns: 6.3 + risk: 9.1 + sharpe_ratio: 0.69 + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + examples: + Example: + description: Bad Request + value: + status_code: 400 + error: Bad Request + message: portfolio_id is invalid + description: Compute and return the performance statistics for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = + "https://portfoliopilot.com/api/v1/get_portfolio_performance_stats" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_performance_stats?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_assessment: + get: + tags: + - Portfolio Management + summary: Get Portfolio Assessment + operationId: get-portfolio-assessment + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to calculate the portfolio score for + - name: target_risk + in: query + required: false + description: The target risk level for the portfolio. + schema: + type: string + enum: + - conservative + - moderately_conservative + - moderately_aggressive + - aggressive + - very_aggressive + - generic + - extreme + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: Portfolio assessment data + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioAssessmentResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + description: Get portfolio assessment data for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_assessment" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","target_risk":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_assessment?portfolio_dict=SOME_STRING_VALUE&target_risk=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); + /v1/get_portfolio_insights: + get: + tags: + - Portfolio Management + summary: Get Portfolio Insights + operationId: get-portfolio-insights + parameters: + - schema: + type: string + in: query + name: portfolio_dict + required: true + description: >- + A stringified (jsonified) portfolio dict (key=ticker, value=amount) + to generate insights + - $ref: '#/components/parameters/ApiKey' + responses: + '200': + description: Portfolio Insights list + content: + application/json: + schema: + $ref: '#/components/schemas/PortfolioInsights' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/BadRequest' + description: Get portfolio insights for a given portfolio + x-code-samples: + - lang: Node + source: >- + const fetch = require('node-fetch'); + + + let url = + 'https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE'; + + + let options = {method: 'GET'}; + + + fetch(url, options) + .then(res => res.json()) + .then(json => console.log(json)) + .catch(err => console.error('error:' + err)); + - lang: Python + source: >- + import requests + + + url = "https://portfoliopilot.com/api/v1/get_portfolio_insights" + + + querystring = + {"portfolio_dict":"SOME_STRING_VALUE","api_key":"SOME_STRING_VALUE"} + + + response = requests.request("GET", url, params=querystring) + + + print(response.text) + - lang: Shell + source: |- + curl --request GET \ + --url 'https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE' + - lang: Java + source: >- + HttpResponse response = + Unirest.get("https://portfoliopilot.com/api/v1/get_portfolio_insights?portfolio_dict=SOME_STRING_VALUE&api_key=SOME_STRING_VALUE") + .asString(); +externalDocs: + url: https://www.globalpredictions.com +security: + - api_key: [] +servers: + - url: https://portfoliopilot.com/api + description: Global predictions URL +components: + links: {} + callbacks: {} + schemas: + InfluentialDrivers: + type: array + description: '' + x-examples: + Example: + - United States GDP + - United States CPI + - Apple Inc + items: + type: string + HistoryObject: + type: object + properties: + date: + type: string + val: + type: number + required: + - date + - val + x-examples: + Example: + - date: '2015-01-01' + val: 42.8 + - date: '2015-02-01' + val: 43.7 + History: + type: array + description: '' + items: + $ref: '#/components/schemas/HistoryObject' + ForecastObject: + type: object + description: '' + required: + - date + - val + - high + - low + properties: + date: + type: string + val: + type: number + high: + type: number + low: + type: number + x-examples: + example-1: + - date: '2021-01-01' + val: 88.2 + high: 92.2 + low: 84.2 + - date: '2021-02-01' + val: 89.4 + high: 93.4 + low: 85.4 + Forecast: + type: array + description: '' + items: + $ref: '#/components/schemas/ForecastObject' + Anomalies: + type: array + description: '' + x-examples: + example-1: + - United States CPI + - Real Estate Index + - South Korea Building Permits + items: + type: string + SeriesTypeWithCategory: + type: object + description: '' + properties: + series_type: + type: string + category: + type: string + SeriesTypeWithCategories: + type: array + description: '' + items: + $ref: '#/components/schemas/SeriesTypeWithCategory' + BadRequest: + type: object + description: Bad Request + required: + - status_code + - error + - message + properties: + status_code: + type: number + error: + type: string + message: + type: string + SeriesNames: + type: array + description: '' + x-examples: + Example: + - Global X Education ETF + - Vanguard 500 ETF + - iShares Asia 50 ETF + items: + type: string + Investment: + type: object + description: Investment of user + required: + - security_name + - ticker + - amount + - weight + properties: + security_name: + type: string + ticker: + type: string + amount: + type: number + weight: + type: number + x-examples: + Example: + - security_name: Vanguard 500 ETF + ticker: VOO + amount: 20000 + weight: 12.2 + Portfolio: + type: array + description: portfolio for the user + x-examples: + Example: null + items: + $ref: '#/components/schemas/Investment' + Recommendation: + type: object + required: + - recommendation_type + - key + - recommendation + - problem + - suggested_changes + - benefit + properties: + recommendation_type: + type: string + key: + type: string + recommendation: + type: string + problem: + type: string + suggested_changes: + type: array + items: + $ref: '#/components/schemas/Investment' + benefit: + type: number + x-examples: + Example: + - recommendation_type: Diversification + key: Diversification-US Mid Cap Equities + benefit: 10 + recommendation: >- + Diversify your portfolio and decrease overall risk by adding + securities where you have low asset class exposure + problem: >- + Your exposure to US Mid Cap Equities is lower than the system + recommendation for you, increase exposure to reduce overall + aggregated portfolio risk appropriately + suggested_changes: + - security_name: Global X CleanTech ETF + ticker: CTEC + amount: 12000 + weight: 24.6 + Example-2: + - recommendation_type: Factor Exposure + key: Factor Exposure-Core Inflation + benefit: 4.3222 + recommendation: >- + Improve your portfolio sensitivity to upside surprises in Core + Inflation + problem: >- + If Core Inflation surprises significantly to the upside (which + happens 2.5% of the time) your portfolio could decrease by -6.3% + or more. + suggested_changes: + - security_name: Hubspot Inc + ticker: HUBS + amount: -6400 + weight: 3.4 + Recommendations: + type: array + description: Recommendations + x-examples: + Example: null + items: + $ref: '#/components/schemas/Recommendation' + PortfolioScore: + type: object + description: Portfolio Score + x-examples: + Example: + - portfolio_score: 720 + score_remark: Good + percentile_rank: 81 + risk_match_score: 10 + sharpe_ratio_score: 5.4 + downside_protection_score: 6.1 + properties: + portfolio_score: + type: number + score_remark: + type: string + percentile_rank: + type: number + risk_match_score: + type: number + sharpe_ratio_score: + type: number + downside_protection_score: + type: number + PortfolioAssessmentResponse: + type: object + properties: + portfolio_score: + type: number + score_remark: + type: string + percentile_rank: + type: number + risk_match_score: + type: number + sharpe_ratio_score: + type: number + downside_protection_score: + type: number + score_result: + $ref: '#/components/schemas/ScoreResult' + downside_component_statuses: + type: array + items: + $ref: '#/components/schemas/DownsideComponentStatus' + sharpe_ratio_analysis: + $ref: '#/components/schemas/SharpeRatioComponentStatus' + PortfolioInsights: + type: array + items: + type: string + ScoreResult: + type: object + properties: + risk_match_component_status: + $ref: '#/components/schemas/RiskMatchComponentStatus' + RiskMatchComponentStatus: + type: object + properties: + target_risk: + type: number + portfolio_risk: + type: number + DownsideComponentStatus: + type: object + properties: + name: + type: string + score: + type: number + status: + type: string + is_significant: + type: boolean + SharpeRatioComponentStatus: + type: object + properties: + sharpe_ratio_contribution: + type: object + additionalProperties: + type: number + portfolio_sharpe_ratio: + type: number + PortfolioPerformanceStats: + type: object + description: Portfolio Performance Stats + x-examples: + Example: + - returns: 6.3 + risk: 9.1 + sharpe_ratio: 0.69 + properties: + returns: + type: number + risk: + type: number + sharpe_ratio: + type: number + parameters: + ApiKey: + name: api_key + in: query + required: true + schema: + type: string + description: api_key for making the request. + securitySchemes: + api_key: + type: apiKey + name: api_key + in: query diff --git a/sdks/db/processed-custom-request-cache/globalpredictions.com.yaml b/sdks/db/processed-custom-request-cache/globalpredictions.com.yaml new file mode 100644 index 0000000000..9da7ce3b97 --- /dev/null +++ b/sdks/db/processed-custom-request-cache/globalpredictions.com.yaml @@ -0,0 +1,20 @@ +processed: + securitySchemes: + api_key: + type: apiKey + name: api_key + in: query + apiBaseUrl: https://portfoliopilot.com/api + apiVersion: 1.0.0 + apiDescription: Global Predictions external api + apiTitle: Global Predictions API + endpoints: 13 + sdkMethods: 14 + schemas: 22 + parameters: 27 + contactEmail: support@globalpredictions.com + originalCustomRequest: + type: GET + url: https://portfoliopilot.com/static/external_api/external_api.yaml + customRequestSpecFilename: globalpredictions.com.yaml + difficultyScore: 31.75 diff --git a/sdks/db/progress/global-predictions-inc-progress.yaml b/sdks/db/progress/global-predictions-inc-progress.yaml new file mode 100644 index 0000000000..f5da5d037e --- /dev/null +++ b/sdks/db/progress/global-predictions-inc-progress.yaml @@ -0,0 +1,54 @@ +examples: {} +examples_2: {} +examples_3: {} +operationIds: + /v1/all_series_names: + get: DataSeries_getAllNames + /v1/all_series_types: + get: DataSeries_getAllTypes + /v1/anomalies: + get: WorldMonitoring_listEconomicAnomalies + /v1/forecast: + get: DataSeries_getForecastData + /v1/get_portfolio: + get: PortfolioManagement_getSecuritiesAmounts + /v1/get_portfolio_assessment: + get: PortfolioManagement_getAssessmentData + /v1/get_portfolio_insights: + get: PortfolioManagement_getInsights + /v1/get_portfolio_performance_stats: + get: PortfolioManagement_computePerformanceStats + /v1/get_portfolio_score: + get: PortfolioManagement_computePortfolioScore + /v1/get_recommendations: + get: PortfolioManagement_computeRecommendations + /v1/history: + get: DataSeries_getFullHistory + /v1/influential_drivers: + get: KnowledgeGraph_getTopDriversBySeries + /v1/update_portfolio: + post: PortfolioManagement_updatePortfolio +operationTags: {} +renameTags: {} +requestSchemaNames: + /v1/update_portfolio: + post: + application/json: PortfolioManagementUpdatePortfolioRequest +responseDescriptions: {} +responseSchemaNames: + /v1/update_portfolio: + post: + '200': + application/json: PortfolioManagementUpdatePortfolioResponse +securityParameters: + portfolio_dict: + query: false + portfolio_id: + query: false + series_name: + query: false + series_type: + query: false + target_risk: + query: false +validServerUrls: {} diff --git a/sdks/db/published/from-custom-request_globalpredictions.com.json b/sdks/db/published/from-custom-request_globalpredictions.com.json new file mode 100644 index 0000000000..ee5191cea8 --- /dev/null +++ b/sdks/db/published/from-custom-request_globalpredictions.com.json @@ -0,0 +1,395 @@ +{ + "securitySchemes": { + "api_key": { + "type": "apiKey", + "name": "api_key", + "in": "query" + } + }, + "apiBaseUrl": "https://portfoliopilot.com/api", + "apiVersion": "1.0.0", + "apiDescription": "Global Predictions external api", + "apiTitle": "Global Predictions API", + "endpoints": 13, + "sdkMethods": 14, + "schemas": 24, + "parameters": 27, + "contactEmail": "support@globalpredictions.com", + "originalCustomRequest": { + "type": "GET", + "url": "https://portfoliopilot.com/static/external_api/external_api.yaml" + }, + "customRequestSpecFilename": "globalpredictions.com.yaml", + "difficultyScore": 31.75, + "difficulty": "Very Easy", + "company": "Global Predictions Inc", + "sdkName": "global-predictions-inc-{language}-sdk", + "clientName": "GlobalPredictionsInc", + "metaDescription": "Global Predictions is building an AI-powered WealthOS, a full-stack solution for financial advice and personalized recommendations built on top of our proprietary Economic Insights Engine. We power fintech solutions for millions of people through the GP API and customized insights. Our flagship product is PortfolioPilot for individuals, the world's best financial advisor, with over $6.2B assets on platform.\n\nPlease read our important disclosures: https://www.globalpredictions.com/disclosures", + "apiStatusUrls": "inherit", + "homepage": "www.globalpredictions.com/", + "developerDocumentation": "portfoliopilot.com/static/external_api/documentation.html", + "categories": [ + "ai", + "financial_services", + "fintech", + "financial_technology" + ], + "category": "AI Tools", + "methods": [ + { + "url": "/v1/influential_drivers", + "method": "getTopDriversBySeries", + "httpMethod": "get", + "tag": "Knowledge Graph", + "typeScriptTag": "knowledgeGraph", + "description": "Influential Drivers", + "parameters": [ + { + "name": "seriesName", + "schema": "string", + "required": true, + "description": "Series name for which the most influential drivers will be returned", + "example": "SERIES_NAME" + } + ], + "responses": [ + { + "statusCode": "200", + "description": "" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/history", + "method": "getFullHistory", + "httpMethod": "get", + "tag": "Data Series", + "typeScriptTag": "dataSeries", + "description": "History", + "parameters": [ + { + "name": "seriesName", + "schema": "string", + "description": "The series name to get the history" + } + ], + "responses": [ + { + "statusCode": "200", + "description": "" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/forecast", + "method": "getForecastData", + "httpMethod": "get", + "tag": "Data Series", + "typeScriptTag": "dataSeries", + "description": "Forecast", + "parameters": [ + { + "name": "seriesName", + "schema": "string", + "description": "The series name to get the forecast" + } + ], + "responses": [ + { + "statusCode": "200", + "description": "" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/anomalies", + "method": "listEconomicAnomalies", + "httpMethod": "get", + "tag": "World Monitoring", + "typeScriptTag": "worldMonitoring", + "description": "Anomalies", + "parameters": [], + "responses": [ + { + "statusCode": "200", + "description": "" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/all_series_types", + "method": "getAllTypes", + "httpMethod": "get", + "tag": "Data Series", + "typeScriptTag": "dataSeries", + "description": "Series Types", + "parameters": [], + "responses": [ + { + "statusCode": "200", + "description": "" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/all_series_names", + "method": "getAllNames", + "httpMethod": "get", + "tag": "Data Series", + "typeScriptTag": "dataSeries", + "description": "Series Names", + "parameters": [ + { + "name": "seriesType", + "schema": "string", + "description": "The series type for which the series names are returned" + } + ], + "responses": [ + { + "statusCode": "200", + "description": "" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/get_portfolio", + "method": "getSecuritiesAmounts", + "httpMethod": "get", + "tag": "Portfolio Management", + "typeScriptTag": "portfolioManagement", + "description": "Get Portfolio", + "parameters": [ + { + "name": "portfolioId", + "schema": "integer", + "required": true, + "description": "The portfolio id for the portfolio to retrieve", + "example": 0 + } + ], + "responses": [ + { + "statusCode": "200", + "description": "portfolio for the user" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/update_portfolio", + "method": "updatePortfolio", + "httpMethod": "post", + "tag": "Portfolio Management", + "typeScriptTag": "portfolioManagement", + "description": "Update portfolio", + "parameters": [ + { + "name": "portfolio", + "schema": "array", + "description": "" + }, + { + "name": "portfolio_id", + "schema": "number", + "description": "" + }, + { + "name": "investor_preference", + "schema": "string", + "description": "" + } + ], + "responses": [ + { + "statusCode": "200", + "description": "" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/get_recommendations", + "method": "computeRecommendations", + "httpMethod": "get", + "tag": "Portfolio Management", + "typeScriptTag": "portfolioManagement", + "description": "Portfolio Recommendations", + "parameters": [ + { + "name": "portfolioId", + "schema": "integer", + "required": true, + "description": "The portfolio id for the portfolio to get recommendations for", + "example": 0 + } + ], + "responses": [ + { + "statusCode": "200", + "description": "Recommendations" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/get_portfolio_score", + "method": "computePortfolioScore", + "httpMethod": "get", + "tag": "Portfolio Management", + "typeScriptTag": "portfolioManagement", + "description": "Portfolio Score", + "parameters": [ + { + "name": "portfolioDict", + "schema": "string", + "required": true, + "description": "A stringified (https://portfoliopilot.com/static/external_api/documentation.html portfolio dict (key=ticker, value=amount) to calculate the portfolio score for", + "example": "PORTFOLIO_DICT" + } + ], + "responses": [ + { + "statusCode": "200", + "description": "Portfolio Score" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/get_portfolio_performance_stats", + "method": "computePerformanceStats", + "httpMethod": "get", + "tag": "Portfolio Management", + "typeScriptTag": "portfolioManagement", + "description": "Portfolio Performance Stats", + "parameters": [ + { + "name": "portfolioDict", + "schema": "string", + "required": true, + "description": "A stringified (https://portfoliopilot.com/static/external_api/documentation.html portfolio dict (key=ticker, value=amount) to calculate the portfolio score for", + "example": "PORTFOLIO_DICT" + } + ], + "responses": [ + { + "statusCode": "200", + "description": "Portfolio Performance Stats" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/get_portfolio_assessment", + "method": "getAssessmentData", + "httpMethod": "get", + "tag": "Portfolio Management", + "typeScriptTag": "portfolioManagement", + "description": "Get Portfolio Assessment", + "parameters": [ + { + "name": "portfolioDict", + "schema": "string", + "required": true, + "description": "A stringified (https://portfoliopilot.com/static/external_api/documentation.html portfolio dict (key=ticker, value=amount) to calculate the portfolio score for", + "example": "PORTFOLIO_DICT" + }, + { + "name": "targetRisk", + "schema": "string", + "required": false, + "description": "The target risk level for the portfolio." + } + ], + "responses": [ + { + "statusCode": "200", + "description": "" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + }, + { + "url": "/v1/get_portfolio_insights", + "method": "getInsights", + "httpMethod": "get", + "tag": "Portfolio Management", + "typeScriptTag": "portfolioManagement", + "description": "Get Portfolio Insights", + "parameters": [ + { + "name": "portfolioDict", + "schema": "string", + "required": true, + "description": "A stringified (https://portfoliopilot.com/static/external_api/documentation.html portfolio dict (key=ticker, value=amount) to generate insights", + "example": "PORTFOLIO_DICT" + } + ], + "responses": [ + { + "statusCode": "200", + "description": "" + }, + { + "statusCode": "400", + "description": "Bad Request" + } + ] + } + ], + "repositoryDescription": "Building AI-powered WealthOS for financial advice with Economic Insights Engine. Providing fintech solutions through GP API and PortfolioPilot, the world's best financial advisor. Global Predictions Inc's {language} SDK generated by Konfig (https://konfigthis.com/).", + "logo": "https://raw.githubusercontent.com/konfig-sdks/openapi-examples/HEAD/global-predictions-inc/logo.png", + "openApiRaw": "https://raw.githubusercontent.com/konfig-sdks/openapi-examples/HEAD/global-predictions-inc/openapi.yaml", + "openApiGitHubUi": "https://github.com/konfig-sdks/openapi-examples/tree/HEAD/global-predictions-inc/openapi.yaml", + "previewLinkImage": "https://raw.githubusercontent.com/konfig-sdks/openapi-examples/HEAD/global-predictions-inc/imagePreview.png", + "faviconUrl": "https://raw.githubusercontent.com/konfig-sdks/openapi-examples/HEAD/global-predictions-inc/favicon.jpg", + "clientNameCamelCase": "globalPredictionsInc", + "lastUpdated": "2024-03-28T23:24:57.727Z", + "typescriptSdkUsageCode": "import { GlobalPredictionsInc } from 'global-predictions-inc-typescript-sdk';\n\nconst globalPredictionsInc = new GlobalPredictionsInc({\n apiKey: \"API_KEY\"\n})", + "typescriptSdkFirstRequestCode": "// Influential Drivers\nconst getTopDriversBySeriesResponse = globalPredictionsInc.knowledgeGraph.getTopDriversBySeries({\n seriesName: \"SERIES_NAME\"\n})", + "fixedSpecFileName": "global-predictions-inc-fixed-spec.yaml" +} \ No newline at end of file diff --git a/sdks/db/spec-data/from-custom-request_globalpredictions.com.json b/sdks/db/spec-data/from-custom-request_globalpredictions.com.json new file mode 100644 index 0000000000..4785712878 --- /dev/null +++ b/sdks/db/spec-data/from-custom-request_globalpredictions.com.json @@ -0,0 +1,25 @@ +{ + "securitySchemes": { + "api_key": { + "type": "apiKey", + "name": "api_key", + "in": "query" + } + }, + "apiBaseUrl": "https://portfoliopilot.com/api", + "apiVersion": "1.0.0", + "apiDescription": "Global Predictions external api", + "apiTitle": "Global Predictions API", + "endpoints": 13, + "sdkMethods": 14, + "schemas": 22, + "parameters": 27, + "contactEmail": "support@globalpredictions.com", + "originalCustomRequest": { + "type": "GET", + "url": "https://portfoliopilot.com/static/external_api/external_api.yaml" + }, + "customRequestSpecFilename": "globalpredictions.com.yaml", + "difficultyScore": 31.75, + "difficulty": "Very Easy" +} \ No newline at end of file diff --git a/sdks/publish.yaml b/sdks/publish.yaml index 980fdfb920..aeccf9a804 100644 --- a/sdks/publish.yaml +++ b/sdks/publish.yaml @@ -7041,3 +7041,27 @@ publish: serviceName: false sdkName: belvo-{language}-sdk clientName: Belvo + from-custom-request_globalpredictions.com: + homepage: www.globalpredictions.com/ + company: Global Predictions Inc + developerDocumentation: portfoliopilot.com/static/external_api/documentation.html + apiStatusUrls: inherit + metaDescription: >- + Global Predictions is building an AI-powered WealthOS, a full-stack + solution for financial advice and personalized recommendations built on + top of our proprietary Economic Insights Engine. We power fintech + solutions for millions of people through the GP API and customized + insights. Our flagship product is PortfolioPilot for individuals, the + world's best financial advisor, with over $6.2B assets on platform. + + + Please read our important disclosures: + https://www.globalpredictions.com/disclosures + categories: + - ai + - financial_services + - fintech + - financial_technology + serviceName: false + sdkName: global-predictions-inc-{language}-sdk + clientName: GlobalPredictionsInc diff --git a/sdks/src/collect-from-custom-requests.ts b/sdks/src/collect-from-custom-requests.ts index a69463e94b..52d476cfcf 100644 --- a/sdks/src/collect-from-custom-requests.ts +++ b/sdks/src/collect-from-custom-requests.ts @@ -2232,6 +2232,10 @@ const customRequests: Record = { type: "GET", url: "https://raw.githubusercontent.com/onna/platform-api/main/spec/platform-api.yaml", }, + "globalpredictions.com": { + type: "GET", + url: "https://portfoliopilot.com/static/external_api/external_api.yaml", + }, }; async function downloadOpenApiSpecFromMintlify({