Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions SmartApi/smartConnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class SmartConnect(object):
"api.gtt.list":"/rest/secure/angelbroking/gtt/v1/ruleList",

"api.candle.data":"/rest/secure/angelbroking/historical/v1/getCandleData",
"api.oi.data":"/rest/secure/angelbroking/historical/v1/getOIData",
"api.market.data":"/rest/secure/angelbroking/market/v1/quote",
"api.search.scrip": "/rest/secure/angelbroking/order/v1/searchScrip",
"api.allholding": "/rest/secure/angelbroking/portfolio/v1/getAllHolding",
Expand All @@ -63,6 +64,8 @@ class SmartConnect(object):
"api.gainersLosers" : 'rest/secure/angelbroking/marketData/v1/gainersLosers',
"api.putCallRatio" : 'rest/secure/angelbroking/marketData/v1/putCallRatio',
"api.oIBuildup" : 'rest/secure/angelbroking/marketData/v1/OIBuildup',
"api.nseIntraday" : 'rest/secure/angelbroking/marketData/v1/nseIntraday',
"api.bseIntraday" : 'rest/secure/angelbroking/marketData/v1/bseIntraday',
}

try:
Expand Down Expand Up @@ -462,6 +465,14 @@ def getCandleData(self,historicDataParams):
getCandleDataResponse=self._postRequest("api.candle.data",historicDataParams)
return getCandleDataResponse

def getOIData(self,historicOIDataParams):
params=historicOIDataParams
for k in list(params.keys()):
if params[k] is None:
del(params[k])
getOIDataResponse=self._postRequest("api.oi.data",historicOIDataParams)
return getOIDataResponse

def getMarketData(self,mode,exchangeTokens):
params={
"mode":mode,
Expand Down Expand Up @@ -543,10 +554,19 @@ def putCallRatio(self):
putCallRatioResponse=self._getRequest("api.putCallRatio")
return putCallRatioResponse

def nseIntraday(self):
nseIntraday=self._getRequest("api.nseIntraday")
return nseIntraday

def bseIntraday(self):
bseIntraday=self._getRequest("api.bseIntraday")
return bseIntraday

def oIBuildup(self,params):
oIBuildupResponse=self._postRequest("api.oIBuildup",params)
return oIBuildupResponse


def _user_agent(self):
return (__title__ + "-python/").capitalize() + __version__

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name="smartapi-python",
version="1.5.0",
version="1.5.1",
author="ab-smartapi",
author_email="smartapi.sdk@gmail.com",
description="Angel Broking openApi integration",
Expand Down