AfroTax API
Calculate income tax, corporate tax, and withholding tax for all 54 African countries. Supports gross-to-net and net-to-gross calculation modes.
Overview
The AfroTax API provides accurate, up-to-date tax calculations based on each country's current tax legislation. It supports multiple tax types and automatically applies the correct brackets, thresholds, and deductions for each jurisdiction.
Supported Tax Types
- Income Tax (PAYE) — Personal income tax with progressive brackets
- Corporate Tax — Company income tax rates
- Withholding Tax — Tax on dividends, interest, and royalties
- Capital Gains Tax — Tax on investment profits
Calculation Modes
| Mode | Description |
|---|---|
| gross_to_net | Given a gross amount, calculate the tax and return net pay. Default mode. |
| net_to_gross | Given a desired net amount, calculate the gross salary required to achieve it. |
Supported Countries
The AfroTax API covers all 54 African countries. Tax rules are updated within 30 days of any legislative change. Use the List Countries endpoint to get all supported countries and their current tax year.
Endpoints
Base URL
https://afrotools.com/api/tax
Quick Example
# Calculate Nigerian income tax on 500,000 NGN
curl -X POST https://afrotools.com/api/tax \
-H "x-api-key: afro_test_abc123" \
-H "Content-Type: application/json" \
-d '{
"country": "NG",
"amount": 500000,
"type": "income",
"period": "monthly"
}'
Example Response
{
"success": true,
"data": {
"country": "NG",
"currency": "NGN",
"gross_amount": 500000,
"tax_amount": 78400,
"net_amount": 421600,
"effective_rate": 15.68,
"type": "income",
"period": "monthly",
"brackets": [
{ "from": 0, "to": 300000, "rate": 7 },
{ "from": 300001, "to": 600000, "rate": 11 }
],
"tax_year": "2026"
}
}