africaAPI

Platform

Rate Limits

Safe client behavior for Africa API, including retries, batching, and caching guidance.

Current Behavior

As of March 2026, Africa API does not publish formal per-key quota headers. You should still build for backoff, batching, and caching.

  1. Set explicit request timeouts.
  2. Retry only transient failures (429, 5xx).
  3. Batch related observations into one /v1/data call instead of many single-resource requests.
  4. Cache GET /v1/countries using ETag and Cache-Control.
  5. Avoid request spikes when hydrating dashboards.

Retry Template (JavaScript)

async function requestWithBackoff(url, init, maxAttempts = 4) {
  let delayMs = 300;

  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
    const response = await fetch(url, init);
    if (response.ok) return response;

    const retryable = response.status === 429 || response.status >= 500;
    if (!retryable || attempt === maxAttempts) return response;

    await new Promise((resolve) => setTimeout(resolve, delayMs + Math.random() * 200));
    delayMs *= 2;
  }
}

Query Design Tips

  • Prefer country_codes=ng,ke,za over three separate requests.
  • Prefer metric_keys=population_total,gdp_current_usd where a combined response is acceptable.
  • Use latest=true when you do not need a full time series.

Future Contract

If explicit quota headers or published plans are introduced, this page should be treated as the source of truth.

On this page