Overview

SmartAPI by Angel Broking is an Indian stock brokerage API that lets developers build automated trading systems, portfolio trackers, and order management tools for the NSE and BSE markets. It requires an API key and supports real-time market data, historical data, order placement, and WebSocket streaming. This API is best suited for developers with some trading domain knowledge.

Beginner Tip

Before placing live orders, always test your integration in the sandbox environment to avoid accidental real trades. Start by exploring the market data endpoints before attempting order management.

Available Data

The kind of data this API exposes, based on its documentation. We could not call the endpoint to confirm the exact field names.

SmartAPI data via REST API

Example Response

Illustrative shape only — we were not able to call this endpoint (it requires credentials or exposes no public sample URL), so the fields below show the kind of data this API returns rather than a recorded response.

JSON Response · Illustrative
{
  "status": "success",
  "data": {
    "result": "Data from SmartAPI",
    "description": "Gain access to set of <SmartAPI> and create end-to-end broking services",
    "timestamp": "2025-01-15T10:00:00Z"
  }
}

Field Reference

status True if the request was successful, false if it failed.
message Human-readable status message or error description.
data.jwtToken JWT access token to include in the Authorization header for subsequent requests.
data.refreshToken Token used to obtain a new JWT access token after expiry.
data.feedToken Separate token required for WebSocket market data feed connections.

Implementation Example

Calls a real endpoint of this API. Replace any placeholder credentials with your own key.

Request
const url = "https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword";
// Replace headers or query params with the values required by this API.
const response = await fetch(url, {
  headers: {
  "X-API-Key": "YOUR_API_KEY"
  }
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();
console.log(data);

What Can You Build?

Note: These code examples are AI-generated and unverified. Always refer to the official API documentation for accurate usage.

Common Errors & Troubleshooting

Generated guidance based on this API's documentation, not observed by us. Treat it as a starting point and check against the provider's own error reference.

AG8001 - Invalid Token JWT access token has expired (tokens are short-lived).
Implement token refresh logic using the refresh token endpoint before making subsequent API calls.
AG8002 - Unauthorized API key not activated or IP address not whitelisted.
Log into your Angel Broking account, activate the API key, and add your server IP to the whitelist.
TOTP Required error Angel Broking requires a Time-based One-Time Password for login.
Use an authenticator app or the pyotp/speakeasy library to generate TOTP codes from your TOTP secret.

Metadata Score Breakdown

Estimated from metadata — endpoint not independently tested

This score is estimated from observable metadata — HTTPS support, authentication model, declared CORS, and documentation reachability — because the API requires authentication or exposes no publicly testable endpoint. The five-signal breakdown is only shown for live-tested APIs.

Metadata estimate · endpoint not independently tested

Technical Specifications

Auth API Key
HTTPS REQUIRED
CORS UNKNOWN
Category Finance
Difficulty Intermediate
Listing details not endpoint-verified

Related Tags

Similar APIs

View All →