diff --git a/components/finnhub/actions/get-ebitda-estimate/get-ebitda-estimate.mjs b/components/finnhub/actions/get-ebitda-estimate/get-ebitda-estimate.mjs new file mode 100644 index 0000000000000..52fd5380a106b --- /dev/null +++ b/components/finnhub/actions/get-ebitda-estimate/get-ebitda-estimate.mjs @@ -0,0 +1,40 @@ +import app from "../../finnhub.app.mjs"; + +export default { + key: "finnhub-get-ebitda-estimate", + name: "Get EBITDA Estimate", + description: "Retrieves EBITDA (Earnings Before Interest, Taxes, Depreciation, and Amortization) estimates for a specified company. Returns analyst consensus estimates including average, high, and low values for annual or quarterly periods. Requires a premium Finnhub API subscription. [See the documentation](https://finnhub.io/docs/api/company-ebitda-estimates)", + version: "0.0.1", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + type: "action", + props: { + app, + symbol: { + propDefinition: [ + app, + "symbol", + ], + }, + freq: { + propDefinition: [ + app, + "freq", + ], + }, + }, + async run({ $ }) { + const response = await this.app.getEbitdaEstimate({ + $, + params: { + symbol: this.symbol, + freq: this.freq, + }, + }); + $.export("$summary", `Successfully retrieved EBITDA estimates for ${this.symbol}`); + return response; + }, +}; diff --git a/components/finnhub/common/constants.mjs b/components/finnhub/common/constants.mjs index 86481b1834d2e..15411c3d3cb84 100644 --- a/components/finnhub/common/constants.mjs +++ b/components/finnhub/common/constants.mjs @@ -5,6 +5,10 @@ export default { "crypto", "merger", ], + FREQUENCIES: [ + "annual", + "quarterly", + ], EXCHANGES: [ { label: "ADU DHABI SECURITIES EXCHANGE", diff --git a/components/finnhub/finnhub.app.mjs b/components/finnhub/finnhub.app.mjs index 1df131eb1954e..a5d57547a4772 100644 --- a/components/finnhub/finnhub.app.mjs +++ b/components/finnhub/finnhub.app.mjs @@ -46,6 +46,14 @@ export default { description: "Filter by MIC code, i.e.: `XNGS`", optional: true, }, + freq: { + type: "string", + label: "Frequency", + description: "Frequency of the estimates. Use `annual` for yearly estimates or `quarterly` for quarterly estimates.", + options: constants.FREQUENCIES, + optional: true, + default: "annual", + }, }, methods: { _baseUrl() { @@ -92,6 +100,11 @@ export default { ...args, }); }, - + async getEbitdaEstimate(args = {}) { + return this._makeRequest({ + path: "/stock/ebitda-estimate", + ...args, + }); + }, }, }; diff --git a/components/finnhub/package.json b/components/finnhub/package.json index 656eeb6c912c3..61c04b9e86a5b 100644 --- a/components/finnhub/package.json +++ b/components/finnhub/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/finnhub", - "version": "0.2.0", + "version": "0.3.0", "description": "Pipedream Finnhub Components", "main": "finnhub.app.mjs", "keywords": [