├── .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("
19 | * An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
20 | *
17 | * The index module provides access to constructors for all the classes which comprise the public API.
18 | *
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 | *
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.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 | }
--------------------------------------------------------------------------------