worldtradingdata v1.0.12
worldtradingdata
Node.js wrapper for World Trading Data API
Installation
npm i worldtradingdataUsage
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
- realTime
- mutualFundRealTime
- intradayMarketData
- fullHistory
- multiSingleDayHistory
- forex
- forexHistory
- forexSingleDay
- stockSearch
constructor
A wrapper for the World Trading Data API
Parameters
tokenAPI token
realTime
Returns the nearest trading data for stocks and indexes worldwide.
Parameters
symbolsArray with stocks you wish to return.sortOrderChange the sort order of values. Options: 'asc', 'desc'.sortBySort by a particular data attribute or by the order you entered the list. Options: symbol, name, list_orderoutputChange 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
symbolsArray with stocks you wish to return.sortOrderChange the sort order of values. Options: 'asc', 'desc'.sortBySort by a particular data attribute or by the order you entered the list. Options: symbol, name, list_orderoutputChange output to CSV. Options: 'csv', 'json'.
intradayMarketData
Return a stream of the latest data for stocks and indexes worldwide.
Parameters
symbolValue of the stock, index or mutual fund you wish to return data for. Only one symbol per request.intervalNumber of minutes between the data. Options: 1, 2, 5, 60.rangeThe number of days data is returned for. Options: 1-30.sortChange the sort order of values. Options: 'asc', 'desc'.outputChange output to CSV. Options: 'csv', 'json'.formattedAlter 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
symbolValue of the stock, index or mutual fund you wish to return data for.date_fromdate_tosortChange the sort order of values. Options: 'asc', 'desc'.outputChange output to CSV. Options: 'csv', 'json'.formattedAlter JSON data format. Does not affect CSV. Options: true, false.intervalNumber of minutes between the data. Options: 1, 2, 5, 60.rangeThe 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
symbolsComma seperated values of the tickers you wish to return.dateThe date you wish to retrieve data for.sortChange the sort order of values. Options: 'asc', 'desc'.outputChange output to CSV. Options: 'csv', 'json'.formattedAlter JSON data format. Does not affect CSV. Options: true, false.
forex
Returns all the conversion rates for the base currency in exceptional timing.
Parameters
baseValue of the currency you wish to return data for.
forexHistory
Returns the end of day conversion rate for each day of data.
Parameters
baseBase of the currency you wish to return data for.convertToValue of the currency you wish to return conversion data to.sortChange the sort order of values. Options: 'asc', 'desc'.outputChange output to CSV. Options: 'csv', 'json'.formattedAlter 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
baseValue of the currency you wish to return data for.dateDate you wish to return the conversion data for.outputChange output to CSV. Options: 'csv', 'json'.formattedAlter 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
searchTermSearch term you wish to find stocks for. Example: AAPLsearchBySearch by only symbol or name, or both. Options: symbol, name, symbol, name.stockExchangeFilter by a array of stock exchanges.currencyFilter by a array of currencies.limitLimit the number of results returned. Options: 1-500pageValue of the page you wish to see values for.sortBySort by a specific column. Options: symbol, name, currency, stock_exchange_long, stock_exchange_short, market_cap, volume, change_pct.sortOrderChange the sort order of values. Options: 'asc', 'desc'.outputChange output to CSV. Options: 'csv', 'json'.