extra-fyers

A Javascript interface for FYERS API.

https://github.com/nodef/extra-fyers

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.4%) to scientific vocabulary

Keywords

api cancel-order cancel-orders commodity-futures-charges commodity-options-charges connect-market-data connect-order-update convert-position currency-futures-charges currency-options-charges derivative-type derivative-type-description equity-delivery-charges extra finance fyers http market stock websocket
Last synced: 4 months ago · JSON representation ·

Repository

A Javascript interface for FYERS API.

Basic Info
Statistics
  • Stars: 10
  • Watchers: 2
  • Forks: 5
  • Open Issues: 0
  • Releases: 1
Topics
api cancel-order cancel-orders commodity-futures-charges commodity-options-charges connect-market-data connect-order-update convert-position currency-futures-charges currency-options-charges derivative-type derivative-type-description equity-delivery-charges extra finance fyers http market stock websocket
Created almost 4 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

A Javascript interface for FYERS API.
📦 Node.js, 🌐 Web, 📜 Files, 📰 Docs.

FYERS is one of the cheapest online stock brokers in India, that offers trading in the equity (NSE, BSE), currency (NSE), and commodity segments (MCX). The objective of this package is to provide a cleaner interface to FYERS API. The http namespace provides the same interface as FYERS HTTP API. The websocket namespace provides the same interface as FYERS WebSocket API, along with parsing of binary market data. This allows you to recieve instant notifications of order update and market data. The top namespace (global functions, classes) provide a facade for the HTTP and the WebSocket APIs and provides additional utility functions, such as calculating charges.

Global functions associated with FYERS API, such as getPositions(), are stateless and accept Authorization as the first parameter. On the other hand, the Api class includes stateful functions which do not require the Authorization parameter (required while creating object). Note that this authorization can be obtained be performing login with loginStep1() and loginStep2().

The goals for the future include doing a thorough interface check, and possibly writing a CLI interface. Obtaining details of symbols, including images and more could be done as part of a separate package.

This package is available in both Node.js and Web formats. The web format is exposed as extra_fyers standalone variable and can be loaded from jsDelivr CDN.

Stability: Experimental.


```javascript const fyers = require('extra-fyers');

async function main() { var appId = '*'; // app_id recieved after creating app var accessToken = '*'; // access_token recieved after login var api = new fyers.Api(appId, accessToken);

// List equity and commodity fund limits. console.log(await api.getFunds());

// List holdings. console.log(await api.getHoldings());

// Place CNC market order for SBIN (equity) on NSE for 5 shares var id = await api.placeOrder({symbol: 'NSE:SBIN-EQ', quantity: 5});

// List postions for today (should list NSE:SBIN-EQ-CNC). console.log(await api.getPositions());

// Connect to Market data with WebSocket // and recieve real-time market quotes. await api.connectMarketData(quote => { console.log(quote); }); // Choose which symbols you want to subscribe to. await api.subscribeMarketDepth(['NSE:SBIN-EQ']);

// Connect to Order update with WebSocket // and recieve real-time order status updates. await api.connectOrderUpdate(order => { console.log(order); }); // Subscribe to order status updates. await api.subscribeOrderUpdate(); } main(); ```



Index

| 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. |



References



ORG DOI

Owner

  • Name: nodef
  • Login: nodef
  • Kind: organization

A summary of programs made with Node.js.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Sahu
    given-names: Subhajit
    orcid: https://orcid.org/0000-0001-5140-6578
title: "nodef/extra-fyers: A Javascript interface for FYERS API"
version: 1.3.0
doi: 10.5281/zenodo.6647512
date-released: 2022-06-15

GitHub Events

Total
  • Watch event: 1
  • Push event: 1
