> ## Documentation Index
> Fetch the complete documentation index at: https://casparser.in/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Cases

> Real-world applications of CAS Parser across fintech, wealth management, and financial services.

Used by **100+ companies** across portfolio tracking, wealth management, credit underwriting, and tax filing.

## Setup

Every example below uses this helper so the API call isn't repeated each time. CAS Parser is a plain REST API — there is no client library to install beyond `requests`.

```python theme={null}
import requests

API_KEY = "YOUR_API_KEY"          # or "sandbox-with-json-responses" to test
BASE_URL = "https://api.casparser.in"
HEADERS = {"x-api-key": API_KEY}


def parse_cas(pdf_file, password):
    """Parse a CAS PDF and return the unified JSON response."""
    response = requests.post(
        f"{BASE_URL}/v4/smart/parse",
        headers=HEADERS,
        files={"file": pdf_file},
        data={"password": password},
        timeout=60,
    )
    response.raise_for_status()
    return response.json()
```

> [!NOTE]
>
> Functions like `calculate_allocation` or `assess_eligibility` in the examples are **your** business logic, not part of the API. Only the `requests` calls are real.

## Portfolio Tracking Apps

### Challenge

Users have investments across multiple platforms (Zerodha, Groww, Kuvera, etc.). Manually entering transaction history is tedious and error-prone.

### Solution

Let users upload their CAS PDF to import their entire portfolio history in seconds.

### Implementation

```python theme={null}
# User uploads CAS PDF
cas_data = parse_cas(pdf_file, password)

# Import to your database
for folio in cas_data['mutual_funds']:
    for scheme in folio['schemes']:
        for txn in scheme['transactions']:
            db.insert_transaction({
                'user_id': user.id,
                'date': txn['date'],
                'scheme': scheme['scheme'],
                'amount': txn['amount'],
                'units': txn['units'],
                'nav': txn['nav']
            })
```

### Benefits

* **70% faster onboarding** — Import years of data in seconds
* **100% accurate** — No manual entry errors
* **Better UX** — Users see complete portfolio immediately

### Customers

Angel One, Neo Wealth, Dezerv

***

## Wealth Management Platforms

### Challenge

Advisors need to understand client portfolios before making recommendations. Clients often have scattered investments across 5-10 platforms.

### Solution

Request CAS via KFintech API, parse automatically, and generate consolidated reports.

### Implementation

```python theme={null}
# Step 1: Request CAS generation. With cas_authority="cams" the PDF password
# rule allows a PAN, so you don't need to store a separate secret.
requests.post(
    f"{BASE_URL}/v4/generate",
    headers=HEADERS,
    json={
        "email": client.email,
        "pan_no": client.pan,
        "from_date": "2020-01-01",
        "to_date": "2024-12-31",
        "password": client.pan,
        "cas_authority": "cams",
    },
    timeout=60,
).raise_for_status()

# Step 2: Client receives CAS in email, uploads to portal
# Step 3: Parse and analyze
cas_data = parse_cas(pdf_file, client.pan)

# Generate asset allocation report
allocation = calculate_allocation(cas_data)
recommendations = generate_recommendations(allocation, client.risk_profile)
```

### Benefits

* **Comprehensive view** — All investments in one place
* **Faster advice** — Automated portfolio analysis
* **Better decisions** — Data-driven recommendations

### Customers

Grip Invest, KFintech

***

## Advisor & Distributor Onboarding

### Challenge

Platforms and networks that onboard financial advisors and mutual fund distributors must confirm each one is genuinely registered — an RIA with SEBI, a distributor with AMFI — and hasn't been suspended or terminated. Checking the regulators' websites by hand doesn't scale.

### Solution

Verify a registration number against the official register in one API call, before onboarding. `verified` gates the decision, and suspended or terminated distributors are flagged — not just reported as "not found".

### Implementation

```python theme={null}
# Verify a SEBI Registered Investment Adviser (category auto-detected from the number)
ria = requests.post(
    f"{BASE_URL}/v1/verify/sebi",
    headers=HEADERS,
    json={"registration_number": "INA000000888"},
    timeout=30,
).json()

if not ria["verified"]:
    reject(f"Not an active RIA — {ria['registration_status']}")

# Verify a mutual fund distributor by ARN, with AMFI adverse-list screening
mfd = requests.post(
    f"{BASE_URL}/v1/verify/mfd",
    headers=HEADERS,
    json={"arn": "89762"},
    timeout=30,
).json()

if mfd["registration_status"] in ("SUSPENDED", "TERMINATED"):
    escalate(f"ARN on AMFI {mfd['registration_status']} list")
```

### Benefits

* **Compliant onboarding** — Confirm SEBI/AMFI registration before granting access
* **Catch bad actors** — Suspended and terminated distributors are flagged automatically
* **Zero manual lookups** — One call replaces checking the regulators' portals by hand

***

## Tax Filing Platforms

### Challenge

Calculating capital gains requires transaction-level data. Users don't have organized records.

### Solution

Parse CAS to extract all buy/sell transactions, calculate FIFO/LIFO gains automatically.

### Implementation

