REST API for Indian stock market intelligence. AI-powered DVM scores, convergence signals, market regime analysis, composite ML forecasts, institutional flow, options intelligence, and 330+ endpoints across v1/v2/v3.
All API requests (except /api/health and /api/v3/openapi-spec) require an API key sent via the X-API-Key header.
curl -H "X-API-Key: dalalai_YOUR_KEY_HERE" \
https://dalalai.com/api/v1/stocks
You can have up to 3 active keys per account. Keys are SHA-256 hashed on our end — the raw key is shown only once at creation.
Try the API before subscribing. Every registered user gets 25 API calls over 3 days with a trial key.
To generate a trial key, go to the API Dashboard and click “Try Free”. The trial key works on all endpoints with the same response format.
After 25 calls or 3 days, the key expires. Subscribe to the Developer plan for unlimited access.
https://dalalai.com/api/v1/
Current version: v1. The X-API-Version: 1 header is included in all responses. When v2 launches, v1 will remain supported for at least 6 months.
All responses use a consistent JSON envelope:
{
"data": { ... }, // The actual payload (null on error)
"meta": {
"timestamp": "2026-03-14T08:30:00Z",
"version": 1,
"endpoint": "/api/v1/stocks",
"dataTimestamp": "2026-03-14 07:32:40",
"cached": true,
"pagination": { "page": 1, "limit": 50, "total": 799, "pages": 16 }
},
"error": null // null on success
}
On error:
{
"data": null,
"meta": { ... },
"error": {
"code": 1004,
"message": "Rate limit exceeded",
"suggestion": "Wait and retry after the Retry-After period.",
"docs": "https://dalalai.com/docs/api"
}
}
These query parameters work on all data endpoints. On /api/v1/stocks, they apply to the stocks array.
?fields=Return only specified fields, reducing payload size significantly.
curl -H "X-API-Key: YOUR_KEY" \
"https://dalalai.com/api/v1/stocks?fields=Symbol,CMP,DVM_Score"
# Response: only Symbol, CMP, DVM_Score per stock (other fields omitted)
?sort=Sort results server-side. Prefix with - for descending order.
# Top stocks by DVM_Score (descending)
curl -H "X-API-Key: YOUR_KEY" \
"https://dalalai.com/api/v1/stocks?sort=-DVM_Score&limit=10"
# Alphabetical by symbol (ascending)
curl ... "https://dalalai.com/api/v1/stocks?sort=Symbol"
?filter=Filter records using comparison operators. Comma-separate multiple clauses (AND logic). Max 10 clauses.
| Operator | Example | Meaning |
|---|---|---|
> | ?filter=DVM_Score>80 | Greater than 80 |
< | ?filter=CMP<500 | Less than 500 |
>= | ?filter=DVM_Score>=90 | Greater or equal |
= | ?filter=AI_Rating=Strong Buy | Exact match |
!= | ?filter=Sector!=IT | Not equal |
# High-conviction stocks above ₹100
curl -H "X-API-Key: YOUR_KEY" \
"https://dalalai.com/api/v1/stocks?filter=DVM_Score>80,CMP>100&sort=-DVM_Score&fields=Symbol,CMP,DVM_Score"
Fetch up to 5 endpoints in a single API call. Saves latency and rate limit quota.
curl -H "X-API-Key: YOUR_KEY" \
"https://dalalai.com/api/v1/batch?endpoints=stocks,regime,breadth"
# Response:
{
"data": {
"stocks": { ... }, // full stocks response
"regime": { ... }, // full regime response
"breadth": { ... } // full breadth response
},
"meta": { "endpoints": ["stocks", "regime", "breadth"], ... }
}
Files are deduplicated internally — if two endpoints share the same data file, it's fetched only once.
Every response includes an ETag header. On subsequent requests, send If-None-Match to get a 304 Not Modified (empty body) if data hasn't changed. Ideal for polling.
# First request — save the ETag
curl -v -H "X-API-Key: YOUR_KEY" https://dalalai.com/api/v1/regime
# Response header: ETag: "a1b2c3d4e5f6..."
# Subsequent request — include If-None-Match
curl -H "X-API-Key: YOUR_KEY" \
-H 'If-None-Match: "a1b2c3d4e5f6..."' \
https://dalalai.com/api/v1/regime
# → 304 Not Modified (0 bytes, no bandwidth cost)
Embed live market data badges in your blog, dashboard, or social profile. Returns an SVG image. No API key needed.
# SVG badge (default)
https://dalalai.com/api/v1/widget?type=regime&format=svg
# JSON (for custom rendering)
https://dalalai.com/api/v1/widget?type=regime&format=json
Embed in HTML:
<img src="https://dalalai.com/api/v1/widget?type=regime" alt="DalalAI Market Regime" />
Available types: regime (market regime), stocks (stocks scored count), or any endpoint name.
| Code | HTTP | Message | Suggestion |
|---|---|---|---|
1001 | 401 | Missing or invalid API key | Include X-API-Key header |
1002 | 401 | Invalid or revoked API key | Check key or generate new one |
1003 | 401 | API subscription expired | Renew Developer plan |
1004 | 429 | Rate limit exceeded | Wait for Retry-After period |
1005 | 405 | Method not allowed | Use HTTP GET |
1006 | 403 | Trial quota exhausted | Subscribe for unlimited |
1007 | 429 | Daily quota exhausted | Upgrade plan or wait until midnight UTC |
2001 | 200 | Unknown resource | Call /api/v1 for endpoint list |
2002 | 404 | Stock not found | Use NSE symbol |
5001 | 502 | Data source unavailable | Retry in a few minutes |
5002 | 500 | Internal error | Report with X-Request-Id |
5003 | 503 | API temporarily disabled | Check status page |
Rate limits are tier-based:
| Tier | Req/min | Req/day | API Keys |
|---|---|---|---|
| Free | 5 | 10 | 1 |
| Starter (₹1,999/mo) | 100 | 5,000 | 3 |
| Pro (₹9,999/mo) | 500 | 50,000 | 10 |
| Enterprise (₹24,999/mo) | 1,000 | 1,00,000 | 20 |
| Trial | 5 | 25 total lifetime | 1 |
Every response includes rate limit headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 27
X-RateLimit-Reset: 1710403260
X-Request-Id: a1b2c3d4-e5f6-...
X-Data-Age-Hours: 3.2
When rate limited (HTTP 429), the Retry-After header indicates seconds to wait.
The X-Data-Age-Hours header shows how old the underlying data is. The meta.warnings array will contain a staleness warning if data is older than 26 hours.
No library to install — just requests. Here's a production-ready wrapper:
import requests
from typing import Optional
class DalalAI:
BASE = "https://dalalai.com/api/v1"
def __init__(self, api_key: str):
self.session = requests.Session()
self.session.headers["X-API-Key"] = api_key
self._etags = {}
def _get(self, endpoint: str, params: Optional[dict] = None):
url = f"{self.BASE}/{endpoint}"
headers = {}
if url in self._etags:
headers["If-None-Match"] = self._etags[url]
r = self.session.get(url, params=params, headers=headers, timeout=15)
if r.status_code == 304:
return None # data unchanged
r.raise_for_status()
if "ETag" in r.headers:
self._etags[url] = r.headers["ETag"]
return r.json()["data"]
def stocks(self, sort=None, filter=None, fields=None, page=1, limit=50):
p = {"page": page, "limit": limit}
if sort: p["sort"] = sort
if filter: p["filter"] = filter
if fields: p["fields"] = fields
return self._get("stocks", p)
def regime(self):
return self._get("regime")
def batch(self, endpoints: list):
return self._get("batch", {"endpoints": ",".join(endpoints)})
def widget(self, type="regime", format="json"):
return self._get("widget", {"type": type, "format": format})
# Usage:
api = DalalAI("dalalai_YOUR_KEY_HERE")
top = api.stocks(sort="-DVM_Score", filter="DVM_Score>80", fields="Symbol,CMP,DVM_Score", limit=10)
regime = api.regime()
multi = api.batch(["stocks", "regime", "breadth"])
Try any endpoint live. Enter your API key (or use the trial endpoint) and hit Send.
// Response will appear here // Try clicking a Quick button above ↑
| ?symbol=RELIANCE | Filter by NSE symbol (returns single stock object) |
| ?sort=-DVM_Score | Sort by any field. Prefix - for descending. |
| ?filter=DVM_Score>80 | Filter with operators: > < >= <= = != |
| ?fields=Symbol,CMP | Return only specified fields (reduce payload) |
| ?page=1&limit=50 | Pagination. Default: page 1, limit 50. Max limit: 100. |
// Response shape (paginated):
{
"data": {
"stocks": [{ "Symbol": "MAHABANK", "DVM_Score": 87.4, "AI_Rating": "Strong Buy", ... }],
"total": 799, "page": 1, "limit": 50,
"regime": { "state": "RANGING", ... }
},
"meta": { "pagination": { "page": 1, "limit": 50, "total": 799, "pages": 16 }, ... }
}
// Response shape (single stock):
{
"data": { "stock": { "Symbol": "RELIANCE", "DVM_Score": 44.7, ... } }
}
{
"data": {
"regime": { "state": "RANGING", "confidence": 0.72, ... },
"summary": { "stocks_scored": 799, "avg_convergence": 53.8, ... },
"timestamp": "2026-03-14 07:32:40"
}
}
{
"data": {
"top_20": [{ "symbol": "MAHABANK", "convergence_score": 87.4, "signal_strength": "very_high_convergence", ... }],
"summary": { "stocks_scored": 799, "very_high_count": 19, "avg_convergence": 53.8 },
"regime": "RANGING"
}
}
Quantitative analytics, microstructure, multi-factor scoring, and institutional-grade tooling. Auto-registered data endpoints.
Higher-level endpoints that compose multiple ML models and analytics into unified, actionable responses. All v2 endpoints require authentication.
{
"symbol": "RELIANCE",
"lstm_forecast": { "direction": "UP", "magnitude": 2.3, ... },
"conformal_intervals": { "5d": { "lower": 2780, "upper": 2950 }, ... },
"ai_signal": { "ensemble_action": "BUY", "ensemble_confidence": 0.82, "models": { ... } },
"cmp": 2856.45
}
{
"symbol": "MAHABANK",
"votes": { "RandomForest": { "action": "BUY", "probability": 0.87 }, ... },
"consensus": { "action": "BUY", "agreement_pct": 83.3, "buy_votes": 5, "sell_votes": 1, "hold_votes": 0 },
"lstm": { ... }, "gnn_peer_boost": { ... }
}
| ?signal=BUY | Filter by ensemble signal |
| ?min_convergence=70 | Minimum convergence score (0-100) |
| ?min_confidence=80 | Minimum AI confidence % |
| ?sentiment=positive | Filter by news sentiment |
| ?limit=20 | Max results (1-100, default 20) |
| ?limit=20 | Max results (1-100, default 20) |
{
"symbol": "RELIANCE",
"feature_count": 70,
"features": { "RSI": 58.3, "MACD": 12.7, "ADX": 34.2, "ATR_pct": 1.8, ... },
"metadata": { "Symbol": "RELIANCE", "Sector": "Energy" }
}
| ?symbols=RELIANCE,TCS,INFY | Comma-separated symbols (max 50, required) |
| ?symbol=RELIANCE | Focal stock (optional — omit for full graph overview) |
| ?top_n=10 | Top-N correlated peers (1-50, default 10) |
High-value endpoints targeting FIIs, HNIs, institutional investors, and retail brokers. Each composes multiple data assets into institutional-grade intelligence. Pro Enterprise
{
"institutional_bias": "Bullish",
"fii_dii": { "fii_net_cr": 1247.3, "dii_net_cr": 832.1, "combined_net_cr": 2079.4 },
"fii_long_short_ratio": 1.42,
"participant_oi": { ... }, "fpi_stock_holdings": { ... }, "smart_money": { ... }
}
| ?limit=50 | Max deals to return (1-200, default 50) |
| ?limit=30 | Top N stocks (1-100, default 30) |
{
"symbol": "NIFTY",
"unusual_activity": { ... },
"oi_heatmap": { ... },
"put_call_ratio": 0.87,
"vix": { "level": 14.2, "label": "Normal" },
"options_chain_summary": { "max_pain": 22500, "total_ce_oi": 1234567, "total_pe_oi": 987654 }
}
{
"symbol": "RELIANCE",
"risk_flags": ["High promoter pledge: 22.5%", "2 SEBI takeover filing(s)"],
"insider_transactions": [ ... ],
"promoter_holding": { ... }, "promoter_pledge": { ... },
"shareholding_pattern": { ... }, "sebi_takeover_filings": [ ... ]
}
| ?limit=50 | Max items per category (1-200, default 50) |
| ?scenario=rate_hike | Scenario: rate_hike, crash_10pct, fii_exit, vix_spike, global_selloff |
21 new endpoints that unlock webhooks, streaming, custom factor building, historical snapshots, execution quality, and explainable AI for institutional B2B clients. Pro Enterprise
?events=regime_change,breakout_signal.(Momentum_Score * 0.6) + (Quality_Score * 0.4) and get CAGR, Sharpe, max drawdown, and top-ranked stocks.?date=2026-03-20&symbol=RELIANCE.?severity=critical or ?alert_type=regime_change.High-value composite endpoints that combine 10+ ML model outputs into actionable intelligence. Cross-model consensus, accuracy-weighted predictions, and full explainability. Pro Enterprise
?min_confidence=0.7&limit=20.?days=30&model=LSTM.{
"data": {
"status": "ok",
"uptime": true,
"dataSource": "ok",
"endpoints": 409,
"rateLimit": "tier-based"
}
}
{
"data": {
"gate": "PASS",
"summary": "Quality Gate: PASS — 21/21 passed",
"stats": { "total": 21, "passed": 21, "warned": 0, "failed": 0 },
"files": [
{ "file": "dvm_scores.json", "status": "PASS", "age_hours": 3.2, "record_count": 806 },
...
]
}
}
{
"tier": "PRO",
"rate_limits": { "daily_calls": 50000, "per_minute": 500 },
"quotas": { "keys": 10, "webhooks": 25, "historical_days": 1825 },
"all_tiers": { "free": { ... }, "starter": { ... }, "pro": { ... }, "enterprise": { ... } },
"upgrade_url": "https://dalalai.com/b2b#pricing"
}
These endpoints manage API keys, webhooks, and organizations. They require Firebase Authentication (Bearer token) or a valid API key depending on the endpoint.
POST /api/manageApiKeys — Requires Firebase Auth token in Authorization header + App Check.
action field in the JSON body.| generate_trial | Generate a free trial key (25 calls, 3 days). One per account. |
| generate | Generate a new API key. Requires active B2B subscription. Keys are SHA-256 hashed in storage — save the raw key immediately. |
| list | List all your API keys (active + last 10 revoked) with usage stats and tier info. |
| revoke | Revoke a key by keyId. Atomic transaction decrements active key count. |
| rotate | Rotate a key: atomically revokes old key and creates a new one. 5-minute grace period for the old key. |
| get_usage | Returns 7-day usage sparkline data (daily call counts across all your keys). |
// Generate a trial key
POST /api/manageApiKeys
Authorization: Bearer {firebase_id_token}
{ "action": "generate_trial" }
// Response
{
"success": true,
"apiKey": "dalalai_a1b2c3d4...",
"prefix": "dalalai_a1b2c3d4",
"trial": true,
"limits": { "calls": 25, "expiresAt": "2026-03-26T..." }
}
Manage webhook subscriptions for real-time event push notifications. Requires API key via X-API-Key header. Starter tier and above.
?action=health for delivery stats + dead letter queue, or ?action=deadletters for paginated DLQ.POST /api/webhooks
X-API-Key: dalalai_your_key
{
"url": "https://your-server.com/webhook",
"events": ["regime_change", "breakout_signal", "earnings_surprise"],
"secret": "optional-signing-secret"
}
// Response: { "id": "wh_abc123", "url": "...", "events": [...], "active": true }
Supported events: regime_change, breakout_signal, convergence_spike, earnings_surprise,
insider_trade, fii_flow_reversal, portfolio_alert, price_target_hit, vix_spike, block_deal
Delivery: HMAC-SHA256 signed payloads (X-DalalAI-Signature: sha256=...), exponential backoff retries (1s/5s/15s), auto-disabled after 10 consecutive failures, dead letter queue with 7-day retention.
{ "action": "retry", "deadLetterId": "..." } or { "action": "purge_deadletters" }.Multi-user organizations with RBAC. Enterprise tier only. Requires API key via X-API-Key.
action field in the JSON body:| create | Create an org. Body: { "name": "Acme Corp", "gstin": "optional" }. One org per user. |
| get | Get org details including all members and their roles. |
| invite | Invite a member by email. Body: { "email": "[email protected]", "role": "developer" }. Roles: admin, developer, viewer. |
| accept_invite | Accept an invitation. Body: { "orgId": "...", "inviteId": "..." } |
| remove_member | Remove a member (admin only). Cannot remove org owner. |
| update_role | Change a member's role (admin only). |
| ip_whitelist | Set org IP whitelist (up to 50 IPs). Body: { "ips": ["1.2.3.4", "5.6.7.8"] } |
| usage | Org-wide usage analytics (aggregated across all members' keys). |
DalalAI uses additive versioning. v1/v2/v3 are concurrently supported. No endpoint is removed without at least 12 months notice via:
Deprecation: true response header when an endpoint is scheduled for removalSunset: Sat, 31 Mar 2027 23:59:59 GMT header with the exact removal dateCurrent status: All v1, v2, and v3 endpoints are stable. No deprecations are currently scheduled. v1 is guaranteed through at least March 31, 2027.
Every endpoint is gated to a minimum tier. Higher tiers inherit all endpoints from lower tiers. This table shows what each pricing plan unlocks.
| Category | Free ₹0 |
Starter ₹1,999/mo |
Pro ₹9,999/mo |
Enterprise ₹24,999/mo |
|---|---|---|---|---|
| Core stock data DVM scores, tech data, regime, signal accuracy, history |
5 | ✓ | ✓ | ✓ |
| Market overview Morning briefing, daily digest, NSE holidays, global cues |
4 | ✓ | ✓ | ✓ |
| Portfolio & discovery Portfolio health, trending/smart/graduated discovery |
5 | ✓ | ✓ | ✓ |
| Institutional & fundamental FII/DII, advisory, earnings, quarterlies |
5 | ✓ | ✓ | ✓ |
| Derivatives & technicals Options, futures, breakout, volume shockers, RSI |
6 | ✓ | ✓ | ✓ |
| Free tier subtotal | ~30 | ✓ | ✓ | ✓ |
| All v1 data endpoints Analytics, alternative data, ML models, predictions, alerts, screeners, sentiment (275 additional) |
— | 305 | ✓ | ✓ |
| Starter tier subtotal | — | 306 | ✓ | ✓ |
| v2 Composite APIs Stock forecast, DNA, AI consensus, risk score, trade plan, screener, market pulse, portfolio X-ray, earnings edge, etc. |
— | — | 38 | ✓ |
| v2 ML Intelligence ML consensus, prediction confidence, stock intelligence, circuit breaker risk, earnings edge ML |
— | — | 5 | ✓ |
| v3 Select premium Macro dashboard, index rebalance, stress test, attribution, stress scenarios, explainable alerts |
— | — | 6 | ✓ |
| v3 B2B features Webhooks, SSE streaming, factor builder, timeseries snapshots |
— | — | 7 | ✓ |
| Pro tier subtotal | — | — | 369 | ✓ |
| v3 Premium institutional Institutional flow, FII sector rotation, block deal intel, smart money, options flow/strategy, insider radar, regulatory, ESG, IPO, overnight risk, event catalyst, flow heatmap, derivatives intel |
— | — | — | 14 |
| v3 Premium advanced Risk cockpit, portfolio construction, MLOps health, prediction stack, regime intelligence, volatility lab, alpha lab, quant screener, India macro pulse, India NLP trends |
— | — | — | 10 |
| v3 B2B enterprise exclusives Multi-asset risk, execution quality, fund flow prediction, conviction decay |
— | — | — | 4 |
| v2 Enterprise developer Quant risk attribution, execution planner, market integrity, regulatory dashboard, anomaly radar |
— | — | — | 5 |
| v3 ML Intelligence enterprise ML health dashboard, alpha signals, accuracy trends, ensemble explainer, risk/return matrix |
— | — | — | 5 |
| Enterprise tier total | — | — | — | 409 |
| Limit | Free | Starter | Pro | Enterprise |
|---|---|---|---|---|
| Daily API calls | 10 | 5,000 | 50,000 | 1,00,000 |
| Requests/min | 5 | 100 | 500 | 1,000 |
| API keys | 1 | 3 | 10 | 20 |
| Webhooks | 0 | 3 | 25 | 50 |
| Historical depth | 30 days | 1 year | 5 years | 10 years |
| SLA | — | 99.5% | 99.9% | 99.99% |
| Endpoints | ~30 | 306 | 369 | 409 |
Tier is resolved from your API key via Firestore. Use GET /api/v1/tier-info to check your current tier and quotas programmatically. Response headers include X-API-Tier, X-RateLimit-Daily, and X-RateLimit-PerMinute on every request.
API subscriptions are market-specific. A subscription on dalalai.com covers Indian market endpoints; us.dalalai.com covers US market endpoints.
Multi-provider LLM router with 6 AI providers, smart routing by query complexity, and automatic fallback. Use your DalalAI API key to access AI completions for financial analysis. Enterprise
Authenticate with your DalalAI API key via the X-API-Key header:
curl -X POST https://dalalai.com/b2bAiApi \
-H "X-API-Key: dalalai_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"systemPrompt": "You are a financial analyst.",
"userMessage": "Analyze TCS Q4 results",
"stream": false,
"genConfig": { "temperature": 0.5, "maxTokens": 1024 }
}'
| Field | Type | Required | Description |
|---|---|---|---|
userMessage | string | Yes | The user's query or instruction |
systemPrompt | string | No | System-level instructions for the AI (default: general assistant) |
stream | boolean | No | If true, response is streamed as Server-Sent Events (SSE) |
genConfig.temperature | number | No | Sampling temperature (0-1). Default: 0.5 |
genConfig.maxTokens | number | No | Maximum output tokens. Default: 1024, max: 2048 |
{
"text": "TCS reported strong Q4 results with...",
"provider": "groq",
"model": "llama-3.3-70b-versatile",
"latencyMs": 842,
"usage": { "estimatedTokens": 256 }
}
When stream: true, the response is streamed as SSE events in Gemini format:
data: {"candidates":[{"content":{"parts":[{"text":"TCS "}],"role":"model"}}]}
data: {"candidates":[{"content":{"parts":[{"text":"reported "}],"role":"model"}}]}
data: [DONE]
30 requests per minute per API key. Additional tier-based limits from your subscription plan apply.
import requests
resp = requests.post("https://dalalai.com/b2bAiApi", headers={
"X-API-Key": "dalalai_your_key",
"Content-Type": "application/json"
}, json={
"systemPrompt": "You are a stock market analyst for Indian equities.",
"userMessage": "What are the top 3 momentum stocks today?",
"genConfig": {"temperature": 0.3, "maxTokens": 512}
})
print(resp.json()["text"])
| HTTP | Meaning |
|---|---|
| 401 | Missing or invalid API key |
| 400 | userMessage field is required |
| 429 | Rate limit exceeded (30/min per key) |
| 502 | All AI providers temporarily unavailable |
Import the ready-made Postman collection to test all endpoints instantly:
After importing, set the api_key variable in your Postman environment to your API key.
/api/v1/tier-info — self-service tier/quota check?fields=Symbol,CMP — reduce response payload?sort=-DVM_Score — server-side sorting?filter=DVM_Score>80 — multi-clause filtering/api/v1/batch?endpoints=stocks,regime — up to 5 in one call304 Not Modified for bandwidth-efficient polling/api/v1/widget?type=regime — SVG badgesdata, meta, error)X-RateLimit-*) and request tracing (X-Request-Id)/api/v1/healthView full changelog → | RSS Feed
Ready to build?
Start with a free trial key or subscribe for full access.
Subscribe — ₹1,999/mo Open Dashboard