Last Year
  • Watch event: 1
  • Push event: 1

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 102
  • Total Committers: 1
  • Avg Commits per committer: 102.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 2
  • Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Subhajit Sahu w****7@g****m 102

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 6
  • Total pull requests: 0
  • Average time to close issues: 9 days
  • Average time to close pull requests: N/A
  • Total issue authors: 3
  • Total pull request authors: 0
  • Average comments per issue: 5.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • shyamg2000 (2)
  • ashishbindal93 (1)
  • vishalknishad (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 6
  • Total downloads:
    • npm 578 last-month
  • Total dependent packages: 12
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 708
  • Total maintainers: 1
npmjs.org: extra-fyers

A Javascript interface for FYERS API.

  • Versions: 166
  • Dependent Packages: 3
  • Dependent Repositories: 1
  • Downloads: 247 Last month
Rankings
Downloads: 5.7%
Dependent packages count: 5.9%
Average: 8.6%
Forks count: 9.9%
Dependent repos count: 10.4%
Stargazers count: 11.0%
Maintainers (1)
Last synced: 4 months ago
npmjs.org: @extra-fyers/websocket.web

A Javascript interface for FYERS API {websocket} web.

  • Versions: 77
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 20 Last month
Rankings
Dependent packages count: 8.9%
Downloads: 9.5%
Forks count: 9.9%
Average: 9.9%
Dependent repos count: 10.4%
Stargazers count: 11.0%
Maintainers (1)
Last synced: 4 months ago
npmjs.org: @extra-fyers/http

A Javascript interface for FYERS API {http}.

  • Versions: 118
  • Dependent Packages: 2
  • Dependent Repositories: 0
  • Downloads: 42 Last month
Rankings
Downloads: 8.2%
Dependent packages count: 9.5%
Forks count: 12.3%
Average: 14.0%
Stargazers count: 14.6%
Dependent repos count: 25.3%
Maintainers (1)
Last synced: 5 months ago
npmjs.org: @extra-fyers/http.web

A Javascript interface for FYERS API {http} web.

  • Versions: 103
  • Dependent Packages: 2
  • Dependent Repositories: 0
  • Downloads: 16 Last month
Rankings
Downloads: 8.6%
Dependent packages count: 9.5%
Forks count: 12.3%
Average: 14.1%
Stargazers count: 14.6%
Dependent repos count: 25.3%
Maintainers (1)
Last synced: 4 months ago
npmjs.org: @extra-fyers/websocket

A Javascript interface for FYERS API {websocket}.

  • Versions: 87
  • Dependent Packages: 2
  • Dependent Repositories: 0
  • Downloads: 27 Last month
Rankings
Dependent packages count: 9.5%
Downloads: 9.6%
Forks count: 12.3%
Average: 14.2%
Stargazers count: 14.6%
Dependent repos count: 25.3%
Maintainers (1)
Last synced: 4 months ago
npmjs.org: extra-fyers.web

A Javascript interface for FYERS API web.

  • Versions: 157
  • Dependent Packages: 1
  • Dependent Repositories: 0
  • Downloads: 226 Last month
Rankings
Downloads: 8.9%
Forks count: 12.3%
Stargazers count: 14.6%
Average: 15.5%
Dependent packages count: 16.2%
Dependent repos count: 25.3%
Maintainers (1)
Last synced: 4 months ago

Dependencies

package-lock.json npm
  • 142 dependencies
package.json npm
  • @rollup/plugin-alias ^3.1.9 development
  • @rollup/plugin-commonjs ^21.0.3 development
  • @rollup/plugin-node-resolve ^13.1.3 development
  • @types/node ^17.0.23 development
  • @types/ws ^8.5.3 development
  • extra-build ^2.0.31 development
  • rollup-plugin-cleanup ^3.2.1 development
  • rollup-plugin-dts ^4.2.0 development
  • rollup-plugin-exclude-dependencies-from-bundle ^1.1.22 development
  • rollup-plugin-terser ^7.0.2 development
  • ws ^8.5.0
.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v2 composite
.github/workflows/pr.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v2 composite