├── .openapi-generator ├── VERSION └── FILES ├── mocha.opts ├── .travis.yml ├── .babelrc ├── release.sh ├── package.json ├── .gitignore ├── git_push.sh ├── README.md ├── LICENSE ├── src └── index.js └── dist └── index.js /.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | 5.2.1 -------------------------------------------------------------------------------- /mocha.opts: -------------------------------------------------------------------------------- 1 | --timeout 10000 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | cache: npm 3 | node_js: 4 | - "6" 5 | - "6.1" 6 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["@babel/preset-env", { "modules": "commonjs" }] 4 | ], 5 | "plugins": [ 6 | ["@babel/plugin-transform-runtime"] 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /release.sh: -------------------------------------------------------------------------------- 1 | if [ $# -eq 0 ] 2 | then 3 | echo "No arguments supplied" 4 | exit 5 | fi 6 | 7 | rm -rf node_modules 8 | npm install 9 | npm run build 10 | npm publish --access public 11 | 12 | git add -A 13 | git commit -m "update v$1" 14 | git push origin -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "finnhub", 3 | "version": "2.0.12", 4 | "description": "JS API Client for Finnhub", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "build": "babel src -d dist", 8 | "test": "mocha --require @babel/register --recursive" 9 | }, 10 | "dependencies": { 11 | "@babel/runtime": "^7.27.6", 12 | "finnhub": "^2.0.11", 13 | "node-fetch": "^3.3.2" 14 | }, 15 | "devDependencies": { 16 | "@babel/cli": "^7.0.0", 17 | "@babel/core": "^7.0.0", 18 | "@babel/plugin-transform-runtime": "^7.28.0", 19 | "@babel/preset-env": "^7.0.0", 20 | "@babel/register": "^7.0.0", 21 | "mocha": "^8.0.1" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 18 | .grunt 19 | 20 | # node-waf configuration 21 | .lock-wscript 22 | 23 | # Compiled binary addons (http://nodejs.org/api/addons.html) 24 | build/Release 25 | 26 | # Dependency directory 27 | node_modules 28 | 29 | # Optional npm cache directory 30 | .npm 31 | 32 | # Optional REPL history 33 | .node_repl_history 34 | 35 | test.js 36 | TEST.md 37 | UPDATE.md 38 | -------------------------------------------------------------------------------- /git_push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ 3 | # 4 | # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" 5 | 6 | git_user_id=$1 7 | git_repo_id=$2 8 | release_note=$3 9 | git_host=$4 10 | 11 | if [ "$git_host" = "" ]; then 12 | git_host="github.com" 13 | echo "[INFO] No command line input provided. Set \$git_host to $git_host" 14 | fi 15 | 16 | if [ "$git_user_id" = "" ]; then 17 | git_user_id="GIT_USER_ID" 18 | echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" 19 | fi 20 | 21 | if [ "$git_repo_id" = "" ]; then 22 | git_repo_id="GIT_REPO_ID" 23 | echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" 24 | fi 25 | 26 | if [ "$release_note" = "" ]; then 27 | release_note="Minor update" 28 | echo "[INFO] No command line input provided. Set \$release_note to $release_note" 29 | fi 30 | 31 | # Initialize the local directory as a Git repository 32 | git init 33 | 34 | # Adds the files in the local repository and stages them for commit. 35 | git add . 36 | 37 | # Commits the tracked changes and prepares them to be pushed to a remote repository. 38 | git commit -m "$release_note" 39 | 40 | # Sets the new remote 41 | git_remote=`git remote` 42 | if [ "$git_remote" = "" ]; then # git remote not defined 43 | 44 | if [ "$GIT_TOKEN" = "" ]; then 45 | echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." 46 | git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git 47 | else 48 | git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git 49 | fi 50 | 51 | fi 52 | 53 | git pull origin master 54 | 55 | # Pushes (Forces) the changes in the local repository up to the remote repository 56 | echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" 57 | git push origin master 2>&1 | grep -v 'To https' 58 | 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # finnhub-js 2 | 3 | Official JavaScript client for Finnhub https://finnhub.io/ 4 | 5 | - API version: 1.0.0 6 | - Package version: 2.2.0 7 | 8 | ## Installation 9 | 10 | ```shell 11 | npm install finnhub --save 12 | ``` 13 | 14 | ## Getting Started 15 | 16 | ```javascript 17 | const finnhub = require('finnhub'); 18 | 19 | const finnhubClient = new finnhub.DefaultApi("") // Replace this 20 | 21 | // Stock candles 22 | finnhubClient.stockCandles("AAPL", "D", 1590988249, 1591852249, (error, data, response) => { 23 | console.log(data) 24 | }); 25 | 26 | //Company News 27 | finnhubClient.companyNews("AAPL", "2020-01-01", "2020-05-01", (error, data, response) => { 28 | if (error) { 29 | console.error(error); 30 | } else { 31 | console.log(data) 32 | } 33 | }); 34 | 35 | // Investor Ownership 36 | let optsLimit = {'limit': 10}; 37 | finnhubClient.ownership("AAPL", optsLimit, (error, data, response) => { 38 | console.log(data) 39 | }); 40 | 41 | //Aggregate Indicator 42 | finnhubClient.aggregateIndicator("AAPL", "D", (error, data, response) => { 43 | console.log(data) 44 | }); 45 | 46 | // Basic financials 47 | finnhubClient.companyBasicFinancials("AAPL", "margin", (error, data, response) => { 48 | console.log(data) 49 | }); 50 | 51 | // Company earnings 52 | finnhubClient.companyEarnings("AAPL", {'limit': 10}, (error, data, response) => { 53 | console.log(data) 54 | }); 55 | 56 | // Company EPS estimates 57 | finnhubClient.companyEpsEstimates("AAPL", {}, (error, data, response) => { 58 | console.log(data) 59 | }); 60 | 61 | // Ebitda Estimates 62 | finnhubClient.companyEbitdaEstimates("AAPL", {"freq": "annual"}, (error, data, response) => { 63 | console.log(data) 64 | }); 65 | 66 | // Ebit Estimates 67 | finnhubClient.companyEbitEstimates("AAPL", {"freq": "annual"}, (error, data, response) => { 68 | console.log(data) 69 | }); 70 | 71 | // Company executive 72 | finnhubClient.companyExecutive("AAPL", (error, data, response) => { 73 | console.log(data) 74 | }); 75 | 76 | // Company peers 77 | finnhubClient.companyPeers("AAPL", (error, data, response) => { 78 | console.log(data) 79 | }); 80 | 81 | // Company profile 82 | finnhubClient.companyProfile({'symbol': 'AAPL'}, (error, data, response) => { 83 | console.log(data) 84 | }); 85 | finnhubClient.companyProfile({'isin': 'US0378331005'}, (error, data, response) => { 86 | console.log(data) 87 | }); 88 | finnhubClient.companyProfile({'cusip': '037833100'}, (error, data, response) => { 89 | console.log(data) 90 | }); 91 | 92 | //Company profile2 93 | finnhubClient.companyProfile2({'symbol': 'AAPL'}, (error, data, response) => { 94 | console.log(data) 95 | }); 96 | 97 | // Revenue Estimates 98 | finnhubClient.companyRevenueEstimates("AAPL", {}, (error, data, response) => { 99 | console.log(data) 100 | }); 101 | 102 | // List country 103 | finnhubClient.country((error, data, response) => { 104 | console.log(data) 105 | }); 106 | 107 | // Covid-19 108 | finnhubClient.covid19((error, data, response) => { 109 | console.log(data) 110 | }); 111 | 112 | // Crypto candles 113 | finnhubClient.cryptoCandles("BINANCE:BTCUSDT", "D", 1590988249, 1591852249, (error, data, response) => { 114 | console.log(data) 115 | }); 116 | 117 | // Crypto exchanges 118 | finnhubClient.cryptoExchanges((error, data, response) => { 119 | console.log(data) 120 | }); 121 | 122 | //Crypto symbols 123 | finnhubClient.cryptoSymbols("BINANCE", (error, data, response) => { 124 | console.log(data) 125 | }); 126 | 127 | // Earnings calendar 128 | finnhubClient.earningsCalendar({"from": "2020-06-01", "to": "2020-06-30"}, (error, data, response) => { 129 | console.log(data) 130 | }); 131 | 132 | // Economic code 133 | finnhubClient.economicCode((error, data, response) => { 134 | console.log(data) 135 | }); 136 | 137 | // Economic data 138 | finnhubClient.economicData("MA-USA-656880", (error, data, response) => { 139 | console.log(data) 140 | }); 141 | 142 | // Filings 143 | finnhubClient.filings({"symbol": "AAPL"}, (error, data, response) => { 144 | console.log(data) 145 | }); 146 | 147 | //Financials 148 | finnhubClient.financials("AAPL", "ic", "annual", (error, data, response) => { 149 | console.log(data) 150 | }); 151 | 152 | // Financials Reported 153 | finnhubClient.financialsReported({"symbol": "AAPL"}, (error, data, response) => { 154 | console.log(data) 155 | }); 156 | 157 | // Forex candles 158 | finnhubClient.forexCandles("OANDA:EUR_USD", "D", 1590988249, 1591852249, (error, data, response) => { 159 | console.log(data) 160 | }); 161 | 162 | // Forex exchanges 163 | finnhubClient.forexExchanges((error, data, response) => { 164 | console.log(data) 165 | }); 166 | 167 | // Forex rates 168 | finnhubClient.forexRates({"base": "USD"}, (error, data, response) => { 169 | console.log(data) 170 | }); 171 | 172 | // Forex symbols 173 | finnhubClient.forexSymbols("OANDA", (error, data, response) => { 174 | console.log(data) 175 | }); 176 | 177 | //Fund ownership 178 | finnhubClient.fundOwnership("AAPL", {'limit': 10}, (error, data, response) => { 179 | console.log(data) 180 | }); 181 | 182 | // General news 183 | finnhubClient.marketNews("general", {}, (error, data, response) => { 184 | console.log(data) 185 | }); 186 | 187 | // Ipo calendar 188 | finnhubClient.ipoCalendar("2020-01-01", "2020-06-15", (error, data, response) => { 189 | console.log(data) 190 | }); 191 | 192 | //Major development 193 | finnhubClient.pressReleases("AAPL", {}, (error, data, response) => { 194 | console.log(data) 195 | }); 196 | 197 | // News sentiment 198 | finnhubClient.newsSentiment("AAPL", (error, data, response) => { 199 | console.log(data) 200 | }); 201 | 202 | // Pattern recognition 203 | finnhubClient.patternRecognition("AAPL", "D", (error, data, response) => { 204 | console.log(data) 205 | }); 206 | 207 | // Price target 208 | finnhubClient.priceTarget("AAPL", (error, data, response) => { 209 | console.log(data) 210 | }); 211 | 212 | //Quote 213 | finnhubClient.quote("AAPL", (error, data, response) => { 214 | console.log(data) 215 | }); 216 | 217 | // Recommendation trends 218 | finnhubClient.recommendationTrends("AAPL", (error, data, response) => { 219 | console.log(data) 220 | }); 221 | 222 | // Stock dividends 223 | finnhubClient.stockDividends("KO", "2019-01-01", "2020-06-30", (error, data, response) => { 224 | console.log(data) 225 | }); 226 | 227 | // Splits 228 | finnhubClient.stockSplits("AAPL", "2000-01-01", "2020-06-15", (error, data, response) => { 229 | console.log(data) 230 | }); 231 | 232 | // Stock symbols 233 | finnhubClient.stockSymbols("US", (error, data, response) => { 234 | console.log(data) 235 | }); 236 | 237 | // Support resistance 238 | finnhubClient.supportResistance("AAPL", "D", (error, data, response) => { 239 | console.log(data) 240 | }); 241 | 242 | // Technical indicator 243 | finnhubClient.technicalIndicator("AAPL", "D", 1580988249, 1591852249, "macd", {}, (error, data, response) => { 244 | console.log(data) 245 | }); 246 | 247 | // Transcripts 248 | finnhubClient.transcripts("AAPL_162777", (error, data, response) => { 249 | console.log(data) 250 | }); 251 | 252 | // Transcripts list 253 | finnhubClient.transcriptsList("AAPL", (error, data, response) => { 254 | console.log(data) 255 | }); 256 | 257 | // Upgrade/downgrade 258 | finnhubClient.upgradeDowngrade({"symbol": "AAPL"}, (error, data, response) => { 259 | console.log(data) 260 | }); 261 | 262 | // Tick Data 263 | finnhubClient.stockTick("AAPL", "2020-03-25", 500, 0, (error, data, response) => { 264 | console.log(data); 265 | }); 266 | 267 | // Indices Constituents 268 | finnhubClient.indicesConstituents("^GSPC", (error, data, response) => { 269 | console.log(data); 270 | }); 271 | 272 | // Indices Historical Constituents 273 | finnhubClient.indicesHistoricalConstituents("^GSPC", (error, data, response) => { 274 | console.log(data); 275 | }); 276 | 277 | // ETFs Profile 278 | finnhubClient.etfsProfile({'symbol': 'SPY'}, (error, data, response) => { 279 | console.log(data); 280 | }); 281 | 282 | // ETFs Holdings 283 | finnhubClient.etfsHoldings({'symbol': 'ARKK'}, (error, data, response) => { 284 | console.log(data); 285 | }); 286 | 287 | // ETFs Industry Exposure 288 | finnhubClient.etfsSectorExposure('SPY', (error, data, response) => { 289 | console.log(data); 290 | }); 291 | 292 | // ETFs Country Exposure 293 | finnhubClient.etfsCountryExposure('SPY', (error, data, response) => { 294 | console.log(data); 295 | }); 296 | 297 | // Mutual Funds Profile 298 | finnhubClient.mutualFundProfile({'symbol': 'VTSAX'}, (error, data, response) => { 299 | console.log(data); 300 | }); 301 | 302 | // Mutual Funds Holdings 303 | finnhubClient.mutualFundHoldings({'symbol': 'VTSAX'}, (error, data, response) => { 304 | console.log(data); 305 | }); 306 | 307 | // Mutual Funds Industry Exposure 308 | finnhubClient.mutualFundSectorExposure('VTSAX', (error, data, response) => { 309 | console.log(data); 310 | }); 311 | 312 | // Mutual Funds Country Exposure 313 | finnhubClient.mutualFundCountryExposure('VTSAX', (error, data, response) => { 314 | console.log(data); 315 | }); 316 | 317 | // Insider Transactions 318 | finnhubClient.insiderTransactions('AAPL', (error, data, response) => { 319 | console.log(data); 320 | }); 321 | 322 | // Revenue Breakdown 323 | finnhubClient.revenueBreakdown({'symbol': 'AAPL'}, (error, data, response) => { 324 | console.log(data); 325 | }); 326 | 327 | // Social Sentiment 328 | finnhubClient.socialSentiment('GME', (error, data, response) => { 329 | console.log(data); 330 | }); 331 | 332 | // Investment Theme 333 | finnhubClient.investmentThemes('financialExchangesData', (error, data, response) => { 334 | console.log(data); 335 | }); 336 | 337 | // Supply Chain 338 | finnhubClient.supplyChainRelationships('AAPL', (error, data, response) => { 339 | console.log(data); 340 | }); 341 | 342 | // Company ESG 343 | finnhubClient.companyEsgScore('AAPL', (error, data, response) => { 344 | console.log(data); 345 | }); 346 | 347 | // Company Earnings Quality Score 348 | finnhubClient.companyEarningsQualityScore('AAPL', 'quarterly', (error, data, response) => { 349 | console.log(data); 350 | }); 351 | 352 | // Crypto Profile 353 | finnhubClient.cryptoProfile('BTC', (error, data, response) => { 354 | console.log(data); 355 | }); 356 | 357 | // USPO Patent 358 | finnhubClient.stockUsptoPatent('NVDA', '2021-01-01', '2021-12-31', (error, data, response) => { 359 | console.log(data); 360 | }); 361 | 362 | // Visa Application 363 | finnhubClient.stockVisaApplication('AAPL', '2021-01-01', '2021-12-31', (error, data, response) => { 364 | console.log(data); 365 | }); 366 | 367 | ``` 368 | 369 | ## License 370 | 371 | Apache License 372 | -------------------------------------------------------------------------------- /.openapi-generator/FILES: -------------------------------------------------------------------------------- 1 | .babelrc 2 | .gitignore 3 | .travis.yml 4 | docs/AggregateIndicators.md 5 | docs/AirlinePriceIndex.md 6 | docs/AirlinePriceIndexData.md 7 | docs/BasicFinancials.md 8 | docs/BondCandles.md 9 | docs/BondProfile.md 10 | docs/BondTickData.md 11 | docs/BondYieldCurve.md 12 | docs/BondYieldCurveInfo.md 13 | docs/BreakdownItem.md 14 | docs/Company.md 15 | docs/CompanyESG.md 16 | docs/CompanyESG2.md 17 | docs/CompanyEarningsQualityScore.md 18 | docs/CompanyEarningsQualityScoreData.md 19 | docs/CompanyExecutive.md 20 | docs/CompanyNews.md 21 | docs/CompanyNewsStatistics.md 22 | docs/CompanyProfile.md 23 | docs/CompanyProfile2.md 24 | docs/CongressionalTrading.md 25 | docs/CongressionalTransaction.md 26 | docs/CountryMetadata.md 27 | docs/CovidInfo.md 28 | docs/CryptoCandles.md 29 | docs/CryptoProfile.md 30 | docs/CryptoSymbol.md 31 | docs/DefaultApi.md 32 | docs/Development.md 33 | docs/Dividends.md 34 | docs/Dividends2.md 35 | docs/Dividends2Info.md 36 | docs/DocumentResponse.md 37 | docs/ETFCountryExposureData.md 38 | docs/ETFHoldingsData.md 39 | docs/ETFProfileData.md 40 | docs/ETFSectorExposureData.md 41 | docs/ETFsCountryExposure.md 42 | docs/ETFsHoldings.md 43 | docs/ETFsProfile.md 44 | docs/ETFsSectorExposure.md 45 | docs/EarningRelease.md 46 | docs/EarningResult.md 47 | docs/EarningsCalendar.md 48 | docs/EarningsCallTranscripts.md 49 | docs/EarningsCallTranscriptsList.md 50 | docs/EarningsEstimates.md 51 | docs/EarningsEstimatesInfo.md 52 | docs/EbitEstimates.md 53 | docs/EbitEstimatesInfo.md 54 | docs/EbitdaEstimates.md 55 | docs/EbitdaEstimatesInfo.md 56 | docs/EconomicCalendar.md 57 | docs/EconomicCode.md 58 | docs/EconomicData.md 59 | docs/EconomicDataInfo.md 60 | docs/EconomicEvent.md 61 | docs/EmployeeCount.md 62 | docs/ExcerptResponse.md 63 | docs/FDAComitteeMeeting.md 64 | docs/Filing.md 65 | docs/FilingResponse.md 66 | docs/FilingSentiment.md 67 | docs/FinancialStatements.md 68 | docs/FinancialsAsReported.md 69 | docs/ForexCandles.md 70 | docs/ForexSymbol.md 71 | docs/Forexrates.md 72 | docs/FundOwnership.md 73 | docs/FundOwnershipInfo.md 74 | docs/HistoricalCompanyESG.md 75 | docs/HistoricalEmployeeCount.md 76 | docs/HistoricalMarketCapData.md 77 | docs/HistoricalNBBO.md 78 | docs/IPOCalendar.md 79 | docs/IPOEvent.md 80 | docs/InFilingResponse.md 81 | docs/InFilingSearchBody.md 82 | docs/IndexHistoricalConstituent.md 83 | docs/Indicator.md 84 | docs/IndicesConstituents.md 85 | docs/IndicesConstituentsBreakdown.md 86 | docs/IndicesHistoricalConstituents.md 87 | docs/InsiderSentiments.md 88 | docs/InsiderSentimentsData.md 89 | docs/InsiderTransactions.md 90 | docs/InstitutionalOwnership.md 91 | docs/InstitutionalOwnershipGroup.md 92 | docs/InstitutionalOwnershipInfo.md 93 | docs/InstitutionalPortfolio.md 94 | docs/InstitutionalPortfolioGroup.md 95 | docs/InstitutionalPortfolioInfo.md 96 | docs/InstitutionalProfile.md 97 | docs/InstitutionalProfileInfo.md 98 | docs/InternationalFiling.md 99 | docs/InvestmentThemePortfolio.md 100 | docs/InvestmentThemes.md 101 | docs/IsinChange.md 102 | docs/IsinChangeInfo.md 103 | docs/KeyCustomersSuppliers.md 104 | docs/LastBidAsk.md 105 | docs/LobbyingData.md 106 | docs/LobbyingResult.md 107 | docs/MarketCapData.md 108 | docs/MarketHoliday.md 109 | docs/MarketHolidayData.md 110 | docs/MarketNews.md 111 | docs/MarketStatus.md 112 | docs/MutualFundCountryExposure.md 113 | docs/MutualFundCountryExposureData.md 114 | docs/MutualFundEet.md 115 | docs/MutualFundEetPai.md 116 | docs/MutualFundHoldings.md 117 | docs/MutualFundHoldingsData.md 118 | docs/MutualFundProfile.md 119 | docs/MutualFundProfileData.md 120 | docs/MutualFundSectorExposure.md 121 | docs/MutualFundSectorExposureData.md 122 | docs/NewsSentiment.md 123 | docs/Ownership.md 124 | docs/OwnershipInfo.md 125 | docs/PatternRecognition.md 126 | docs/PressRelease.md 127 | docs/PriceMetrics.md 128 | docs/PriceTarget.md 129 | docs/Quote.md 130 | docs/RecommendationTrend.md 131 | docs/Report.md 132 | docs/RevenueBreakdown.md 133 | docs/RevenueEstimates.md 134 | docs/RevenueEstimatesInfo.md 135 | docs/SECSentimentAnalysis.md 136 | docs/SearchBody.md 137 | docs/SearchFilter.md 138 | docs/SearchResponse.md 139 | docs/SectorMetric.md 140 | docs/SectorMetricData.md 141 | docs/Sentiment.md 142 | docs/SentimentContent.md 143 | docs/SimilarityIndex.md 144 | docs/SimilarityIndexInfo.md 145 | docs/SocialSentiment.md 146 | docs/Split.md 147 | docs/StockCandles.md 148 | docs/StockSymbol.md 149 | docs/StockTranscripts.md 150 | docs/SupplyChainRelationships.md 151 | docs/SupportResistance.md 152 | docs/SymbolChange.md 153 | docs/SymbolChangeInfo.md 154 | docs/SymbolLookup.md 155 | docs/SymbolLookupInfo.md 156 | docs/TechnicalAnalysis.md 157 | docs/TickData.md 158 | docs/Transactions.md 159 | docs/TranscriptContent.md 160 | docs/TranscriptParticipant.md 161 | docs/Trend.md 162 | docs/UpgradeDowngrade.md 163 | docs/UsaSpending.md 164 | docs/UsaSpendingResult.md 165 | docs/UsptoPatent.md 166 | docs/UsptoPatentResult.md 167 | docs/VisaApplication.md 168 | docs/VisaApplicationResult.md 169 | git_push.sh 170 | mocha.opts 171 | package.json 172 | src/ApiClient.js 173 | src/api/DefaultApi.js 174 | src/index.js 175 | src/model/AggregateIndicators.js 176 | src/model/AirlinePriceIndex.js 177 | src/model/AirlinePriceIndexData.js 178 | src/model/BasicFinancials.js 179 | src/model/BondCandles.js 180 | src/model/BondProfile.js 181 | src/model/BondTickData.js 182 | src/model/BondYieldCurve.js 183 | src/model/BondYieldCurveInfo.js 184 | src/model/BreakdownItem.js 185 | src/model/Company.js 186 | src/model/CompanyESG.js 187 | src/model/CompanyESG2.js 188 | src/model/CompanyEarningsQualityScore.js 189 | src/model/CompanyEarningsQualityScoreData.js 190 | src/model/CompanyExecutive.js 191 | src/model/CompanyNews.js 192 | src/model/CompanyNewsStatistics.js 193 | src/model/CompanyProfile.js 194 | src/model/CompanyProfile2.js 195 | src/model/CongressionalTrading.js 196 | src/model/CongressionalTransaction.js 197 | src/model/CountryMetadata.js 198 | src/model/CovidInfo.js 199 | src/model/CryptoCandles.js 200 | src/model/CryptoProfile.js 201 | src/model/CryptoSymbol.js 202 | src/model/Development.js 203 | src/model/Dividends.js 204 | src/model/Dividends2.js 205 | src/model/Dividends2Info.js 206 | src/model/DocumentResponse.js 207 | src/model/ETFCountryExposureData.js 208 | src/model/ETFHoldingsData.js 209 | src/model/ETFProfileData.js 210 | src/model/ETFSectorExposureData.js 211 | src/model/ETFsCountryExposure.js 212 | src/model/ETFsHoldings.js 213 | src/model/ETFsProfile.js 214 | src/model/ETFsSectorExposure.js 215 | src/model/EarningRelease.js 216 | src/model/EarningResult.js 217 | src/model/EarningsCalendar.js 218 | src/model/EarningsCallTranscripts.js 219 | src/model/EarningsCallTranscriptsList.js 220 | src/model/EarningsEstimates.js 221 | src/model/EarningsEstimatesInfo.js 222 | src/model/EbitEstimates.js 223 | src/model/EbitEstimatesInfo.js 224 | src/model/EbitdaEstimates.js 225 | src/model/EbitdaEstimatesInfo.js 226 | src/model/EconomicCalendar.js 227 | src/model/EconomicCode.js 228 | src/model/EconomicData.js 229 | src/model/EconomicDataInfo.js 230 | src/model/EconomicEvent.js 231 | src/model/EmployeeCount.js 232 | src/model/ExcerptResponse.js 233 | src/model/FDAComitteeMeeting.js 234 | src/model/Filing.js 235 | src/model/FilingResponse.js 236 | src/model/FilingSentiment.js 237 | src/model/FinancialStatements.js 238 | src/model/FinancialsAsReported.js 239 | src/model/ForexCandles.js 240 | src/model/ForexSymbol.js 241 | src/model/Forexrates.js 242 | src/model/FundOwnership.js 243 | src/model/FundOwnershipInfo.js 244 | src/model/HistoricalCompanyESG.js 245 | src/model/HistoricalEmployeeCount.js 246 | src/model/HistoricalMarketCapData.js 247 | src/model/HistoricalNBBO.js 248 | src/model/IPOCalendar.js 249 | src/model/IPOEvent.js 250 | src/model/InFilingResponse.js 251 | src/model/InFilingSearchBody.js 252 | src/model/IndexHistoricalConstituent.js 253 | src/model/Indicator.js 254 | src/model/IndicesConstituents.js 255 | src/model/IndicesConstituentsBreakdown.js 256 | src/model/IndicesHistoricalConstituents.js 257 | src/model/InsiderSentiments.js 258 | src/model/InsiderSentimentsData.js 259 | src/model/InsiderTransactions.js 260 | src/model/InstitutionalOwnership.js 261 | src/model/InstitutionalOwnershipGroup.js 262 | src/model/InstitutionalOwnershipInfo.js 263 | src/model/InstitutionalPortfolio.js 264 | src/model/InstitutionalPortfolioGroup.js 265 | src/model/InstitutionalPortfolioInfo.js 266 | src/model/InstitutionalProfile.js 267 | src/model/InstitutionalProfileInfo.js 268 | src/model/InternationalFiling.js 269 | src/model/InvestmentThemePortfolio.js 270 | src/model/InvestmentThemes.js 271 | src/model/IsinChange.js 272 | src/model/IsinChangeInfo.js 273 | src/model/KeyCustomersSuppliers.js 274 | src/model/LastBidAsk.js 275 | src/model/LobbyingData.js 276 | src/model/LobbyingResult.js 277 | src/model/MarketCapData.js 278 | src/model/MarketHoliday.js 279 | src/model/MarketHolidayData.js 280 | src/model/MarketNews.js 281 | src/model/MarketStatus.js 282 | src/model/MutualFundCountryExposure.js 283 | src/model/MutualFundCountryExposureData.js 284 | src/model/MutualFundEet.js 285 | src/model/MutualFundEetPai.js 286 | src/model/MutualFundHoldings.js 287 | src/model/MutualFundHoldingsData.js 288 | src/model/MutualFundProfile.js 289 | src/model/MutualFundProfileData.js 290 | src/model/MutualFundSectorExposure.js 291 | src/model/MutualFundSectorExposureData.js 292 | src/model/NewsSentiment.js 293 | src/model/Ownership.js 294 | src/model/OwnershipInfo.js 295 | src/model/PatternRecognition.js 296 | src/model/PressRelease.js 297 | src/model/PriceMetrics.js 298 | src/model/PriceTarget.js 299 | src/model/Quote.js 300 | src/model/RecommendationTrend.js 301 | src/model/Report.js 302 | src/model/RevenueBreakdown.js 303 | src/model/RevenueEstimates.js 304 | src/model/RevenueEstimatesInfo.js 305 | src/model/SECSentimentAnalysis.js 306 | src/model/SearchBody.js 307 | src/model/SearchFilter.js 308 | src/model/SearchResponse.js 309 | src/model/SectorMetric.js 310 | src/model/SectorMetricData.js 311 | src/model/Sentiment.js 312 | src/model/SentimentContent.js 313 | src/model/SimilarityIndex.js 314 | src/model/SimilarityIndexInfo.js 315 | src/model/SocialSentiment.js 316 | src/model/Split.js 317 | src/model/StockCandles.js 318 | src/model/StockSymbol.js 319 | src/model/StockTranscripts.js 320 | src/model/SupplyChainRelationships.js 321 | src/model/SupportResistance.js 322 | src/model/SymbolChange.js 323 | src/model/SymbolChangeInfo.js 324 | src/model/SymbolLookup.js 325 | src/model/SymbolLookupInfo.js 326 | src/model/TechnicalAnalysis.js 327 | src/model/TickData.js 328 | src/model/Transactions.js 329 | src/model/TranscriptContent.js 330 | src/model/TranscriptParticipant.js 331 | src/model/Trend.js 332 | src/model/UpgradeDowngrade.js 333 | src/model/UsaSpending.js 334 | src/model/UsaSpendingResult.js 335 | src/model/UsptoPatent.js 336 | src/model/UsptoPatentResult.js 337 | src/model/VisaApplication.js 338 | src/model/VisaApplicationResult.js 339 | test/model/AirlinePriceIndex.spec.js 340 | test/model/AirlinePriceIndexData.spec.js 341 | test/model/CompanyESG2.spec.js 342 | test/model/EmployeeCount.spec.js 343 | test/model/HistoricalCompanyESG.spec.js 344 | test/model/HistoricalEmployeeCount.spec.js 345 | test/model/HistoricalMarketCapData.spec.js 346 | test/model/MarketCapData.spec.js 347 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Finnhub API 3 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 4 | * 5 | * The version of the OpenAPI document: 1.0.0 6 | * 7 | * 8 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 9 | * https://openapi-generator.tech 10 | * Do not edit the class manually. 11 | * 12 | */ 13 | 14 | 15 | /** 16 | * JS API client generated by OpenAPI Generator.
17 | * The index module provides access to constructors for all the classes which comprise the public API. 18 | *

19 | * An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: 20 | *

 21 | * var finnhub = require('index'); // See note below*.
 22 | * var xxxSvc = new finnhub.XxxApi(); // Allocate the API class we're going to use.
 23 | * var yyyModel = new finnhub.Yyy(); // Construct a model instance.
 24 | * yyyModel.someProperty = 'someValue';
 25 | * ...
 26 | * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
 27 | * ...
 28 | * 
29 | * *NOTE: For a top-level AMD script, use require(['index'], function(){...}) 30 | * and put the application logic within the callback function. 31 | *

32 | *

33 | * A non-AMD browser application (discouraged) might do something like this: 34 | *

 35 | * var xxxSvc = new finnhub.XxxApi(); // Allocate the API class we're going to use.
 36 | * var yyy = new finnhub.Yyy(); // Construct a model instance.
 37 | * yyyModel.someProperty = 'someValue';
 38 | * ...
 39 | * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
 40 | * ...
 41 | * 
42 | *

43 | * @module index 44 | * @version 2.0.0 45 | */ 46 | 47 | let fetchFn; 48 | try { 49 | fetchFn = fetch; 50 | } catch (e) { 51 | fetchFn = require('node-fetch'); 52 | } 53 | 54 | 55 | function simpleRequest(url, params, callback) { 56 | const query = Object.entries(params) 57 | .filter(([_, v]) => v !== undefined && v !== null) 58 | .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`) 59 | .join('&'); 60 | const fullUrl = query ? `${url}?${query}` : url; 61 | fetchFn(fullUrl) 62 | .then(async (res) => { 63 | const text = await res.text(); 64 | let data; 65 | try { 66 | data = JSON.parse(text); 67 | } catch (e) { 68 | data = text; 69 | } 70 | if (!res.ok) { 71 | callback(data || text || res.statusText, null, res); 72 | } else { 73 | callback(null, data, res); 74 | } 75 | }) 76 | .catch((err) => callback(err, null, null)); 77 | } 78 | 79 | 80 | const BASE_URL = 'https://finnhub.io/api/v1'; 81 | 82 | /** 83 | * Default service. 84 | * @module api/DefaultApi 85 | * @version 1.2.19 86 | */ 87 | 88 | export class DefaultApi { 89 | 90 | constructor(apiKey) { 91 | this.apiKey = apiKey; 92 | } 93 | 94 | _callApi(path, params, callback) { 95 | simpleRequest(BASE_URL + path, { ...params, token: this.apiKey }, callback); 96 | } 97 | 98 | aggregateIndicator(symbol, resolution, callback) { 99 | this._callApi('/scan/technical-indicator', { symbol, resolution }, callback); 100 | } 101 | 102 | 103 | airlinePriceIndex(airline, from, to, callback) { 104 | this._callApi('/airline/price-index', { airline, from, to }, callback); 105 | } 106 | 107 | 108 | bondPrice(isin, from, to, callback) { 109 | this._callApi('/bond/price', { isin, from, to }, callback); 110 | } 111 | 112 | 113 | bondProfile(opts, callback) { 114 | this._callApi('/bond/profile', opts, callback); 115 | } 116 | 117 | 118 | bondTick(isin, date, limit, skip, exchange, callback) { 119 | this._callApi('/bond/tick', { isin, date, limit, skip, exchange }, callback); 120 | } 121 | 122 | 123 | bondYieldCurve(code, callback) { 124 | this._callApi('/bond/yield-curve', { code }, callback); 125 | } 126 | 127 | 128 | companyBasicFinancials(symbol, metric, callback) { 129 | this._callApi('/stock/metric', { symbol, metric }, callback); 130 | } 131 | 132 | 133 | companyEarnings(symbol, opts, callback) { 134 | this._callApi('/stock/earnings', { symbol, limit: opts['limit'] }, callback); 135 | } 136 | 137 | 138 | companyEarningsQualityScore(symbol, freq, callback) { 139 | this._callApi('/stock/earnings-quality-score', { symbol, freq }, callback); 140 | } 141 | 142 | companyEbitEstimates(symbol, opts, callback) { 143 | this._callApi('/stock/ebit-estimate', { symbol, freq: opts['freq'] }, callback); 144 | } 145 | 146 | companyEbitdaEstimates(symbol, opts, callback) { 147 | this._callApi('/stock/ebitda-estimate', { symbol, freq: opts['freq'] }, callback); 148 | } 149 | 150 | companyEpsEstimates(symbol, opts, callback) { 151 | this._callApi('/stock/eps-estimate', { symbol, freq: opts['freq'] }, callback); 152 | } 153 | 154 | companyEsgScore(symbol, callback) { 155 | this._callApi('/stock/esg', { symbol }, callback); 156 | } 157 | 158 | companyExecutive(symbol, callback) { 159 | this._callApi('/stock/executive', { symbol }, callback); 160 | } 161 | 162 | companyHistoricalEsgScore(symbol, callback) { 163 | this._callApi('/stock/historical-esg', { symbol }, callback); 164 | } 165 | 166 | 167 | companyNews(symbol, from, to, callback) { 168 | this._callApi('/company-news', { symbol, from, to }, callback); 169 | } 170 | 171 | 172 | stockNewsroom(symbol, from, to, callback) { 173 | this._callApi('/stock/newsroom', { symbol, from, to }, callback); 174 | } 175 | 176 | companyPeers(symbol, opts, callback) { 177 | this._callApi('/stock/peers', { symbol, grouping: opts['grouping'] }, callback); 178 | } 179 | 180 | 181 | companyProfile(opts, callback) { 182 | this._callApi('/stock/profile', opts, callback); 183 | } 184 | 185 | 186 | companyProfile2(opts, callback) { 187 | this._callApi('/stock/profile2', opts, callback); 188 | } 189 | 190 | 191 | companyRevenueEstimates(symbol, opts, callback) { 192 | this._callApi('/stock/revenue-estimate', { symbol, freq: opts['freq'] }, callback); 193 | } 194 | 195 | 196 | congressionalTrading(symbol, from, to, callback) { 197 | this._callApi('/stock/congressional-trading', { symbol, from, to }, callback); 198 | } 199 | 200 | country(callback) { 201 | this._callApi('/country', {}, callback); 202 | } 203 | 204 | covid19(callback) { 205 | this._callApi('/covid19/us', {}, callback); 206 | } 207 | 208 | 209 | cryptoCandles(symbol, resolution, from, to, callback) { 210 | this._callApi('/crypto/candle', { symbol, resolution, from, to }, callback); 211 | } 212 | 213 | 214 | cryptoExchanges(callback) { 215 | this._callApi('/crypto/exchange', {}, callback); 216 | } 217 | 218 | 219 | cryptoProfile(symbol, callback) { 220 | this._callApi('/crypto/profile', { symbol }, callback); 221 | } 222 | 223 | 224 | cryptoSymbols(exchange, callback) { 225 | this._callApi('/crypto/symbol', { exchange }, callback); 226 | } 227 | 228 | 229 | earningsCalendar(opts, callback) { 230 | this._callApi('/calendar/earnings', { from: opts['from'], to: opts['to'], symbol: opts['symbol'], international: opts['international'] }, callback); 231 | } 232 | 233 | 234 | economicCalendar(opts, callback) { 235 | this._callApi('/calendar/economic', { from: opts['from'], to: opts['to'] }, callback); 236 | } 237 | 238 | 239 | economicCode(callback) { 240 | this._callApi('/economic/code', {}, callback); 241 | } 242 | 243 | 244 | economicData(code, callback) { 245 | this._callApi('/economic', { code }, callback); 246 | } 247 | 248 | 249 | etfsCountryExposure(opts, callback) { 250 | this._callApi('/etf/country', { symbol: opts['symbol'], isin: opts['isin'] }, callback); 251 | } 252 | 253 | etfsHoldings(opts, callback) { 254 | this._callApi('/etf/holdings', { symbol: opts['symbol'], isin: opts['isin'], skip: opts['skip'], date: opts['date'] }, callback); 255 | } 256 | 257 | etfsProfile(opts, callback) { 258 | this._callApi('/etf/profile', { symbol: opts['symbol'], isin: opts['isin'] }, callback); 259 | } 260 | 261 | etfsSectorExposure(opts, callback) { 262 | this._callApi('/etf/sector', { symbol: opts['symbol'], isin: opts['isin'] }, callback); 263 | } 264 | 265 | fdaCommitteeMeetingCalendar(callback) { 266 | this._callApi('/fda-advisory-committee-calendar', {}, callback); 267 | } 268 | 269 | 270 | filings(opts, callback) { 271 | this._callApi('/stock/filings', { symbol: opts['symbol'], cik: opts['cik'], accessNumber: opts['accessNumber'], form: opts['form'], from: opts['from'], to: opts['to'] }, callback); 272 | } 273 | 274 | 275 | filingsSentiment(accessNumber, callback) { 276 | this._callApi('/stock/filings-sentiment', { accessNumber }, callback); 277 | } 278 | 279 | 280 | financials(symbol, statement, freq, callbackOrPreliminary, callbackMaybe) { 281 | let preliminary = false; 282 | let callback; 283 | if (typeof callbackOrPreliminary === 'function') { 284 | callback = callbackOrPreliminary; 285 | } else { 286 | preliminary = callbackOrPreliminary === undefined ? false : callbackOrPreliminary; 287 | callback = callbackMaybe; 288 | } 289 | this._callApi('/stock/financials', { symbol, statement, freq, preliminary }, callback); 290 | } 291 | 292 | 293 | financialsReported(opts, callback) { 294 | this._callApi('/stock/financials-reported', { symbol: opts['symbol'], cik: opts['cik'], accessNumber: opts['accessNumber'], freq: opts['freq'], from: opts['from'], to: opts['to'] }, callback); 295 | } 296 | 297 | 298 | forexCandles(symbol, resolution, from, to, callback) { 299 | this._callApi('/forex/candle', { symbol, resolution, from, to }, callback); 300 | } 301 | 302 | 303 | forexExchanges(callback) { 304 | this._callApi('/forex/exchange', {}, callback); 305 | } 306 | 307 | 308 | forexRates(opts, callback) { 309 | this._callApi('/forex/rates', { base: opts['base'], date: opts['date'] }, callback); 310 | } 311 | 312 | 313 | forexSymbols(exchange, callback) { 314 | this._callApi('/forex/symbol', { exchange }, callback); 315 | } 316 | 317 | 318 | fundOwnership(symbol, opts, callback) { 319 | this._callApi('/stock/fund-ownership', { symbol, limit: opts['limit'] }, callback); 320 | } 321 | 322 | 323 | historicalEmployeeCount(symbol, from, to, callback) { 324 | this._callApi('/stock/historical-employee-count', { symbol, from, to }, callback); 325 | } 326 | 327 | 328 | historicalMarketCap(symbol, from, to, callback) { 329 | this._callApi('/stock/historical-market-cap', { symbol, from, to }, callback); 330 | } 331 | 332 | 333 | indicesConstituents(symbol, callback) { 334 | this._callApi('/index/constituents', { symbol }, callback); 335 | } 336 | 337 | 338 | indicesHistoricalConstituents(symbol, callback) { 339 | this._callApi('/index/historical-constituents', { symbol }, callback); 340 | } 341 | 342 | insiderSentiment(symbol, from, to, callback) { 343 | this._callApi('/stock/insider-sentiment', { symbol, from, to }, callback); 344 | } 345 | 346 | insiderTransactions(symbol, opts, callback) { 347 | this._callApi('/stock/insider-transactions', { symbol, from: opts['from'], to: opts['to'] }, callback); 348 | } 349 | 350 | 351 | institutionalOwnership(symbol, cusip, from, to, callback) { 352 | this._callApi('/institutional/ownership', { symbol, cusip, from, to }, callback); 353 | } 354 | 355 | 356 | institutionalPortfolio(cik, from, to, callback) { 357 | this._callApi('/institutional/portfolio', { cik, from, to }, callback); 358 | } 359 | 360 | 361 | institutionalProfile(opts, callback) { 362 | this._callApi('/institutional/profile', opts, callback); 363 | } 364 | 365 | 366 | internationalFilings(opts, callback) { 367 | this._callApi('/stock/international-filings', { symbol: opts['symbol'], country: opts['country'], from: opts['from'], to: opts['to'] }, callback); 368 | } 369 | 370 | 371 | investmentThemes(theme, callback) { 372 | this._callApi('/stock/investment-theme', { theme }, callback); 373 | } 374 | 375 | 376 | ipoCalendar(from, to, callback) { 377 | this._callApi('/calendar/ipo', { from, to }, callback); 378 | } 379 | 380 | /** 381 | * ISIN Change 382 | * Get a list of ISIN changes for EU-listed securities. Limit to 2000 events at a time. 383 | * @param {String} from From date YYYY-MM-DD. 384 | * @param {String} to To date YYYY-MM-DD. 385 | * @param {module:api/DefaultApi~isinChangeCallback} callback The callback function, accepting three arguments: error, data, response 386 | * data is of type: {@link module:model/IsinChange} 387 | */ 388 | isinChange(from, to, callback) { 389 | this._callApi('/ca/isin-change', { from, to }, callback); 390 | } 391 | 392 | 393 | marketHoliday(exchange, callback) { 394 | this._callApi('/stock/market-holiday', { exchange }, callback); 395 | } 396 | 397 | 398 | marketNews(category, opts, callback) { 399 | this._callApi('/news', { category, minId: opts['minId'] }, callback); 400 | } 401 | 402 | 403 | marketStatus(exchange, callback) { 404 | this._callApi('/stock/market-status', { exchange }, callback); 405 | } 406 | 407 | 408 | mutualFundCountryExposure(opts, callback) { 409 | this._callApi('/mutual-fund/country', { symbol: opts['symbol'], isin: opts['isin'] }, callback); 410 | } 411 | 412 | 413 | mutualFundEet(isin, callback) { 414 | this._callApi('/mutual-fund/eet', { isin }, callback); 415 | } 416 | 417 | 418 | mutualFundEetPai(isin, callback) { 419 | this._callApi('/mutual-fund/eet-pai', { isin }, callback); 420 | } 421 | 422 | 423 | mutualFundHoldings(opts, callback) { 424 | this._callApi('/mutual-fund/holdings', { symbol: opts['symbol'], isin: opts['isin'], skip: opts['skip'] }, callback); 425 | } 426 | 427 | 428 | mutualFundProfile(opts, callback) { 429 | this._callApi('/mutual-fund/profile', opts, callback); 430 | } 431 | 432 | 433 | mutualFundSectorExposure(opts, callback) { 434 | this._callApi('/mutual-fund/sector', opts, callback); 435 | } 436 | 437 | 438 | newsSentiment(symbol, callback) { 439 | this._callApi('/news-sentiment', { symbol }, callback); 440 | } 441 | 442 | 443 | ownership(symbol, opts, callback) { 444 | this._callApi('/stock/ownership', { symbol, ...opts }, callback); 445 | } 446 | 447 | 448 | patternRecognition(symbol, resolution, callback) { 449 | this._callApi('/scan/pattern', { symbol, resolution }, callback); 450 | } 451 | 452 | 453 | pressReleases(symbol, opts, callback) { 454 | this._callApi('/press-releases', { symbol, from: opts['from'], to: opts['to'] }, callback); 455 | } 456 | 457 | 458 | priceMetrics(symbol, opts, callback) { 459 | this._callApi('/stock/price-metric', { symbol, date: opts['date'] }, callback); 460 | } 461 | 462 | 463 | priceTarget(symbol, callback) { 464 | this._callApi('/stock/price-target', { symbol }, callback); 465 | } 466 | 467 | 468 | quote(symbol, callback) { 469 | this._callApi('/quote', { symbol }, callback); 470 | } 471 | 472 | 473 | recommendationTrends(symbol, callback) { 474 | this._callApi('/stock/recommendation', { symbol }, callback); 475 | } 476 | 477 | 478 | revenueBreakdown(opts, callback) { 479 | this._callApi('/stock/revenue-breakdown', { symbol: opts['symbol'], cik: opts['cik'] }, callback); 480 | } 481 | 482 | 483 | sectorMetric(region, callback) { 484 | this._callApi('/sector/metrics', { region }, callback); 485 | } 486 | 487 | 488 | similarityIndex(opts, callback) { 489 | this._callApi('/stock/similarity-index', { ...opts }, callback); 490 | } 491 | 492 | 493 | socialSentiment(symbol, opts, callback) { 494 | this._callApi('/stock/social-sentiment', { symbol, from: opts['from'], to: opts['to'] }, callback); 495 | } 496 | 497 | 498 | stockCandles(symbol, resolution, from, to, callback) { 499 | this._callApi('/stock/candle', { symbol, resolution, from, to }, callback); 500 | } 501 | 502 | 503 | stockDividends(symbol, from, to, callback) { 504 | this._callApi('/stock/dividend', { symbol, from, to }, callback); 505 | } 506 | 507 | 508 | stockLobbying(symbol, from, to, callback) { 509 | this._callApi('/stock/lobbying', { symbol, from, to }, callback); 510 | } 511 | 512 | 513 | stockNbbo(symbol, date, limit, skip, callback) { 514 | this._callApi('/stock/bbo', { symbol, date, limit, skip }, callback); 515 | } 516 | 517 | 518 | stockSplits(symbol, from, to, callback) { 519 | this._callApi('/stock/split', { symbol, from, to }, callback); 520 | } 521 | 522 | 523 | stockSymbols(exchange, opts, callback) { 524 | this._callApi('/stock/symbol', { exchange, mic: opts['mic'], securityType: opts['securityType'], currency: opts['currency'] }, callback); 525 | } 526 | 527 | 528 | stockTick(symbol, date, limit, skip, callback) { 529 | this._callApi('/stock/tick', { symbol, date, limit, skip }, callback); 530 | } 531 | 532 | 533 | stockUsaSpending(symbol, from, to, callback) { 534 | this._callApi('/stock/usa-spending', { symbol, from, to }, callback); 535 | } 536 | 537 | 538 | stockUsptoPatent(symbol, from, to, callback) { 539 | this._callApi('/stock/uspto-patent', { symbol, from, to }, callback); 540 | } 541 | 542 | 543 | stockVisaApplication(symbol, from, to, callback) { 544 | this._callApi('/stock/visa-application', { symbol, from, to }, callback); 545 | } 546 | 547 | 548 | supportResistance(symbol, resolution, callback) { 549 | this._callApi('/scan/support-resistance', { symbol, resolution }, callback); 550 | } 551 | 552 | 553 | symbolChange(from, to, callback) { 554 | this._callApi('/ca/symbol-change', { from, to }, callback); 555 | } 556 | 557 | 558 | symbolSearch(q, opts, callback) { 559 | this._callApi('/search', { q, exchange: opts['exchange'] }, callback); 560 | } 561 | 562 | 563 | technicalIndicator(symbol, resolution, from, to, indicator, opts, callback) { 564 | this._callApi('/indicator', { symbol, resolution, from, to, indicator, ...opts }, callback); 565 | } 566 | 567 | transcripts(id, callback) { 568 | this._callApi('/stock/transcripts', { id }, callback); 569 | } 570 | 571 | transcriptsList(symbol, callback) { 572 | this._callApi('/stock/transcripts/list', { symbol }, callback); 573 | } 574 | 575 | upgradeDowngrade(opts, callback) { 576 | this._callApi('/stock/upgrade-downgrade', { ...opts }, callback); 577 | } 578 | 579 | bankBranch(symbol, callback) { 580 | this._callApi('/bank-branch', { symbol }, callback); 581 | } 582 | } 583 | 584 | // For CommonJS compatibility 585 | if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { 586 | module.exports = { DefaultApi }; 587 | } 588 | -------------------------------------------------------------------------------- /dist/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | Object.defineProperty(exports, "__esModule", { 5 | value: true 6 | }); 7 | exports.DefaultApi = void 0; 8 | var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); 9 | var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); 10 | var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); 11 | var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); 12 | var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); 13 | var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); 14 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 15 | function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } 16 | /** 17 | * Finnhub API 18 | * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) 19 | * 20 | * The version of the OpenAPI document: 1.0.0 21 | * 22 | * 23 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). 24 | * https://openapi-generator.tech 25 | * Do not edit the class manually. 26 | * 27 | */ 28 | 29 | /** 30 | * JS API client generated by OpenAPI Generator.
31 | * The index module provides access to constructors for all the classes which comprise the public API. 32 | *

33 | * An AMD (recommended!) or CommonJS application will generally do something equivalent to the following: 34 | *

 35 | * var finnhub = require('index'); // See note below*.
 36 | * var xxxSvc = new finnhub.XxxApi(); // Allocate the API class we're going to use.
 37 | * var yyyModel = new finnhub.Yyy(); // Construct a model instance.
 38 | * yyyModel.someProperty = 'someValue';
 39 | * ...
 40 | * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
 41 | * ...
 42 | * 
43 | * *NOTE: For a top-level AMD script, use require(['index'], function(){...}) 44 | * and put the application logic within the callback function. 45 | *

46 | *

47 | * A non-AMD browser application (discouraged) might do something like this: 48 | *

 49 | * var xxxSvc = new finnhub.XxxApi(); // Allocate the API class we're going to use.
 50 | * var yyy = new finnhub.Yyy(); // Construct a model instance.
 51 | * yyyModel.someProperty = 'someValue';
 52 | * ...
 53 | * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
 54 | * ...
 55 | * 
56 | *

57 | * @module index 58 | * @version 2.0.0 59 | */ 60 | 61 | var fetchFn; 62 | try { 63 | fetchFn = fetch; 64 | } catch (e) { 65 | fetchFn = require('node-fetch'); 66 | } 67 | function simpleRequest(url, params, callback) { 68 | var query = Object.entries(params).filter(function (_ref) { 69 | var _ref2 = (0, _slicedToArray2["default"])(_ref, 2), 70 | _ = _ref2[0], 71 | v = _ref2[1]; 72 | return v !== undefined && v !== null; 73 | }).map(function (_ref3) { 74 | var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2), 75 | k = _ref4[0], 76 | v = _ref4[1]; 77 | return "".concat(encodeURIComponent(k), "=").concat(encodeURIComponent(v)); 78 | }).join('&'); 79 | var fullUrl = query ? "".concat(url, "?").concat(query) : url; 80 | fetchFn(fullUrl).then(/*#__PURE__*/function () { 81 | var _ref5 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(res) { 82 | var text, data; 83 | return _regenerator["default"].wrap(function (_context) { 84 | while (1) switch (_context.prev = _context.next) { 85 | case 0: 86 | _context.next = 1; 87 | return res.text(); 88 | case 1: 89 | text = _context.sent; 90 | try { 91 | data = JSON.parse(text); 92 | } catch (e) { 93 | data = text; 94 | } 95 | if (!res.ok) { 96 | callback(data || text || res.statusText, null, res); 97 | } else { 98 | callback(null, data, res); 99 | } 100 | case 2: 101 | case "end": 102 | return _context.stop(); 103 | } 104 | }, _callee); 105 | })); 106 | return function (_x) { 107 | return _ref5.apply(this, arguments); 108 | }; 109 | }())["catch"](function (err) { 110 | return callback(err, null, null); 111 | }); 112 | } 113 | var BASE_URL = 'https://finnhub.io/api/v1'; 114 | 115 | /** 116 | * Default service. 117 | * @module api/DefaultApi 118 | * @version 1.2.19 119 | */ 120 | var DefaultApi = exports.DefaultApi = /*#__PURE__*/function () { 121 | function DefaultApi(apiKey) { 122 | (0, _classCallCheck2["default"])(this, DefaultApi); 123 | this.apiKey = apiKey; 124 | } 125 | return (0, _createClass2["default"])(DefaultApi, [{ 126 | key: "_callApi", 127 | value: function _callApi(path, params, callback) { 128 | simpleRequest(BASE_URL + path, _objectSpread(_objectSpread({}, params), {}, { 129 | token: this.apiKey 130 | }), callback); 131 | } 132 | }, { 133 | key: "aggregateIndicator", 134 | value: function aggregateIndicator(symbol, resolution, callback) { 135 | this._callApi('/scan/technical-indicator', { 136 | symbol: symbol, 137 | resolution: resolution 138 | }, callback); 139 | } 140 | }, { 141 | key: "airlinePriceIndex", 142 | value: function airlinePriceIndex(airline, from, to, callback) { 143 | this._callApi('/airline/price-index', { 144 | airline: airline, 145 | from: from, 146 | to: to 147 | }, callback); 148 | } 149 | }, { 150 | key: "bondPrice", 151 | value: function bondPrice(isin, from, to, callback) { 152 | this._callApi('/bond/price', { 153 | isin: isin, 154 | from: from, 155 | to: to 156 | }, callback); 157 | } 158 | }, { 159 | key: "bondProfile", 160 | value: function bondProfile(opts, callback) { 161 | this._callApi('/bond/profile', opts, callback); 162 | } 163 | }, { 164 | key: "bondTick", 165 | value: function bondTick(isin, date, limit, skip, exchange, callback) { 166 | this._callApi('/bond/tick', { 167 | isin: isin, 168 | date: date, 169 | limit: limit, 170 | skip: skip, 171 | exchange: exchange 172 | }, callback); 173 | } 174 | }, { 175 | key: "bondYieldCurve", 176 | value: function bondYieldCurve(code, callback) { 177 | this._callApi('/bond/yield-curve', { 178 | code: code 179 | }, callback); 180 | } 181 | }, { 182 | key: "companyBasicFinancials", 183 | value: function companyBasicFinancials(symbol, metric, callback) { 184 | this._callApi('/stock/metric', { 185 | symbol: symbol, 186 | metric: metric 187 | }, callback); 188 | } 189 | }, { 190 | key: "companyEarnings", 191 | value: function companyEarnings(symbol, opts, callback) { 192 | this._callApi('/stock/earnings', { 193 | symbol: symbol, 194 | limit: opts['limit'] 195 | }, callback); 196 | } 197 | }, { 198 | key: "companyEarningsQualityScore", 199 | value: function companyEarningsQualityScore(symbol, freq, callback) { 200 | this._callApi('/stock/earnings-quality-score', { 201 | symbol: symbol, 202 | freq: freq 203 | }, callback); 204 | } 205 | }, { 206 | key: "companyEbitEstimates", 207 | value: function companyEbitEstimates(symbol, opts, callback) { 208 | this._callApi('/stock/ebit-estimate', { 209 | symbol: symbol, 210 | freq: opts['freq'] 211 | }, callback); 212 | } 213 | }, { 214 | key: "companyEbitdaEstimates", 215 | value: function companyEbitdaEstimates(symbol, opts, callback) { 216 | this._callApi('/stock/ebitda-estimate', { 217 | symbol: symbol, 218 | freq: opts['freq'] 219 | }, callback); 220 | } 221 | }, { 222 | key: "companyEpsEstimates", 223 | value: function companyEpsEstimates(symbol, opts, callback) { 224 | this._callApi('/stock/eps-estimate', { 225 | symbol: symbol, 226 | freq: opts['freq'] 227 | }, callback); 228 | } 229 | }, { 230 | key: "companyEsgScore", 231 | value: function companyEsgScore(symbol, callback) { 232 | this._callApi('/stock/esg', { 233 | symbol: symbol 234 | }, callback); 235 | } 236 | }, { 237 | key: "companyExecutive", 238 | value: function companyExecutive(symbol, callback) { 239 | this._callApi('/stock/executive', { 240 | symbol: symbol 241 | }, callback); 242 | } 243 | }, { 244 | key: "companyHistoricalEsgScore", 245 | value: function companyHistoricalEsgScore(symbol, callback) { 246 | this._callApi('/stock/historical-esg', { 247 | symbol: symbol 248 | }, callback); 249 | } 250 | }, { 251 | key: "companyNews", 252 | value: function companyNews(symbol, from, to, callback) { 253 | this._callApi('/company-news', { 254 | symbol: symbol, 255 | from: from, 256 | to: to 257 | }, callback); 258 | } 259 | }, { 260 | key: "stockNewsroom", 261 | value: function stockNewsroom(symbol, from, to, callback) { 262 | this._callApi('/stock/newsroom', { 263 | symbol: symbol, 264 | from: from, 265 | to: to 266 | }, callback); 267 | } 268 | }, { 269 | key: "companyPeers", 270 | value: function companyPeers(symbol, opts, callback) { 271 | this._callApi('/stock/peers', { 272 | symbol: symbol, 273 | grouping: opts['grouping'] 274 | }, callback); 275 | } 276 | }, { 277 | key: "companyProfile", 278 | value: function companyProfile(opts, callback) { 279 | this._callApi('/stock/profile', opts, callback); 280 | } 281 | }, { 282 | key: "companyProfile2", 283 | value: function companyProfile2(opts, callback) { 284 | this._callApi('/stock/profile2', opts, callback); 285 | } 286 | }, { 287 | key: "companyRevenueEstimates", 288 | value: function companyRevenueEstimates(symbol, opts, callback) { 289 | this._callApi('/stock/revenue-estimate', { 290 | symbol: symbol, 291 | freq: opts['freq'] 292 | }, callback); 293 | } 294 | }, { 295 | key: "congressionalTrading", 296 | value: function congressionalTrading(symbol, from, to, callback) { 297 | this._callApi('/stock/congressional-trading', { 298 | symbol: symbol, 299 | from: from, 300 | to: to 301 | }, callback); 302 | } 303 | }, { 304 | key: "country", 305 | value: function country(callback) { 306 | this._callApi('/country', {}, callback); 307 | } 308 | }, { 309 | key: "covid19", 310 | value: function covid19(callback) { 311 | this._callApi('/covid19/us', {}, callback); 312 | } 313 | }, { 314 | key: "cryptoCandles", 315 | value: function cryptoCandles(symbol, resolution, from, to, callback) { 316 | this._callApi('/crypto/candle', { 317 | symbol: symbol, 318 | resolution: resolution, 319 | from: from, 320 | to: to 321 | }, callback); 322 | } 323 | }, { 324 | key: "cryptoExchanges", 325 | value: function cryptoExchanges(callback) { 326 | this._callApi('/crypto/exchange', {}, callback); 327 | } 328 | }, { 329 | key: "cryptoProfile", 330 | value: function cryptoProfile(symbol, callback) { 331 | this._callApi('/crypto/profile', { 332 | symbol: symbol 333 | }, callback); 334 | } 335 | }, { 336 | key: "cryptoSymbols", 337 | value: function cryptoSymbols(exchange, callback) { 338 | this._callApi('/crypto/symbol', { 339 | exchange: exchange 340 | }, callback); 341 | } 342 | }, { 343 | key: "earningsCalendar", 344 | value: function earningsCalendar(opts, callback) { 345 | this._callApi('/calendar/earnings', { 346 | from: opts['from'], 347 | to: opts['to'], 348 | symbol: opts['symbol'], 349 | international: opts['international'] 350 | }, callback); 351 | } 352 | }, { 353 | key: "economicCalendar", 354 | value: function economicCalendar(opts, callback) { 355 | this._callApi('/calendar/economic', { 356 | from: opts['from'], 357 | to: opts['to'] 358 | }, callback); 359 | } 360 | }, { 361 | key: "economicCode", 362 | value: function economicCode(callback) { 363 | this._callApi('/economic/code', {}, callback); 364 | } 365 | }, { 366 | key: "economicData", 367 | value: function economicData(code, callback) { 368 | this._callApi('/economic', { 369 | code: code 370 | }, callback); 371 | } 372 | }, { 373 | key: "etfsCountryExposure", 374 | value: function etfsCountryExposure(opts, callback) { 375 | this._callApi('/etf/country', { 376 | symbol: opts['symbol'], 377 | isin: opts['isin'] 378 | }, callback); 379 | } 380 | }, { 381 | key: "etfsHoldings", 382 | value: function etfsHoldings(opts, callback) { 383 | this._callApi('/etf/holdings', { 384 | symbol: opts['symbol'], 385 | isin: opts['isin'], 386 | skip: opts['skip'], 387 | date: opts['date'] 388 | }, callback); 389 | } 390 | }, { 391 | key: "etfsProfile", 392 | value: function etfsProfile(opts, callback) { 393 | this._callApi('/etf/profile', { 394 | symbol: opts['symbol'], 395 | isin: opts['isin'] 396 | }, callback); 397 | } 398 | }, { 399 | key: "etfsSectorExposure", 400 | value: function etfsSectorExposure(opts, callback) { 401 | this._callApi('/etf/sector', { 402 | symbol: opts['symbol'], 403 | isin: opts['isin'] 404 | }, callback); 405 | } 406 | }, { 407 | key: "fdaCommitteeMeetingCalendar", 408 | value: function fdaCommitteeMeetingCalendar(callback) { 409 | this._callApi('/fda-advisory-committee-calendar', {}, callback); 410 | } 411 | }, { 412 | key: "filings", 413 | value: function filings(opts, callback) { 414 | this._callApi('/stock/filings', { 415 | symbol: opts['symbol'], 416 | cik: opts['cik'], 417 | accessNumber: opts['accessNumber'], 418 | form: opts['form'], 419 | from: opts['from'], 420 | to: opts['to'] 421 | }, callback); 422 | } 423 | }, { 424 | key: "filingsSentiment", 425 | value: function filingsSentiment(accessNumber, callback) { 426 | this._callApi('/stock/filings-sentiment', { 427 | accessNumber: accessNumber 428 | }, callback); 429 | } 430 | }, { 431 | key: "financials", 432 | value: function financials(symbol, statement, freq, callbackOrPreliminary, callbackMaybe) { 433 | var preliminary = false; 434 | var callback; 435 | if (typeof callbackOrPreliminary === 'function') { 436 | callback = callbackOrPreliminary; 437 | } else { 438 | preliminary = callbackOrPreliminary === undefined ? false : callbackOrPreliminary; 439 | callback = callbackMaybe; 440 | } 441 | this._callApi('/stock/financials', { 442 | symbol: symbol, 443 | statement: statement, 444 | freq: freq, 445 | preliminary: preliminary 446 | }, callback); 447 | } 448 | }, { 449 | key: "financialsReported", 450 | value: function financialsReported(opts, callback) { 451 | this._callApi('/stock/financials-reported', { 452 | symbol: opts['symbol'], 453 | cik: opts['cik'], 454 | accessNumber: opts['accessNumber'], 455 | freq: opts['freq'], 456 | from: opts['from'], 457 | to: opts['to'] 458 | }, callback); 459 | } 460 | }, { 461 | key: "forexCandles", 462 | value: function forexCandles(symbol, resolution, from, to, callback) { 463 | this._callApi('/forex/candle', { 464 | symbol: symbol, 465 | resolution: resolution, 466 | from: from, 467 | to: to 468 | }, callback); 469 | } 470 | }, { 471 | key: "forexExchanges", 472 | value: function forexExchanges(callback) { 473 | this._callApi('/forex/exchange', {}, callback); 474 | } 475 | }, { 476 | key: "forexRates", 477 | value: function forexRates(opts, callback) { 478 | this._callApi('/forex/rates', { 479 | base: opts['base'], 480 | date: opts['date'] 481 | }, callback); 482 | } 483 | }, { 484 | key: "forexSymbols", 485 | value: function forexSymbols(exchange, callback) { 486 | this._callApi('/forex/symbol', { 487 | exchange: exchange 488 | }, callback); 489 | } 490 | }, { 491 | key: "fundOwnership", 492 | value: function fundOwnership(symbol, opts, callback) { 493 | this._callApi('/stock/fund-ownership', { 494 | symbol: symbol, 495 | limit: opts['limit'] 496 | }, callback); 497 | } 498 | }, { 499 | key: "historicalEmployeeCount", 500 | value: function historicalEmployeeCount(symbol, from, to, callback) { 501 | this._callApi('/stock/historical-employee-count', { 502 | symbol: symbol, 503 | from: from, 504 | to: to 505 | }, callback); 506 | } 507 | }, { 508 | key: "historicalMarketCap", 509 | value: function historicalMarketCap(symbol, from, to, callback) { 510 | this._callApi('/stock/historical-market-cap', { 511 | symbol: symbol, 512 | from: from, 513 | to: to 514 | }, callback); 515 | } 516 | }, { 517 | key: "indicesConstituents", 518 | value: function indicesConstituents(symbol, callback) { 519 | this._callApi('/index/constituents', { 520 | symbol: symbol 521 | }, callback); 522 | } 523 | }, { 524 | key: "indicesHistoricalConstituents", 525 | value: function indicesHistoricalConstituents(symbol, callback) { 526 | this._callApi('/index/historical-constituents', { 527 | symbol: symbol 528 | }, callback); 529 | } 530 | }, { 531 | key: "insiderSentiment", 532 | value: function insiderSentiment(symbol, from, to, callback) { 533 | this._callApi('/stock/insider-sentiment', { 534 | symbol: symbol, 535 | from: from, 536 | to: to 537 | }, callback); 538 | } 539 | }, { 540 | key: "insiderTransactions", 541 | value: function insiderTransactions(symbol, opts, callback) { 542 | this._callApi('/stock/insider-transactions', { 543 | symbol: symbol, 544 | from: opts['from'], 545 | to: opts['to'] 546 | }, callback); 547 | } 548 | }, { 549 | key: "institutionalOwnership", 550 | value: function institutionalOwnership(symbol, cusip, from, to, callback) { 551 | this._callApi('/institutional/ownership', { 552 | symbol: symbol, 553 | cusip: cusip, 554 | from: from, 555 | to: to 556 | }, callback); 557 | } 558 | }, { 559 | key: "institutionalPortfolio", 560 | value: function institutionalPortfolio(cik, from, to, callback) { 561 | this._callApi('/institutional/portfolio', { 562 | cik: cik, 563 | from: from, 564 | to: to 565 | }, callback); 566 | } 567 | }, { 568 | key: "institutionalProfile", 569 | value: function institutionalProfile(opts, callback) { 570 | this._callApi('/institutional/profile', opts, callback); 571 | } 572 | }, { 573 | key: "internationalFilings", 574 | value: function internationalFilings(opts, callback) { 575 | this._callApi('/stock/international-filings', { 576 | symbol: opts['symbol'], 577 | country: opts['country'], 578 | from: opts['from'], 579 | to: opts['to'] 580 | }, callback); 581 | } 582 | }, { 583 | key: "investmentThemes", 584 | value: function investmentThemes(theme, callback) { 585 | this._callApi('/stock/investment-theme', { 586 | theme: theme 587 | }, callback); 588 | } 589 | }, { 590 | key: "ipoCalendar", 591 | value: function ipoCalendar(from, to, callback) { 592 | this._callApi('/calendar/ipo', { 593 | from: from, 594 | to: to 595 | }, callback); 596 | } 597 | 598 | /** 599 | * ISIN Change 600 | * Get a list of ISIN changes for EU-listed securities. Limit to 2000 events at a time. 601 | * @param {String} from From date YYYY-MM-DD. 602 | * @param {String} to To date YYYY-MM-DD. 603 | * @param {module:api/DefaultApi~isinChangeCallback} callback The callback function, accepting three arguments: error, data, response 604 | * data is of type: {@link module:model/IsinChange} 605 | */ 606 | }, { 607 | key: "isinChange", 608 | value: function isinChange(from, to, callback) { 609 | this._callApi('/ca/isin-change', { 610 | from: from, 611 | to: to 612 | }, callback); 613 | } 614 | }, { 615 | key: "marketHoliday", 616 | value: function marketHoliday(exchange, callback) { 617 | this._callApi('/stock/market-holiday', { 618 | exchange: exchange 619 | }, callback); 620 | } 621 | }, { 622 | key: "marketNews", 623 | value: function marketNews(category, opts, callback) { 624 | this._callApi('/news', { 625 | category: category, 626 | minId: opts['minId'] 627 | }, callback); 628 | } 629 | }, { 630 | key: "marketStatus", 631 | value: function marketStatus(exchange, callback) { 632 | this._callApi('/stock/market-status', { 633 | exchange: exchange 634 | }, callback); 635 | } 636 | }, { 637 | key: "mutualFundCountryExposure", 638 | value: function mutualFundCountryExposure(opts, callback) { 639 | this._callApi('/mutual-fund/country', { 640 | symbol: opts['symbol'], 641 | isin: opts['isin'] 642 | }, callback); 643 | } 644 | }, { 645 | key: "mutualFundEet", 646 | value: function mutualFundEet(isin, callback) { 647 | this._callApi('/mutual-fund/eet', { 648 | isin: isin 649 | }, callback); 650 | } 651 | }, { 652 | key: "mutualFundEetPai", 653 | value: function mutualFundEetPai(isin, callback) { 654 | this._callApi('/mutual-fund/eet-pai', { 655 | isin: isin 656 | }, callback); 657 | } 658 | }, { 659 | key: "mutualFundHoldings", 660 | value: function mutualFundHoldings(opts, callback) { 661 | this._callApi('/mutual-fund/holdings', { 662 | symbol: opts['symbol'], 663 | isin: opts['isin'], 664 | skip: opts['skip'] 665 | }, callback); 666 | } 667 | }, { 668 | key: "mutualFundProfile", 669 | value: function mutualFundProfile(opts, callback) { 670 | this._callApi('/mutual-fund/profile', opts, callback); 671 | } 672 | }, { 673 | key: "mutualFundSectorExposure", 674 | value: function mutualFundSectorExposure(opts, callback) { 675 | this._callApi('/mutual-fund/sector', opts, callback); 676 | } 677 | }, { 678 | key: "newsSentiment", 679 | value: function newsSentiment(symbol, callback) { 680 | this._callApi('/news-sentiment', { 681 | symbol: symbol 682 | }, callback); 683 | } 684 | }, { 685 | key: "ownership", 686 | value: function ownership(symbol, opts, callback) { 687 | this._callApi('/stock/ownership', _objectSpread({ 688 | symbol: symbol 689 | }, opts), callback); 690 | } 691 | }, { 692 | key: "patternRecognition", 693 | value: function patternRecognition(symbol, resolution, callback) { 694 | this._callApi('/scan/pattern', { 695 | symbol: symbol, 696 | resolution: resolution 697 | }, callback); 698 | } 699 | }, { 700 | key: "pressReleases", 701 | value: function pressReleases(symbol, opts, callback) { 702 | this._callApi('/press-releases', { 703 | symbol: symbol, 704 | from: opts['from'], 705 | to: opts['to'] 706 | }, callback); 707 | } 708 | }, { 709 | key: "priceMetrics", 710 | value: function priceMetrics(symbol, opts, callback) { 711 | this._callApi('/stock/price-metric', { 712 | symbol: symbol, 713 | date: opts['date'] 714 | }, callback); 715 | } 716 | }, { 717 | key: "priceTarget", 718 | value: function priceTarget(symbol, callback) { 719 | this._callApi('/stock/price-target', { 720 | symbol: symbol 721 | }, callback); 722 | } 723 | }, { 724 | key: "quote", 725 | value: function quote(symbol, callback) { 726 | this._callApi('/quote', { 727 | symbol: symbol 728 | }, callback); 729 | } 730 | }, { 731 | key: "recommendationTrends", 732 | value: function recommendationTrends(symbol, callback) { 733 | this._callApi('/stock/recommendation', { 734 | symbol: symbol 735 | }, callback); 736 | } 737 | }, { 738 | key: "revenueBreakdown", 739 | value: function revenueBreakdown(opts, callback) { 740 | this._callApi('/stock/revenue-breakdown', { 741 | symbol: opts['symbol'], 742 | cik: opts['cik'] 743 | }, callback); 744 | } 745 | }, { 746 | key: "sectorMetric", 747 | value: function sectorMetric(region, callback) { 748 | this._callApi('/sector/metrics', { 749 | region: region 750 | }, callback); 751 | } 752 | }, { 753 | key: "similarityIndex", 754 | value: function similarityIndex(opts, callback) { 755 | this._callApi('/stock/similarity-index', _objectSpread({}, opts), callback); 756 | } 757 | }, { 758 | key: "socialSentiment", 759 | value: function socialSentiment(symbol, opts, callback) { 760 | this._callApi('/stock/social-sentiment', { 761 | symbol: symbol, 762 | from: opts['from'], 763 | to: opts['to'] 764 | }, callback); 765 | } 766 | }, { 767 | key: "stockCandles", 768 | value: function stockCandles(symbol, resolution, from, to, callback) { 769 | this._callApi('/stock/candle', { 770 | symbol: symbol, 771 | resolution: resolution, 772 | from: from, 773 | to: to 774 | }, callback); 775 | } 776 | }, { 777 | key: "stockDividends", 778 | value: function stockDividends(symbol, from, to, callback) { 779 | this._callApi('/stock/dividend', { 780 | symbol: symbol, 781 | from: from, 782 | to: to 783 | }, callback); 784 | } 785 | }, { 786 | key: "stockLobbying", 787 | value: function stockLobbying(symbol, from, to, callback) { 788 | this._callApi('/stock/lobbying', { 789 | symbol: symbol, 790 | from: from, 791 | to: to 792 | }, callback); 793 | } 794 | }, { 795 | key: "stockNbbo", 796 | value: function stockNbbo(symbol, date, limit, skip, callback) { 797 | this._callApi('/stock/bbo', { 798 | symbol: symbol, 799 | date: date, 800 | limit: limit, 801 | skip: skip 802 | }, callback); 803 | } 804 | }, { 805 | key: "stockSplits", 806 | value: function stockSplits(symbol, from, to, callback) { 807 | this._callApi('/stock/split', { 808 | symbol: symbol, 809 | from: from, 810 | to: to 811 | }, callback); 812 | } 813 | }, { 814 | key: "stockSymbols", 815 | value: function stockSymbols(exchange, opts, callback) { 816 | this._callApi('/stock/symbol', { 817 | exchange: exchange, 818 | mic: opts['mic'], 819 | securityType: opts['securityType'], 820 | currency: opts['currency'] 821 | }, callback); 822 | } 823 | }, { 824 | key: "stockTick", 825 | value: function stockTick(symbol, date, limit, skip, callback) { 826 | this._callApi('/stock/tick', { 827 | symbol: symbol, 828 | date: date, 829 | limit: limit, 830 | skip: skip 831 | }, callback); 832 | } 833 | }, { 834 | key: "stockUsaSpending", 835 | value: function stockUsaSpending(symbol, from, to, callback) { 836 | this._callApi('/stock/usa-spending', { 837 | symbol: symbol, 838 | from: from, 839 | to: to 840 | }, callback); 841 | } 842 | }, { 843 | key: "stockUsptoPatent", 844 | value: function stockUsptoPatent(symbol, from, to, callback) { 845 | this._callApi('/stock/uspto-patent', { 846 | symbol: symbol, 847 | from: from, 848 | to: to 849 | }, callback); 850 | } 851 | }, { 852 | key: "stockVisaApplication", 853 | value: function stockVisaApplication(symbol, from, to, callback) { 854 | this._callApi('/stock/visa-application', { 855 | symbol: symbol, 856 | from: from, 857 | to: to 858 | }, callback); 859 | } 860 | }, { 861 | key: "supportResistance", 862 | value: function supportResistance(symbol, resolution, callback) { 863 | this._callApi('/scan/support-resistance', { 864 | symbol: symbol, 865 | resolution: resolution 866 | }, callback); 867 | } 868 | }, { 869 | key: "symbolChange", 870 | value: function symbolChange(from, to, callback) { 871 | this._callApi('/ca/symbol-change', { 872 | from: from, 873 | to: to 874 | }, callback); 875 | } 876 | }, { 877 | key: "symbolSearch", 878 | value: function symbolSearch(q, opts, callback) { 879 | this._callApi('/search', { 880 | q: q, 881 | exchange: opts['exchange'] 882 | }, callback); 883 | } 884 | }, { 885 | key: "technicalIndicator", 886 | value: function technicalIndicator(symbol, resolution, from, to, indicator, opts, callback) { 887 | this._callApi('/indicator', _objectSpread({ 888 | symbol: symbol, 889 | resolution: resolution, 890 | from: from, 891 | to: to, 892 | indicator: indicator 893 | }, opts), callback); 894 | } 895 | }, { 896 | key: "transcripts", 897 | value: function transcripts(id, callback) { 898 | this._callApi('/stock/transcripts', { 899 | id: id 900 | }, callback); 901 | } 902 | }, { 903 | key: "transcriptsList", 904 | value: function transcriptsList(symbol, callback) { 905 | this._callApi('/stock/transcripts/list', { 906 | symbol: symbol 907 | }, callback); 908 | } 909 | }, { 910 | key: "upgradeDowngrade", 911 | value: function upgradeDowngrade(opts, callback) { 912 | this._callApi('/stock/upgrade-downgrade', _objectSpread({}, opts), callback); 913 | } 914 | }, { 915 | key: "bankBranch", 916 | value: function bankBranch(symbol, callback) { 917 | this._callApi('/bank-branch', { 918 | symbol: symbol 919 | }, callback); 920 | } 921 | }]); 922 | }(); // For CommonJS compatibility 923 | if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') { 924 | module.exports = { 925 | DefaultApi: DefaultApi 926 | }; 927 | } --------------------------------------------------------------------------------