# CASParser > Portfolio Import API for India - parse CAS PDFs, contract notes, and portfolio documents into structured JSON. ## 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. ## Capabilities - Parse CAS PDFs into structured JSON (auto-detects CDSL/NSDL/CAMS/KFintech) - Parse broker contract notes (Zerodha, Groww, Upstox, ICICI) - Fetch real-time demat holdings from CDSL via OTP - Generate CAS statements via KFintech (any date range, up to 50+ years of transaction history) - Import CAS files from Gmail inbox via OAuth - Inbound Email — investors forward CAS to a dedicated email, webhook delivers parsed data - Portfolio Links — branded upload pages (link.casparser.in/your-company), no code needed - White-label Portfolio Connect UI SDK (works with any frontend — React, Vue, Angular, or vanilla JS) ## 9 Asset Classes Supported 1. Equities (Demat) - CDSL, NSDL 2. Mutual Funds (Demat) - CDSL, NSDL, CAMS, KFintech 3. Mutual Funds (Non-Demat) - CDSL, NSDL, CAMS, KFintech 4. Alternative Investment Funds (AIFs) 5. Corporate Bonds 6. Government Securities (G-Secs, SDLs, T-Bills) 7. Life Insurance (Demat) 8. National Pension System (NPS) 9. Contract Notes (Broker trades) ## API Quick Start Base URL: https://api.casparser.in Legacy URL: https://portfolio-parser.api.casparser.in (still supported) Auth: x-api-key header Sandbox key: sandbox-with-json-responses (returns sample data, no signup needed) Docs: https://casparser.in/docs OpenAPI Spec: https://api.casparser.in/openapi.json ### Parse a CAS PDF ``` POST /v4/smart/parse Content-Type: multipart/form-data x-api-key: YOUR_API_KEY pdf_file: password: ``` ### Response Format (unified across all CAS types) ```json { "status": "success", "meta": { "cas_type": "CDSL" }, "investor": { "name": "...", "pan": "..." }, "summary": { "total_value": 2500000 }, "demat_accounts": [...], "mutual_funds": [...], "insurance": [...], "nps": [...] } ``` ## Credit Pricing - CAS Parsing: 1.0 credit - Contract Note Parsing: 0.5 credits - CAS Generator (Mutual Funds): 0.5 credits - CDSL OTP Fetch: 0.5 credits - Gmail Inbox Pull: 0.2 credit per file - Inbound Email: 0.2 credits per processed email - Free tier: 10 credits/month (no credit card) - Paid plans from INR 999/month - Enterprise: on-premise deployment, unlimited parsing, custom SLA ## SDKs & Integrations - Python: `cas-parser-python` (pip) - Node.js/TypeScript: `cas-parser-node` (npm) - auto-generated from OpenAPI spec - Frontend: `@cas-parser/connect` (npm) - Portfolio Connect UI SDK - MCP Server: `cas-parser-node-mcp` (npm) - 17 tools for AI agents - Agent Toolkit: `npx skills add casparser/agent-toolkit` ## Timeouts - CAS / Contract Note Parsing: 60s - CDSL OTP Fetch: 50s (includes captcha solving) - Access Tokens / Credits: 10s ## Error Format ```json { "status": "error", "msg": "Human-readable error message" } ``` 400/401/403 = not retryable (fix request) 500/502/503 = retryable (exponential backoff: 1s, 2s, 4s) ## Links - Website: https://casparser.in - App: https://app.casparser.in - Docs: https://casparser.in/docs - Full Context for LLMs: https://casparser.in/llms-full.txt - GitHub: https://github.com/CASParser - Agent Toolkit: https://github.com/CASParser/agent-toolkit - Portfolio Connect Demo: https://connect.casparser.in - Ask AI (PortfolioGPT): https://chatgpt.com/g/g-698778fc35f881919a8e57c537e211c6-india-portfoliogpt-powered-by-casparser