API v1.0

AfroTools API

African financial data for developers. Tax rates, FX rates, salary benchmarks, and PAYE calculations for 54 countries.

Get Your Free API Key

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.

Base URL: https://afrotools.com/api/v1
All 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()
Test keys: Test keys return deterministic sandbox data on supported PAYE and VAT sandbox endpoints. Keys starting with afro_test_ have free-tier sandbox limits. Use live dashboard keys for production data.

Rate Limits

TierDaily LimitMonthly LimitActivation
Free API1003,000Verified dashboard key
API Growth10,000300,000Manual paid pilot
API Pro100,0003,000,000Manual paid pilot
Enterprise/customCustomCustomContracted 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

Current version: v1
Status endpoint: https://afrotools.com/api/status
Breaking 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"
}
StatusCodeMeaning
400MISSING_REQUIRED_FIELDA required parameter is missing
401INVALID_API_KEYMissing or invalid API key
404INVALID_COUNTRYCountry code not recognized
429RATE_LIMIT_EXCEEDEDDaily rate limit exceeded
500INTERNAL_ERRORServer 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.

POST /api/v1/tax/paye

Calculate income tax for any supported African country.

Request Body

FieldTypeRequiredDescription
countrystringRequiredISO 3166-1 alpha-2 code (e.g., NG, KE, ZA)
grossAnnualnumber*Annual gross salary in local currency
grossMonthlynumber*Monthly gross salary (alternative)
netAnnualnumber*Net salary for reverse calculation
regimestringOptionalTax regime (e.g., NTA_2026 for Nigeria)
pensionbooleanOptionalInclude 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 /api/v1/tax/paye?country=NG

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 /api/v1/tax/rates

Get tax rate data for one or all African countries.

Parameters

ParameterTypeRequiredDescription
countrystringOptionalISO alpha-2 code. Omit for all countries.
typestringOptionalpaye 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 /api/v1/fx/rates

Get current or historical exchange rates.

Parameters

ParameterTypeRequiredDescription
basestringOptionalBase currency (e.g., USD). Returns all African pairs.
targetstringOptionalTarget currency (e.g., NGN).
daysnumberOptionalHistorical 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 /api/salary-benchmarks

Get salary benchmarks for a specific country.

Parameters

ParameterTypeRequiredDescription
countrystringRequiredISO alpha-2 code (e.g., NG, KE, ZA)
periodstringOptionalmonthly (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.

GET /api/v1/countries

List all African countries or get detail for one.

Parameters

ParameterTypeRequiredDescription
codestringOptionalISO 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.

Save production keys server-side only. Rotate keys from your dashboard.