Free public API for calculating UAE and Saudi Arabia End of Service Benefits. 100 requests/day per IP on the free tier. No API key required.
https://eosbcalculator.comCalculate UAE EOSB gratuity. Reference: UAE Federal Decree Law No. 33 of 2021, Article 51. Salary base is basic salary only (not allowances). Minimum service: 1 year. Rate: 21 days/year (years 1–5), 30 days/year (years 5+). Cap: 2 years total wages.
{
"basicSalary": 10000, // number, required — AED per month (basic only)
"startDate": "2018-01-01", // string, required — ISO date (YYYY-MM-DD)
"endDate": "2024-06-30", // string, required — ISO date (YYYY-MM-DD)
"reasonForLeaving": "terminated", // string, required — see valid values below
"savingsSchemeEnrolled": false, // boolean, optional — UAE Savings Scheme (Oct 2025+)
"unusedLeaveDays": 15, // number, optional — adds to final settlement
"noticePeriodOwed": false, // boolean, optional
"noticePeriodDays": 0 // number, optional — if noticePeriodOwed is true
}"terminated" | "resigned" | "contract_end" | "mutual_agreement"{
"success": true,
"result": {
"qualifies": true,
"grossEntitlement": 57333.33,
"netEntitlement": 57333.33,
"capApplied": false,
"currency": "AED",
"yearsOfService": 6.5,
"breakdown": [
{ "year": 1, "days": 105, "dailyRate": 333.33, "amount": 35000, "label": "Years 1–5 (21 days/year)" },
{ "year": 6, "days": 30, "dailyRate": 333.33, "amount": 10000, "label": "Year 6 (30 days/year)" },
{ "year": 7, "days": 182, "dailyRate": 333.33, "amount": 4983.56, "label": "Partial year (182 days, 30 days/year rate)" }
],
"unusedLeavePayout": 5000,
"totalFinalSettlement": 62333.33,
"lawReference": "UAE Federal Decree Law No. 33 of 2021, Article 51"
},
"meta": {
"calculatedAt": "2024-07-01T12:00:00.000Z",
"lawReference": "UAE Federal Decree Law No. 33 of 2021, Article 51",
"disclaimer": "This is an estimate only. Consult a qualified UAE labour lawyer for binding advice."
}
}{ "success": false, "error": "Missing required field: basicSalary" }Calculate KSA EOSB. Reference: KSA Labour Law, Article 84. Salary base includes basic + fixed allowances (housing, transport, other fixed). Rate: 0.5 months/year (years 1–5), 1 month/year (years 5+). Resignation reductions apply for under 10 years of service.
{
"basicSalary": 10000, // number, required — SAR per month
"housingAllowance": 3000, // number, optional (default 0) — SAR per month
"transportAllowance": 1000, // number, optional (default 0) — SAR per month
"otherFixedAllowances": 0, // number, optional (default 0) — SAR per month
"startDate": "2018-01-01", // string, required — ISO date (YYYY-MM-DD)
"endDate": "2024-06-30", // string, required — ISO date (YYYY-MM-DD)
"reasonForLeaving": "terminated", // string, required — see valid values below
"gender": "male", // string, required — "male" or "female"
"unusedLeaveDays": 0, // number, optional — adds to final settlement
"noticePeriodOwed": false, // boolean, optional
"noticePeriodDays": 0 // number, optional — if noticePeriodOwed is true
}"terminated" | "resigned" | "contract_end" | "mutual_agreement"
| "resignation_marriage" // female resigned within 6 months of marriage
| "resignation_childbirth" // female resigned within 3 months of childbirth{
"success": true,
"result": {
"qualifies": true,
"grossEntitlement": 39000,
"netEntitlement": 39000,
"capApplied": false,
"currency": "SAR",
"yearsOfService": 6.5,
"breakdown": [
{ "year": 1, "days": 75, "dailyRate": 466.67, "amount": 35000, "label": "Years 1–5 (0.5 months/year)" },
{ "year": 6, "days": 30, "dailyRate": 466.67, "amount": 14000, "label": "Year 6 (1 month/year)" }
],
"lawReference": "KSA Labour Law, Article 84"
},
"meta": {
"calculatedAt": "2024-07-01T12:00:00.000Z",
"lawReference": "KSA Labour Law, Article 84",
"disclaimer": "This is an estimate only. Consult a qualified KSA labour lawyer for binding advice."
}
}curl -X POST https://eosbcalculator.com/api/v1/calculate/uae \
-H "Content-Type: application/json" \
-d '{
"basicSalary": 10000,
"startDate": "2018-01-01",
"endDate": "2024-06-30",
"reasonForLeaving": "terminated",
"savingsSchemeEnrolled": false,
"unusedLeaveDays": 15
}'curl -X POST https://eosbcalculator.com/api/v1/calculate/ksa \
-H "Content-Type: application/json" \
-d '{
"basicSalary": 10000,
"housingAllowance": 3000,
"transportAllowance": 1000,
"otherFixedAllowances": 0,
"startDate": "2018-01-01",
"endDate": "2024-06-30",
"reasonForLeaving": "terminated",
"gender": "male",
"unusedLeaveDays": 0
}'const response = await fetch("https://eosbcalculator.com/api/v1/calculate/uae", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
basicSalary: 10000,
startDate: "2018-01-01",
endDate: "2024-06-30",
reasonForLeaving: "terminated",
savingsSchemeEnrolled: false,
unusedLeaveDays: 15,
}),
});
const data = await response.json();
if (data.success) {
console.log("Net entitlement:", data.result.netEntitlement, data.result.currency);
console.log("Years of service:", data.result.yearsOfService);
} else {
console.error("Error:", data.error);
}import requests
url = "https://eosbcalculator.com/api/v1/calculate/ksa"
payload = {
"basicSalary": 10000,
"housingAllowance": 3000,
"transportAllowance": 1000,
"otherFixedAllowances": 0,
"startDate": "2018-01-01",
"endDate": "2024-06-30",
"reasonForLeaving": "terminated",
"gender": "male",
"unusedLeaveDays": 0,
}
resp = requests.post(url, json=payload)
data = resp.json()
if data["success"]:
result = data["result"]
print(f"Net entitlement: {result['netEntitlement']} {result['currency']}")
print(f"Years of service: {result['yearsOfService']}")
else:
print(f"Error: {data['error']}")The free tier allows 100 requests per 24 hours per IP address. No API key is required. The remaining request count is returned in the response header:
X-RateLimit-Remaining: 94If you need higher limits for a production integration, contact us.
| HTTP Status | Meaning | Example error message |
|---|---|---|
| 400 | Bad request — missing or invalid field | Missing required field: basicSalary |
| 429 | Rate limit exceeded | Rate limit exceeded. 100 requests/day. |
| 500 | Internal server error | Internal calculation error. |
Note: A 200 response with qualifies: false is not an error — it means the employee does not qualify for EOSB under the given inputs (e.g. under 1 year service in UAE, or under 2 years service for KSA resignations).
All calculations are estimates based on publicly available labour legislation (UAE Federal Decree Law No. 33 of 2021, Article 51; KSA Labour Law Article 84) as of the date of calculation. Results do not constitute legal advice and may not reflect your specific employment contract, amendments, or recent regulatory changes. Always consult a qualified labour lawyer before making any employment decisions based on these figures.