GetLTP failing with Internal Error


  • payload {
    "exchange": "NFO",
    "tradingsymbol": "BANKNIFTY23FEB23FUT",
    "symboltoken": "48756"
    }
    headers {'Authorization': 'Bearer -------------------', 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-UserType': 'USER', 'X-SourceID': 'WEB', 'X-ClientLocalIP': 'CLIENT_LOCAL_IP', 'X-ClientPublicIP': 'CLIENT_PUBLIC_IP', 'X-MACAddress': 'MAC_ADDRESS', 'X-PrivateKey': '----------------'}
    data_getltp>>>>>>>>>>>> b'<!doctype html><html lang="en"><head><title>HTTP Status 500 \xe2\x80\x93 Internal Server Error</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 \xe2\x80\x93 Internal Server Error</h1></body></html>'

    Code Used:

    def get_ltp(jwt_token,api_key,symbol,token,exchg):
    conn = http.client.HTTPSConnection(
    "apiconnect.angelbroking.com")

    payload = "{\n     \"exchange\": \"" + \
              exchg + "\",\n \"tradingsymbol\": \"" + \
              symbol + "\",\n \"symboltoken\": \"" + \
              token + "\"\n}"
    headers = {
        'Authorization': jwt_token,
        'Content-Type': 'application/json',
        'Accept': 'application/json',
        'X-UserType': 'USER',
        'X-SourceID': 'WEB',
        'X-ClientLocalIP': 'CLIENT_LOCAL_IP',
        'X-ClientPublicIP': 'CLIENT_PUBLIC_IP',
        'X-MACAddress': 'MAC_ADDRESS',
        'X-PrivateKey': api_key
    }
    conn.request("POST",
                 "/order-service/rest/secure/angelbroking/order/v1/getLtpData",
                 payload,
                 headers)
    
    res = conn.getresponse()
    data = res.read()

  • Hi @mohan1710

    Apologies for delayed response.
    Kindly reverify if the issue still occurs on getLTP.

    Thanks & Regards,
    SmartAPI team