API Documentation

Portfolio Parser API allows you to programmatically parse Indian investment portfolio statements and extract structured data.

Introduction

The Portfolio Parser API provides a simple REST interface to parse PDF statements from CAMS, KFintech, CDSL, and NSDL. Extract holdings, transactions, and investor details in JSON format.

Base URL

https://portfolio.parse.co.in/api/v1

Authentication

Currently, the API uses rate limiting based on IP address. For production use with higher limits, contact us for API key access.

Parse Statement

Upload and parse a portfolio statement PDF.

POST /parse/upload

Request

Send a multipart/form-data request with the following fields:

Parameter Type Required Description
file File Yes PDF file to parse (max 10MB)
password String No Password for encrypted PDFs

Example Request

curl -X POST https://portfolio.parse.co.in/api/v1/parse/upload \
  -F "file=@statement.pdf" \
  -F "password=yourpassword"

Example Response

{
  "success": true,
  "data": {
    "statement_type": "CAMS",
    "parser_version": "v2",
    "investor_details": {
      "name": "JOHN DOE",
      "pan": "ABCDE1234F",
      "email": "john@example.com",
      "mobile": "9876543210"
    },
    "portfolio_summary": {
      "total_market_value": 5000000,
      "total_cost_value": 4000000,
      "gain_loss": 1000000,
      "gain_loss_percentage": 25.0
    },
    "holdings": [
      {
        "scheme_name": "HDFC Equity Fund - Growth",
        "isin": "INF179K01014",
        "folio_number": "12345678",
        "current_units": 1000.5,
        "current_nav": 500.25,
        "stated_market_value": 500500.13
      }
    ],
    "transactions": [
      {
        "date": "01-Jan-2024",
        "description": "Purchase",
        "amount": 10000,
        "nav": 450.5,
        "units": 22.2,
        "unit_balance": 1000.5
      }
    ]
  }
}

Response Format

All responses follow this structure:

Field Type Description
success Boolean Whether the request succeeded
data Object Parsed statement data (on success)
error String Error message (on failure)

Supported Formats

  • CAMS - Consolidated Account Statement (detailed reports only)
  • KFintech - Consolidated Account Statement (detailed reports only)
  • CDSL - Demat holdings and MF statements
  • NSDL - Demat holdings and MF statements

Note: Summary reports are not supported. Only detailed CAS reports with transaction history are supported.

Rate Limits

Free tier limits:

  • 10 requests per day per IP address
  • Maximum file size: 10MB

For production use with higher limits and API keys, please contact us.

Error Handling

The API uses standard HTTP status codes:

Status Code Description
200 Success
400 Bad Request - Invalid file or parameters
429 Rate Limit Exceeded
500 Server Error - Parsing failed

Error Response Example

{
  "success": false,
  "error": "Only PDF files are allowed",
  "data": null
}