Getting Started
Learn how to use the SimplyCPF API
This guide will help you get started with the SimplyCPF API.
Prerequisites
No authentication is required. All endpoints are publicly accessible.
Making Your First Request
Using curl
curl https://simplycpf.com/api/cpf/age-groupsUsing JavaScript/TypeScript
const = await (
"https://simplycpf.com/api/cpf/calculate",
{
: "POST",
: { "Content-Type": "application/json" },
: .({ : 5000, : 30 }),
}
);
const = await .();
.();Using Python
import requests
response = requests.post(
"https://simplycpf.com/api/cpf/calculate",
json={"income": 5000, "age": 30}
)
data = response.json()
print(data)Response Format
All successful responses return JSON with the following structure:
{
"contribution": {
"employee": 1000,
"employer": 850,
"totalContribution": 1850
},
"distribution": {
"OA": 1085.5,
"SA": 277.5,
"MA": 487
},
"afterCpfContribution": 4000
}Error Handling
When an error occurs, the API returns an appropriate HTTP status code with an error message:
{
"error": "Income must be a non-negative number"
}Common Status Codes
| Status | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 404 | Not Found - Endpoint does not exist |
| 500 | Internal Server Error |
Rate Limits
There are currently no rate limits on the API. However, please use the API responsibly.
Next Steps
- Explore the API Reference for detailed endpoint documentation
- Check out Examples for common use cases
- View the Changelog for recent updates