- Notifications
You must be signed in to change notification settings - Fork5
A Javascript interface for FYERS API.
License
nodef/extra-fyers
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A Javascript interface for FYERS API.
📦Node.js,🌐Web,📜Files,📰Docs.
FYERS is one of the cheapest online stock brokers in India, that offerstrading in the equity (NSE, BSE), currency (NSE), and commodity segments (MCX).The objective of this package is to provide a cleaner interface toFYERS API.Thehttp
namespace provides the same interface as FYERS HTTP API. Thewebsocket
namespace provides the same interface as FYERS WebSocket API, alongwith parsing of binary market data. This allows you to recieveinstantnotifications oforder update andmarket data. The top namespace (globalfunctions, classes) provide afacade for the HTTP and the WebSocket APIs andprovides additional utility functions, such as calculating charges.
Global functions associated with FYERS API, such asgetPositions()
, arestateless and acceptAuthorization
as the first parameter. On the otherhand, theApi
class includes stateful functions which do not requiretheAuthorization
parameter (required while creating object). Note thatthis authorization can be obtained be performing login withloginStep1()
andloginStep2()
.
The goals for the future include doing a thorough interface check, and possiblywriting a CLI interface. Obtaining details of symbols, including images and morecould be done as part of a separate package.
This package is available in bothNode.js andWeb formats. The web formatis exposed asextra_fyers
standalone variable and can be loaded fromjsDelivr CDN.
Stability:Experimental.
constfyers=require('extra-fyers');asyncfunctionmain(){varappId='****';// app_id recieved after creating appvaraccessToken='****';// access_token recieved after loginvarapi=newfyers.Api(appId,accessToken);// List equity and commodity fund limits.console.log(awaitapi.getFunds());// List holdings.console.log(awaitapi.getHoldings());// Place CNC market order for SBIN (equity) on NSE for 5 sharesvarid=awaitapi.placeOrder({symbol:'NSE:SBIN-EQ',quantity:5});// List postions for today (should list NSE:SBIN-EQ-CNC).console.log(awaitapi.getPositions());// Connect to Market data with WebSocket// and recieve real-time market quotes.awaitapi.connectMarketData(quote=>{console.log(quote);});// Choose which symbols you want to subscribe to.awaitapi.subscribeMarketDepth(['NSE:SBIN-EQ']);// Connect to Order update with WebSocket// and recieve real-time order status updates.awaitapi.connectOrderUpdate(order=>{console.log(order);});// Subscribe to order status updates.awaitapi.subscribeOrderUpdate();}main();
Property | Description |
---|---|
exchangeDescription | Get exchange description. |
exchange | Get exchange code. |
segmentDescription | Get segment description. |
segment | Get segment code. |
positionSideDescription | Get position side description. |
positionSide | Get position side code. |
orderSideDescription | Get order side description. |
orderSide | Get order side code. |
orderSourceDescription | Get order source description. |
orderSource | Get order source code. |
orderStatusDescription | Get order status description. |
orderStatus | Get order status code. |
orderTypeDescription | Get order type description. |
orderType | Get order type code. |
orderValidityDescription | Get order validity description. |
orderValidity | Get order validity code. |
optionTypeDescription | Get option type description. |
optionType | Get option type code. |
derivativeTypeDescription | Get derivative type description. |
derivativeType | Get derivative type code. |
holdingTypeDescription | Get holding type description. |
holdingType | Get holding type code. |
productTypeDescription | Get product type description. |
productType | Get product type code. |
instrumentTypeDescription | Get instrument type description. |
instrumentType | Get instrument type code. |
symbolName | Get symbol exchange, underlying, currency-pair, or commodity name. |
symbolExchange | Get symbol exchange. |
symbolSeries | Get symbol exchange series. |
symbolOptionType | Get symbol option type. |
symbolDerivativeType | Get symbol derivative type. |
symbolStrikePrice | Get symbol strike price. |
symbolToken | Get symbol token, a unique identifier. |
symbolDescription | Get symbol description. |
symbolIsin | Get symbol ISIN. |
symbolLotSize | Get symbol minimum lot size. |
equityDeliveryCharges | Get equity delivery charges. |
equityIntradayCharges | Get equity intraday charges. |
equityFuturesCharges | Get equity futures charges. |
equityOptionsCharges | Get equity options charges. |
currencyFuturesCharges | Get currency futures charges. |
currencyOptionsCharges | Get currency options charges. |
commodityFuturesCharges | Get commodity futures charges. |
commodityOptionsCharges | Get commodity options charges. |
loginStep1 | Get request step 1 for authorization. |
loginStep2 | Get request step 2 for authorization. |
getProfile | Get basic details of the client. |
getFunds | Get balance available for the user for capital as well as the commodity market. |
getHoldings | Get the equity and mutual fund holdings which the user has in this demat account. |
getOrder | Get details of an order placed in the current trading day. |
getOrders | Get details of all the orders placed in the current trading day. |
getPositions | Get details of all the positions in the current trading day. |
getTrades | Get details of all the trades in the current trading day. |
placeOrder | Place an order to any exchange via Fyers. |
placeOrders | Place multiple orders to any exchange via Fyers. |
modifyOrder | Modifies an order placed on any exchange via Fyers. |
modifyOrders | Modifies orders placed on any exchange via Fyers. |
cancelOrder | Cancels an order placed on any exchange via Fyers. |
cancelOrders | Cancels orders placed on any exchange via Fyers. |
exitPosition | Exits a position on the current trading day. |
exitAllPositions | Exits all positions on the current trading day. |
convertPosition | Converts a position on the current trading day. |
getMarketStatus | Get the current market status of all the exchanges and their segments. |
getMarketHistory | Get the market history for a particular symbol. |
getMarketQuotes | Get the current market quotes for a set of symbols. |
getMarketDepth | Get the current market depth for a particular symbol. |
getSymbolMaster | Get all the latest symbols of all the exchanges from the symbol master files. |
processSymbolMaster | Get details of symbols from the symbol master file text. |
loadSymbolMaster | Get details of symbols from the symbol master files. |
generateEdisTpin | Generate e-DIS TPIN for validating/authorising transaction. |
getEdisTransactions | Get the necessary information regarding the holdings you have on your and also the status of the holdings. |
submitEdisHoldingsStep | Redirect to CDSL page for login where you can submit your Holdings information and accordingly you can provide the same to exchange to Sell your holdings (browser only). |
inquireEdisTransaction | Inquire the information/status of the provided transaction Id for the respective holdings you have on your end. |
connectMarketData | Connect to Market data URL with WebSocket. |
subscribeMarketQuote | Subscribe to market quote. |
subscribeMarketDepth | Subscribe to market depth. |
unsubscribeMarketQuote | Unsubscribe to market quote. |
unsubscribeMarketDepth | Unsubscribe to market depth. |
connectOrderUpdate | Connect to Order update URL with WebSocket. |
subscribeOrderUpdate | Subscribe to order update. |
unsubscribeOrderUpdate | Unsubscribe to order update. |
Api | Stateful interface for FYERS API. |
- FYERS API Docs
- FYERS Community
- FYERS Detailed Charges List
- fyers-api-v2 package
- C# wrapper of Fyers API v2 : ArthaChitra
- Fyers API golang client : Rishi Anand
- The Kite Connect API Javascript client - v4
- Intermarket Trading System (ITS)
- What are stop loss orders and how to use them?
- How to use Stoploss-limit(SL) order like a Stoploss-Market(SLM) order?
- What is disclosed quantity feature and how to use it?
- What are cover orders and how to use them?
- What does CNC, MIS and NRML mean?
- What is UNDCUR,UNDIRC, UNDIRT, UNDIRT in CDs? And what its use
- Can some one tell me what is FUTIRC?
- I want to know in nifty f & o what is futidx, futivx, futstk?
- What Is a Rally?
About
A Javascript interface for FYERS API.