The Easiest Way to Get Malawian Kwacha (MWK) - N/A Historical Rates — using a REST API in 2026

Metals-API 10 min read
The Easiest Way to Get Malawian Kwacha (MWK) - N/A Historical Rates — using a REST API in 2026

You need a clean, daily history of Malawian Kwacha (MWK) exchange rates you can drop straight into a dashboard, pricing engine, or backtest. By the end of this guide you’ll query MWK historical rates from a REST API, export them to CSV, and understand how to handle dates, base currency, and weekends so your pipeline runs reliably.

What you’ll build: a daily MWK history table ready for charts and models

We’ll pull Malawian Kwacha (MWK) rates against USD for a date range, then write the series into a simple table you can chart or join to other data. Along the way, we’ll cover two endpoints that matter for a historical feed:

Illustration: The Easiest Way to Get Malawian Kwacha (MWK) - N/A Historical Rates — using a REST API in 2026
  • Historical date endpoint: point-in-time lookup (one date at a time).
  • Time-series endpoint: a continuous daily series between two dates.

We’ll use Metals-API, which delivers both metals and currency rates in a consistent JSON format. If you also price metal inputs (gold, silver, copper, aluminum, nickel, etc.) alongside local currencies, you can keep one integration across your stack.

Before you start: API key, symbol, and base currency

Grab a free API key first: Register. Confirm that MWK appears in the supported list here: Metals-API Supported Symbols.

Key concepts you’ll rely on in the responses:

  • Base currency: by default, rates are expressed relative to USD. For MWK, that means “how many MWK per 1 USD.”
  • Dates and timestamps: responses carry an ISO date (YYYY-MM-DD) and a UNIX timestamp (seconds since epoch). Treat dates as UTC.
  • Units: Currencies are unitless (amount of quote currency per 1 unit of base currency). Metals endpoints use “per troy ounce.”

Full parameter options and plan features are in the Documentation. You can also browse the homepage to see end-to-end capabilities: metals-api.com.

Endpoint 1: Historical date (point-in-time MWK rate)

Use this when you need the MWK rate for a specific date (for example, for backfilling a missing row in your warehouse).

Historical date curl example

Request the rate for 2026-10-15. Replace YOUR_API_KEY with your key.

curl "https://metals-api.com/api/2026-10-15?access_key=YOUR_API_KEY&symbols=MWK&base=USD"

Historical date JSON response (official sample)

This is an official MWK response example. It shows the date, UNIX timestamp, base, and the rates payload including MWK.

{"success":true,"timestamp":1792022880,"date":"2026-10-15","base":"USD","rates":{"MWK":1738.6923755,"USD":1,"USDMWK":0.0005751448698407202}}

How to read it

  • success: true means the request worked.
  • timestamp: 1792022880 is the UNIX epoch in seconds (UTC).
  • date: "2026-10-15" is the business date for the rate.
  • base: "USD" indicates the base currency.
  • rates.MWK: 1738.6923755 means 1 USD = 1738.6923755 MWK.
  • rates.USD: 1 is present when USD is the base.
  • rates.USDMWK: 0.0005751448698407202 is included in this sample; use rates.MWK as your primary value when storing “MWK per USD.”

Alternative historical sample (same date)

For completeness, here’s the same response you’ll typically parse when you fetch the 2026-10-15 historical rate for MWK.

{
"success": true,
"timestamp": 1792022880,
"date": "2026-10-15",
"base": "USD",
"rates": {
"MWK": 1738.6923755,
"USD": 1,
"USDMWK": 0.0005751448698407202
}
}

Endpoint 2: Time-series (continuous MWK history)

Use this to fetch a daily series between two dates. You can backfill a chart or power a model without looping one date at a time.

Time-series curl example

Fetch a single-day time series for clarity (you can expand the range as needed):

curl "https://metals-api.com/api/timeseries?access_key=YOUR_API_KEY&start_date=2026-10-15&end_date=2026-10-15&symbols=MWK&base=USD"

Time-series JSON response (single day)

The series is keyed by date. For a broader range, you’ll see one object per day under rates.

{
"success": true,
"timeseries": true,
"start_date": "2026-10-15",
"end_date": "2026-10-15",
"base": "USD",
"rates": {
"2026-10-15": {
"MWK": 1738.6923755,
"USD": 1,
"USDMWK": 0.0005751448698407202
}
}
}

