npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

worldtradingdata

v1.0.12

Published

Node.js wrapper for World Trading Data API

Downloads

21

Readme

worldtradingdata

Node.js wrapper for World Trading Data API

Installation

npm i worldtradingdata

Usage

import { WorldTradingDataWrapper } from "worldtradingdata";

var token = "<yourToken>";

var wtd = new WorldTradingDataWrapper(token);

wtd.realTime(["AAPL"]).then(
  (realTimeResponse): void => {
    console.log(realTimeResponse.data[0]);
  }
);

Class Methods

constructor

A wrapper for the World Trading Data API

Parameters

  • token API token

realTime

Returns the nearest trading data for stocks and indexes worldwide.

Parameters

  • symbols Array with stocks you wish to return.
  • sortOrder Change the sort order of values. Options: 'asc', 'desc'.
  • sortBy Sort by a particular data attribute or by the order you entered the list. Options: symbol, name, list_order
  • output Change output to CSV. Options: 'csv', 'json'.

mutualFundRealTime

The endpoint allows up to 500 mutual funds to be returned with each request in exceptional timing.

Parameters

  • symbols Array with stocks you wish to return.
  • sortOrder Change the sort order of values. Options: 'asc', 'desc'.
  • sortBy Sort by a particular data attribute or by the order you entered the list. Options: symbol, name, list_order
  • output Change output to CSV. Options: 'csv', 'json'.

intradayMarketData

Return a stream of the latest data for stocks and indexes worldwide.

Parameters

  • symbol Value of the stock, index or mutual fund you wish to return data for. Only one symbol per request.
  • interval Number of minutes between the data. Options: 1, 2, 5, 60.
  • range The number of days data is returned for. Options: 1-30.
  • sort Change the sort order of values. Options: 'asc', 'desc'.
  • output Change output to CSV. Options: 'csv', 'json'.
  • formatted Alter JSON data format. Does not affect CSV. Options: true, false.

fullHistory

Return the end of day history for every day the stock, index or mutual fund has been traded.

Parameters

  • symbol Value of the stock, index or mutual fund you wish to return data for.
  • date_from
  • date_to
  • sort Change the sort order of values. Options: 'asc', 'desc'.
  • output Change output to CSV. Options: 'csv', 'json'.
  • formatted Alter JSON data format. Does not affect CSV. Options: true, false.
  • interval Number of minutes between the data. Options: 1, 2, 5, 60.
  • range The number of days data is returned for. Options: 1-30.

multiSingleDayHistory

Returns data for multiple stock, index or mutual funds for a single specific day.

Parameters

  • symbols Comma seperated values of the tickers you wish to return.
  • date The date you wish to retrieve data for.
  • sort Change the sort order of values. Options: 'asc', 'desc'.
  • output Change output to CSV. Options: 'csv', 'json'.
  • formatted Alter JSON data format. Does not affect CSV. Options: true, false.

forex

Returns all the conversion rates for the base currency in exceptional timing.

Parameters

  • base Value of the currency you wish to return data for.

forexHistory

Returns the end of day conversion rate for each day of data.

Parameters

  • base Base of the currency you wish to return data for.
  • convertTo Value of the currency you wish to return conversion data to.
  • sort Change the sort order of values. Options: 'asc', 'desc'.
  • output Change output to CSV. Options: 'csv', 'json'.
  • formatted Alter JSON data format. Does not affect CSV. Options: true, false.

forexSingleDay

eturn the all the conversion rates for the base currency for a specific date in exceptional timing.

Parameters

  • base Value of the currency you wish to return data for.
  • date Date you wish to return the conversion data for.
  • output Change output to CSV. Options: 'csv', 'json'.
  • formatted Alter JSON data format. Does not affect CSV. Options: true, false.

stockSearch

Search and filter the entire stock and index database to build your own search functionality for your applications.

Parameters

  • searchTerm Search term you wish to find stocks for. Example: AAPL
  • searchBy Search by only symbol or name, or both. Options: symbol, name, symbol, name.
  • stockExchange Filter by a array of stock exchanges.
  • currency Filter by a array of currencies.
  • limit Limit the number of results returned. Options: 1-500
  • page Value of the page you wish to see values for.
  • sortBy Sort by a specific column. Options: symbol, name, currency, stock_exchange_long, stock_exchange_short, market_cap, volume, change_pct.
  • sortOrder Change the sort order of values. Options: 'asc', 'desc'.
  • output Change output to CSV. Options: 'csv', 'json'.