How-to kiteconnect.js Node.js

kiteconnect.js Node.js quickstart

From WebNotes, a public knowledge base. Last updated . Reading time ~3 min.

Conflict-of-interest disclosure. This guide is published by WebNotes Editorial Team for informational purposes. WebNotes has no commercial relationship with Zerodha. No affiliate commission is earned from successful completion of the procedure.

Step-by-step procedure

Per the procedure infobox.

Code example

const KiteConnect = require("kiteconnect").KiteConnect;

const kite = new KiteConnect({
  api_key: "YOUR_API_KEY"
});

kite.setAccessToken("YOUR_ACCESS_TOKEN");

// Get profile
kite.getProfile()
  .then(profile => console.log(profile))
  .catch(err => console.error(err));

// Place order
kite.placeOrder("regular", {
  exchange: "NSE",
  tradingsymbol: "RELIANCE",
  transaction_type: "BUY",
  quantity: 1,
  product: "MIS",
  order_type: "MARKET"
}).then(order => console.log(order.order_id));

// Get positions
kite.getPositions()
  .then(positions => console.log(positions))
  .catch(err => console.error(err));

See also

External references

References

  1. Zerodha, kiteconnect Node.js SDK, github.com/zerodhatech.

Reviewed and published by

The WebNotes Editorial Team covers Indian capital markets, payments infrastructure and retail investor procedures. Every article is fact-checked against primary sources, principally SEBI circulars and master directions, NPCI specifications and the official support documentation published by the intermediary in question. Drafts go through a second-pair-of-eyes review and a separate compliance read before publication, and revisions are tracked against the SEBI and NPCI rule changes referenced in the methodology section.

Last reviewed
Conflicts of interest
WebNotes is independent. No relationship with any broker, registrar or bank named in this article.