try: # Make the HTTP GET request response = requests.get(url, headers={"X-Kite-Version": "3", "Authorization": f"token {api_k}:{access_token}"})
# Check if the request was successful (status code 200) if response.status_code == 200: # Parse the JSON response positions_data = response.json()
# Access specific information from the response #net_positions = positions_data.get("data", {}).get("net", []) #P dont need the pnl contribution of holdings day_positions = positions_data.get("data", {}).get("day", [])
day_positions contains the information about positions in "list of dictionary" form.
Since I'm using this to calculate pnl and plan on doing it every couple of seconds, I wanted to know that wether making this kind of request every second can cause some sort of error when the code runs for entire day?
Also, is there a limit for such requests example: kite.order() and kite.positions() ?