API v1 documentation

Start in sandbox. Move to a reviewed API pilot.

AfroTools API gives product teams African PAYE, tax-rate, VAT, FX, fuel, central-bank, and country data through predictable JSON endpoints.

Quickstart

Use the demo sandbox key below for deterministic development responses. Replace it with a dashboard key when your route needs authenticated production access.

Test keys return deterministic sandbox data. Keys beginning with afro_test_ are safe for documentation, demos, and local development.
curl -X POST "https://afrotools.com/api/v1/tax/paye" \
  -H "x-api-key: afro_test_demo123456789" \
  -H "Content-Type: application/json" \
  -d '{"country":"NG","grossMonthly":500000}'

Expected result: 200 OK with status, sandbox, and result.netMonthly.

Authentication

Send API keys with the x-api-key header. Query-string keys are accepted for quick testing, but headers are recommended for production.

# Header, recommended
x-api-key: afro_live_xxxxxxxxxxxxx

# Query parameter, quick testing only
?api_key=afro_live_xxxxxxxxxxxxx

Sandbox keys

afro_test_* keys return deterministic sandbox data and use sandbox free-tier limits.

Live keys

afro_live_* keys are created after sign-in and email verification in the API dashboard.

Service keys

Named partner integrations use dedicated server-side keys, endpoint scopes, and negotiated quotas. They are not browser credentials.

Do not expose production keys in browser JavaScript, public mobile apps, logs, screenshots, or support tickets. Use your backend as a proxy.

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

Where a route exposes rate-limit headers, they use X-RateLimit-Limit and X-RateLimit-Remaining. Daily limits reset at midnight UTC.

Endpoint catalog

MethodPathUseTry first with
POST/api/v1/tax/payeCalculate PAYE salary tax for supported African countries.Sandbox key
GET/api/v1/tax/ratesRead PAYE and VAT reference rates by country.Sandbox key
POST/api/v1/vat/calculateAdd or extract VAT for supported countries.Sandbox key
GET/api/v1/fx/ratesRead latest and historical FX rates.Sandbox key or live call
GET/api/v1/fuel/pricesRead latest fuel prices by country or region.Sandbox key or live call
GET/api/v1/rates/central-bankRead central-bank policy-rate and inflation reference data.Sandbox key or live call
GET/api/v1/countriesRead country metadata and available API products.Sandbox key
GET/api/v1/catalog/tools?product=salarypadi&category=careerRead SalaryPadi's versioned career-tool integration contract.SalaryPadi service key
GET/api/v1/catalog/healthVerify the published catalog schema, count, and verification date.SalaryPadi service key

SalaryPadi tool catalog

GET/api/v1/catalog/tools?product=salarypadi&category=career

This server-to-server endpoint publishes schema version 1.0.0. Every tool is explicitly classified as api, widget, or link. PAYE and FX are API integrations. Other career tools remain link integrations until a matching calculation or widget contract is both implemented and tested.

Keep the dedicated SalaryPadi service key on the server. Do not place it in browser JavaScript, public environment variables, client logs, analytics, or screenshots. Salary values and calculation results must not be logged.
curl "https://afrotools.com/api/v1/catalog/tools?product=salarypadi&category=career" \
  -H "x-api-key: $SALARYPADI_API_KEY"

A representative tool record inside the response:

{
  "id": "ng-paye",
  "integrationMode": "api",
  "canonicalUrl": "https://afrotools.com/nigeria/ng-salary-tax",
  "countries": ["NG"],
  "api": { "method": "POST", "path": "/api/v1/tax/paye" },
  "inputSchema": "https://afrotools.com/api/schemas/v1/paye-request.schema.json",
  "outputSchema": "https://afrotools.com/api/schemas/v1/paye-response.schema.json",
  "rulesVersion": "NG-PAYE:PITA_2025+NTA_2026",
  "lastVerified": "2026-07-11"
}

Successful responses include standard ETag, the exact application validator in X-AfroTools-Catalog-ETag, Cache-Control, X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Scope. Prefer the AfroTools validator and replay its exact value in both X-AfroTools-If-None-Match and standard If-None-Match; the application header takes precedence when an intermediary consumes or normalizes the standard header. Retain the last-known-good catalog on 304 Not Modified. The full schema is published at /api/schemas/v1/tool-catalog-response.schema.json.

