Angel One Smart API Integration: Complete 2025 Guide for Seamless Trading Setup
- What is Angel One Smart API and Why Use It?
- How to Choose Between SMART_API and SMART_API_M Platforms?
- Step-by-Step: Generating Your Smart API Private Key
- Configuring TOTP Security: Your Trading Fort Knox
- Connecting Your Trading Account: Validation Process
- SMART_API_M Platform: OAuth Authentication Alternative
- Troubleshooting Common API Integration Issues
- Security Best Practices for API Trading
- Frequently Asked Questions
This comprehensive guide walks you through every step of integrating with Angel Broking's (now Angel One) Smart API platform. Whether you're a developer building trading solutions or an active trader looking to automate your strategies, we cover both recommended methods (SMART_API and SMART_API_M) with detailed instructions, troubleshooting tips, and visual references. Learn how to generate API keys, configure TOTP security, and connect your trading account efficiently.
What is Angel One Smart API and Why Use It?
Angel One's Smart API provides programmatic access to India's stock markets through a secure developer platform. The API offers several advantages over manual trading: 1) Automated order execution eliminates emotional decisions, 2) Backtesting capabilities allow strategy validation, 3) Reduced latency for time-sensitive trades, 4) Portfolio management through code, and 5) Integration with third-party tools like TradingView. Over 2 million traders currently use Angel One's platforms, with API adoption growing 47% year-over-year according to 2024 exchange data.
How to Choose Between SMART_API and SMART_API_M Platforms?
Angel One offers two integration approaches with distinct characteristics. The SMART_API platform (recommended) provides direct authentication using your trading credentials and TOTP security, offering uninterrupted access. Meanwhile, SMART_API_M uses OAuth authentication that requires daily manual login but doesn't expose your credentials. Consider SMART_API if you: 1) Need 24/7 automated trading, 2) Can securely store API keys, 3) Want to avoid daily logins. Choose SMART_API_M if you: 1) Prefer not to share credentials, 2) Trade during fixed hours, 3) Want simpler initial setup.
Step-by-Step: Generating Your Smart API Private Key
Follow this foolproof process to create your API credentials: First, visit smartapi.angelbroking.com and complete registration (remember to add your Angel Client ID). After logging in, click "Create An App" with these exact parameters: API Type = "Trading API", App Name = "StocksDeveloper" (no spaces), Redirect URL = "https://webx.stocksdeveloper.in/". Pro tip: Take screenshots during setup as reference. The generated API Key grants access to: 1) Market data feeds, 2) Order placement, 3) Portfolio tracking, 4) Historical data, and 5) Webhook configurations. Store this key securely - it's like a password to your trading account.
Configuring TOTP Security: Your Trading Fort Knox
Two-factor authentication adds critical protection to your API access. Begin by installing Google Authenticator on your mobile device. Navigate to Angel One's TOTP activation page (https://smartapi.angelbroking.com/enable-totp) and complete SMS verification. You'll receive: 1) A QR code for mobile scanning, 2) A 32-character secret key. The secret key serves multiple purposes: a) Generates time-based OTPs, b) Allows recovery if you lose your device, c) Enables API validation. In AutoTrader Web, paste this key in Settings > Trading Accounts under TOTP Secret Key. Remember: This setup is one-time only but essential for uninterrupted API access.
Connecting Your Trading Account: Validation Process
With your API key and TOTP configured, finalize the integration in AutoTrader Web: 1) Navigate to Settings > Trading Accounts, 2) Click Create and select Angel as your broker, 3) Enter your login ID and MPIN (same as trade.angelone.in), 4) Paste your API key, 5) Click Validate. The system verifies: a) API key validity, b) Account credentials, c) TOTP configuration. Upon successful validation (typically 5-15 seconds), save the configuration. For multiple accounts, repeat the process - each requires unique API credentials. Pro tip: Test with small orders before live trading.
SMART_API_M Platform: OAuth Authentication Alternative
For traders preferring OAuth, the SMART_API_M platform offers credential-free access. After standard API setup (obtaining Key/Secret), add your account in AutoTrader Web by: 1) Selecting SMART_API_M as platform, 2) Entering only your API Key, 3) Completing OAuth login redirect. Key differences include: a) Daily manual login requirement, b) No TOTP configuration, c) Session-based access tokens. This method suits: 1) Discretionary traders, 2) Those uncomfortable sharing credentials, 3) Developers building client-facing tools. The trade-off? Less automation potential than SMART_API.
Troubleshooting Common API Integration Issues
Even smooth setups encounter occasional hiccups. The AB1007 error ("invalid user id or password") typically indicates: 1) Incorrect MPIN entry, 2) Expired API key (valid 1 year by default), 3) TOTP misconfiguration. Solutions include: a) Regenerating API keys, b) Resetting MPIN via Angel One portal, c) Re-verifying TOTP secret. Other common issues: 1) Connectivity problems (check API status page), 2) Rate limit breaches (5 requests/second), 3) Session timeouts (especially SMART_API_M). Bookmark Angel One's API documentation for reference.
Security Best Practices for API Trading
Protecting your API access is as crucial as securing your bank details. Implement these security measures: 1) Never share API keys in public forums, 2) Use unique passwords for Angel One account and API portal, 3) Regularly rotate API keys (every 3-6 months), 4) Monitor API usage logs for suspicious activity, 5) Restrict IP access if possible. Remember: API keys grant full trading access - treat them like debit card PINs. For added security, consider: a) Dedicated trading devices, b) VPN usage, c) Separate accounts for API vs manual trading.
Frequently Asked Questions
How long does Angel One API key remain valid?
API keys typically expire after 1 year of inactivity, but we recommend regenerating them every 6 months as security best practice. Active keys don't automatically expire.
Can I use the same API key for multiple trading accounts?
No, each Angel One trading account requires separate API key generation. The system associates each key with a specific client ID.
Is there any cost for using Angel One Smart API?
Angel One currently provides API access free of charge, though standard brokerage fees apply to trades executed via API.
What happens if I lose my TOTP secret key?
You'll need to disable and reconfigure TOTP through Angel One's portal. Keep your secret key in password manager or secure offline storage.
Can API trading qualify for volume-based brokerage discounts?
Yes, API-executed trades count toward your monthly volume and qualify for all applicable brokerage discounts.