Overview
The AfroTools API provides programmatic access to African financial data: tax rates, exchange rates, salary benchmarks, and PAYE calculations across supported African markets.
Built for fintechs, HR platforms, payroll systems, accounting firms, and business media. Start with the free tier (100 requests/day and 3,000/month). Paid API Growth, API Pro, and Enterprise/custom access are manually activated commercial pilots.
https://afrotools.com/api/v1All endpoints return JSON with
Content-Type: application/json.
Authentication
Include your API key in every request using one of these methods:
# Header (recommended)
x-api-key: afro_live_xxxxxxxxxxxxx
# Or query parameter
?api_key=afro_live_xxxxxxxxxxxxx
Example with cURL
curl "https://afrotools.com/api/v1/tax/rates?country=NG" \
-H "x-api-key: YOUR_API_KEY"
Example with JavaScript
const res = await fetch('https://afrotools.com/api/v1/tax/rates?country=NG', {
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
Example with Python
import requests
data = requests.get(
"https://afrotools.com/api/v1/tax/rates",
params={"country": "NG"},
headers={"x-api-key": "YOUR_API_KEY"}
).json()
afro_test_ have free-tier sandbox limits. Use live dashboard keys for production data.
Rate Limits
| Tier | Daily Limit | Monthly Limit | Activation |
|---|---|---|---|
| Free API | 100 | 3,000 | Verified dashboard key |
| API Growth | 10,000 | 300,000 | Manual paid pilot |
| API Pro | 100,000 | 3,000,000 | Manual paid pilot |
| Enterprise/custom | Custom | Custom | Contracted access |
Free keys are created from the API dashboard. Paid API Growth and API Pro limits can be applied manually during a pilot; request activation from API pricing.
Where a route exposes rate limit headers, they follow this shape. The dashboard is the main usage view:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 87
Limits reset at midnight UTC daily.
Status, Versioning, and Key Security
v1Status endpoint:
https://afrotools.com/api/statusBreaking changes ship under a new URL version with at least 90 days of deprecation notice. Do not expose production keys in browser or mobile client code. Use a backend proxy and rotate keys from the dashboard.
Error Codes
All errors return a JSON body with an error field:
{
"error": "Invalid or missing API key",
"code": "INVALID_API_KEY"
}
| Status | Code | Meaning |
|---|---|---|
| 400 | MISSING_REQUIRED_FIELD | A required parameter is missing |
| 401 | INVALID_API_KEY | Missing or invalid API key |
| 404 | INVALID_COUNTRY | Country code not recognized |
| 429 | RATE_LIMIT_EXCEEDED | Daily rate limit exceeded |
| 500 | INTERNAL_ERROR | Server error — try again |
Tax Calculate (PAYE)
The most powerful endpoint — compute African PAYE without building your own engine. Supports gross-to-net and net-to-gross calculations for 53 countries.
Calculate income tax for any supported African country.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
country | string | Required | ISO 3166-1 alpha-2 code (e.g., NG, KE, ZA) |
grossAnnual | number | * | Annual gross salary in local currency |
grossMonthly | number | * | Monthly gross salary (alternative) |
netAnnual | number | * | Net salary for reverse calculation |
regime | string | Optional | Tax regime (e.g., NTA_2026 for Nigeria) |
pension | boolean | Optional | Include pension deduction (default: true) |
* Provide one of grossAnnual, grossMonthly, netAnnual, or netMonthly.
Example Request
curl -X POST "https://afrotools.com/api/v1/tax/paye" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"country":"NG","grossAnnual":7200000}'
Example Response
{
"status": "success",
"input": { "country": "NG", "grossAnnual": 7200000, "regime": "NTA_2026" },
"deductions": {
"pension": 576000,
"nhf": 180000,
"totalDeductions": 1773600
},
"tax": {
"taxableIncome": 6444000,
"netTax": 1017600,
"bands": [...]
},
"result": {
"netAnnual": 5426400,
"netMonthly": 452200,
"effectiveRate": "14.13%"
}
}
GET: List Supported Countries
Get country tax info, supported regimes, and available options.
curl "https://afrotools.com/api/v1/tax/paye" \
-H "x-api-key: YOUR_API_KEY"
Tax Rates (Reference Data)
Static reference data — PAYE bands, VAT rates, and tax authority info for all African countries.
Get tax rate data for one or all African countries.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
country | string | Optional | ISO alpha-2 code. Omit for all countries. |
type | string | Optional | paye or vat to filter. |
Example Request
curl "https://afrotools.com/api/v1/tax/rates?country=NG" \
-H "x-api-key: YOUR_API_KEY"
Example Response
{
"country": "NG",
"country_name": "Nigeria",
"currency": "NGN",
"tax_authority": "FIRS",
"paye": {
"regimes": ["PITA_2025", "NTA_2026"],
"year": "2026",
"source": "Federal Inland Revenue Service (FIRS)"
},
"vat": {
"standard_rate": 0.075,
"currency": "NGN"
}
}
FX Rates
Exchange rates for African currencies with historical data support.
Get current or historical exchange rates.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
base | string | Optional | Base currency (e.g., USD). Returns all African pairs. |
target | string | Optional | Target currency (e.g., NGN). |
days | number | Optional | Historical days (e.g., 30 for 30-day history). Requires base + target. |
Example Request
curl "https://afrotools.com/api/v1/fx/rates?base=USD&target=NGN" \
-H "x-api-key: YOUR_API_KEY"
Example Response
{
"base": "USD",
"target": "NGN",
"rate": 1580.50,
"source": "CBN",
"updated_at": "2026-03-19T08:00:00Z",
"change_24h": -0.32
}
Salary Benchmarks
Salary benchmark data aggregated from AfroTools users.
Get salary benchmarks for a specific country.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
country | string | Required | ISO alpha-2 code (e.g., NG, KE, ZA) |
period | string | Optional | monthly (default) or annual |
Example Response
{
"country": "NG",
"currency": "NGN",
"period": "monthly",
"sample_size": 1250,
"gross": { "median": 450000, "p25": 250000, "p75": 800000 },
"net": { "median": 375000, "p25": 220000, "p75": 680000 },
"effective_tax_rate": 12.5
}
Countries
Reference data for all 54 African countries including currencies, regions, and available tools.
List all African countries or get detail for one.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
code | string | Optional | ISO alpha-2 code for single-country detail. |
Example Response (single country)
{
"code": "NG",
"name": "Nigeria",
"currency": "NGN",
"currency_symbol": "\u20a6",
"region": "West Africa",
"population": 230000000,
"tools_available": ["paye", "vat", "fx"]
}
Get Your API Key
Enter your email to start signup. Keys are generated only after sign-in and email verification. Free tier includes 100 requests/day and 3,000/month.