@allratestoday/sbp-exchange-rate 1.3.6 โ†’ 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +60 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
  [![license](https://img.shields.io/npm/l/@allratestoday%2Fsbp-exchange-rate.svg)](https://github.com/AllRates-Today/sbp-exchange-rate/blob/main/LICENSE)
5
5
  [![zero dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)](https://www.npmjs.com/package/@allratestoday/sbp-exchange-rate)
6
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-types%20included-3178C6.svg)](https://www.typescriptlang.org/)
7
+ [![USD/PKR today](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fallratestoday.com%2Fapi%2Fopen%2Fcentral-bank%2Fsbp%3Fsource%3DUSD%26target%3DPKR&query=%24.rate&label=USD%2FPKR%20published%20by%20State%20Bank%20of%20Pakistan&color=0A7E8C&cacheSeconds=3600)](https://allratestoday.com/central-bank-rates-api/sbp/)
8
+ [![rate date](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fallratestoday.com%2Fapi%2Fopen%2Fcentral-bank%2Fsbp%3Fsource%3DUSD%26target%3DPKR&query=%24.rate_date&label=rate%20date&color=555&cacheSeconds=3600)](https://allratestoday.com/central-bank-rates-api/sbp/)
7
9
 
8
10
  **Official State Bank of Pakistan (Pakistan) daily exchange rates for Node.js and TypeScript. The published central bank rates behind tax filings, customs valuations, audits, and compliant invoicing โ€” not market estimates, but the numbers State Bank of Pakistan itself prints, every business day.**
9
11
 
@@ -33,6 +35,56 @@ console.log(r.rate_date, r.rates.length); // the central bank's latest published
33
35
 
34
36
  The open endpoint serves the *latest* table only and asks for a visible attribution link. The client below uses the keyed API, which adds point-in-time tables, history, and CSV/XML/Excel output.
35
37
 
38
+ ## ๐Ÿ“ˆ Latest published table
39
+
40
+ [![Latest State Bank of Pakistan table](https://allratestoday.com/api/open/central-bank/sbp/table.svg)](https://allratestoday.com/central-bank-rates-api/sbp/)
41
+
42
+ The image is rendered live from the keyless endpoint above, so it follows the central bank's publications on npm and on GitHub alike without a new release. The text copy below is there for search and copy-paste: on GitHub [a daily Action](.github/workflows/daily-table.yml) refreshes it whenever the central bank publishes a new table; on npm it is as of the package's publish date.
43
+
44
+ <!-- daily-table:start -->
45
+ Published **2026-10-12** by State Bank of Pakistan โ€” 35 rates. Updated 2026-10-12.
46
+
47
+ | Base | Quote | Type | Rate |
48
+ | --- | --- | --- | ---: |
49
+ | AED | PKR | reference | 75.407 |
50
+ | ARS | PKR | reference | 0.1826 |
51
+ | AUD | PKR | reference | 193.0783 |
52
+ | BDT | PKR | reference | 2.25 |
53
+ | BHD | PKR | reference | 733.3166 |
54
+ | BRL | PKR | reference | 55.4802 |
55
+ | CAD | PKR | reference | 194.1835 |
56
+ | CHF | PKR | reference | 332.781 |
57
+ | CNH | PKR | reference | 41.3767 |
58
+ | CNY | PKR | reference | 41.3841 |
59
+ | DKK | PKR | reference | 41.4755 |
60
+ | EUR | PKR | reference | 310.0166 |
61
+ | GBP | PKR | reference | 366.6439 |
62
+ | HKD | PKR | reference | 35.2936 |
63
+ | IDR | PKR | reference | 0.0155 |
64
+ | INR | PKR | reference | 2.8937 |
65
+ | JPY | PKR | reference | 1.7481 |
66
+ | KRW | PKR | reference | 0.2081 |
67
+ | KWD | PKR | reference | 898.8274 |
68
+ | KZT | PKR | reference | 0.6128 |
69
+ | LKR | PKR | reference | 0.837 |
70
+ | MXN | PKR | reference | 15.0488 |
71
+ | MYR | PKR | reference | 67.84 |
72
+ | NOK | PKR | reference | 28.9129 |
73
+ | NZD | PKR | reference | 155.1191 |
74
+ | OMR | PKR | reference | 719.3654 |
75
+ | QAR | PKR | reference | 75.9831 |
76
+ | RUB | PKR | reference | 3.2982 |
77
+ | SAR | PKR | reference | 73.7475 |
78
+ | SEK | PKR | reference | 27.6581 |
79
+ | SGD | PKR | reference | 216.3603 |
80
+ | THB | PKR | reference | 8.2433 |
81
+ | TRY | PKR | reference | 5.6139 |
82
+ | USD | PKR | reference | 276.9736 |
83
+ | ZAR | PKR | reference | 16.7283 |
84
+
85
+ Source: [Official rates published by SBP, served by AllRatesToday](https://allratestoday.com/central-bank-rates-api/sbp/). Rates are as printed by the central bank; AllRatesToday is not affiliated with it.
86
+ <!-- daily-table:end -->
87
+
36
88
  ## ๐Ÿ”‘ Get your API key
37
89
 
38
90
  Get a free API key at [allratestoday.com/register](https://allratestoday.com/register) โ€” no credit card required. Latest rates are on every plan, including free.
@@ -85,10 +137,10 @@ const pair = await getRate('USD', 'PKR', { apiKey: 'art_live_...' });
85
137
  {
86
138
  bank: 'sbp',
87
139
  name: 'State Bank of Pakistan',
88
- rate_date: '2026-10-08', // State Bank of Pakistan's own publication date
140
+ rate_date: '2026-10-09', // State Bank of Pakistan's own publication date
89
141
  source: 'USD',
90
142
  target: 'PKR',
91
- rate: 277.0133,
143
+ rate: 277.004,
92
144
  rate_type: 'reference',
93
145
  derived: false,
94
146
  method: 'published',
@@ -113,9 +165,9 @@ console.log(table.rate_date, table.rates.length);
113
165
  {
114
166
  bank: 'sbp',
115
167
  name: 'State Bank of Pakistan',
116
- rate_date: '2026-10-08',
168
+ rate_date: '2026-10-09',
117
169
  rates: [
118
- { "base": "USD", "quote": "PKR", "type": "reference", "value": 277.0133 },
170
+ { "base": "USD", "quote": "PKR", "type": "reference", "value": 277.004 },
119
171
  // โ€ฆ the rest of the published table (35 currencies vs PKR)
120
172
  ],
121
173
  disclaimer: 'โ€ฆ'
@@ -155,7 +207,7 @@ Paid plans. One resolved rate per publication date โ€” ready for charting, reval
155
207
  import { getHistory } from '@allratestoday/sbp-exchange-rate';
156
208
 
157
209
  const series = await getHistory(
158
- { source: 'USD', target: 'PKR', from: '2026-01-01', to: '2026-10-08' },
210
+ { source: 'USD', target: 'PKR', from: '2026-01-01', to: '2026-10-09' },
159
211
  { apiKey: 'art_live_...' }
160
212
  );
161
213
  ```
@@ -168,11 +220,11 @@ const series = await getHistory(
168
220
  source: 'USD',
169
221
  target: 'PKR',
170
222
  from: '2026-01-01',
171
- to: '2026-10-08',
223
+ to: '2026-10-09',
172
224
  count: 152,
173
225
  rates: [
174
226
  // one entry per publication date
175
- { date: '2026-10-08', rate: 277.0133, rate_type: 'reference', derived: false, method: 'published' },
227
+ { date: '2026-10-09', rate: 277.004, rate_type: 'reference', derived: false, method: 'published' },
176
228
  // โ€ฆ
177
229
  ],
178
230
  disclaimer: 'โ€ฆ'
@@ -222,6 +274,7 @@ curl "https://allratestoday.com/api/v1/central-bank/sbp/latest?format=xml&api_ke
222
274
  - MCP server: `npx -y @allratestoday/central-bank-mcp` (stdio) or the hosted endpoint `https://allratestoday.com/api/mcp` โ€” tools for official rates, history, cross-bank comparison and publication calendars
223
275
  - Already using the general SDK or MCP server? Since 2026-10-01 [`@allratestoday/sdk`](https://www.npmjs.com/package/@allratestoday/sdk) 1.4+ has `officialRates('sbp')` and [`@allratestoday/mcp-server`](https://www.npmjs.com/package/@allratestoday/mcp-server) 0.6+ has a `get_official_rates` tool โ€” both return this source's latest table with no key, so you can add it without a second dependency
224
276
  - Claude Code plugin (no key): `/plugin marketplace add AllRates-Today/claude-code-plugin` then `/plugin install allratestoday@allratestoday` โ€” bundles both MCP servers plus an `/official-rate sbp ...` command
277
+ - Need dated tables or history for an evaluation? Agents can self-issue a trial key with no signup: `POST https://allratestoday.com/api/agent/keys` (send `Content-Type: application/json`) returns a 100-call key valid 7 days; the MCP servers expose it as `request_trial_key`
225
278
  - Machine-readable site guide: [llms.txt](https://allratestoday.com/llms.txt) ยท [for-ai-agents](https://allratestoday.com/for-ai-agents/)
226
279
 
227
280
  ## โš–๏ธ Published vs derived rates
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allratestoday/sbp-exchange-rate",
3
- "version": "1.3.6",
3
+ "version": "1.3.9",
4
4
  "description": "Official State Bank of Pakistan (Pakistan) daily exchange rates โ€” 35 currencies vs PKR, history since 2017. Zero-dependency Node.js/TypeScript client.",
5
5
  "keywords": [
6
6
  "sbp",