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.
Prerequisites
- cURL installed
- Get an API key
- Have a CAS PDF ready (or use sandbox key)
1. Parse a CAS PDF
curl -X POST https://api.casparser.in/v4/smart/parse \
-H "x-api-key: YOUR_API_KEY" \
-F "file=@cas.pdf" \
-F "password=YOUR_PAN_NUMBER"
2. Parse from URL
curl -X POST https://api.casparser.in/v4/smart/parse \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"pdf_url": "https://example.com/cas.pdf",
"password": "YOUR_PAN_NUMBER"
}'
3. Try it yourself
Test without consuming credits:
curl -X POST https://api.casparser.in/v4/smart/parse \
-H "x-api-key: sandbox-with-json-responses" \
-F "file=@cas.pdf" \
-F "password=test"
Check your credits
curl -X POST https://api.casparser.in/v1/credits \
-H "x-api-key: YOUR_API_KEY"
Response:
{
"used": 15,
"remaining": 35,
"limit": 50,
"reset_date": "2024-02-01",
"features": ["cdsl", "nsdl", "cams_kfintech", "inbox", "cdsl_fetch"]
}
Every API response includes:
| Header | Description |
|---|
X-Request-ID | Unique request ID (e.g., req_abc123) for support |
X-Credits-Used | Credits consumed by this request |
X-Credits-Remaining | Remaining credits for billing period |
Error handling
# Check response status
response=$(curl -s -w "\n%{http_code}" -X POST https://api.casparser.in/v4/smart/parse \
-H "x-api-key: YOUR_API_KEY" \
-F "file=@cas.pdf" \
-F "password=WRONG_PASSWORD")
http_code=$(echo "$response" | tail -n1)
body=$(echo "$response" | sed '$d')
if [ "$http_code" -ne 200 ]; then
echo "Error: $body"
exit 1
fi
echo "$body" | jq '.summary.total_value'
Common errors
| Status | Error | Solution |
|---|
| 400 | Invalid password | Check PAN format (encrypted PAN for CDSL/NSDL) |
| 401 | Invalid API key | Verify your API key at app.casparser.in |
| 402 | Insufficient credits | Upgrade plan or wait for reset |
| 422 | Invalid PDF | Ensure PDF is not scanned/tampered |
Next steps
API Reference
Explore all endpoints
Sandbox
Test with sample data