```python theme={null}
cas_data = parse_cas(pdf_file, password)

# Extract equity transactions
equity_txns = []
for account in cas_data['demat_accounts']:
    for equity in account['equities']:
        for txn in equity.get('transactions', []):
            equity_txns.append({
                'isin': equity['isin'],
                'date': txn['date'],
                'type': txn['type'],
                'quantity': txn['quantity'],
                'price': txn['price']
            })

# Calculate capital gains
gains = calculate_capital_gains(equity_txns, method='FIFO')
```

### Benefits

* **Accurate ITR** — No missed transactions
* **Time savings** — Automated gain calculation
* **Audit trail** — Complete transaction history

***

## Credit Underwriting

### Challenge

Verifying borrower's financial status requires authentic portfolio data. Self-reported data is unreliable.

### Solution

Request CAS directly from CDSL via OTP, verify authenticity, assess creditworthiness.

### Implementation

```python theme={null}
# Step 1: Request OTP from CDSL (pan, bo_id and dob are all required)
session = requests.post(
    f"{BASE_URL}/v4/cdsl/fetch",
    headers=HEADERS,
    json={"pan": borrower.pan, "bo_id": borrower.bo_id, "dob": borrower.dob},
    timeout=50,
).json()

# Step 2: Borrower enters the OTP sent to their registered mobile
files = requests.post(
    f"{BASE_URL}/v4/cdsl/fetch/{session['session_id']}/verify",
    headers=HEADERS,
    json={"otp": otp},
    timeout=60,
).json()["files"]

# Step 3: Parse the returned URL and assess
cas_data = requests.post(
    f"{BASE_URL}/v4/smart/parse",
    headers=HEADERS,
    json={"pdf_url": files[0], "password": borrower.pan},
    timeout=60,
).json()

# Calculate credit score factors
total_portfolio_value = cas_data['summary']['total_value']
equity_exposure = calculate_equity_percentage(cas_data)
loan_eligibility = assess_eligibility(total_portfolio_value, equity_exposure)
```

### Benefits

* **Tamper-proof** — Direct from depository
* **Real-time** — Instant verification
* **Accurate** — No self-reporting bias

***

## Financial Research

### Challenge

Analyzing investment trends requires aggregated portfolio data. Individual CAS files are unstructured.

### Solution

Parse thousands of CAS files, aggregate data, identify patterns.

### Implementation

```python theme={null}
import statistics
from collections import Counter

results = []
for cas_file, password in cas_files:
    data = parse_cas(cas_file, password)

    # A CAS may hold zero demat accounts (mutual-fund-only investors),
    # so flatten across accounts rather than indexing into the first one.
    equities = [e for acc in data['demat_accounts'] for e in acc['equities']]

    results.append({
        'total_value': data['summary']['total_value'],
        'equities': equities,
        'mf_count': sum(len(f['schemes']) for f in data['mutual_funds']),
    })

# Aggregate insights
avg_portfolio_value = statistics.mean(r['total_value'] for r in results)
popular_stocks = Counter(
    e['isin'] for r in results for e in r['equities']
).most_common(10)
```

### Benefits

* **Large-scale analysis** — Process thousands of CAS files
* **Market insights** — Identify trends and patterns
* **Research reports** — Data-driven publications

***

## Robo-Advisors

### Challenge

Providing personalized advice requires understanding current portfolio allocation.

### Solution

Parse CAS, analyze allocation, suggest rebalancing.

### Implementation

```python theme={null}
cas_data = parse_cas(pdf_file, password)

# Current allocation
current = {
    'equity': calculate_equity_value(cas_data),
    'debt': calculate_debt_value(cas_data),
    'gold': calculate_gold_value(cas_data)
}

# Target allocation (based on risk profile)
target = {'equity': 0.6, 'debt': 0.3, 'gold': 0.1}

# Rebalancing suggestions
suggestions = generate_rebalancing_plan(current, target)
```

### Benefits

* **Personalized advice** — Based on actual holdings
* **Automated rebalancing** — Data-driven suggestions
* **Better outcomes** — Optimized portfolios

***

## Insurance Platforms

### Challenge

Assessing insurance needs requires knowing existing coverage and assets.

### Solution

Parse CAS to extract insurance policies and portfolio value, recommend coverage.

### Implementation

```python theme={null}
cas_data = parse_cas(pdf_file, password)

# Extract existing insurance
existing_coverage = sum(p['sum_assured'] for p in cas_data['insurance'])

# Calculate recommended coverage
portfolio_value = cas_data['summary']['total_value']
recommended_coverage = portfolio_value * 10  # 10x rule

# Gap analysis
coverage_gap = recommended_coverage - existing_coverage
```

### Benefits

* **Accurate needs** — Based on real assets
* **Gap identification** — Underinsured users
* **Cross-sell** — Targeted recommendations

***

## Get Started

> [card] [Start Free](https://app.casparser.in)
>
> 10 free credits. No credit card.

> [card] [Speak to an Engineer](https://cal.com/sameer-kumar/casparser-1-1-with-sameer)
>
> Have questions? Jump on a quick call.

> [card] [API Reference](https://casparser.in/docs/api-reference)
>
> Explore all endpoints


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.