# CASParser - Portfolio Import API for India > The fastest way to import Indian investment portfolios. Parse CAS PDFs, contract notes, and portfolio documents into structured JSON. 9 asset classes. 5-minute integration. No regulatory approvals. Start at ₹999/month. ## What is CASParser? CASParser is an API platform that extracts structured data from Indian financial portfolio documents. It parses Consolidated Account Statements (CAS) from CDSL, NSDL, CAMS, and KFintech, plus broker contract notes from Zerodha, Groww, Upstox, and ICICI Direct. **Primary use case:** Fintech platforms, wealth managers, and advisors that need to import investor portfolio data programmatically — without building their own PDF parser or waiting months for Account Aggregator approval. **Key differentiator:** CASParser replaced MFcentral (shut down September 2025) for 100+ fintech platforms. It deploys in 5 minutes at ₹999/month with no regulatory approvals needed. ## Who Uses CASParser - **Fintech Platforms** (Dezerv, AngelOne, Scripbox): Replace MFcentral, add portfolio import in 5 minutes - **Wealth Managers**: Automate client onboarding, reduce time by 70% with Gmail inbox integration - **Advisors & MFDs**: White-label Portfolio Connect UI SDK for client portfolio consolidation - **HNI/UHNI Platforms**: All 9 asset classes, 50+ years of transaction history from CAMS/KFintech - **Developers & AI Agents**: REST API, SDKs, MCP server with 17 tools ## 9 Asset Classes Supported 1. **Equities (Demat)** — CDSL, NSDL. Stock holdings with ISIN, company name, units, market value, transaction history. 2. **Mutual Funds (Demat)** — CDSL, NSDL, CAMS, KFintech. Demat MF holdings with scheme name, units, current value. 3. **Mutual Funds (Non-Demat)** — CDSL, NSDL, CAMS, KFintech. Complete MF history with NAV, cost, unrealized gain, 50+ years of transactions. 4. **Alternative Investment Funds (AIFs)** — CDSL, NSDL. AIF holdings for HNI portfolios. 5. **Corporate Bonds** — CDSL, NSDL. Bond holdings with ISIN, issuer, coupon rate, maturity date. 6. **Government Securities (G-Secs)** — CDSL, NSDL. Gilts, SDLs, T-Bills. 7. **Life Insurance Policies** — CDSL, NSDL. Policy number, provider, sum assured, premium details. 8. **NPS (National Pension System)** — CDSL, NSDL. PRAN, fund-level breakdown, Tier 1 and Tier 2. 9. **Contract Notes** — Zerodha, Groww, Upstox, ICICI. Broker trade documents with equity/derivatives transactions and charges. ## Core Features ### CAS Parser API - Auto-detects CAS type (CDSL/NSDL/CAMS/KFintech) via `/v4/smart/parse` - Unified response format regardless of CAS type - 97% parsing accuracy - Supports file upload (multipart/form-data) or URL input - Password: typically encrypted PAN of the investor ### Portfolio Connect UI SDK - Drop-in UI modal (`@cas-parser/connect` on npm) - White-label UI — works under your brand - Handles file upload, Gmail inbox import, CDSL OTP fetch — all in one modal - Works with any frontend — React, Next.js, Vue, Angular, or vanilla HTML/JS (via UMD bundle) - Generate access tokens from backend via `POST /v1/token` ### Gmail Inbox Integration - One-time read-only OAuth consent with infinite validity, restricted to CAS sender emails only - Automatically finds CAS statements from CDSL, NSDL, CAMS, KFintech - No password sharing required - Download URLs valid for 24 hours ### CAS Generator (Mutual Funds) - Automate CAS statement requests via CAMS/KFintech for any date range - Up to 50+ years of transaction history - Async email mailback — PDF sent to investor's registered email - Endpoint: `POST /v4/kfintech/generate` ### CDSL OTP Fetch - Fetch real-time demat holdings directly from CDSL - 2-step OTP flow: request → verify - Step 1: `POST /v4/cdsl/fetch` (takes ~15-20s for captcha solving, returns session_id) - Step 2: `POST /v4/cdsl/fetch/{session_id}/verify` (submit OTP, get download URLs) ### Contract Note Parser - Auto-detects broker format (Zerodha, Groww, Upstox, ICICI) - Equity and derivatives transactions - Charges summary: STT, GST, stamp duty, brokerage - Endpoint: `POST /v4/contract_note/parse` ### Inbound Email (Email Forwarding) - Create dedicated email addresses (e.g., `ie_xxx@import.casparser.in`) for investors to forward CAS to - Only processes emails from verified CAS authorities (CDSL, NSDL, CAMS, KFintech) - Webhook delivers parsed data to your `callback_url` - Presigned download URLs expire in 48 hours - Endpoints: `POST /v4/inbound-email`, `GET /v4/inbound-email`, `DELETE /v4/inbound-email/{id}` - 0.2 credits per successfully processed email ### Portfolio Links (No-Code) - Branded portfolio collection pages: `link.casparser.in/your-company` - Share via WhatsApp, email, or SMS — clients upload CAS, you get parsed data via email - Zero code, zero integration required - Manage at https://app.casparser.in/portfolio-links ## API Reference **Base URL:** `https://api.casparser.in` **Legacy URL:** `https://portfolio-parser.api.casparser.in` (still supported for backward compatibility) **Authentication:** `x-api-key: YOUR_API_KEY` header on all requests **Sandbox key:** `sandbox-with-json-responses` (returns sample data, no signup needed) **Full docs:** https://casparser.in/docs **OpenAPI spec:** https://api.casparser.in/openapi.json ### Key Endpoints | Endpoint | Description | |----------|-------------| | `POST /v4/smart/parse` | Parse any CAS PDF (auto-detects type) | | `POST /v4/cdsl/parse` | Parse CDSL eCAS specifically | | `POST /v4/nsdl/parse` | Parse NSDL eCAS specifically | | `POST /v4/cams_kfintech/parse` | Parse CAMS/KFintech CAS specifically | | `POST /v4/contract_note/parse` | Parse broker contract notes | | `POST /v4/kfintech/generate` | CAS Generator - request CAS via CAMS/KFintech (async mailback) | | `POST /v4/cdsl/fetch` | Initiate CDSL OTP fetch (Step 1) | | `POST /v4/cdsl/fetch/{session_id}/verify` | Complete CDSL OTP fetch (Step 2) | | `POST /v4/inbox/connect` | Start Gmail OAuth flow | | `POST /v4/inbox/cas` | List CAS files from Gmail inbox | | `POST /v1/token` | Generate short-lived frontend access token | | `POST /v1/credits` | Check remaining credits | | `POST /v1/usage` | Usage logs | | `POST /v1/usage/summary` | Aggregated usage analytics | | `POST /v4/inbound-email` | Create inbound email address for CAS forwarding | | `GET /v4/inbound-email` | List all inbound email addresses | | `GET /v4/inbound-email/{id}` | Get a specific inbound email address | | `DELETE /v4/inbound-email/{id}` | Delete an inbound email address | | `POST /v4/inbox/disconnect` | Revoke Gmail OAuth access | ### Unified Response Format All CAS parse endpoints return the same structure: ```json { "status": "success", "meta": { "cas_type": "CDSL", "statement_period": { "from": "2024-01-01", "to": "2024-12-31" } }, "investor": { "name": "Investor Name", "pan": "ABCDE1234F", "email": "investor@example.com", "mobile": "9999999999", "address": "..." }, "summary": { "total_value": 2500000, "accounts": { "demat": { "count": 2, "total_value": 1500000 }, "mutual_funds": { "count": 15, "total_value": 800000 }, "insurance": { "count": 1, "total_value": 100000 }, "nps": { "count": 1, "total_value": 100000 } } }, "demat_accounts": [...], "mutual_funds": [...], "insurance": [...], "nps": [...] } ``` ### Error Format ```json { "status": "error", "msg": "Human-readable error message" } ``` - **400/401/403** — Not retryable. Fix the request (wrong password, invalid key, quota exceeded). - **500/502/503** — Retryable. Use exponential backoff: 1s, 2s, 4s. ## Credit Pricing | Operation | Credits | |-----------|---------| | CAS Parsing (smart/cdsl/nsdl/cams_kfintech) | 1.0 | | Contract Note Parsing | 0.5 | | CAS Generator (Mutual Funds) | 0.5 | | CDSL OTP Fetch | 0.5 | | Gmail Inbox Pull | 0.2 per file discovered | | Failed operations | 0 (never charged) | **Plans:** - Free: 10 credits/month, no credit card - Lite 50: ₹999/month, 50 credits - Pro 200: ₹3,500/month, 200 credits (most popular) - Ultra 750: ₹10,500/month, 750 credits - Enterprise: On-premise deployment, unlimited parsing, custom SLA ## Timeouts - CAS / Contract Note Parsing: **60 seconds** - CDSL OTP Fetch Step 1: **50 seconds** (includes captcha solving) - Access Tokens / Credits check: **10 seconds** ## SDKs & Integrations - **Python:** `cas-parser-python` (pip) — thin wrapper around REST API - **Node.js/TypeScript:** `cas-parser-node` (npm) - auto-generated from OpenAPI spec - **Portfolio Connect UI SDK:** `@cas-parser/connect` (npm) — drop-in modal - **MCP Server:** `cas-parser-node-mcp` (npm) — 17 tools for AI agents - **Agent Toolkit:** Templates and skills at https://github.com/CASParser/agent-toolkit ## Security - No data stored after processing — all parsed data discarded immediately - HTTPS-only transmission - Built-in fraud detection — rejects tampered/modified PDFs - India-hosted infrastructure for data sovereignty - Read-only Gmail access (OAuth scopes limited to search and read) ## Comparison vs Alternatives | | CASParser | Account Aggregator | MFcentral | Build In-House | |---|---|---|---|---| | Time to market | 5 minutes | 5-10 months | Shut down | 3-6 months | | Monthly cost | ₹999/mo | ₹5-25 lakhs+ setup | N/A | ₹10-50 lakhs+ | | Regulatory approval | None | Required | N/A | None | | Asset classes | 9 | All financial | MF only | Custom | | Gmail integration | Yes | No | No | No | | CAS Generator | Yes | No | No | No | | White-label UI | Yes | Limited | No | Custom build | ## Blog Posts - [Auto Generate CAS Statement from CAMS via API](https://casparser.in/blog/auto-generate-cams-cas-statement-api/) — API to automate CAS generation from CAMS, CDSL and NSDL without manual intervention. - [CAS Parser — Convert Mutual Fund CAS to CSV, Excel](https://casparser.in/blog/cas-parser-convert-mutual-fund-cas-to-csv-excel/) — Complete guide to CAS statements, NAV, ISIN, and converting CAS PDFs to CSV/Excel/JSON. - [MFcentral is Gone. Here's What You Should Do.](https://casparser.in/blog/mfcentral-alternative/) — Options for fintech platforms after MFcentral API shutdown. - [MFcentral Shutdown: What You Need to Know and What to Do](https://casparser.in/blog/mfcentral-shutdown-what-to-do/) — Detailed analysis of the shutdown and its impact. - [CASParser vs Account Aggregator: Speed, Cost, and Simplicity](https://casparser.in/blog/casparser-vs-account-aggregator/) — Detailed comparison of implementation time, cost, and features. - [Understanding CDSL, NSDL, CAMS, and KFintech CAS Formats](https://casparser.in/blog/understanding-cas-formats/) — Technical guide to different CAS types and data content. - [Automate Client Onboarding with Portfolio Connect UI SDK](https://casparser.in/blog/portfolio-connect-sdk-guide/) — Drop-in SDK integration guide for wealth managers. - [Portfolio API for AI Agents: Building with Claude, ChatGPT, and Gemini](https://casparser.in/blog/portfolio-api-for-ai-agents/) — Using CASParser with AI agents and MCP. - [Complete Guide to Indian Portfolio Data Extraction](https://casparser.in/blog/complete-guide-portfolio-data-extraction/) — End-to-end guide to parsing CAS statements and contract notes. - [State of Account Aggregator in 2026](https://casparser.in/blog/state-of-account-aggregator-2026/) — What founders actually need to know about AA adoption, coverage gaps, and alternatives. ## Important Links - Website: https://casparser.in - App / Portal: https://app.casparser.in - API Docs: https://casparser.in/docs - GitHub: https://github.com/CASParser - Agent Toolkit: https://github.com/CASParser/agent-toolkit - Portfolio Connect Demo: https://connect.casparser.in - npm (SDK): https://www.npmjs.com/package/@cas-parser/connect - npm (MCP): https://www.npmjs.com/package/cas-parser-node-mcp - PortfolioGPT (ChatGPT): https://chatgpt.com/g/g-698778fc35f881919a8e57c537e211c6-india-portfoliogpt-powered-by-casparser - Contact: sameer@casparser.in