☰
Login
Signup
Home
›
Python client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.3K
All Categories
0
Incidents
129
Node JS client
39
Go client
770
.Net API client
364
Kite Publisher
532
.Net / VBA / Excel (3rd party)
441
Algorithms and Strategies
974
Java client
1K
API clients
401
PHP client
3.8K
Python client
332
Mobile and Desktop apps
1.3K
Market data (WebSockets)
3.2K
General
In this Discussion
January 2018
rakeshr
January 2018
Anuj
Issues in getting OHLC Prices
Anuj
January 2018
in
Python client
Hi,
I am trying to get OHLC Prices. Here is the code:
def get_quote(stock, api_key, access_token):
url="
https://api.kite.trade/instruments/NSE/
"+stock+"?api_key="+api_key+"&access_token="+access_token
response = requests.get(url)
response_dict=response.json()
return(response_dict['data']['ohlc']['open'])
This code returns error in many cases. The error being:
File "xx.py", line 35, in get_quote
return(response_dict['data']['ohlc']['open'])
KeyError: 'data'
Can you please help resolve?
Anuj
January 2018
Just to add, this code works in some cases and fails in some. The same code works for a stock one time and fails the other time for the same stock.
rakeshr
January 2018
Hi
@Anuj
,
If you are looking for LTP and OHLC data, you can use Bulk quote API, go through
this documentation
.
Anuj
January 2018
Thanks
@rakeshr
.
Yes, Bulk quote API addresses my requirements perfectly
This discussion has been closed.
If you are looking for LTP and OHLC data, you can use Bulk quote API, go through this documentation.
Yes, Bulk quote API addresses my requirements perfectly