What you’ll actually use

  • rates["YYYY-MM-DD"].MWK: the daily close for MWK per USD.
  • start_date, end_date: confirm your window.
  • timeseries: true signals the payload is a series rather than a single date.

Optional: day-over-day fluctuation in MWK

If you want a quick summary of changes across a window, the fluctuation endpoint returns net move and percentage change. A zero-length window will naturally show no change. Example below uses the same day for start and end to keep numbers consistent with the official MWK rate provided above.

Fluctuation curl example

curl "https://metals-api.com/api/fluctuation?access_key=YOUR_API_KEY&start_date=2026-10-15&end_date=2026-10-15&symbols=MWK&base=USD"

Fluctuation JSON response (single-day window)

{
"success": true,
"fluctuation": true,
"start_date": "2026-10-15",
"end_date": "2026-10-15",
"base": "USD",
"rates": {
"MWK": {
"start_rate": 1738.6923755,
"end_rate": 1738.6923755,
"change": 0.0,
"change_pct": 0.0
}
}
}

End-to-end example: write MWK time series to CSV (Python)

This script calls the time-series endpoint and writes a CSV with columns [date, MWK_per_USD]. Expand the date window when you’re ready for full backfills.

import csv
import os
import requests

API_KEY = os.getenv("METALS_API_KEY", "YOUR_API_KEY")
BASE = "USD"
SYMBOL = "MWK"
START_DATE = "2026-10-15"
END_DATE = "2026-10-15"

url = "https://metals-api.com/api/timeseries"
params = {
"access_key": API_KEY,
"start_date": START_DATE,
"end_date": END_DATE,
"symbols": SYMBOL,
"base": BASE
}

resp = requests.get(url, params=params, timeout=30)
resp.raise_for_status()
data = resp.json()

if not data.get("success"):
raise SystemExit(f"API error: {data}")

rates = data.get("rates", {})

# Normalize into a list of rows sorted by date
rows = []
for day in sorted(rates.keys()):
day_payload = rates[day]
mwk_per_usd = day_payload.get("MWK")
if mwk_per_usd is None:
# Skip if the symbol is missing for a given date
continue
rows.append({"date": day, "MWK_per_USD": mwk_per_usd})

# Write CSV
out_path = "mwk_history.csv"
with open(out_path, "w", newline="") as f:
writer = csv.DictWriter(f, fieldnames=["date", "MWK_per_USD"])
writer.writeheader()
writer.writerows(rows)

print(f"Wrote {len(rows)} rows to {out_path}")

Caching, weekends, and data hygiene for a stable feed

Even a small amount of care around dates and caching will save hours later. Here are patterns that work well in production:

  • Date format: always use YYYY-MM-DD. Treat dates as UTC business dates. Store both date and UNIX timestamp if you need precise ordering.
  • Base currency: by default, the response is relative to USD. If you convert the base, update your column names accordingly (e.g., USD_per_MWK vs. MWK_per_USD). If you’re unsure about base handling, review the Documentation.
  • Weekends and holidays: for FX-like rates, weekends may not produce new values; you may observe the last available rate carried forward to the next business day depending on your logic. When you chart, forward-fill missing days explicitly to avoid stair-step artifacts.
  • Time-series windowing: fetch entire months or quarters rather than day-by-day where possible. It lowers request count and guarantees contiguous context in your pipeline.
  • Caching: cache responses at the date or month granularity. For example, persist each time-series block you fetch so retries don’t re-hit the API. Control refresh based on your plan’s update frequency.
  • Idempotency: write daily snapshots keyed by date and symbol (“2026-10-15_MWK”). Overwrite on re-run so late-arriving fixes don’t create duplicates.
  • Validation: assert that rates.MWK is present and parseable as a float. Alert on anomalies such as zero or negative values.

When MWK meets metals: one API for both inputs and FX

If you cost imported materials in MWK but model exposures in USD, you can fetch both MWK and metal benchmarks from the same integration. Metals-API delivers metals “per troy ounce” and currencies per base unit, with consistent timestamps and JSON structure—useful when joining time-series. For symbol coverage and metadata, see the Supported Symbols catalog.

