@allratestoday/sdk 1.4.8 → 1.4.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.
- package/README.md +10 -8
- package/dist/index.d.mts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +8 -5
- package/dist/index.mjs +8 -5
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -123,7 +123,7 @@ console.log(data);
|
|
|
123
123
|
|
|
124
124
|
### Currency Conversion
|
|
125
125
|
|
|
126
|
-
Convert any amount between currencies — including historical conversions:
|
|
126
|
+
Convert any amount between currencies — including historical conversions (paid plans):
|
|
127
127
|
|
|
128
128
|
```typescript
|
|
129
129
|
// Current conversion
|
|
@@ -199,7 +199,7 @@ console.log(data);
|
|
|
199
199
|
|
|
200
200
|
### Time Series Data
|
|
201
201
|
|
|
202
|
-
Get exchange rates over a date range for trend analysis and charting:
|
|
202
|
+
Get exchange rates over a date range for trend analysis and charting (paid plans):
|
|
203
203
|
|
|
204
204
|
```typescript
|
|
205
205
|
const data = await client.timeSeries('2026-01-01', '2026-03-31', {
|
|
@@ -290,7 +290,7 @@ not the time of your call. Dated tables and history need a paid plan and use
|
|
|
290
290
|
|
|
291
291
|
### Historical Rates by Period
|
|
292
292
|
|
|
293
|
-
Get historical rates using preset periods — no date math needed:
|
|
293
|
+
Get historical rates using preset periods — no date math needed (paid plans):
|
|
294
294
|
|
|
295
295
|
```typescript
|
|
296
296
|
const history = await client.getHistoricalRates('USD', 'EUR', '30d');
|
|
@@ -469,6 +469,8 @@ console.log(await getPrice(99.99, 'GBP')); // "78.90 GBP"
|
|
|
469
469
|
|
|
470
470
|
### Historical Chart Data
|
|
471
471
|
|
|
472
|
+
Needs a paid plan (history is not included in free or trial keys).
|
|
473
|
+
|
|
472
474
|
```typescript
|
|
473
475
|
import AllRatesToday from '@allratestoday/sdk';
|
|
474
476
|
|
|
@@ -494,13 +496,13 @@ console.log({ labels, values });
|
|
|
494
496
|
| Method | Description |
|
|
495
497
|
| ------ | ----------- |
|
|
496
498
|
| `latest(options?)` | Get latest rates for one or more currencies |
|
|
497
|
-
| `forDate(date, options?)` | Get rates for a specific historical date |
|
|
498
|
-
| `convert(from, to, amount, options?)` | Convert amount between currencies (
|
|
499
|
-
| `timeSeries(start, end, options?)` | Get rates across a custom date range |
|
|
499
|
+
| `forDate(date, options?)` | Get rates for a specific historical date (paid plan) |
|
|
500
|
+
| `convert(from, to, amount, options?)` | Convert amount between currencies (historical `date` needs a paid plan) |
|
|
501
|
+
| `timeSeries(start, end, options?)` | Get rates across a custom date range (paid plan) |
|
|
500
502
|
| `symbols(options?)` | List all 160+ supported currency codes and names |
|
|
501
503
|
| `getRate(from, to, amount?, options?)` | Get a single exchange rate |
|
|
502
504
|
| `getRates(source, target, options?)` | Get rates with full metadata |
|
|
503
|
-
| `getHistoricalRates(source, target, period?, options?)` | Historical rates by preset period (1d/7d/30d/1y) |
|
|
505
|
+
| `getHistoricalRates(source, target, period?, options?)` | Historical rates by preset period (1d/7d/30d/1y; paid plan) |
|
|
504
506
|
| `officialRates(bank, options?)` | Latest official table (or one pair) published by a central bank / tax authority — **keyless** |
|
|
505
507
|
| `officialSources(options?)` | Every covered official source with latest publication date and freshness — **keyless** |
|
|
506
508
|
|
|
@@ -535,7 +537,7 @@ The same rates are available to coding agents and LLM tools without a second int
|
|
|
535
537
|
- **Claude Code plugin** (no key): `/plugin marketplace add AllRates-Today/claude-code-plugin` then `/plugin install allratestoday@allratestoday`
|
|
536
538
|
- **Hosted MCP endpoint**: `https://allratestoday.com/api/mcp` — Streamable HTTP, keyless, nothing to install
|
|
537
539
|
- **Local MCP servers**: `npx -y @allratestoday/mcp-server` (live mid-market rates) · `npx -y @allratestoday/central-bank-mcp` (official central-bank rates)
|
|
538
|
-
- **Trial key for agents, no signup**: `POST https://allratestoday.com/api/agent/keys` (send `Content-Type: application/json`) returns a 100-call key valid 7 days
|
|
540
|
+
- **Trial key for agents, no signup**: `POST https://allratestoday.com/api/agent/keys` (send `Content-Type: application/json`) returns a 100-call key valid 7 days for latest rates and latest central-bank tables (history and dated tables are paid-plan only); both MCP servers expose it as `request_trial_key`
|
|
539
541
|
- **Daily Reference Rate** (first published 2026-10-12): one fixed USD table per business day, the 16:00 London median of minute samples, never revised — keyless at `https://allratestoday.com/api/open/reference-rate`, `get_reference_rate` in the MCP server
|
|
540
542
|
- Machine-readable site guide: [llms.txt](https://allratestoday.com/llms.txt)
|
|
541
543
|
|
package/dist/index.d.mts
CHANGED
|
@@ -188,7 +188,8 @@ declare class AllRatesToday {
|
|
|
188
188
|
*/
|
|
189
189
|
latest(options?: LatestOptions): Promise<LatestResponse>;
|
|
190
190
|
/**
|
|
191
|
-
* Get exchange rates for a specific historical date.
|
|
191
|
+
* Get exchange rates for a specific historical date. Paid plans only: free and trial keys
|
|
192
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
192
193
|
*
|
|
193
194
|
* ```ts
|
|
194
195
|
* // Using a string
|
|
@@ -203,7 +204,8 @@ declare class AllRatesToday {
|
|
|
203
204
|
*/
|
|
204
205
|
forDate(date: string | Date, options?: ForDateOptions): Promise<ForDateResponse>;
|
|
205
206
|
/**
|
|
206
|
-
* Get exchange rate time series between two dates.
|
|
207
|
+
* Get exchange rate time series between two dates. Paid plans only: free and trial keys
|
|
208
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
207
209
|
*
|
|
208
210
|
* ```ts
|
|
209
211
|
* const data = await client.timeSeries('2026-01-01', '2026-03-31', {
|
|
@@ -245,7 +247,7 @@ declare class AllRatesToday {
|
|
|
245
247
|
* console.log(`ECB ${usd.rate_date}: 1 EUR = ${usd.rate} USD`);
|
|
246
248
|
* ```
|
|
247
249
|
*
|
|
248
|
-
* Dated tables and history need a
|
|
250
|
+
* Dated tables and history need a paid plan: see `/api/v1/central-bank/{bank}/{date}`.
|
|
249
251
|
*/
|
|
250
252
|
officialRates(bank: string, options?: OfficialRateOptions): Promise<OfficialRatesResponse>;
|
|
251
253
|
/**
|
|
@@ -281,7 +283,8 @@ declare class AllRatesToday {
|
|
|
281
283
|
*/
|
|
282
284
|
getRates(source: string, target: string, options?: RequestOptions): Promise<AuthRateResponse[]>;
|
|
283
285
|
/**
|
|
284
|
-
* Get historical rates by period.
|
|
286
|
+
* Get historical rates by period. Paid plans only: free and trial keys
|
|
287
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
285
288
|
*
|
|
286
289
|
* ```ts
|
|
287
290
|
* const history = await client.getHistoricalRates('USD', 'EUR', '30d');
|
|
@@ -299,7 +302,7 @@ declare class AllRatesToday {
|
|
|
299
302
|
* const result = await client.convert('USD', 'EUR', 1000);
|
|
300
303
|
* console.log(`$1,000 = €${result.result}`);
|
|
301
304
|
*
|
|
302
|
-
* // Historical conversion
|
|
305
|
+
* // Historical conversion (paid plans only)
|
|
303
306
|
* const result = await client.convert('USD', 'EUR', 1000, { date: '2026-01-15' });
|
|
304
307
|
* console.log(`Rate on Jan 15: ${result.rate}`);
|
|
305
308
|
* ```
|
package/dist/index.d.ts
CHANGED
|
@@ -188,7 +188,8 @@ declare class AllRatesToday {
|
|
|
188
188
|
*/
|
|
189
189
|
latest(options?: LatestOptions): Promise<LatestResponse>;
|
|
190
190
|
/**
|
|
191
|
-
* Get exchange rates for a specific historical date.
|
|
191
|
+
* Get exchange rates for a specific historical date. Paid plans only: free and trial keys
|
|
192
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
192
193
|
*
|
|
193
194
|
* ```ts
|
|
194
195
|
* // Using a string
|
|
@@ -203,7 +204,8 @@ declare class AllRatesToday {
|
|
|
203
204
|
*/
|
|
204
205
|
forDate(date: string | Date, options?: ForDateOptions): Promise<ForDateResponse>;
|
|
205
206
|
/**
|
|
206
|
-
* Get exchange rate time series between two dates.
|
|
207
|
+
* Get exchange rate time series between two dates. Paid plans only: free and trial keys
|
|
208
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
207
209
|
*
|
|
208
210
|
* ```ts
|
|
209
211
|
* const data = await client.timeSeries('2026-01-01', '2026-03-31', {
|
|
@@ -245,7 +247,7 @@ declare class AllRatesToday {
|
|
|
245
247
|
* console.log(`ECB ${usd.rate_date}: 1 EUR = ${usd.rate} USD`);
|
|
246
248
|
* ```
|
|
247
249
|
*
|
|
248
|
-
* Dated tables and history need a
|
|
250
|
+
* Dated tables and history need a paid plan: see `/api/v1/central-bank/{bank}/{date}`.
|
|
249
251
|
*/
|
|
250
252
|
officialRates(bank: string, options?: OfficialRateOptions): Promise<OfficialRatesResponse>;
|
|
251
253
|
/**
|
|
@@ -281,7 +283,8 @@ declare class AllRatesToday {
|
|
|
281
283
|
*/
|
|
282
284
|
getRates(source: string, target: string, options?: RequestOptions): Promise<AuthRateResponse[]>;
|
|
283
285
|
/**
|
|
284
|
-
* Get historical rates by period.
|
|
286
|
+
* Get historical rates by period. Paid plans only: free and trial keys
|
|
287
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
285
288
|
*
|
|
286
289
|
* ```ts
|
|
287
290
|
* const history = await client.getHistoricalRates('USD', 'EUR', '30d');
|
|
@@ -299,7 +302,7 @@ declare class AllRatesToday {
|
|
|
299
302
|
* const result = await client.convert('USD', 'EUR', 1000);
|
|
300
303
|
* console.log(`$1,000 = €${result.result}`);
|
|
301
304
|
*
|
|
302
|
-
* // Historical conversion
|
|
305
|
+
* // Historical conversion (paid plans only)
|
|
303
306
|
* const result = await client.convert('USD', 'EUR', 1000, { date: '2026-01-15' });
|
|
304
307
|
* console.log(`Rate on Jan 15: ${result.rate}`);
|
|
305
308
|
* ```
|
package/dist/index.js
CHANGED
|
@@ -165,7 +165,8 @@ var AllRatesToday = class {
|
|
|
165
165
|
return { base: params.source, date, rates };
|
|
166
166
|
}
|
|
167
167
|
/**
|
|
168
|
-
* Get exchange rates for a specific historical date.
|
|
168
|
+
* Get exchange rates for a specific historical date. Paid plans only: free and trial keys
|
|
169
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
169
170
|
*
|
|
170
171
|
* ```ts
|
|
171
172
|
* // Using a string
|
|
@@ -190,7 +191,8 @@ var AllRatesToday = class {
|
|
|
190
191
|
return { base: source, date: dateStr, rates };
|
|
191
192
|
}
|
|
192
193
|
/**
|
|
193
|
-
* Get exchange rate time series between two dates.
|
|
194
|
+
* Get exchange rate time series between two dates. Paid plans only: free and trial keys
|
|
195
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
194
196
|
*
|
|
195
197
|
* ```ts
|
|
196
198
|
* const data = await client.timeSeries('2026-01-01', '2026-03-31', {
|
|
@@ -254,7 +256,7 @@ var AllRatesToday = class {
|
|
|
254
256
|
* console.log(`ECB ${usd.rate_date}: 1 EUR = ${usd.rate} USD`);
|
|
255
257
|
* ```
|
|
256
258
|
*
|
|
257
|
-
* Dated tables and history need a
|
|
259
|
+
* Dated tables and history need a paid plan: see `/api/v1/central-bank/{bank}/{date}`.
|
|
258
260
|
*/
|
|
259
261
|
async officialRates(bank, options = {}) {
|
|
260
262
|
const code = bank.trim().toLowerCase();
|
|
@@ -329,7 +331,8 @@ var AllRatesToday = class {
|
|
|
329
331
|
return this.request("/api/v1/rates", { source, target }, key);
|
|
330
332
|
}
|
|
331
333
|
/**
|
|
332
|
-
* Get historical rates by period.
|
|
334
|
+
* Get historical rates by period. Paid plans only: free and trial keys
|
|
335
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
333
336
|
*
|
|
334
337
|
* ```ts
|
|
335
338
|
* const history = await client.getHistoricalRates('USD', 'EUR', '30d');
|
|
@@ -358,7 +361,7 @@ var AllRatesToday = class {
|
|
|
358
361
|
* const result = await client.convert('USD', 'EUR', 1000);
|
|
359
362
|
* console.log(`$1,000 = €${result.result}`);
|
|
360
363
|
*
|
|
361
|
-
* // Historical conversion
|
|
364
|
+
* // Historical conversion (paid plans only)
|
|
362
365
|
* const result = await client.convert('USD', 'EUR', 1000, { date: '2026-01-15' });
|
|
363
366
|
* console.log(`Rate on Jan 15: ${result.rate}`);
|
|
364
367
|
* ```
|
package/dist/index.mjs
CHANGED
|
@@ -139,7 +139,8 @@ var AllRatesToday = class {
|
|
|
139
139
|
return { base: params.source, date, rates };
|
|
140
140
|
}
|
|
141
141
|
/**
|
|
142
|
-
* Get exchange rates for a specific historical date.
|
|
142
|
+
* Get exchange rates for a specific historical date. Paid plans only: free and trial keys
|
|
143
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
143
144
|
*
|
|
144
145
|
* ```ts
|
|
145
146
|
* // Using a string
|
|
@@ -164,7 +165,8 @@ var AllRatesToday = class {
|
|
|
164
165
|
return { base: source, date: dateStr, rates };
|
|
165
166
|
}
|
|
166
167
|
/**
|
|
167
|
-
* Get exchange rate time series between two dates.
|
|
168
|
+
* Get exchange rate time series between two dates. Paid plans only: free and trial keys
|
|
169
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
168
170
|
*
|
|
169
171
|
* ```ts
|
|
170
172
|
* const data = await client.timeSeries('2026-01-01', '2026-03-31', {
|
|
@@ -228,7 +230,7 @@ var AllRatesToday = class {
|
|
|
228
230
|
* console.log(`ECB ${usd.rate_date}: 1 EUR = ${usd.rate} USD`);
|
|
229
231
|
* ```
|
|
230
232
|
*
|
|
231
|
-
* Dated tables and history need a
|
|
233
|
+
* Dated tables and history need a paid plan: see `/api/v1/central-bank/{bank}/{date}`.
|
|
232
234
|
*/
|
|
233
235
|
async officialRates(bank, options = {}) {
|
|
234
236
|
const code = bank.trim().toLowerCase();
|
|
@@ -303,7 +305,8 @@ var AllRatesToday = class {
|
|
|
303
305
|
return this.request("/api/v1/rates", { source, target }, key);
|
|
304
306
|
}
|
|
305
307
|
/**
|
|
306
|
-
* Get historical rates by period.
|
|
308
|
+
* Get historical rates by period. Paid plans only: free and trial keys
|
|
309
|
+
* get a 403 `historical_requires_paid_plan` error.
|
|
307
310
|
*
|
|
308
311
|
* ```ts
|
|
309
312
|
* const history = await client.getHistoricalRates('USD', 'EUR', '30d');
|
|
@@ -332,7 +335,7 @@ var AllRatesToday = class {
|
|
|
332
335
|
* const result = await client.convert('USD', 'EUR', 1000);
|
|
333
336
|
* console.log(`$1,000 = €${result.result}`);
|
|
334
337
|
*
|
|
335
|
-
* // Historical conversion
|
|
338
|
+
* // Historical conversion (paid plans only)
|
|
336
339
|
* const result = await client.convert('USD', 'EUR', 1000, { date: '2026-01-15' });
|
|
337
340
|
* console.log(`Rate on Jan 15: ${result.rate}`);
|
|
338
341
|
* ```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allratestoday/sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.9",
|
|
4
4
|
"description": "Exchange Rate API — Real-time mid-market currency exchange rates for Node.js and browsers. 160+ currencies, zero dependencies, free tier.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"fx",
|
|
34
34
|
"exchangerate",
|
|
35
35
|
"exchange rate",
|
|
36
|
+
"exchange rates",
|
|
36
37
|
"currency-api",
|
|
37
38
|
"currency-exchange-rates",
|
|
38
39
|
"forex-api",
|