finnhub-ts
Version:
OpenAPI client for finnhub-ts
881 lines • 373 kB
JavaScript
"use strict";
/* tslint:disable */
/* eslint-disable */
/**
* Finnhub API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator = void 0;
const axios_1 = require("axios");
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("./common");
// @ts-ignore
const base_1 = require("./base");
/**
* DefaultApi - axios parameter creator
* @export
*/
const DefaultApiAxiosParamCreator = function (configuration) {
return {
/**
* Get aggregate signal of multiple technical indicators such as MACD, RSI, Moving Average v.v.
* @summary Aggregate Indicators
* @param {string} symbol symbol
* @param {string} resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
aggregateIndicator: async (symbol, resolution, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('aggregateIndicator', 'symbol', symbol);
// verify required parameter 'resolution' is not null or undefined
(0, common_1.assertParamExists)('aggregateIndicator', 'resolution', resolution);
const localVarPath = `/scan/technical-indicator`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (resolution !== undefined) {
localVarQueryParameter['resolution'] = resolution;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get end-of-day bond\'s price data.
* @summary Bond price data
* @param {string} isin ISIN.
* @param {number} from UNIX timestamp. Interval initial value.
* @param {number} to UNIX timestamp. Interval end value.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
bondPrice: async (isin, from, to, options = {}) => {
// verify required parameter 'isin' is not null or undefined
(0, common_1.assertParamExists)('bondPrice', 'isin', isin);
// verify required parameter 'from' is not null or undefined
(0, common_1.assertParamExists)('bondPrice', 'from', from);
// verify required parameter 'to' is not null or undefined
(0, common_1.assertParamExists)('bondPrice', 'to', to);
const localVarPath = `/bond/price`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (isin !== undefined) {
localVarQueryParameter['isin'] = isin;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (to !== undefined) {
localVarQueryParameter['to'] = to;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get general information of a bond. You can query by FIGI, ISIN or CUSIP
* @summary Bond Profile
* @param {string} [isin] ISIN
* @param {string} [cusip] CUSIP
* @param {string} [figi] FIGI
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
bondProfile: async (isin, cusip, figi, options = {}) => {
const localVarPath = `/bond/profile`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (isin !== undefined) {
localVarQueryParameter['isin'] = isin;
}
if (cusip !== undefined) {
localVarQueryParameter['cusip'] = cusip;
}
if (figi !== undefined) {
localVarQueryParameter['figi'] = figi;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get company basic financials such as margin, P/E ratio, 52-week high/low etc.
* @summary Basic Financials
* @param {string} symbol Symbol of the company: AAPL.
* @param {string} metric Metric type. Can be 1 of the following values <code>all</code>
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyBasicFinancials: async (symbol, metric, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyBasicFinancials', 'symbol', symbol);
// verify required parameter 'metric' is not null or undefined
(0, common_1.assertParamExists)('companyBasicFinancials', 'metric', metric);
const localVarPath = `/stock/metric`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (metric !== undefined) {
localVarQueryParameter['metric'] = metric;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get company historical quarterly earnings surprise going back to 2000.
* @summary Earnings Surprises
* @param {string} symbol Symbol of the company: AAPL.
* @param {number} [limit] Limit number of period returned. Leave blank to get the full history.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyEarnings: async (symbol, limit, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyEarnings', 'symbol', symbol);
const localVarPath = `/stock/earnings`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* <p>This endpoint provides Earnings Quality Score for global companies.</p><p> Earnings quality refers to the extent to which current earnings predict future earnings. \"High-quality\" earnings are expected to persist, while \"low-quality\" earnings do not. A higher score means a higher earnings quality</p><p>Finnhub uses a proprietary model which takes into consideration 4 criteria:</p> <ul style=\"list-style-type: unset; margin-left: 30px;\"><li>Profitability</li><li>Growth</li><li>Cash Generation & Capital Allocation</li><li>Leverage</li></ul><br/><p>We then compare the metrics of each company in each category against its peers in the same industry to gauge how quality its earnings is.</p>
* @summary Company Earnings Quality Score
* @param {string} symbol Symbol.
* @param {string} freq Frequency. Currently support <code>annual</code> and <code>quarterly</code>
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyEarningsQualityScore: async (symbol, freq, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyEarningsQualityScore', 'symbol', symbol);
// verify required parameter 'freq' is not null or undefined
(0, common_1.assertParamExists)('companyEarningsQualityScore', 'freq', freq);
const localVarPath = `/stock/earnings-quality-score`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (freq !== undefined) {
localVarQueryParameter['freq'] = freq;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get company\'s ebit estimates.
* @summary EBIT Estimates
* @param {string} symbol Symbol of the company: AAPL.
* @param {string} [freq] Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyEbitEstimates: async (symbol, freq, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyEbitEstimates', 'symbol', symbol);
const localVarPath = `/stock/ebit-estimate`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (freq !== undefined) {
localVarQueryParameter['freq'] = freq;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get company\'s ebitda estimates.
* @summary EBITDA Estimates
* @param {string} symbol Symbol of the company: AAPL.
* @param {string} [freq] Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyEbitdaEstimates: async (symbol, freq, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyEbitdaEstimates', 'symbol', symbol);
const localVarPath = `/stock/ebitda-estimate`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (freq !== undefined) {
localVarQueryParameter['freq'] = freq;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get company\'s EPS estimates.
* @summary Earnings Estimates
* @param {string} symbol Symbol of the company: AAPL.
* @param {string} [freq] Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyEpsEstimates: async (symbol, freq, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyEpsEstimates', 'symbol', symbol);
const localVarPath = `/stock/eps-estimate`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (freq !== undefined) {
localVarQueryParameter['freq'] = freq;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* <p>This endpoint provides ESG scores and important indicators for 1000+ global companies. The data is collected through company\'s public ESG disclosure and public sources.</p><p>Our ESG scoring models takes into account more than 150 different inputs to calculate the level of ESG risks and how well a company is managing them. A higher score means lower ESG risk or better ESG management. ESG scores are in the the range of 0-100. Some key indicators might contain letter-grade score from C- to A+ with C- is the lowest score and A+ is the highest score.</p>
* @summary Company ESG Scores
* @param {string} symbol Symbol.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyEsgScore: async (symbol, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyEsgScore', 'symbol', symbol);
const localVarPath = `/stock/esg`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get a list of company\'s executives and members of the Board.
* @summary Company Executive
* @param {string} symbol Symbol of the company: AAPL.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyExecutive: async (symbol, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyExecutive', 'symbol', symbol);
const localVarPath = `/stock/executive`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List latest company news by symbol. This endpoint is only available for North American companies.
* @summary Company News
* @param {string} symbol Company symbol.
* @param {string} from From date <code>YYYY-MM-DD</code>.
* @param {string} to To date <code>YYYY-MM-DD</code>.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyNews: async (symbol, from, to, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyNews', 'symbol', symbol);
// verify required parameter 'from' is not null or undefined
(0, common_1.assertParamExists)('companyNews', 'from', from);
// verify required parameter 'to' is not null or undefined
(0, common_1.assertParamExists)('companyNews', 'to', to);
const localVarPath = `/company-news`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from instanceof Date ? from.toISOString().substr(0, 10) : from;
}
if (to !== undefined) {
localVarQueryParameter['to'] = to instanceof Date ? to.toISOString().substr(0, 10) : to;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get company peers. Return a list of peers in the same country and sub-industry
* @summary Peers
* @param {string} symbol Symbol of the company: AAPL.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyPeers: async (symbol, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyPeers', 'symbol', symbol);
const localVarPath = `/stock/peers`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get general information of a company. You can query by symbol, ISIN or CUSIP
* @summary Company Profile
* @param {string} [symbol] Symbol of the company: AAPL e.g.
* @param {string} [isin] ISIN
* @param {string} [cusip] CUSIP
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyProfile: async (symbol, isin, cusip, options = {}) => {
const localVarPath = `/stock/profile`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (isin !== undefined) {
localVarQueryParameter['isin'] = isin;
}
if (cusip !== undefined) {
localVarQueryParameter['cusip'] = cusip;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get general information of a company. You can query by symbol, ISIN or CUSIP. This is the free version of <a href=\"#company-profile\">Company Profile</a>.
* @summary Company Profile 2
* @param {string} [symbol] Symbol of the company: AAPL e.g.
* @param {string} [isin] ISIN
* @param {string} [cusip] CUSIP
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyProfile2: async (symbol, isin, cusip, options = {}) => {
const localVarPath = `/stock/profile2`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (isin !== undefined) {
localVarQueryParameter['isin'] = isin;
}
if (cusip !== undefined) {
localVarQueryParameter['cusip'] = cusip;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get company\'s revenue estimates.
* @summary Revenue Estimates
* @param {string} symbol Symbol of the company: AAPL.
* @param {string} [freq] Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
companyRevenueEstimates: async (symbol, freq, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('companyRevenueEstimates', 'symbol', symbol);
const localVarPath = `/stock/revenue-estimate`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (freq !== undefined) {
localVarQueryParameter['freq'] = freq;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List all countries and metadata.
* @summary Country Metadata
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
country: async (options = {}) => {
const localVarPath = `/country`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get real-time updates on the number of COVID-19 (Corona virus) cases in the US with a state-by-state breakdown. Data is sourced from CDC and reputable sources. You can also access this API <a href=\"https://rapidapi.com/Finnhub/api/finnhub-real-time-covid-19\" target=\"_blank\" rel=\"nofollow\">here</a>
* @summary COVID-19
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
covid19: async (options = {}) => {
const localVarPath = `/covid19/us`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get candlestick data for crypto symbols.
* @summary Crypto Candles
* @param {string} symbol Use symbol returned in <code>/crypto/symbol</code> endpoint for this field.
* @param {string} resolution Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
* @param {number} from UNIX timestamp. Interval initial value.
* @param {number} to UNIX timestamp. Interval end value.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
cryptoCandles: async (symbol, resolution, from, to, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('cryptoCandles', 'symbol', symbol);
// verify required parameter 'resolution' is not null or undefined
(0, common_1.assertParamExists)('cryptoCandles', 'resolution', resolution);
// verify required parameter 'from' is not null or undefined
(0, common_1.assertParamExists)('cryptoCandles', 'from', from);
// verify required parameter 'to' is not null or undefined
(0, common_1.assertParamExists)('cryptoCandles', 'to', to);
const localVarPath = `/crypto/candle`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (resolution !== undefined) {
localVarQueryParameter['resolution'] = resolution;
}
if (from !== undefined) {
localVarQueryParameter['from'] = from;
}
if (to !== undefined) {
localVarQueryParameter['to'] = to;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List supported crypto exchanges
* @summary Crypto Exchanges
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
cryptoExchanges: async (options = {}) => {
const localVarPath = `/crypto/exchange`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get crypto\'s profile.
* @summary Crypto Profile
* @param {string} symbol Crypto symbol such as BTC or ETH.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
cryptoProfile: async (symbol, options = {}) => {
// verify required parameter 'symbol' is not null or undefined
(0, common_1.assertParamExists)('cryptoProfile', 'symbol', symbol);
const localVarPath = `/crypto/profile`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List supported crypto symbols by exchange
* @summary Crypto Symbol
* @param {string} exchange Exchange you want to get the list of symbols from.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
cryptoSymbols: async (exchange, options = {}) => {
// verify required parameter 'exchange' is not null or undefined
(0, common_1.assertParamExists)('cryptoSymbols', 'exchange', exchange);
const localVarPath = `/crypto/symbol`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (exchange !== undefined) {
localVarQueryParameter['exchange'] = exchange;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Get historical and coming earnings release. EPS and Revenue in this endpoint are non-GAAP, which means they are adjusted to exclude some one-time or unusual items. This is the same data investors usually react to and talked about on the media. Estimates are sourced from both sell-side and buy-side analysts.
* @summary Earnings Calendar
* @param {string} [from] From date: 2020-03-15.
* @param {string} [to] To date: 2020-03-16.
* @param {string} [symbol] Filter by symbol: AAPL.
* @param {boolean} [international] Set to <code>true</code> to include international markets. Default value is <code>false</code>
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
earningsCalendar: async (from, to, symbol, international, options = {}) => {
const localVarPath = `/calendar/earnings`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
// authentication api_key required
await (0, common_1.setApiKeyToObject)(localVarQueryParameter, 'token', configuration);
if (from !== undefined) {
localVarQueryParameter['from'] = from instanceof Date ? from.toISOString().substr(0, 10) : from;
}
if (to !== undefined) {
localVarQueryParameter['to'] = to instanceof Date ? to.toISOString().substr(0, 10) : to;
}
if (symbol !== undefined) {
localVarQueryParameter['symbol'] = symbol;
}
if (international !== undefined) {
localVarQueryParameter['international'] = international;
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* <p>Get recent and upcoming economic releases.</p><p>Historical events and surprises are available for Enterprise clients.</p>
* @summary Economic Calendar
* @param {string} [from] From date <code&g