For organizations experimenting with smart manufacturing and digital twins, this unification is practical: you can integrate materials prices, currency exposures (MWK), and operational KPIs into one data layer. If you’re exploring more advanced coverage, visit the MCP page.

Troubleshooting your first MWK pulls

  • Missing symbol: verify “MWK” is included in the “symbols” parameter and that your plan supports it. Cross-check on the symbols page.
  • No data on a date: try the nearest business day or expand your time-series window. Some days (holidays/weekends) won’t update.
  • Unexpected base: if you don’t pass base=USD, confirm which base is returned. Your stored field names should reflect base/quote orientation.
  • Timeouts: batch by month or quarter. Implement retries with exponential backoff. Cache successful blocks to reduce repeated fetches.

Quick check: latest MWK for sanity testing

While you’ll rely on time-series for backfills, a quick latest request can validate connectivity and symbol handling.

Latest curl (sanity check)

curl "https://metals-api.com/api/latest?access_key=YOUR_API_KEY&symbols=MWK&base=USD"

Latest JSON response (example aligned with the official MWK payload)

In testing, you may see a response mirroring the same fields as historical. Values vary over time; structure remains consistent.

{
"success": true,
"timestamp": 1792022880,
"date": "2026-10-15",
"base": "USD",
"rates": {
"MWK": 1738.6923755,
"USD": 1,
"USDMWK": 0.0005751448698407202
}
}

Data handling patterns: storage schema and joins

Keep your storage normalized and easy to join with other assets:

  • Primary key: (date, symbol, base). Value: rate (float). Optional: timestamp (int64 UTC).
  • Column naming: MWK_per_USD for clarity. If you flip base, rename explicitly (USD_per_MWK) to avoid silent inversions.
  • Joins: When combining with commodities, align on UTC date and consider a calendar table for holidays and weekends to avoid accidental gaps.

If you later expand to metals and want OHLC-style analytics for research dashboards, see the relevant sections of the Documentation.

Security, governance, and cost control tips

  • Keys: keep your API key in environment variables or a secrets vault. Never commit to source control.
  • Rate management: prefer time-series endpoints over loops. Cache and only refresh deltas.
  • Validation: implement a guardrail that checks if today’s rate deviates by more than a threshold versus a rolling median, then flag for review.
  • Audit: log request parameters and response checksums so you can reproduce any result used in pricing or financial reporting.

Side note for innovators: Tellurium (TE), data fusion, and smart pipelines

As manufacturers and miners instrument physical processes, pairing currency data like MWK with metals inputs (including less mainstream elements such as Tellurium, TE) unlocks richer analytics. Tellurium feeds into high-efficiency solar and advanced alloys; combining TE price history, MWK FX, and plant telemetry in one pipeline supports near-real-time cost attribution and hedging simulations. Metals-API’s consistent JSON structures and timestamps make this fusion approachable for dev teams building smart, automated decision loops.

Reference: one more look at the official MWK JSON

Use this sample for your deserialization tests and contract checks:

{"success":true,"timestamp":1792022880,"date":"2026-10-15","base":"USD","rates":{"MWK":1738.6923755,"USD":1,"USDMWK":0.0005751448698407202}}

FAQ

Q1: What does “base: USD” mean for MWK?
A: The rate is quoted as MWK per 1 USD. In the response above, MWK=1738.6923755 means 1 USD equals 1738.6923755 MWK.

Q2: How do I handle weekends and holidays for MWK?
A: Some days won’t have fresh updates. When plotting or backtesting, forward-fill from the last available business day or restrict analytics to a business-day calendar.

Q3: Can I request a large backfill in one call?
A: Use the time-series endpoint for contiguous windows. For very long histories, segment by month or quarter and cache the responses to reduce retries and control costs. See parameters in the Documentation.

Q4: How do I store these rates safely?
A: Use a schema like (date, symbol, base, rate, timestamp). Enforce unique(date, symbol, base). Cast to decimal or double per your precision policy and audit changes by date.

Q5: Where can I confirm symbols for MWK and metals I might add later?
A: Check the catalog at Metals-API Supported Symbols.

Get your API key and ship your MWK history today

Sign up for a key in minutes and start pulling MWK historical rates via REST. See parameters and examples in the Documentation, confirm coverage on the symbols page, and Register to get your free API key.


Additional resources: