Group Details Private

SmartAPI Group

  • H

    Why Open, High, Low data not is available in web socket for INDEX( Bank Nifty, Nifty 50, Nifty Next 50 ,Nifty Fin Service, NIFTY MID SELECT) Why only LTP?

    4 days agoread more
  • V

    @admin

    Please do something regarding this issue otherwise all algo traders are ruined. This decision will ruin algo trade industry.

    We need to find another country where monkeys are not controlling stock market decisions.

    this is like sword in monkey's hand

    8 days agoread more
  • A

    @Y15996 the error comes when you exceed the rate limit while sending requests.

    9 days agoread more
  • A

    @Simba007 Please try again and check.

    9 days agoread more
  • Robo order not support MCX

    Helle Folks,

    Could you please someone clarify my doubts.

    1. Is Robo would be applicable for all the exchange. I have tried for MCX, getting an error stating not supported.

    2. If robo order not supported for MCX, then what would be best to place sl and target together using java sdk.

    Thanks in advance.

    posted in Java SDK
  • Access denied because of exceeding access limits

    Re: Python SDK 'Access denied because of exceeding access rate'

    Hi @admin, I get this error "access denied because of exceeding access limits" I have gone through the api documentation on access request limits but still I am not able to fetch the data using api. Please resolve this as some as possible

    posted in Python SDK
  • Get Historical API not working

    https://apiconnect.angelone.in/rest/secure/angelbroking/historical/v1/getCandleData is not working.

    Getting 400 bad request. No response body for error code.

    posted in Bugs
  • How can I get Index performance with % change.

    Hi @admin @administrators

    I just want to know that how would I know the Index performance during opening market hours. Like SS provided below:-Index_Performance.jpeg

    posted in General Discussion
  • lost charts study templates

    I lost all my charts study templates.

    There is no proper response from angel one .

    this might have been happen due to recent mobile app update from play store .

    screenshot angel app.jpeg

    posted in General Discussion
  • RE: please share some example of WebSocket 2.0 response data

    @Jaydip-Garala you are able to get bid ask price from websocket?

    posted in C#/.Net SDK
  • RE: please share some example of WebSocket 2.0 response data

    @Jaydip-Garala you are able to get best five data Buy/Sell prices (in websocket streaming) than please help me i am not able

    posted in C#/.Net SDK
  • from Smartapi import SmartConnect, WebSocket ModuleNotFoundError: No module named 'Smartapi'

    I have Tried all possible solutions but im still facing this error for my algo trading.
    from Smartapi import SmartConnect, WebSocket
    ModuleNotFoundError: No module named 'Smartapi'

    can anyone help this?

    posted in Bugs
  • Invalid totp
    // server.js
    const express = require('express');
    const { SmartAPI } = require('smartapi-javascript');
    const WebSocket = require('ws');
    const path = require('path');
    require('dotenv').config();
    
    const app = express();
    const port = 3000;
    
    // Middleware
    app.use(express.json());
    app.use(express.static('public'));
    
    // Initialize SmartAPI
    let smart_api;
    try {
        smart_api = new SmartAPI({
            api_key: process.env.SMART_API_KEY,    // Your API Key
            clientId: process.env.CLIENT_ID,       // Your Client ID
            clientSecret: process.env.CLIENT_SECRET // Your Client Secret
        });
        console.log('SmartAPI initialized successfully');
    } catch (error) {
        console.error('Error initializing SmartAPI:', error);
        process.exit(1);
    }
    
    // Store session data
    let session = null;
    
    // Session check middleware
    const checkSession = (req, res, next) => {
        if (!session || !session.feedToken) {
            return res.status(401).json({ success: false, message: 'Not logged in or session expired' });
        }
        next();
    };
    
    //login code test
    app.post('/api/login', async (req, res) => {
        try {
            console.log('Login attempt started...');
            const { client_code, password, totp } = req.body;
            
            if (!client_code || !password || !totp) {
                throw new Error('Missing required login parameters');
            }
    
            console.log('Generating session...');
            const data = await smart_api.generateSession(client_code, password, totp);
            
            console.log('Full API Response:', JSON.stringify(data, null, 2));
    
            if (!data || !data.jwtToken || !data.feedToken) {
                throw new Error('Session generation failed, missing tokens.');
            }
    
            console.log('Session generated successfully:', {
                hasAccessToken: !!data.accessToken,
                hasRefreshToken: !!data.refreshToken,
                hasJwtToken: !!data.jwtToken,
                hasFeedToken: !!data.feedToken
            });
    
            session = data;
            smart_api.jwtToken = data.jwtToken;
            smart_api.feedToken = data.feedToken;
    
            res.json({
                success: true,
                message: 'Login successful',
                sessionInfo: {
                    hasAccessToken: !!data.accessToken,
                    hasJwtToken: !!data.jwtToken,
                    hasFeedToken: !!data.feedToken
                }
            });
    
        } catch (error) {
            console.error('Login error details:', error);
            res.status(500).json({
                success: false,
                message: error.message || 'Login failed',
                errorDetails: error.toString()
            });
        }
    });
    
    

    clientcode:"K624646"

    posted in General Discussion
  • Invalid totp

    Here is my code

    
    // Initialize SmartAPI
    let smart_api;
    try {
        smart_api = new SmartAPI({
            api_key: process.env.SMART_API_KEY,    // Your API Key
            clientId: process.env.CLIENT_ID,       // Your Client ID
            clientSecret: process.env.CLIENT_SECRET // Your Client Secret
        });
        console.log('SmartAPI initialized successfully');
    } catch (error) {
        console.error('Error initializing SmartAPI:', error);
        process.exit(1);
    }
    
    // Store session data
    let session = null;
    
    // Session check middleware
    const checkSession = (req, res, next) => {
        if (!session || !session.feedToken) {
            return res.status(401).json({ success: false, message: 'Not logged in or session expired' });
        }
        next();
    };
    
    //login code test
    app.post('/api/login', async (req, res) => {
        try {
            console.log('Login attempt started...');
            const { client_code, password, totp } = req.body;
            
            if (!client_code || !password || !totp) {
                throw new Error('Missing required login parameters');
            }
    
            console.log('Generating session...');
            const data = await smart_api.generateSession(client_code, password, totp);
            
            console.log('Full API Response:', JSON.stringify(data, null, 2));
    
            if (!data) {
                throw new Error('Session generation failed, missing tokens.');
            }
    
            console.log('Session generated successfully:', {
                hasAccessToken: !!data.accessToken,
                hasRefreshToken: !!data.refreshToken,
                hasJwtToken: !!data.jwtToken,
                hasFeedToken: !!data.feedToken
            });
    
            session = data;
            smart_api.jwtToken = data.jwtToken;
            smart_api.feedToken = data.feedToken;
    
            res.json({
                success: true,
                message: 'Login successful',
                sessionInfo: {
                    hasAccessToken: !!data.accessToken,
                    hasJwtToken: !!data.jwtToken,
                    hasFeedToken: !!data.feedToken
                }
            });
    
        } catch (error) {
            console.error('Login error details:', error);
            res.status(500).json({
                success: false,
                message: error.message || 'Login failed',
                errorDetails: error.toString()
            });
        }
    });
    
    
    

    Response

    Generating session...
    Full API Response: {
    "status": false,
    "message": "Invalid totp",
    "errorcode": "AB1050",
    "data": null
    }
    Session generated successfully: {
    hasAccessToken: false,
    hasRefreshToken: false,
    hasJwtToken: false,
    hasFeedToken: false
    }

    ID: "k624646"

    any one help me to solve this.

    posted in NodeJS SDK