You don't need to write code to use PakDataHub. Every series is available as CSV, so your spreadsheet can load it directly and keep it current.
Google Sheets: one formula
=IMPORTDATA("https://api.pakdatahub.com/v1/series/fx.rate.avg.usd?format=csv&sort=asc&from=2020-01-01&api_key=pk_live_xxx")
That fills four columns (series, date, value, dims) with the monthly USD/PKR rate, which was 277.92 for August 2026, and Sheets refreshes it periodically. Swap the id for anything in the catalog:
| You want | Id |
|---|---|
| Inflation (YoY %) | inflation.cpi.national.yoy |
| 6-month KIBOR | rates.kibor.6m |
| SBP reserves | reserves.total_sbp_reserves |
| Remittances | remittances.total |
| Flour price, Lahore | commodities.wheat_flour with &dims=city:lahore |
Prefer functions to URLs? Install the free PakDataHub Sheets script and write =PAKDATA("fx.rate.avg.usd", "2020-01-01") or =PAKDATA_LATEST("rates.kibor.6m", "side:offer") instead. Your key is stored once in the script's settings, not in a URL in a cell.
Tip: anyone who can see the sheet can see the key, so use a dedicated key for shared sheets and revoke it later from the dashboard.
Excel: Power Query, key kept out of the URL
- Data → Get Data → From Other Sources → From Web → Advanced.
- URL:
https://api.pakdatahub.com/v1/series/inflation.cpi.national.yoy?format=csv&sort=asc. - Header:
X-API-Key= your key. - Load. Refresh All pulls the latest month.
Growth rates without formulas
Let the API compute year-on-year change and save yourself the spreadsheet formulas:
=IMPORTDATA("https://api.pakdatahub.com/v1/series/remittances.total?format=csv&sort=asc&transform=yoy&api_key=pk_live_xxx")
The transforms are yoy, mom, pct_change, 3ma (moving average) and index (rebase to 100).
The full guide, including Power BI, is in Excel, Google Sheets & Power BI. A free key includes 500 API calls a month, and each refresh uses one.