African Economic Stress Monitor — API avatar

African Economic Stress Monitor — API

Pricing

Pay per usage

Go to Apify Store
African Economic Stress Monitor — API

African Economic Stress Monitor — API

HTTP/Standby API for the African Economic Stress Monitor: serves the latest cross-signal stress score + structural-vulnerability snapshots for 11 African economies as JSON (ranked crisis-scan, or per country). Delayed data; backs the RapidAPI listing.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Simon M

Simon M

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

1

Monthly active users

4 days ago

Last modified

Share

African Economic Stress Monitor — API (Standby)

A lightweight HTTP API that serves the latest ../african-economic-stress-monitor snapshots as JSON — built to sit behind RapidAPI.

This actor runs in Apify Standby mode (a persistent HTTP server). It runs no scrapers: it reads the snapshots that the producer actor writes to a shared key-value store and returns them instantly.

Two-actor architecture

Actor A (producer) shared named KVS Actor B (this actor)
african-economic-stress-monitor ── writes ──▶ "stress-monitor-state" ── reads ──▶ …-api (Standby HTTP)
• scrapes + scores, on a SCHEDULE └ LAST_RUN { savedAt, • serves JSON
• pay-per-event on the Apify Store byCountry: {…} } • RapidAPI proxies here
  • A is unchanged — it keeps producing the snapshots (and is sold per-event on the Apify Store).
  • B (this actor) only reads A's latest output and serves it over HTTP — fast and cheap, decoupled from request volume.
  • They share a versioned schema contract (src/_contract/README.md): A is the single source of truth; B vendors A's Snapshot schema and a test pins the schema version so the two can't silently diverge.

Endpoints

Method · PathReturns
GET /crisis-scanAll 11 covered countries, ranked most-stressed first, each a full snapshot
GET /country/{code}One country (ISO alpha-2, e.g. /country/GH); also /country?code=GH
GET /healthReadiness + freshness of the underlying snapshot

Every payload carries a freshness envelope{ schemaVersion, generatedAt, ageSeconds, delayed: true } — so consumers always see how delayed the data is. Before the producer has ever run, the data endpoints return 503 warming_up.

A machine-readable OpenAPI 3.0 spec for these endpoints (modelled from the Snapshot contract, with a real example response) lives in openapi.yaml — use it to create the RapidAPI listing.

Example — GET /country/GH

{
"schemaVersion": 8,
"generatedAt": "2026-06-07T11:00:00.000Z",
"ageSeconds": 3600,
"delayed": true,
"country": { /* the full schema-8 Snapshot: verdict, stressScore, signals,
vulnerabilityScore, vulnerabilitySignals, attributed details, … */ }
}

Configuration

Env varPurpose
RAPIDAPI_PROXY_SECRETThe X-RapidAPI-Proxy-Secret value from your RapidAPI Provider Dashboard (Security/Gateway). When set, B rejects any request that doesn't carry it — so nobody can bypass RapidAPI and hit this endpoint directly. If unset, the API is OPEN (handy for testing; the actor logs a loud warning). Set it before publishing the listing. Wired via the CLI: apify secrets add rapidapi-proxy-secret <value> + the environmentVariables mapping in .actor/actor.json (@rapidapi-proxy-secret), then apify push — or set it in Console → Settings → Environment variables.

Operational notes

  • This actor needs Full permissions (Console → Settings → Actor permissions). It reads a named key-value store created by Actor A, and Apify's default Limited permissions cannot access another actor's named storage — without it every data request fails and the endpoints return 503 (the log explains the fix). Change the setting, then restart the Standby run so it picks up a full-scope token.
  • Actor A must run on a schedule. B only serves what A last wrote, so set an Apify Schedule on A (e.g. daily) to keep LAST_RUN fresh. The data is delayed by design, so a cached snapshot is the correct model. B reports ageSeconds so a stalled schedule is visible.
  • B caches the snapshot in memory for 60s, so it serves instantly without reading the KVS on every request.
  • Not investment advice; delayed data. Each signal in a snapshot carries its own source attribution and license note (World Bank CC-BY, IMF, national statistics offices / central banks). See Actor A's README for source legality.

Develop

npm install
npm run sync-contract # re-vendor A's Snapshot schema (run after A's schema changes)
npm run build
npm test # serve logic, auth guard, and the contract drift pin