{"id":46401,"library":"smartapi-python","title":"SmartAPI Python","description":"Angel Broking (Angel One) official Python SDK for the SmartAPI – trading, orders, market data, and portfolio management. Current version 1.5.5. Release cadence is irregular, driven by broker API changes.","status":"active","version":"1.5.5","language":"python","source_language":"en","source_url":"https://github.com/angelbroking-github/smartapi-python","tags":["angel-broking","trading","stock-market","smartapi","india"],"install":[{"cmd":"pip install smartapi-python","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"HTTP client","package":"requests","optional":false},{"reason":"TOTP for 2FA","package":"pyotp","optional":false},{"reason":"Connection pooling","package":"urllib3","optional":false}],"imports":[{"wrong":"from smartapi import SmartConnect","symbol":"SmartConnect","correct":"from SmartApi import SmartConnect"}],"quickstart":{"code":"import os\nfrom smartapi import SmartConnect\n\nobj = SmartConnect(api_key=os.environ.get('API_KEY', ''))\ndata = obj.generateSession(os.environ.get('CLIENT_ID', ''), os.environ.get('PASSWORD', ''), os.environ.get('TOTP', ''))\nprint(data)","lang":"python","description":"Initialize SmartConnect with API key, then generate session using client id, password, and TOTP."},"warnings":[{"fix":"Replace session.userProfiles with session.getProfile()['data'].","message":"session.userProfiles and session.profile are deprecated. Use session.getProfile() to fetch profile.","severity":"breaking","affected_versions":">=1.4.0"},{"fix":"Pass the TOTP value (not just password) to generateSession.","message":"TOTP (One Time Password) is mandatory for session generation even in live environment. Many users miss this.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate from 'from smartapi import SmartWebSocket' to 'from smartapi import SmartWebSocketV2'.","message":"SmartWebSocket (V1) is deprecated. Use SmartWebSocketV2 for live market data.","severity":"deprecated","affected_versions":"<=1.3.x"},{"fix":"Extract feed_token from generateSession response: obj.feed_token or feed_token key in returned dict.","message":"FeedToken required for WebSocket connection is returned in generateSession response, not in access_token.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.5.5':22 'angel':3,5,33 'angel-brok':32 'api':30 'broke':4,34 'broker':29 'cadenc':24 'chang':31 'current':20 'data':16 'driven':27 'india':40 'irregular':26 'manag':19 'market':15,38 'offici':7 'one':6 'order':14 'portfolio':18 'python':2,8 'releas':23 'sdk':9 'smartapi':1,12,39 'stock':37 'stock-market':36 'trade':13,35 'version':21","created_at":"2026-06-07T12:59:44.779765+00:00","updated_at":"2026-06-07T12:59:44.779765+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmp4eaj2grp/venv/lib/python3.12/site-packages/SmartApi/__init__.py\", line 3, in <module>\n    from SmartApi.smartConnect import SmartConnect\n  File \"/tmp/tmp4eaj2grp/venv/lib/python3.12/site-packages/SmartApi/smart"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/angelbroking-github/smartapi-python","github":"https://github.com/angelbroking-github/smartapi-python","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["finance"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}