New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

investing-com-api-v2

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

investing-com-api-v2

Unofficial APIs for Investing.com website.

  • 5.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-73.33%
Maintainers
0
Weekly downloads
 
Created
Source

Investing.com Unofficial APIs V2

NPM

Introduction

Unofficial APIs for Investing.com website.
Upgraded from investing-com-api, fixes RAM overflow error when hanging for a long time on windows server.

Install

npm i investing-com-api-v2

Example

const InVestingApiV2 = require('investing-com-api-v2/api/InvestingApiV2');

//default using console, can use winston...
InVestingApiV2.logger(console);

//enable debugger
InVestingApiV2.setDebugger(false);

//startup browser
//function init(pptrLaunchOptions:LaunchOptions):Promise<void>;
await InVestingApiV2.init({});

//get data
/*
function investing(
  input: string,
  period?: 'P1D' | 'P1W' | 'P1M' | 'P3M' | 'P6M' | 'P1Y' | 'P5Y' | 'MAX',
  interval?: 'PT1M' | 'PT5M' | 'PT15M' | 'PT30M' | 'PT1H' | 'PT5H' | 'P1D' | 'P1W' | 'P1M',
  pointscount?: 60 | 70 | 120
): Promise<{
    date: number,
    value: number,
    price_open: number,
    price_high: number,
    price_low: number,
    price_close: number,
  }[]>
*/
let data = await InVestingApiV2.investing(
  'currencies/eur-usd',
  'P1D',
  'PT1M',
  60);
console.log(data);

//close browser
//function close():Promise<void>;
await InVestingApiV2.close();

Inputs

Only input is required, other params are optional.

  • input String: input string, see mapping.js keys, or provide a valid investing.com pairId. (Required)
  • period String: Period of time, window size. Default P1M (1 month). Valid values: P1D, P1W, P1M, P3M, P6M, P1Y, P5Y, MAX.
  • interval Number: Interval between results. Default P1D (1 day). Valid values: PT1M, PT5M, PT15M, PT30M, PT1H, PT5H, P1D, P1W, P1M.
  • pointsCount Number: number of total results. Valid values seems to be 60, 70 or 120.
  • puppeteerLaunchOptions Any: Puppeteer launch options, see official website.

Author

Keywords

FAQs

Package last updated on 01 Sep 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