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 🙏

© 2026 – Pkg Stats / Ryan Hefner

twelvedata-ts

v1.0.8

Published

TypeScript TwelveData API wrapper

Readme

✨ TwelveData in TypeScript ✨

A modern library for the TwelveData financial API


This is a TypeScript wrapper for the TwelveData API. Supported endpoints are well-typed. The ultimate goal is 100% API coverage, that being said, this is still a work in progress.

BIG thanks to @jonnotjohn ❤️

Contributions welcome! 🥺👍


Support

  • (Partial) Core
  • (Partial) Reference Data
    • (Supported) Asset Catalogs
    • (Supported) Discovery
    • (Partial) Markets
    • (Supported) Technical Indicators
  • (Supported) Fundamental
  • (Supported) Currencies
  • (Partial) ETFs
  • (Unsupported) Mutual Funds
  • (Unsupported) Technical Indicators
  • (Supported) Analysis
  • (Unsupported) Regulatory
  • (Partial) Advanced
  • (Unsupported) Websocket

Many of the partial categories have all of their endpoints mapped and typed, but have not been exhaustively tested, so until then, they are listed as "partial."


Installation

npm install twelvedata-ts

Getting Started

import TwelveData from 'twelvedata-ts';

const client = new TwelveData({
  apiKey: "demo",
  creditsPerMinute: 1597, // Put your plan's credits per minute here for automatic rate limiting
});

If the creditsPerMinute option is provided, the client will rate limit requests to avoid exceeding your plan's per-minute limit. The client is also aware of each endpoint's credit cost and will intelligently attempt to maximize each minute's credit usage. Rate limiting is disabled by default.

Endpoints are organized by section as in the official TwelveData documentation. Endpoints are nested in the same hierarchy as they appear in the documentation.

const timeSeriesReq: TimeSeriesRequest = {
            symbol: "AAPL",
            interval: Interval.FiveMin,
            outputSize: 30,
        };
const res = await client.core.getTimeSeries(timeSeriesReq);
// Endpoints that have no required parameters can omit a request object.
const json: ETFsResponse = await client.reference.assetCatalogs.getEtfs();
// If an endpoint supports CSV format, a string will be returned.
const csv: string = await client.reference.assetCatalogs.getEtfs({}, "csv");

Each supported endpoint has a corresponding request and response interface defining the available request/response parameters. Endpoint functions that support either CSV or JSON output also have an optional argument.


Important Notes

  • We currently don't have access to an ultra plan to test many of these endpoints.
    • If you do, and you find an issue, please open one! 🥹
  • Technical Indicators will probably be the last to get support due to the sheer number of endpoints to account for.
  • Some of the API documentation request/response descriptions and examples include options that aren't supported. This includes but is not limited to:
    • fields that show up for crypto but not stocks (and not explicitly mentioned in the documentation)
    • typos/different spelling in the response objects versus what the documentation tells us to expect
    • certain time intervals being unsupported despite being explicitly listed in the request options We will document every case of this that we come across simply because it may help developers down the line somewhere. These discrepancies are organized by endpoint URI in the next section

/time_series

  • 5h (five hour) interval is not supported

/quote

  • "rolling_1day/7_day_change" is actually "rolling_1d/7d_change" in the response object

/commodities

  • "category" request parameter does not act as a filter

/exchanges

  • Only supports "stock, etf, index," not the others in the "type" list. (American Depositary Receipt, Bond, Bond Fund, Closed-end Fund, Common Stock, Depositary Receipt, Digital Currency, ETF, Exchange-Traded Note, Global Depositary Receipt, Limited Partnership, Mutual Fund, Physical Currency, Preferred Stock, REIT, Right, Structured Product, Trust, Unit, Warrant)