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

taapi

v1.4.8

Published

A wrapper and a client for the TAAPI.IO API

Downloads

93

Readme

TAAPI.IO

TAAPI.IO is an API that calculates Technical Analysis Indicator values.

This NPM package is a wrapper and a client for communicating with the TAAPI.IO API

Using this service requires registration. Please check TAAPI.IO. We offer free and paid plans.

Please refer to our main TAAPI.IO Documentation. Here we will provide in-depts explainations and examples.

Getting started

  • Sign up for a free/paid API key at TAAPI.IO
  • Create a new node project: npm init
  • Install this package: npm i taapi --save

Usage

Get started quickly with NodeJS and calculate indicator values with very few lines of code.

  • Create your entry js file (index.js / index.ts for instance) containing:
// Import taapi
import Taapi from 'taapi'; // See out main docs for Common JS usage

// Setup client with authentication
const taapi = new Taapi("<MY_SECRET>");

// RSI for Bitcoin to the US Dollar on the hourly from Binance
taapi.getIndicator("rsi", "BTC/USDT", "1h").then( rsi => {
    console.log(rsi.value);
});

Fetch the last closed 200 period Exponential Moving Average for Bitcoin to the Dollar on the 1 hour timeframe from the Bybit exchange.

// Import taapi
import Taapi from 'taapi'; // See out main docs for Common JS usage

// Setup client with authentication
const taapi = new Taapi("<MY_SECRET>");

taapi.getIndicator("ema", "BTC/USDT", "1h", { period: 200, backtrack: 1 }, "bybit").then( ema => {
    console.log(ema);
});

Stocks & Forex

Using our integration partner Polygon.io, you can easily fetch indicators from the US Stocks & Forex markets. Visit our guide on how to use Polygon.io with TAAPI.IO for detailed explanations.

// Import taapi
import Taapi from 'taapi'; // See out main docs for Common JS usage

// Setup client with authentication
const taapi = new Taapi("<MY_SECRET>");

// Set provider
taapi.setProvider("polygon", "<POLYGON_SECRET>");

// Get stocks indicator
taapi.getIndicator("macd", "AAPL", "1d", { 
    type: "stocks"
}).then( macd => {
    console.log(macd);
});

For Forex examples, please visit out main documentation.

Calling multiple indicators in Bulk

// Import taapi
import Taapi from 'taapi'; // See out main docs for Common JS usage

// Setup client with authentication
const taapi = new Taapi("<MY_SECRET>");

// Reset
taapi.resetBulkConstructs();

// Add calculations
taapi.addCalculation("rsi", "BTC/USDT", "1h", "rsi_1h");
taapi.addCalculation("macd", "BTC/USDT", "1h", "macd_1h");
taapi.addCalculation("ema", "BTC/USDT", "1h", "ema_fast_1h", { period: 9, backtrack: 1 });
taapi.addCalculation("ema", "BTC/USDT", "1h", "ema_slow_1h", { period: 20, backtrack: 1 });

// Execute Crypto request
taapi.executeBulk().then( results => {
    console.log(results);
}).catch( error => {
    console.error(error)
});

For Stocks & Forex examples, please visit out main documentation.

Discover Symbols

// Import taapi
import Taapi from 'taapi'; // See out main docs for Common JS usage

// Setup client with authentication
const taapi = new Taapi("<MY_SECRET>");

// Get all USDT pairs traded on Binance
taapi.getExchangeSymbols("crypto", "binance", "USDT").then( symbols => {
    console.log(symbols);
});

For more examples including Stocks & Forex, please visit our main documentation.

v1.4.0 Breaking Updates

As of version 1.4.0 of this NPM package is completely rewritten in TypeScript. It does not use CCXT anymore as the data-source, but TAAPI.IO's inhouse data source. To keep using the legacy CCXT client, please see the: taapi-ccxt package. Alternatively install this package version 1.3.1