worldtradingdata
Node.js wrapper for World Trading Data API
Installation
npm i worldtradingdata
Usage
import { WorldTradingDataWrapper } from "./index";
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
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_orderoutput
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_orderoutput
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: AAPLsearchBy
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-500page
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'.