Smart API Skills
Complete integration reference for SmartAPI (Angel One's REST API for algorithmic trading). Use this skill whenever the user is building, debugging, or asking about Angel One SmartAPI integrations
npx -y skills add jill6125/Smart-API-SkillsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Complete integration reference for SmartAPI (Angel One's REST API for algorithmic trading). Use this skill whenever the user is building, debugging, or asking about Angel One SmartAPI integrations — including login/session management, placing or managing orders, fetching market data, historical OHLC data, portfolio/holdings, GTT orders, WebSocket streaming, margin estimation, or any SmartAPI endpoint. Trigger on keywords like "SmartAPI", "Angel One API", "AngelBroking API", "place order", "symboltoken", "jwtToken", "feedToken", "GTT rule", "getCandleData", "getLtpData", or any reference to angelone.in / angelbroking.com API URLs. Also trigger when the user is writing Python, JavaScript, or any code that calls these endpoints.
SKILL.md
8.9 KB, ~2.3k tokens by cl100k_base, as published. Nobody here has run it
SmartAPI (Angel One) Integration Skill
Quick Reference
| Need | Go to section |
|---|---|
| Login & tokens | [Session Flow] |
| Place / modify / cancel | [Order Management] |
| Real-time price / quote | [Market Data] |
| OHLC candlestick history | [Historical Data] |
| Holdings & positions | [Portfolio] |
| Conditional (GTT) orders | [GTT Orders] |
| Live streaming | [WebSocket] |
| Margin / brokerage calc | [Utilities] |
| Error codes | [Error Handling] |
For full endpoint field references, read references/endpoints.md.
Base URLs
Current: https://apiconnect.angelone.in/rest
Legacy: https://apiconnect.angelbroking.com/rest
GTT: https://apiconnect.angelone.in/gtt-service/rest
All paths below are relative to the Current base URL unless noted otherwise.
Session Flow
Every integration must follow this lifecycle:
1. POST /auth/angelbroking/user/v1/loginByPassword → jwtToken, refreshToken, feedToken
2. Include jwtToken in Authorization header for all secure calls
3. On JWT expiry → POST /auth/angelbroking/jwt/v1/generateTokens
4. POST /secure/angelbroking/user/v1/logout → end session
Required Headers (all secure endpoints)
Content-Type: application/json
Accept: application/json
Authorization: Bearer <jwtToken>
X-UserType: USER
X-SourceID: WEB
X-ClientLocalIP: 127.0.0.1
X-ClientPublicIP: <your public IP>
X-MACAddress: 00:00:00:00:00:00
X-PrivateKey: <API key from SmartAPI portal>
💡
X-ClientLocalIP,X-ClientPublicIP,X-MACAddresscan use placeholder values during development.
Login
POST /auth/angelbroking/user/v1/loginByPassword
{ "clientcode": "AB1234", "password": "mypassword", "totp": "123456" }
Response tokens:
jwtToken→Authorization: BearerheaderrefreshToken→ regenerate expired JWTfeedToken→ WebSocket streaming
Token Refresh
POST /auth/angelbroking/jwt/v1/generateTokens
{ "refreshToken": "r_ABC123..." }
Order Management
Place Order
POST /secure/angelbroking/order/v1/placeOrder
{
"variety": "NORMAL",
"tradingsymbol": "TCS-EQ",
"symboltoken": "12345",
"transactiontype": "BUY",
"exchange": "NSE",
"ordertype": "MARKET",
"producttype": "DELIVERY",
"duration": "DAY",
"quantity": 1,
"price": 0,
"triggerprice": 0,
"disclosedquantity": 0
}
Returns: { "data": { "orderid": "...", "uniqueorderid": "..." } }
⚠️ Save
uniqueorderid— required for tracking individual order status.
Key field values:
variety:NORMAL|AMO|SLordertype:MARKET|LIMIT|SL|SL-Mproducttype:DELIVERY|CARRYFORWARD|MISduration:DAY|IOC|FILL_OR_KILLprice: Set0for MARKET orderstriggerprice: Required forSLandSL-M
Modify / Cancel
POST /secure/angelbroking/order/v1/modifyOrder # same fields + "orderid"
POST /secure/angelbroking/order/v1/cancelOrder
Track Order Status
GET /secure/angelbroking/order/v1/details/{uniqueorderid} # preferred (10 req/s)
GET /secure/angelbroking/order/v1/getOrderBook # all orders (~1 req/s)
GET /secure/angelbroking/order/v1/getTradeBook # executed trades
GET /secure/angelbroking/order/v1/getPosition # open positions
💡 Always prefer
/details/{uniqueorderid}over polling the full order book — 10x higher rate limit.
Market Data
Symbol Lookup
POST /secure/angelbroking/order/v1/searchScrip
{ "exchange": "NSE", "searchscrip": "TCS" }
Returns tradingsymbol, exchange, symboltoken. Always resolve symboltoken before placing orders.
LTP (Multiple Symbols)
POST /secure/angelbroking/order/v1/getLtpData
{ "exchange": "NSE", "symboltoken": ["2885", "26000"] }
Real-Time Quote
POST /secure/angelbroking/market/v1/quote
{ "mode": "snapshot", "exchangeTokens": ["12345"] }
Other Market Data
| Endpoint | Description |
|---|---|
POST /marketData/v1/optionGreek | Delta, Gamma, Theta, Vega |
POST /marketData/v1/gainersLosers | Top gainers/losers |
GET /marketData/v1/putCallRatio | NIFTY PCR |
POST /marketData/v1/OIBuildup | OI buildup for indices |
GET /marketData/v1/nseIntraday | NSE intraday data |
Historical Data
Candlestick (OHLC)
POST /secure/angelbroking/historical/v1/getCandleData
{
"exchange": "NSE",
"symboltoken": "12345",
"interval": "ONE_DAY",
"fromdate": "2024-01-01 09:15",
"todate": "2024-01-31 15:30"
}
Intervals: ONE_MINUTE | FIVE_MINUTE | ONE_HOUR | ONE_DAY
Response: Array of [timestamp, open, high, low, close, volume]
Historical Open Interest
POST /secure/angelbroking/historical/v1/getOIData
Same structure as getCandleData; returns oi and changeinOi per bucket.
Portfolio / Holdings
GET /secure/angelbroking/portfolio/v1/getHolding # equity holdings
GET /secure/angelbroking/portfolio/v1/getAllHolding # all segments
GTT (Good-Till-Trigger) Orders
⚠️ GTT endpoints use a different base URL prefix:
https://apiconnect.angelone.in/gtt-service/rest/secure/angelbroking/gtt/v1/
Create GTT Rule
POST /gtt-service/rest/secure/angelbroking/gtt/v1/createRule
{
"tradingsymbol": "TCS-EQ", "symboltoken": "12345", "exchange": "NSE",
"transactiontype": "BUY", "ordertype": "MARKET", "producttype": "DELIVERY",
"price": 0, "quantity": 1, "triggerPrice": 2300,
"disclosedquantity": 0, "scripConsent": "yes"
}
| Action | Method | Path suffix | Key Body |
|---|---|---|---|
| Modify | POST | modifyRule | same fields + "id": <rule_id> |
| Cancel | POST | cancelRule | { "id": <rule_id> } |
| Details | POST | ruleDetails | { "id": <rule_id> } |
| List | POST | ruleList | { "status": ["ACTIVE"], "page": 1, "count": 10 } |
WebSocket Streaming
URL: wss://smartapisocket.angelone.in/smart-stream
Auth: feedToken from login response
Topics: real-time market quotes, order status notifications
Utilities
POST /secure/angelbroking/margin/v1/batch # margin for a batch of orders
POST /secure/angelbroking/brokerage/v1/estimateCharges # brokerage + tax breakdown
Error Handling
All responses share this envelope:
{
"status": true,
"message": "SUCCESS",
"errorCode": "",
"data": { }
}
Always check "status": true before reading data.
| Code Range | Meaning |
|---|---|
| AG8001–8005 | Auth / authorization errors |
| AG8002 | Invalid input parameters |
| AG5000 | Server-side errors |
Rate Limits
| Operation | Limit |
|---|---|
| Place / Modify / Cancel order | 20 req/s |
| Individual order status | 10 req/s |
| Order book (full) | ~1 req/s |
| Historical / market data | Generous |
Integration Checklist
- Implement JWT auto-refresh on 401 — don't let the token expire silently
- Resolve
symboltokenviasearchScripbefore every order - Use
uniqueorderid(notorderid) to track individual order status - Use GTT base URL prefix for all GTT operations
- Set
price: 0for MARKET orders; always settriggerpricefor SL/SL-M - Page through
ruleListresults usingpage+count
Need more detail?
Read references/endpoints.md for complete request/response field tables for every endpoint.
Gives 0 of the 12 instructions most apis services skills give in ~2.3k tokens
Counted across 424 of the 426 authors here whose files we hold, read 2026-08-06
- use plural nouns for resource namesin 41 of 424, across 32 files
- use cursor-based pagination for large datasetsin 35 of 424, across 20 files
- include rate limit headers in responsesin 25 of 424, across 13 files
- Use kebab-case for multi-word resourcesin 23 of 424, across 13 files
- version APIs in the URL pathin 19 of 424, across 9 files
- use semantic HTTP status codesin 18 of 424, across 8 files
- verify webhook signaturesin 18 of 424, across 11 files
- use query parameters for filteringin 17 of 424, across 6 files
- use async database operationsin 14 of 424, across 7 files
- wrap successful responses in a data fieldin 13 of 424, across 3 files
- prefix sorting parameters with a hyphen for descending orderin 13 of 424, across 3 files
- set appropriate HTTP status codesin 13 of 424, across 6 files
Said here and by no other author read
- include jwtToken in Authorization header
- auto-refresh JWT on 401 responses
- resolve symboltoken via searchScrip before placing orders
- use uniqueorderid to track order status
- use the GTT base URL prefix for GTT operations
- set price to zero for MARKET orders
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.