Getting started
PakDataHub is one REST API for Pakistan's official economic and financial data: exchange rates, inflation, interest rates, the balance of payments, money and banking, GDP, trade, commodity prices, digital payments, mutual funds, debt securities and more. It holds 16,964 series from 1947 to today, sourced from the State Bank of Pakistan (SBP), the Pakistan Bureau of Statistics (PBS), the PTA and MUFAP.
Every series is a clean time series. You can pull it as JSON or CSV from https://api.pakdatahub.com.
1. Get a key
Create an account at pakdatahub.com/signup, using email and password or Google. Your first API key appears straight away, and it is also emailed to you. Every account gets 500 free API calls a month (resetting on the 1st), no card. See Plans & credits.
2. Find a series
The catalog is public, so you can search it without a key:
curl "https://api.pakdatahub.com/v1/search?q=kibor"
{ "success": true, "count": 3, "data": [
{ "id": "rates.kibor.1y", "module": "fixed-income", "name": "KIBOR 1-Year", "unit": "percent", "frequency": "daily", "source": "SBP", "tier": "basic" },
{ "id": "rates.kibor.3m", "module": "fixed-income", "name": "KIBOR 3-Month", "unit": "percent", "frequency": "daily", "source": "SBP", "tier": "basic" },
{ "id": "rates.kibor.6m", "module": "fixed-income", "name": "KIBOR 6-Month", "unit": "percent", "frequency": "daily", "source": "SBP", "tier": "basic" }
] }
Every result has an id. That's the stable, lowercase identifier you use everywhere else, such as fx.rate.avg.usd, rates.kibor.3m or inflation.cpi.national.yoy.
3. Make your first call
Send your key in the X-API-Key header:
curl -H "X-API-Key: pk_live_xxx" \
"https://api.pakdatahub.com/v1/series/fx.rate.avg.usd/latest"
{
"success": true,
"series": "fx.rate.avg.usd",
"meta": { "name": "Average Exchange rate of Pak Rupees per U.S. Dollar", "unit": "pkr",
"frequency": "monthly", "source": "SBP", "last_updated": "2026-08-31", "transform": null },
"data": [ { "date": "2026-08-31", "value": 277.9187406, "dims": {} } ],
"pagination": { "next_cursor": null, "count": 1 }
}
That's it. Every one of the 16,964 series comes back in this same shape, whether you ask for the 1953 exchange rate or last week's flour price.
4. In Python
import httpx
r = httpx.get(
"https://api.pakdatahub.com/v1/series/inflation.cpi.national.yoy",
params={"from": "2020-01-01", "sort": "asc"},
headers={"X-API-Key": "pk_live_xxx"},
timeout=30,
)
for point in r.json()["data"]:
print(point["date"], point["value"])
Or load straight into pandas with CSV:
import pandas as pd
url = ("https://api.pakdatahub.com/v1/series/fx.rate.avg.usd"
"?from=1947-01-01&sort=asc&format=csv&api_key=pk_live_xxx")
df = pd.read_csv(url, parse_dates=["date"])
Next
- Authentication: keys, headers and sessions.
- Series & the catalog: how ids, modules and dimensions work.
- API reference: every endpoint, with parameters and response schemas.
- Data dictionary: what data exists, with real, callable ids.