Navigation

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

    J300558

    @J300558

    1
    Reputation
    9
    Profile views
    20
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    J300558 Unfollow Follow

    Latest 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