Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google-finance-quote

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-finance-quote

Node Google Finance API wrapper for free. No API key is required!

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-42.86%
Maintainers
1
Weekly downloads
 
Created
Source

google-finance-quote

Node Google Finance API wrapper for free. No API key is required!

Note: This results may vary by up to 20 minutes.

Usage

Get Started

const { Finance, symbols } = require("google-finance-quote");

console.log(symbols); // Returns available symbols.

const finance = new Finance(); // You can use this: new Finance({ from 'USD', to: 'JPY' });
// You can use http(s) proxies.
/*
const proxy = {
  host: 'example.com',
  port: 2000,
  protocol: 'http'
}
const finance = new Finance({ proxy });
*/

finance
  .setFrom('USD');
  .setTo('JPY');

(async () => {
  console.log(await finance.quote()); // { success: true, rate: 150.94225699999998 }
})();

Class

Finance({ from?:string, to?:string, proxy?:object })

Functions

  • .setFrom(from: string) Set the parameter of from.

  • .setTo(to: string) Set the parameter of to.

  • .getParam(): object Returns the current param.

  • .quote(amount?: number): Promise<{ success: boolean, rate: number }> Returns the converted amount based on the exchange rate.

Note: If the current rate cannot be obtained due to rate limits or network errors, success: false is returned.

Get Support

Discord Banner

Keywords

FAQs

Package last updated on 25 Oct 2024

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc