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

@coinpaprika/api-nodejs-client

v3.0.0

Published

This library provides convenient way to use Coinpaprika.com API in NodeJS

Downloads

316

Readme

Coinpaprika API NodeJS Client

This library provides convenient way to use Coinpaprika.com API in NodeJS.

Coinpaprika delivers full market data to the world of crypto: coin prices, volumes, market caps, ATHs, return rates and more.

Install

npm install @coinpaprika/api-nodejs-client

Requires Node.js 18 or newer (uses the built-in global fetch). If you need to support Node 14–17, stay on the 2.x line.

Usage

CommonJS

const CoinpaprikaAPI = require('@coinpaprika/api-nodejs-client');

const client = new CoinpaprikaAPI();

client.getGlobal().then(console.log).catch(console.error);
client.getCoin('btc-bitcoin').then(console.log).catch(console.error);

ESM

import CoinpaprikaAPI from '@coinpaprika/api-nodejs-client';

const client = new CoinpaprikaAPI();
const data = await client.getGlobal();

TypeScript

Type declarations ship with the package — no @types install needed.

import CoinpaprikaAPI from '@coinpaprika/api-nodejs-client';

const client = new CoinpaprikaAPI({ apiKey: process.env.COINPAPRIKA_KEY });
const markets = await client.getCoinMarkets('btc-bitcoin', { quotes: ['USD', 'BTC'] });

Check out the Coinpaprika API documentation for more information!

Configuration

const client = new CoinpaprikaAPI({
  version: 'v1',                         // API version (default 'v1')
  pro: true,                             // Use Pro host (api-pro.coinpaprika.com). Default false.
  baseUrl: 'https://api.coinpaprika.com',// Override entirely (wins over `pro`)
  apiKey: process.env.COINPAPRIKA_KEY,   // Sent as `Authorization: <key>` per Coinpaprika docs (no Bearer prefix)
  retry: { attempts: 3, delay: 300 },    // Opt-in retry on 408/425/429/5xx & network errors (exponential backoff)
  config: {                              // Passed straight to fetch(url, config)
    headers: { 'User-Agent': 'my-app/1.0' },
    signal: controller.signal            // AbortSignal for cancellation (see below)
  },
  fetcher: customFetch                   // Optional: override the fetch implementation
});

Pro API key

Pro-tier endpoints (getCoinsMappings, getChangelogIds, getKeyInfo, and some fields on public endpoints) require an API key and the Pro host (https://api-pro.coinpaprika.com). The client sends the key exactly as documented — Authorization: <key> (no Bearer prefix).

const client = new CoinpaprikaAPI({
  pro: true,
  apiKey: process.env.COINPAPRIKA_KEY
});
await client.getKeyInfo();

Request cancellation

Client-wide (all calls on this client share the signal):

const controller = new AbortController();
const client = new CoinpaprikaAPI({ config: { signal: controller.signal } });

const p = client.getCoins();
setTimeout(() => controller.abort(), 100);
try { await p } catch (e) { /* AbortError */ }

Per-call via withSignal(signal) — returns a new client bound to that signal; the original is untouched:

const client = new CoinpaprikaAPI();

const controller = new AbortController();
const p = client.withSignal(controller.signal).getCoins();
setTimeout(() => controller.abort(), 100);
try { await p } catch (e) { /* AbortError on the scoped call only */ }

// The parent client keeps working:
await client.getGlobal();

Retries

Opt in via retry. Retries only on transient failures (408, 425, 429, 500–504, network errors); 2xx/4xx (besides the above) are returned as-is. Exponential backoff: delay * 2^(attempt-1).

API Coverage

const CoinpaprikaAPI = require('@coinpaprika/api-nodejs-client')
const client = new CoinpaprikaAPI()

Market Data

client.getGlobal()                                    // Global market overview
client.getCoins()                                     // List all coins
client.getCoin('btc-bitcoin')                         // Coin details
client.getCoin('btc-bitcoin', { quotes: ['USD', 'BTC'] })  // Coin details with quotes

getTicker and getAllTickers were removed in 3.0.0 (upstream /ticker endpoint is deprecated). Use getCoin, getCoinsOHLCVLatest, and getCoinsOHLCVHistorical instead. See the CHANGELOG for migration snippets.

OHLCV

client.getCoinsOHLCVLatest('btc-bitcoin')             // Latest full day OHLCV
client.getCoinsOHLCVToday('btc-bitcoin')              // Today's OHLCV (live)
client.getCoinsOHLCVHistorical({ coinId: 'btc-bitcoin', start: '2024-01-01' })  // Historical

Coins

client.getCoinTwitter('btc-bitcoin')                  // Twitter timeline
client.getCoinEvents('btc-bitcoin')                   // Coin events
client.getCoinExchanges('btc-bitcoin')                // Exchanges listing coin
client.getCoinMarkets('btc-bitcoin', { quotes: ['USD', 'BTC'] })  // Markets for coin (array or CSV string)
client.getCoinsMappings()                             // ID mappings (Pro)

Exchanges

client.getExchanges()                                 // List all exchanges
client.getExchange('binance')                         // Exchange details
client.getExchangeMarkets('binance', { quotes: ['USD', 'BTC'] })  // Markets on exchange (array or CSV string)

Contracts

client.getPlatforms()                                 // List contract platforms
client.getContracts('eth-ethereum')                   // Contracts on Ethereum
client.getTickerByContract('eth-ethereum', '0xdac1...') // Ticker by contract
client.getHistoricalByContract('eth-ethereum', '0xdac1...', { start: '2024-01-01' })

Other

client.search({ q: 'bitcoin', c: 'currencies', limit: 10 })
client.priceConverter({ base_currency_id: 'btc-bitcoin', quote_currency_id: 'usd-us-dollars', amount: 1 })
client.getPeople('satoshi-kobayashi')                 // Person details
client.getTags()                                      // List tags
client.getTag('blockchain-service')                   // Tag details
client.getKeyInfo()                                   // API key info (requires key)
client.getChangelogIds()                              // Recent changelog IDs (Pro)

Notes on query params

  • Any param that accepts multiple values (e.g. quotes, c for search) can be passed as either a CSV string or an array; arrays are joined with commas automatically before being sent to the API.
  • Required params are validated synchronously and throw a descriptive Error before any network call (e.g. client.search({}) throws "q (search query) is required").

Changelog

See CHANGELOG.md for release notes.

License

CoinpaprikaAPI is available under the MIT license. See the LICENSE file for more info.