PAYE calculate

POST/api/v1/tax/paye

Calculate gross-to-net or net-to-gross PAYE scenarios. Provide one salary input.

FieldTypeRequiredDescription
countrystringYesISO alpha-2 country code such as NG, KE, or ZA.
grossAnnualnumberOne salary inputAnnual gross salary in local currency.
grossMonthlynumberOne salary inputMonthly gross salary in local currency.
netAnnualnumberOne salary inputAnnual net salary for reverse calculation.
netMonthlynumberOne salary inputMonthly net salary for reverse calculation.

Every successful response follows the published PAYE response schema. Each tax.bands[] item includes canonical label, rate, and amount fields. Production rows retain from, to, and taxInBand as v1 compatibility fields. Production metadata includes _meta.sandbox: false and a non-empty _meta.dataPolicy.

curl -X POST "https://afrotools.com/api/v1/tax/paye" \
  -H "x-api-key: afro_test_demo123456789" \
  -H "Content-Type: application/json" \
  -d '{"country":"NG","grossMonthly":500000}'

Tax rates

GET/api/v1/tax/rates

Read PAYE and VAT reference data. Use country for a single market and type to filter to paye or vat. Production responses include sandbox: false and a non-empty data_policy; deterministic sandbox responses identify themselves with sandbox: true.

curl "https://afrotools.com/api/v1/tax/rates?country=NG" \
  -H "x-api-key: afro_test_demo123456789"

VAT calculate

POST/api/v1/vat/calculate

Add VAT to an exclusive amount or extract VAT from an inclusive amount.

FieldTypeRequiredDescription
countrystringYesISO alpha-2 country code.
amountnumberYesAmount in local currency.
operationstringNoadd or extract.
customRatenumberNoOptional override when a reduced or special rate applies.
curl -X POST "https://afrotools.com/api/v1/vat/calculate" \
  -H "x-api-key: afro_test_demo123456789" \
  -H "Content-Type: application/json" \
  -d '{"country":"NG","amount":1000,"operation":"add"}'

FX rates

GET/api/v1/fx/rates

Read current rates, single pairs, base conversions, and stored historical pairs where available.

ParameterTypeRequiredDescription
basestringNoBase currency, for example USD.
targetstringNoTarget currency, for example NGN.
amountnumberNoOptional amount to convert.
daysnumberNoHistorical lookback when stored for the pair.
curl "https://afrotools.com/api/v1/fx/rates?base=USD&target=NGN"

Fuel prices

GET/api/v1/fuel/prices

Read petrol, diesel, and LPG prices where source coverage is available. Results include timestamps and source metadata.

curl "https://afrotools.com/api/v1/fuel/prices?country=NG"

Central-bank rates

GET/api/v1/rates/central-bank

Read policy rates, inflation reference data, central-bank names, and source fields by country or region.

curl "https://afrotools.com/api/v1/rates/central-bank?country=NG"

Countries

GET/api/v1/countries

Read country names, currencies, regions, population reference values, and available API products.

curl "https://afrotools.com/api/v1/countries?code=NG" \
  -H "x-api-key: afro_test_demo123456789"

Status and health

The status route returns the public API contract. The v1 health route returns category freshness and source metadata.

curl "https://afrotools.com/api/status"
curl "https://afrotools.com/api/v1/health"

Error format

Errors return JSON with an error field and, where available, a stable code.

{
  "error": "Invalid or missing API key",
  "code": "INVALID_API_KEY"
}
StatusCodeMeaning
400MISSING_REQUIRED_FIELDA required field or parameter is missing.
401INVALID_API_KEYThe key is missing or invalid for the route.
404INVALID_COUNTRYThe requested country, currency pair, or resource was not found.
429RATE_LIMIT_EXCEEDEDThe key or anonymous caller exceeded the allowed request limit.
500INTERNAL_ERRORThe service could not complete the request.

Production path

Use sandbox keys for deterministic examples, Free API for dashboard-key testing, and API Growth or API Pro when a real product needs higher limits or support. Enterprise/custom is available for negotiated data scope, request limits, billing, and implementation review.