Cannot Retrieve live market data


  • //This provides LTP/OHLC/FULL market data only during market hours
    
    const axios = require('axios');
    const credentials = require('./config');
    
    var data = JSON.stringify({
        "mode": "FULL",
        "exchangeTokens": {
            "NSE": ["3045"]
        }
    });
    
    var config = {
      method: 'post',
      url: 'https://apiconnect.angelbroking.com/rest/secure/angelbroking/market/v1/quote/',
      headers: {
        'Authorization': 'Bearer '+credentials.jwtToken, 
        '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': credentials.apiKey,
      },
      data : data,
    };
    
    axios(config)
    .then(function (response) {
      console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
      console.log(error);
    });
    

    I am getting the below error since past three hours

    {"message":"Internal Error","errorcode":"AB2001","status":false,"data":null}
    

    LTP, Websocket, and Historical Data APIs work correctly. Just the Live Market Data API is not responding. Please tell if there is anything wrong with the code or the API?


  • @Jeet-Pattani

    i used it like this it working

    mode="FULL"
     
    exchangeTokens= {"NSE": ["3045"]}
    
    marketData=smartApi.getMarketData(mode, exchangeTokens)
    print(f"Market Data : {marketData}")

  • Hello @Jeet-Pattani,

    Apologies for the delayed response.
    Thanks for raising this issue. I have raised this issue to tech team and will get back to you once I get a resolution from them. If you have any other issue, please share request and response on smartapi@angelbroking.com.

    Regards
    SmartAPI Team