PHPackages                             ghostjat/shoonya-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ghostjat/shoonya-php

ActiveLibrary[API Development](/categories/api)

ghostjat/shoonya-php
====================

A php wrapper or connector to the Shoonya-API and websocket.

1.0.5(3y ago)6768[1 issues](https://github.com/ghostjat/Shoonya-php/issues)MITPHPPHP ^8.0

Since Aug 9Pushed 3y ago3 watchersCompare

[ Source](https://github.com/ghostjat/Shoonya-php)[ Packagist](https://packagist.org/packages/ghostjat/shoonya-php)[ Docs](https://github.com/ghostjat/shoonya-php)[ RSS](/packages/ghostjat-shoonya-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (8)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5b1efb50e7c44d5bab1e3758aa7d06361c39d1a004d4c654a117bb6bdaad1949/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67686f73746a61742f53686f6f6e79612d7068702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/ghostjat/Shoonya-php/?branch=main)[![Build Status](https://camo.githubusercontent.com/2aa19c136527401c5955b75a434352ac66d90b179ab8443db77cc4886d808497/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67686f73746a61742f53686f6f6e79612d7068702f6261646765732f6275696c642e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/ghostjat/Shoonya-php/build-status/main)[![Code Intelligence Status](https://camo.githubusercontent.com/f24d8a3d721addad6cc03a5529327e372beaf4c520638f1dd077bd7e40046b19/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f67686f73746a61742f53686f6f6e79612d7068702f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d61696e)](https://scrutinizer-ci.com/code-intelligence)[![GitHub contributors](https://camo.githubusercontent.com/61e8e237fb43b8a4516f8fe8f10b8f35f7ebb556941906dcaf9c250c4bc4d518/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f67686f73746a61742f53686f6f6e79612d706870)](https://camo.githubusercontent.com/61e8e237fb43b8a4516f8fe8f10b8f35f7ebb556941906dcaf9c250c4bc4d518/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f67686f73746a61742f53686f6f6e79612d706870)[![GitHub commit activity](https://camo.githubusercontent.com/3b149d85ce314e570379d2a451c384da7c353f678059e899523ce44b7610421a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6d6d69742d61637469766974792f6d2f67686f73746a61742f53686f6f6e79612d706870)](https://camo.githubusercontent.com/3b149d85ce314e570379d2a451c384da7c353f678059e899523ce44b7610421a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6d6d69742d61637469766974792f6d2f67686f73746a61742f53686f6f6e79612d706870)[![GitHub last commit](https://camo.githubusercontent.com/9f3c2a578e410da715c66e888611cb0dce291b380f0c497eb3567c1b26518685/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f67686f73746a61742f53686f6f6e79612d706870)](https://camo.githubusercontent.com/9f3c2a578e410da715c66e888611cb0dce291b380f0c497eb3567c1b26518685/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f67686f73746a61742f53686f6f6e79612d706870)[![Packagist Version](https://camo.githubusercontent.com/c567c7bf6786b55a8173dfcb4ff434e2d71a6c2baaba37b23bd0762d758ad4df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67686f73746a61742f53686f6f6e79612d706870)](https://camo.githubusercontent.com/c567c7bf6786b55a8173dfcb4ff434e2d71a6c2baaba37b23bd0762d758ad4df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67686f73746a61742f53686f6f6e79612d706870)[![GitHub code size in bytes](https://camo.githubusercontent.com/9ac538abdfac907b794be7b8b467fce856f39bc1720de1290d3ffec6682601d7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f67686f73746a61742f53686f6f6e79612d706870)](https://camo.githubusercontent.com/9ac538abdfac907b794be7b8b467fce856f39bc1720de1290d3ffec6682601d7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f67686f73746a61742f53686f6f6e79612d706870)[![GitHub top language](https://camo.githubusercontent.com/0af6f189b59450689ce827650a462f1ed9e4c76271c39d6ff36b22173eebc570/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f67686f73746a61742f53686f6f6e79612d706870)](https://camo.githubusercontent.com/0af6f189b59450689ce827650a462f1ed9e4c76271c39d6ff36b22173eebc570/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f67686f73746a61742f53686f6f6e79612d706870)

A LOT OF THANKS TO:
===================

[](#a-lot-of-thanks-to)

Finavsia

Shoonya-php (unofficial)
========================

[](#shoonya-php-unofficial)

This php library used to connect to Finvasia Shoonya OMS.

This is a php wrapper or connector to the RestAPI and websocket of Shoonya.

---

Install
-------

[](#install)

to install this package please use Composer

`composer require ghostjat/Shoonya-php`

---

Shoonya-php API
---------------

[](#shoonya-php-api)

`  public  __construct()`

`  public  login(): bool` to login in shoonya

`  public  logout(): bool` to logout from shoonya

`  public  forgotPassword(string $uid, string $pan, string $dob): bool` to reset the password

`  public  getWatchListNames(): array|bool` get the watchlist names

`  public  getWatchList(string $wlname): array|bool` get watchlist

`  public  addScripWatchList(string $wlname, string|array $instrument): boolean` add scrip to watchlist

`  public  deleteScripWatchList(string $wlname, string|array $instrument): boolean` delete scrip from watchlist

`  public  searchScrip(string $searchtext, string $exchange = 'BSE'): array` search for scrip

`  public  getToken(string $tysm, string $exch = 'NFO'): string` get scrip's token

`  public  getLTP(string $tysm, string $exch = 'NFO')` get ltp of scrip

`  public  getLimits(string $prd = null, string $seg = null, string $exch = null)`

`  public  getOptionChain(string $tsym, int $strprc, int $count = 5, string $exch = 'NFO'): array` get option chain

`  public  getScripInfo(string $token, string $exch = 'BSE')` get scrip info

`  public  getQuotes(string $token, string $exchange = 'BSE'): array` get running quotes of scrip

`  public  getTimePriceSeries( string $token, string $startTime = null, string $endTime = null, string $interval = '15', string $exch = 'BSE' )` get time series based price data in minutes

` public  getDailyPriceSeries(string $tysm, string $startDate, string $endDate = null, string $exch = 'NSE')` get eod price series data

`  public  positionProductConversion()`

` public  singleOrderHistory(int $orderNo)` get single order history

`  public  getOrderbook(): array` get order book

`  public  getTradebook(): array|bool` get trade book

`  public  getHoldings(string $productType = self::Delivery): array|object` get portfolio holdings

`  public  getPositions(): array|stdClass`

`  public  placeOrder( type $buy_or_sell, type $productType, type $exchange, type $tradingSymbol, type $quantity, type $discloseQty, type $priceType, int $price = 0.0, int $triggerPrice = null, type $retention = 'DAY', type $amo = 'NO', type $remarks = null, int $booklossPrice = 0.0, int $bookprofitPrice = 0.0, int $trailPrice = 0.0, ): boolean` to place diffrent type of orders

`  public  getOrderStatus(string $orderNo): boolean` get the placed order status

`  public  modifyOrder( type $orderNo, type $exchange, type $tradingSymbol, type $newquantity, type $newpriceType, type $newprice = 0.0, type $newtriggerPrice = null, type $booklossPrice = 0.0, type $bookprofitPrice = 0.0, type $trailPrice = 0.0, ): boolean` to modify placed order

`  public  cancelOrder(type $orderNo): boolean` cancle placed order

`  public  exitOrder(type $orderNo, type $productType): boolean` close/exit from position

`  public  gttOrder( string $buy_or_sell, string $productType, string $exchange, string $tradingSymbol, float $priceToCompare, int $quantity, float $price = 0, string $ai_t = self::AITG, string $retention = 'DAY', string $remarks = null, int $discloseQty = null, ): boolean` set gtt or gtc order

`  public  cancelGtt(int $alID): boolean` to cancle placed gtt

` public  getPendingGtt()` get pending gtt order details

`  public  getEnableGtt()`

` public  getSessionData(): array` get current session tmp data

`  public  subscribe(array|string $intst, $feedType = self::FeedTouchLine)` ws related functions

`  public  unsubscribe(array|string $intst, $feedType = self::FeedTouchLine)`

`  public  subscribeOrders()`

`  public  telegram(string $msg): bool` send telegram notification

---

Todo
----

[](#todo)

AAB PMS RLAB Live-Algo Algo-Backtesting

Author
------

[](#author)

@author Shubham Chaudhary

@author

@blog

@since Aug 2022

@version 1.0.1

@license MIT

---

License
-------

[](#license)

Copyright (C) 2022 Shubham Chaudhary- All Rights Reserved.

---

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Total

7

Last Release

1225d ago

PHP version history (2 changes)1.0.2PHP &gt;=8.0

1.0.4PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/64d55c44db241b5edf53d7f95b9209822731ed613173055ad2535f03137f119c?d=identicon)[ghostjat](/maintainers/ghostjat)

---

Top Contributors

[![ghostjat](https://avatars.githubusercontent.com/u/18235933?v=4)](https://github.com/ghostjat "ghostjat (11 commits)")

---

Tags

algotradeapibroker-apibsefinvasiafnoinvestmentlibrarynsense-stock-dataphpphp-sdksdksharesshoonyashoonya-apistock-markettradetradingphpapibottradingstockindiannfonsebseShoonyaApiFinvasia

### Embed Badge

![Health badge](/badges/ghostjat-shoonya-php/health.svg)

```
[![Health](https://phpackages.com/badges/ghostjat-shoonya-php/health.svg)](https://phpackages.com/packages/ghostjat-shoonya-php)
```

###  Alternatives

[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[renoki-co/php-k8s

Control your Kubernetes clusters with this PHP-based Kubernetes client. It supports any form of authentication, the exec API, and it has an easy implementation for CRDs.

321669.7k2](/packages/renoki-co-php-k8s)[klev-o/telegram-bot-api

Simple and convenient object-oriented implementation Telegram bot API with php version ^7.4 support. You'll like it)

457.8k1](/packages/klev-o-telegram-bot-api)[klev-o/crypto-pay-api

Simple and convenient implementation of the Crypto Pay payment system (@CryptoBot)

205.1k](/packages/klev-o-crypto-pay-api)[kuvardin/telegram-bots-api

SDK for Telegram bots API

145.5k](/packages/kuvardin-telegram-bots-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
