{"id":30617484,"url":"https://github.com/nithinsgowda/growwapi","last_synced_at":"2025-08-30T10:48:04.069Z","repository":{"id":300395458,"uuid":"1006087843","full_name":"NithinSGowda/growwapi","owner":"NithinSGowda","description":"NodeJS SDK for Groww trading APIs","archived":false,"fork":false,"pushed_at":"2025-07-30T18:39:29.000Z","size":204,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-30T10:47:39.168Z","etag":null,"topics":["algotrading","api","bse","groww","nse","trading"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/growwapi","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NithinSGowda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-21T13:16:28.000Z","updated_at":"2025-07-30T18:39:02.000Z","dependencies_parsed_at":"2025-06-21T13:30:43.848Z","dependency_job_id":"e69cfb41-04d9-4e2c-bd87-c00dbd7d755b","html_url":"https://github.com/NithinSGowda/growwapi","commit_stats":null,"previous_names":["nithinsgowda/growwapi"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/NithinSGowda/growwapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NithinSGowda%2Fgrowwapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NithinSGowda%2Fgrowwapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NithinSGowda%2Fgrowwapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NithinSGowda%2Fgrowwapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NithinSGowda","download_url":"https://codeload.github.com/NithinSGowda/growwapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NithinSGowda%2Fgrowwapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272839678,"owners_count":25001862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-30T02:00:09.474Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algotrading","api","bse","groww","nse","trading"],"created_at":"2025-08-30T10:48:01.485Z","updated_at":"2025-08-30T10:48:04.018Z","avatar_url":"https://github.com/NithinSGowda.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# growwapi\n\nNodeJS SDK for Groww trading APIs\n\n![npm version](https://img.shields.io/npm/v/growwapi?style=for-the-badge\u0026label=Version)\n![GitHub last commit](https://img.shields.io/github/last-commit/nithinsgowda/growwapi?style=for-the-badge\u0026label=Last%20Commit)\n\n![downloads](https://img.shields.io/npm/dy/growwapi?style=for-the-badge\u0026label=Downloads)\n![GitHub issues](https://img.shields.io/github/issues/nithinsgowda/growwapi?style=for-the-badge\u0026label=Issues)\n\n![CI Status](https://img.shields.io/github/actions/workflow/status/NithinSGowda/growwapi/npm-publish.yml?style=for-the-badge\u0026label=CI%20Status) \n![license](https://img.shields.io/npm/l/growwapi?style=for-the-badge\u0026label=License)\n\n## 📝 Overview\n\ngrowwapi is a NodeJS SDK for Groww trading APIs. The library provides functionality for trading on Groww including holdings management, margin calculations, order management, and position tracking.\n\n---\n\n## 🚀 Features\n\n- **Live Feed**: Real-time data streaming for market prices\n- **Historic Data**: Access to historical market data\n- **Holdings**: Fetch user portfolio holdings\n- **Instructions**: CSV-based instrument details\n- **Live Data**: Current market data access\n- **Margins**: Retrieve margin details and calculate margins required for orders\n- **Orders**: Create, modify, cancel, and fetch order details\n- **Positions**: Fetch user positions and trading symbol details\n- **Authentication**: Secure API access with API key and TOTPrat\n\n---\n\n## ⚙️ Installation\n\n```bash\nnpm install growwapi\n```\n\n---\n\n## ⚡ Quick Start\n\n### 1. Environment Setup\n\nCreate a `.env` file in your project root:\n\n```env\nGROWW_API_KEY=your_api_key\nGROWW_API_SECRET=your_api_secret\n```\n\nOptional:\n```env\nGROWW_API_BASE_URL=\nGROWW_API_VERSION=\nGROWW_FILECACHE_TTL=\nGROWW_LIVE_FEED_MAX_RETRY_COUNT=\nGROWW_LIVE_FEED_MAX_RETRY_DURATION=\n```\n\n### 2. Sample Implementation\n\nHere's an example of how to initialize the SDK, fetch your holdings, and place an order:\n\n```typescript\nimport { GrowwAPI, Exchange, Segment, Product, OrderType, TransactionType, Validity } from 'growwapi';\n\nconst groww = new GrowwAPI();\n\nconst holdings = await groww.holdings.list();\nconsole.log('Holdings:', holdings);\n\nconst orderDetails = {\n  tradingSymbol: 'RELIANCE',\n  quantity: 1,\n  price: 2800,\n  triggerPrice: 0,\n  validity: Validity.Day,\n  exchange: Exchange.NSE,\n  segment: Segment.CASH,\n  product: Product.CNC,\n  orderType: OrderType.Limit,\n  transactionType: TransactionType.Buy,\n};\n\nconst order = await groww.orders.create(orderDetails);\nconsole.log('Order placed successfully:', order);\n```\n\n---\n\n## 📚 Examples\n\nOnce your environment is set up and the SDK is initialized, you can explore detailed usage for each feature in the [examples directory](./examples/)\n\n- [Order Management](./examples/order.md)\n- [Holdings](./examples/holdings.md)\n- [Historic Data](./examples/historicData.md)\n- [Instructions](./examples/instructions.md)\n- [Live Data](./examples/liveData.md)\n- [Live Feed](./examples/liveFeed.md)\n- [Margins](./examples/margins.md)\n- [Positions](./examples/positions.md)\n- [Authentication](./examples/auth.md)\n\nEach example demonstrates real-world usage and best practices for the respective module.\n\n---\n\n## 📚 API Reference\n\n### Live Feed (`LiveFeed`)\n- `LiveFeed.connect(callback: (data) =\u003e void): void`  \n  Establishes a WebSocket connection for real-time data.\n- `LiveFeed.subscribe(instrumentId: string): void`  \n  Subscribes to real-time data for a specific instrument.\n- `LiveFeed.consume(subscription: string): void`  \n  Starts consuming data from a subscription.\n- `LiveFeed.disconnect(): void`  \n  Disconnects from the WebSocket.\n\n---\n\n### Live Data (`LiveData`)\n- `LiveData.getQuote(params: GetQuoteParams): Promise\u003cGetQuoteResponse\u003e`  \n  Fetches current quote for a trading symbol.\n- `LiveData.getLTP(params: GetLTPParams): Promise\u003cGetLTPResponse\u003e`  \n  Fetches last traded price for one or more symbols.\n- `LiveData.getOHLC(params: GetOHLCParams): Promise\u003cGetOHLCResponse\u003e`  \n  Fetches OHLC data for one or more symbols.\n\n---\n\n### Historic Data (`HistoricData`)\n- `HistoricData.get(params: HistoricDataParams): Promise\u003cHistoricDataResponse\u003e`  \n  Fetches historical candle data for a trading symbol.\n\n---\n\n### Instructions (`Instructions`)\n- `Instructions.getInstructions(): Promise\u003cInstructionsResponse\u003e`  \n  Fetches the full instructions CSV file.\n- `Instructions.getFilteredInstructions(params: InstructionsTypeParams): Promise\u003cInstructionsResponse\u003e`  \n  Fetches filtered instructions based on provided parameters.\n\n---\n\n### Portfolio \u0026 Trading\n\n#### Holdings (`Holdings`)\n- `Holdings.list(): Promise\u003cHoldingsResponse\u003e`  \n  Fetches user holdings.\n\n#### Margins (`Margins`)\n- `Margins.details(): Promise\u003cMarginsResponse\u003e`  \n  Fetches margin details for the user.\n- `Margins.requiredForOrder(params: MarginsRequiredParams): Promise\u003cMarginsRequiredResponse\u003e`  \n  Calculates margins required for an order.\n\n#### Orders (`Orders`)\n- `Orders.create(params: CreateOrderParams): Promise\u003cCreateOrderResponse\u003e`  \n  Creates a new order.\n- `Orders.modify(params: ModifyOrderParams): Promise\u003cModifyOrderResponse\u003e`  \n  Modifies an existing order.\n- `Orders.cancel(params: CancelOrderParams): Promise\u003cCancelOrderResponse\u003e`  \n  Cancels an order.\n- `Orders.getTrades(params: GetTradesParams): Promise\u003cGetTradesResponse\u003e`  \n  Fetches trade details for an order.\n- `Orders.status(params: OrderStatusParams): Promise\u003cOrderStatusResponse\u003e`  \n  Fetches the status of an order.\n- `Orders.statusByReference(params: OrderStatusByReferenceParams): Promise\u003cOrderStatusResponse\u003e`  \n  Fetches the status of an order by reference ID.\n- `Orders.getOrders(params: ListOrderParams): Promise\u003cOrderResponse[]\u003e`  \n  Lists all orders.\n- `Orders.details(params: OrderDetailsParams): Promise\u003cOrderResponse\u003e`  \n  Fetches details of an order.\n\n#### Positions (`Positions`)\n- `Positions.user(params: BaseParams): Promise\u003cPositionsResponse\u003e`  \n  Fetches user positions.\n- `Positions.tradingSymbol(params: TradingSymbolParams): Promise\u003cTradingSymbolResponse\u003e`  \n  Fetches details of a trading symbol.\n\n---\n\n### Advanced Usage\n\n### Authentication (`Auth`)\n- `Auth.generateToken(): Promise\u003cAuthTokenResponse\u003e`  \n  Generates a new authentication token.\n- `Auth.refreshToken(): Promise\u003cAuthTokenResponse\u003e`  \n  Refreshes the current authentication token.\n\n---\n\n### Types\n\nAll request and response types are available in the `types` directory and are strongly typed for TypeScript.  \nSee the [`types`](./src/types/) folder for details.\n\n---\n\n## 🛠️ Development\n\n### Scripts\n- `npm run build`: Builds the project.\n- `npm run test`: Runs tests.\n- `npm run lint`: Lints the code.\n- `npm generate-exports`: Generates exports for all types.\n\n### Testing\n```bash\nnpm run test\n```\n\n### Linting\n```bash\nnpm run lint\n```\n\n---\n\n## 🏗️ Architecture\n\n- **GrowwAPI**: Main class that initializes and provides access to all service modules\n- **Resources**: Independent modules for different API functionalities:\n  - Auth, LiveFeed, HistoricData, Holdings, Instructions, LiveData, Margins, Orders, Positions\n\n---\n\n## 🤔 Troubleshooting\n\n- **Authentication Errors**: Ensure your `GROWW_API_KEY` and `GROWW_API_SECRET` are correct.\n- **Invalid Parameters**: Double-check the parameters you are passing to the methods. Refer to the `types` directory for detailed information on the required and optional parameters.\n- **Network Issues**: Ensure you have a stable internet connection. The SDK will attempt to retry failed requests, but a persistent network issue may cause problems.\n\n---\n\n## 🤝 Contributing\n\n- Maintain strong typing for all methods and parameters\n- Follow resource-based module organization\n- Use camelCase for variables and methods\n- Document all public methods and parameters\n- Handle API errors consistently with descriptive messages\n- Validate environmental dependencies before API calls\n- Follow the established pattern for new resource modules\n\n---\n\n## 📄 License\n\nThis project is licensed under the Apache License 2.0. See the [`LICENSE`](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnithinsgowda%2Fgrowwapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnithinsgowda%2Fgrowwapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnithinsgowda%2Fgrowwapi/lists"}