Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Cannot Retrieve live market data

    Test
    0
    4
    79
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      Jeet Pattani last edited by

      //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?

      R D 2 Replies Last reply Reply Quote 0
      • R
        R50159735 @Jeet Pattani last edited by

        @Jeet-Pattani not

        1 Reply Last reply Reply Quote 0
        • M
          Moderator_1 last edited by

          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

          1 Reply Last reply Reply Quote 0
          • D
            Devansh24 @Jeet Pattani last edited by

            @Jeet-Pattani

            i used it like this it working

            mode="FULL"
             
            exchangeTokens= {"NSE": ["3045"]}
            
            marketData=smartApi.getMarketData(mode, exchangeTokens)
            print(f"Market Data : {marketData}")
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post