Registry / finance / breezeconnect

breezeconnect

JSON →
library1.0.31jsnpmunverified

BreezeConnect is the official JavaScript client library for ICICI Securities trading APIs. Version 1.0.31 provides REST-like APIs for order execution (real-time), portfolio management, historical market data (up to 10 years including 1-second OHLCV), streaming live OHLC via WebSockets, and option chain data. It requires an API key and session token obtained via ICICI Direct's login portal. Compared to other trading SDKs, it offers deep integration with ICICI's regulatory framework (static IP, order limits, no market orders). The package is ES6+ with Promises, supports Node.js, and has a moderate release cadence.

npm install breezeconnect
INSTALL
IMPORT
SIG · BREEZECONNECT
B
breezeconnect
financejavascriptv1.0.31
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BreezeConnect
const { BreezeConnect } = require('breezeconnect');
var BreezeConnect = require('breezeconnect');
The library exports an object with BreezeConnect property; commonjs destructuring is required.
BreezeConnect
import { BreezeConnect } from 'breezeconnect';
import BreezeConnect from 'breezeconnect';
Named export, not default. Use named import for ES modules.
BreezeConnect instance methods
const breeze = new BreezeConnect({ appKey: '...' });
const breeze = new BreezeConnect('...');
Constructor expects an object with appKey property, not a string.

Initialize BreezeConnect, generate session, fetch funds, and subscribe to WebSocket ticks.

const { BreezeConnect } = require('breezeconnect'); const appKey = process.env.BREEZE_APP_KEY ?? ''; const appSecret = process.env.BREEZE_APP_SECRET ?? ''; const sessionToken = process.env.BREEZE_SESSION_TOKEN ?? ''; const breeze = new BreezeConnect({ appKey }); console.log('Login URL:', 'https://api.icicidirect.com/apiuser/login?api_key=' + encodeURIComponent(appKey)); breeze.generateSession(appSecret, sessionToken) .then(() => { breeze.getFunds().then(funds => { console.log('Funds:', funds); }).catch(err => console.error(err)); }) .catch(err => console.error('Session error:', err)); // WebSocket example breeze.wsConnect(); breeze.onTicks = ticks => console.log('Ticks:', ticks);
Debug
Known issues
breakingOrders must be placed only from registered static IP.
fix
Register your static IP with ICICI Direct before placing orders.
affects: >=1.0.0
breakingMarket orders are not permitted.
fix
Use limit or stop-loss orders only.
affects: >=1.0.0
breakingMaximum combined limit of 10 orders per second.
fix
Throttle order placement, modification, cancellation, and square-off to under 10 per second.
affects: >=1.0.0
deprecatedMargin and Option Plus orders via API are prohibited.
fix
Place these orders manually through the ICICI Direct platform.
affects: >=1.0.0
gotchaSession token must be obtained via browser login URL.
fix
Visit https://api.icicidirect.com/apiuser/login?api_key=YOUR_API_KEY in a browser, then pass the session token from the URL parameter.
affects: >=1.0.0
gotchaConstructor expects object with appKey, not string.
fix
new BreezeConnect({ appKey: '...' })
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: BreezeConnect is not a constructor
Incorrect import: using default import instead of named import.
fix
const { BreezeConnect } = require('breezeconnect');
TypeError: breeze.generateSession is not a function
Session not generated or breeze object not properly initialized with constructor.
fix
Ensure BreezeConnect constructor is called with { appKey: '...' } and session is generated before API calls.
Error: Invalid API key
API key not URL-encoded when generating login URL, or incorrect key.
fix
Use encodeURIComponent(appKey) in login URL and verify key.
Error: Session expired
Session token is invalid or expired. Token must be used soon after generation.
fix
Re-obtain a fresh session token from the login URL.
Upgrade
Version history
1.0.31latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
39 hits · last 30 days
node
38
Resources
breezeconnect — npm install breezeconnect · libregistry