Sandbox API Key
Use this key for development and testing:
sandbox-with-json-responses
The sandbox returns sample data for all endpoints without consuming credits.
Usage
import requests
response = requests.post(
"https://api.casparser.in/v4/smart/parse",
headers={"x-api-key": "sandbox-with-json-responses"},
files={"file": open("any-pdf.pdf", "rb")},
data={"password": "test"}
)
# Returns sample portfolio data
print(response.json())
Sample Response
The sandbox returns realistic sample data:
{
"meta": {
"cas_type": "CDSL",
"statement_period": {
"from": "2024-01-01",
"to": "2024-01-31"
},
"generated_at": "2024-02-01T10:30:00Z"
},
"investor": {
"name": "John Doe",
"pan": "ABCDE1234F",
"email": "john.doe@example.com",
"mobile": "9876543210",
"address": "123 Main St, Mumbai",
"pincode": "400001",
"cas_id": "CAS123456"
},
"summary": {
"total_value": 2547832.50,
"accounts": {
"demat": {
"count": 2,
"total_value": 1500000.00
},
"mutual_funds": {
"count": 5,
"total_value": 950000.00
},
"insurance": {
"count": 1,
"total_value": 50000.00
},
"nps": {
"count": 1,
"total_value": 47832.50
}
}
},
"demat_accounts": [
{
"demat_type": "CDSL",
"dp_id": "12345678",
"dp_name": "HDFC Bank Limited",
"client_id": "1234567890123456",
"bo_id": "1234567890123456",
"value": 1500000.00,
"linked_holders": [
{
"name": "John Doe",
"pan": "ABCDE1234F"
}
],
"holdings": {
"equities": [
{
"isin": "INE002A01018",
"name": "Reliance Industries Ltd",
"units": 100.0,
"value": 250000.00
}
]
},
"additional_info": {}
}
],
"mutual_funds": [],
"insurance": {
"life_insurance_policies": []
},
"nps": []
}
What sandbox covers
| Endpoint | Sandbox Behavior |
|---|
/v4/smart/parse | Returns sample CDSL data |
/v4/cdsl/parse | Returns sample CDSL data |
/v4/nsdl/parse | Returns sample NSDL data |
/v4/cams_kfintech/parse | Returns sample MF data |
/v4/kfintech/generate | Returns success (no email sent) |
/v4/cdsl/fetch | Returns mock session_id |
/v4/inbox/* | Returns mock OAuth flow |
/v1/credits | Returns unlimited credits |
/v1/token | Returns working access token |
Moving to Production
- Get an API key at app.casparser.in/developers
- Replace
sandbox-with-json-responses with your real API key
- Test with a real CAS PDF to verify integration
The sandbox PDF password validation is disabled. In production, you must provide the correct password for each CAS type.
Rate Limits
| Environment | Rate Limit |
|---|
| Sandbox | 10 requests/minute |
| Production | Based on your plan |
Next steps