Socket
Socket
Sign inDemoInstall

yahoo-finance2

Package Overview
Dependencies
14
Maintainers
1
Versions
86
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    yahoo-finance2

JS API for Yahoo Finance


Version published
Weekly downloads
3.8K
decreased by-20%
Maintainers
1
Created
Weekly downloads
 

Changelog

Source

1.3.0 (2021-02-01)

Bug Fixes

  • index: default export (ae50993)
  • quoteSummary: s/EndDate/DateObj, and have DateObj json -> Date (#7) (d5f834f)
  • quoteSummary: schema updates and transform fixes (0930f33)

Features

  • quoteSummary: all submodules, using validation type coercion (3970132)
  • quoteSummary/assetProfile: complete (#7) (e95dbc8)

Readme

Source

node-yahoo-finance2

Community API for Yahoo-Finance

Copyright (c) 2021 by Gadi Cohen <dragon@wastelands.net>. MIT licensed.

npm CircleCI coverage semantic-release TypeScript MIT License

Supports Node 12.0.0 and up (tests are run against 12.0.0).

DO NOT USE! In active development. API may change without warning until stable release. Use node-yahoo-finance instead, unless you are contributing to development.

Unofficial API

This project is neither created nor endorsed by Yahoo Inc. Yahoo does not provide any official API to developers, nor makes any guarantees regarding service availability or API consistency. In practice however, the open source community has kept this project (and it's predecessor) working well since 2013.

Nevertheless, we make no guarantees and you use this package at your own risk. The developers (and obviously Yahoo) cannot be held responsible for any losses you may incur as a result of using this service. Use of this package is considered acknowledgement and acceptance of these terms and of it's license.

Quickstart

CLI (Command line interface)

$ npx yahoo-finance2 search AAPL

# or install it
$ npm install -g yahoo-finance2
$ yahoo-finance search AAPL '{ "someOption": true }'

Importing

// Import the entire library or the specific module you need
import { search } from 'yahoo-finance2';
import search from 'yahoo-finance2/api/search';

const results = await search('AAPL');
const results = await search('AAPL', { someOption: true, etc });

For the full list of modules, see the Documentation.

Devel Mode

In "devel" mode, any URL will only be fetched once and cached in memory and on the disk. All future requests (for the rest of time) will return the cached result. This is very helpful to speed up development and is used extensively for our tests.

await search('AAPL', {}, { devel: true });                // uses sha1 from URL
await search('AAPL', {}, { devel: 'search-AAPL.json' });  // fixed filename

Note: require('yahooFinanceFetchDevel') is called conditionally when devel: true. It also uses packages from devDependencies. As such, deployment to production is not supported.

Contributing

Pull Requests welcome! Please read CONTRIBUTING.md to avoid friction :) Mostly importantly, PRs should be submitted against the devel branch (our default branch) and commit messages should follow the conventionalcommits standard (basically Angular). This is important as we use semantic-release to automate releases and CHANGELOG entries when we merge back to master.

Credits

  • Massive thanks to @pilwon for the original node-yahoo-finance and for all our prior collaborations on this and other projects 🙏

FAQs

Last updated on 01 Feb 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc