{"id":48739,"library":"node-bitstamp","title":"node-bitstamp","description":"A Node.js client for the Bitstamp REST and WebSocket API, supporting both v1 and v2 endpoints. Current stable version is 3.1.0, released in 2023. It covers all Bitstamp currencies (BTC, ETH, LTC, XRP) and includes automatic signature/nonce generation, request quota management, and automatic WebSocket reconnection. Compared to alternatives, it offers 100% promise-based interface, optional full control over HTTP responses, and built-in rate limiting to prevent bans.","status":"active","version":"3.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/krystianity/node-bitstamp","tags":["javascript","bitstamp","btc","bitcoin","api","client","v1","v2","litecoin","typescript"],"install":[{"cmd":"npm install node-bitstamp","lang":"bash","label":"npm"},{"cmd":"yarn add node-bitstamp","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-bitstamp","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package exports ES modules; use named import for Bitstamp class.","wrong":"const Bitstamp = require('node-bitstamp')","symbol":"Bitstamp","correct":"import { Bitstamp } from 'node-bitstamp'"},{"note":"Use named import for the WebSocket stream class.","wrong":"const { BitstampStream } = require('node-bitstamp')","symbol":"BitstampStream","correct":"import { BitstampStream } from 'node-bitstamp'"},{"note":"CURRENCY is a named export constant with currency pairs.","wrong":"const CURRENCY = require('node-bitstamp').CURRENCY","symbol":"CURRENCY","correct":"import { CURRENCY } from 'node-bitstamp'"},{"note":"CJS destructuring require is also supported.","symbol":"Bitstamp","correct":"const { Bitstamp } = require('node-bitstamp')"},{"note":"Default import is not available; use named import.","wrong":"import Bitstamp from 'node-bitstamp'","symbol":"Bitstamp","correct":"import { Bitstamp } from 'node-bitstamp'"}],"quickstart":{"code":"import { Bitstamp, BitstampStream, CURRENCY } from 'node-bitstamp'\n\nconst key = process.env.BITSTAMP_KEY ?? ''\nconst secret = process.env.BITSTAMP_SECRET ?? ''\nconst clientId = process.env.BITSTAMP_CLIENT_ID ?? ''\n\n// REST API\nconst rest = new Bitstamp({ key, secret, clientId, timeout: 5000, rateLimit: true })\nconst run = async () => {\n  try {\n    const { body } = await rest.ticker(CURRENCY.BTC_USD)\n    console.log('BTC/USD ticker:', body)\n  } catch (err) {\n    console.error('Error:', err)\n  }\n}\nrun()\n\n// WebSocket stream\nconst stream = new BitstampStream()\nstream.on('connected', () => {\n  const channel = stream.subscribe(stream.CHANNEL_LIVE_TRADES, CURRENCY.ETH_EUR)\n  stream.on(channel, ({ data, event }) => {\n    console.log('Live trade:', data)\n  })\n})\nstream.on('error', (e) => console.error(e))","lang":"typescript","description":"Shows REST API usage (ticker) and WebSocket live trades subscription with proper initialization."},"warnings":[{"fix":"Ensure key, secret, and clientId are provided when instantiating Bitstamp.","message":"Constructor requires all three credentials: key, secret, and clientId. Missing any will cause authentication errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use v2 API methods where available (e.g., ticker_hour instead of ticker for v2).","message":"v1 API endpoints are deprecated by Bitstamp; prefer v2 methods.","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Store the returned channel name and attach listener: stream.on(channelName, handler).","message":"WebSocket subscription returns a channel name string, not a callback. You must listen on that channel name using .on().","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Keep rateLimit: true or implement custom rate limiting.","message":"Rate limiting is enabled by default. If you disable it, you risk being banned by Bitstamp for excessive requests.","severity":"gotcha","affected_versions":">=3.0.0"},{"fix":"Access response body via .body, e.g., const { body } = await bitstamp.ticker(...);","message":"Promise resolution changed: successful REST calls now resolve with { status, headers, body } instead of just body.","severity":"breaking","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'100':54 '2023':27 '3.1.0':24 'altern':51 'api':13,78 'automat':39,46 'ban':73 'base':57 'bitcoin':77 'bitstamp':3,9,31,75 'btc':33,76 'built':67 'built-in':66 'client':6,79 'compar':49 'control':61 'cover':29 'currenc':32 'current':20 'endpoint':19 'eth':34 'full':60 'generat':41 'http':63 'includ':38 'interfac':58 'javascript':74 'limit':70 'litecoin':82 'ltc':35 'manag':44 'node':2 'node-bitstamp':1 'node.js':5 'offer':53 'option':59 'prevent':72 'promis':56 'promise-bas':55 'quota':43 'rate':69 'reconnect':48 'releas':25 'request':42 'respons':64 'rest':10 'signature/nonce':40 'stabl':21 'support':14 'typescript':83 'v1':16,80 'v2':18,81 'version':22 'websocket':12,47 'xrp':36","created_at":"2026-06-07T16:58:12.832158+00:00","updated_at":"2026-06-07T16:58:12.832158+00:00","problems":[{"fix":"Verify key, secret, and clientId from Bitstamp account settings. Ensure system clock is synchronized.","cause":"Incorrect API credentials or nonce generation failure.","error":"Error: Invalid key, secret or signature"},{"fix":"Ensure correct import: import { BitstampStream } from 'node-bitstamp' and instantiate: const stream = new BitstampStream();","cause":"BitstampStream not properly instantiated or imported incorrectly.","error":"TypeError: Cannot read properties of undefined (reading 'subscribe')"},{"fix":"Correct import: import { Bitstamp } from 'node-bitstamp' and instantiate: const bitstamp = new Bitstamp(...);","cause":"Using default import instead of named import, or outdated version.","error":"TypeError: bitstamp.ticker is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/krystianity/node-bitstamp#readme","github":"https://github.com/krystianity/node-bitstamp","docs":null,"changelog":null,"pypi":null,"npm":"node-bitstamp","openapi_spec":null,"status_page":null,"smithery":null,"categories":["finance"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}