Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. J300558
    3. Posts
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 11
    • Posts 20
    • Best 0
    • Groups 0

    Posts made by J300558

    • issue with greek data

      LOGIN FUNCTION

      -----------------------

      def login_once():
      print("🔐 Logging in...")
      totp = pyotp.TOTP(totp_secret).now()
      smart = SmartConnect(api_key)
      session = smart.generateSession(client_code, pin, totp)
      jwt = session['data']['jwtToken']
      return jwt

      -----------------------

      MAIN EXECUTION

      -----------------------

      if name == "main":
      jwt_token = login_once()

      # ✅ Your machine info
      local_ip =
      public_ip =
      mac_addr =
      
      url = "https://apiconnect.angelone.in/rest/secure/angelbroking/marketData/v1/optionGreek"
      
      headers = {
          "Authorization": f"Bearer {jwt_token}",
          "X-ClientLocalIP": local_ip,
          "X-ClientPublicIP": public_ip,
          "X-MACAddress": mac_addr,
          "X-UserType": "USER",
          "X-SourceID": "WEB",
          "Content-Type": "application/json",
          "Accept": "application/json"
      }
      
      payload = {
          "name": "NIFTY",            
          "expirydate": "26JUN2025"   
      }
      
      print("📡 Fetching Greeks...")
      try:
          response = requests.post(url, headers=headers, json=payload, timeout=10)
          data = response.json()
          print("📦 Full response:")
          print(data)
      
          if "data" in data and data["data"]:
              print("✅ Option Greeks:")
              for option in data["data"]:
                  print(
                      f"{option['strikePrice']} {option['optionType']} | "
                      f"Δ={option['delta']} Γ={option['gamma']} Θ={option['theta']} "
                      f"Vega={option['vega']} IV={option['impliedVolatility']} Vol={option['tradeVolume']}"
                  )
          else:
              print("⚠️ No data found in response or empty 'data' array.")
      except Exception as e:
          print("❌ Failed to fetch or parse response:", e)
      

      getting error as follwoing
      🔐 Logging in...
      [I 250625 16:22:56 smartConnect:121] in pool
      📡 Fetching Greeks...
      📦 Full response:
      {'success': False, 'message': 'Invalid Token', 'errorCode': 'AG8001', 'data': ''}
      ⚠️ No data found in response or empty 'data' array.

      posted in Python SDK
      J
      J300558
    • PostBack Feature

      Hi, Wants to confirm PostBack Feature is available or not.
      If yes, then how can we integrate it. Please share the steps. Please

      posted in General Discussion
      J
      J300558
    • RE: Guide to secure your SmartAPI Account with two factor authentication

      Using smart api-Angel Broker plugin, include following js file

      <script src="https://smartapi.angelbroking.com/common/v1.js"></script>

      then passing api key; <smartapi-login href="#" data-smartapi="<api-key>">Login</smartapi-login>

      How to solve with this integration?

      posted in General Discussion
      J
      J300558
    • Require Instrument List and LTP data For segments

      Hi,
      Please specify for which segment you will provide Instrument List and LTP data. I am using following segment:

      1. NSE Cash
      2. NSE Future
      3. Index Option
      4. Stock Option
      5. MCX
      6. MCX Option
      7. NCDEX
      8. NSE Currency
      posted in General Discussion
      J
      J300558
    • Calling Historical Data API

      Can you please confirm in which frequency Historical Data API is called?
      As I am calling Historical Data API in a loop, some time it will not return Historical Data.

      posted in General Discussion
      J
      J300558
    • PostBack URL

      Hi,
      On creating SMART API app; post back URL option is given.
      How this option can be used? Please suggest.

      posted in General Discussion
      J
      J300558
    • Order Rejected Reason

      Hi,
      Placing an order via API with the following input:

      "variety" => "NORMAL",
      "tradingsymbol" => "SBIN-EQ",
      "symboltoken" => "3045",
      "exchange" => "NSE",
      "quantity" => "1",
      "transactiontype" => "BUY",
      "ordertype" => "MARKET",
      "producttype" => "INTRADAY",
      "duration" => "DAY"
      

      order will be placed successfully; but after that order is rejected with following reason
      RMS:Blocked for NON-INTRADAY nse_cm INTRADAY Remarks: INTRADAY PRODUCT BLOCKED FOR NON INTRADAY USERS block type: ALL

      Please clear why this order is rejected.

      posted in General Discussion
      J
      J300558
    • RE: Access Token/Authorize Token Time Period

      @admin Waiting for the response !

      posted in General Discussion
      J
      J300558
    • RE: PostBack URL at App creation

      @admin
      Waiting for the response?

      posted in General Discussion
      J
      J300558
    • RE: Order Rejection API Response

      @admin
      Hi,
      Not getting the same response as in trading panel.
      Trading Panel shows Order : Rejected but API response returns Success message.

      posted in General Discussion
      J
      J300558
    • RE: Order Placing API return no response

      @sandipkhairnar
      Hi,
      Thanks!
      Now getting the responses.
      API response getting Success but when checking into the trading panel:
      https://trade.angelbroking.com/
      it shows Order Rejected.

      posted in General Discussion
      J
      J300558
    • RE: Order Placing API return no response

      @rajanprabu
      Hi, thanks for the response. Now updating MIS to INTRADAY, Response is coming.
      For given input

          "variety" => "NORMAL",
          "tradingsymbol" => "RELIANCE-EQ",
          "symboltoken" => "2885",
          "exchange" => "NSE",
          "quantity" => "1",
          "transactiontype" => "BUY",
          "ordertype" => "MARKET",
          "producttype" => "INTRADAY"
      

      following response is coming:

      AB2001 : Internal Error
      How can this issue be handled?

      posted in General Discussion
      J
      J300558
    • RE: Order Placing API return no response

      @sandipkhairnar
      Hi, Thanks for response again.

      Tried as you have suggested; but not getting the any response. Once again getting an empty result.
      Not receiving success or error response.

      posted in General Discussion
      J
      J300558
    • Order Rejection API Response

      Hi,
      I am using following API to place an order:

      https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder

      There is no response. When I am going to place directly from the panel https://trade.angelbroking.com/; it rejects the order and saying:

      Rejection Reason
      Your order has been rejected due to Insufficient Funds.

      What will be the response of API in case of order rejection?

      posted in General Discussion
      J
      J300558
    • RE: Order Placing API return no response

      @sandipkhairnar
      hi, thanks for the response; I have updated the variety parameter to "NORMAL"; but there is no change in response. Nothing is return.

      posted in General Discussion
      J
      J300558
    • Order Placing API return no response

      Hi, using following method; placing the order but there is no return response:

      $post_value_arr = array(
          "variety" => "REGULAR",
          "tradingsymbol" => "RELIANCE-EQ",
          "symboltoken" => "2885",
          "exchange" => "NSE",
          "quantity" => "1",
          "transaction_type" => "BUY",
          "ordertype" => "MARKET",
          "producttype" => "MIS"
      );
      $post_value_json = json_encode($post_value_arr);
      
      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, "https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder");
      curl_setopt($ch, CURLOPT_POST, 1);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($ch, CURLOPT_HEADER, 1);
      curl_setopt($ch, CURLOPT_POSTFIELDS, $post_value_json);
      curl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: Bearer ' . $auth_token, 'Content-Type: application/json', 'Accept: application/json', 'X-UserType: USER', 'X-SourceID: WEB', 'X-ClientPublicIP: 172.29.24.173', 'X-ClientLocalIP: 172.29.24.173', 'X-MACAddress: e0:d5:5e:91:23:d4', 'X-PrivateKey: ' . $api_key));
      
      // receive server response ...
      $server_output = curl_exec($ch);
      $server_output_arr = json_decode($server_output, true);
      

      Please rectify the issue.

      posted in General Discussion
      J
      J300558
    • Access Token/Authorize Token Time Period

      Hi,
      What will be the validity period of Token?
      Please confirm.

      posted in General Discussion
      J
      J300558
    • PostBack URL at App creation

      Hi,
      At the time of angel broker app creation; there is post back url field as an optional field;

      Is this post back configuration working? And how and when it works?

      Please clear.

      posted in General Discussion
      J
      J300558
    • RE: Placed Order Detail From Order Id

      @admin
      Hi,
      How can I get specific order details from getOrderBook API?
      There is no request string has been passed which contains specific user Id.

      var axios = require('axios');
      var data = '';

      var config = {
      method: 'get',
      url: 'https://apiconnect.angelbroking.com
      /rest/secure/angelbroking/order/
      v1/getOrderBook',
      headers: {
      'Authorization': 'Bearer AUTHORIZATION_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'
      },
      data : data
      };

      axios(config)
      .then(function (response) {
      console.log(JSON.stringify(response.data));
      })
      .catch(function (error) {
      console.log(error);
      });

      posted in General Discussion
      J
      J300558
    • Placed Order Detail From Order Id

      Hi,
      After placing order from smart API : https://apiconnect.angelbroking.com/rest/secure/angelbroking/order/v1/placeOrder
      I can get the OrderId.
      But; I need two things for the OrderId.

      1. Getting the complete details of order i.e. Transaction type, price, timing of execution etc.
      2. Post back feature; so that from every Order execution I can perform required task at the same instance.
      posted in General Discussion
      J
      J300558