☰
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.9K
All Categories
0
Incidents
156
Node JS client
40
Go client
793
.Net API client
380
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
347
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
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