bcrd-exchange-rate 1.2.2 → 1.3.1

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 +72 -16
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Banco Central de la República Dominicana Exchange Rate API — bcrd-exchange-rate
1
+ # Banco Central de la República Dominicana Exchange Rates API — bcrd-exchange-rate
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/bcrd-exchange-rate.svg)](https://www.npmjs.com/package/bcrd-exchange-rate)
4
4
  [![license](https://img.shields.io/npm/l/bcrd-exchange-rate.svg)](https://github.com/AllRates-Today/bcrd-exchange-rate/blob/main/LICENSE)
@@ -18,6 +18,21 @@
18
18
 
19
19
  > **Official rate, not mid-market:** every value here is a number Banco Central de la República Dominicana itself published, fixed once printed and carrying the central bank's own `rate_date` — what filings and audits require. Need the live interbank midpoint for pricing or display instead? Use the [mid-market API](https://allratestoday.com/docs/) or [`@allratestoday/sdk`](https://www.npmjs.com/package/@allratestoday/sdk). The two can diverge by several percent.
20
20
 
21
+ ## ⚡ Try it without a key
22
+
23
+ The latest Banco Central de la República Dominicana table is also served keyless, CORS-open and edge-cached, for evaluation, embeds and AI agents:
24
+
25
+ ```bash
26
+ curl "https://allratestoday.com/api/open/central-bank/bcrd?source=USD&target=DOP"
27
+ ```
28
+
29
+ ```js
30
+ const r = await fetch('https://allratestoday.com/api/open/central-bank/bcrd').then((x) => x.json());
31
+ console.log(r.rate_date, r.rates.length); // the central bank's latest published table, no key
32
+ ```
33
+
34
+ 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
+
21
36
  ## 🔑 Get your API key
22
37
 
23
38
  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.
@@ -36,7 +51,7 @@ yarn add bcrd-exchange-rate
36
51
  pnpm add bcrd-exchange-rate
37
52
  ```
38
53
 
39
- Also published under the org scope as [`@allratestoday/bcrd-exchange-rate`](https://www.npmjs.com/package/@allratestoday/bcrd-exchange-rate) — same code, same versions.
54
+ Requires Node 18+ (global `fetch`); also runs on Bun, Deno and edge runtimes. Also published under the org scope as [`@allratestoday/bcrd-exchange-rate`](https://www.npmjs.com/package/@allratestoday/bcrd-exchange-rate) — same code, same versions.
40
55
 
41
56
  ## 🏁 Quick start
42
57
 
@@ -70,14 +85,14 @@ const pair = await getRate('USD', 'DOP', { apiKey: 'art_live_...' });
70
85
  {
71
86
  bank: 'bcrd',
72
87
  name: 'Banco Central de la República Dominicana',
73
- rate_date: '2026-08-10', // Banco Central de la República Dominicana's own publication date
88
+ rate_date: '2026-09-08', // Banco Central de la República Dominicana's own publication date
74
89
  source: 'USD',
75
90
  target: 'DOP',
76
- rate: 58.199,
77
- rate_type: 'reference',
91
+ rate: 58.8666,
92
+ rate_type: 'sell',
78
93
  derived: false,
79
94
  method: 'published',
80
- disclaimer: '…'
95
+ disclaimer: 'Official rates as published by the named central bank. On weekends/holidays the most recent published rate_date is returned.'
81
96
  }
82
97
  ```
83
98
 
@@ -98,11 +113,10 @@ console.log(table.rate_date, table.rates.length);
98
113
  {
99
114
  bank: 'bcrd',
100
115
  name: 'Banco Central de la República Dominicana',
101
- rate_date: '2026-08-10',
116
+ rate_date: '2026-09-08',
102
117
  rates: [
103
- { "base": "USD", "quote": "DOP", "type": "reference", "value": 58.199 },
104
- { "base": "USD", "quote": "DOP", "type": "sell", "value": 58.5403 },
105
- { "base": "USD", "quote": "DOP", "type": "buy", "value": 58.199 },
118
+ { "base": "USD", "quote": "DOP", "type": "sell", "value": 58.8666 },
119
+ { "base": "USD", "quote": "DOP", "type": "buy", "value": 58.6307 },
106
120
  // … the rest of the published table (14 currencies vs DOP)
107
121
  ],
108
122
  disclaimer: '…'
@@ -142,7 +156,7 @@ Paid plans. One resolved rate per publication date — ready for charting, reval
142
156
  import { getHistory } from 'bcrd-exchange-rate';
143
157
 
144
158
  const series = await getHistory(
145
- { source: 'USD', target: 'DOP', from: '2026-01-01', to: '2026-08-10' },
159
+ { source: 'USD', target: 'DOP', from: '2026-01-01', to: '2026-09-08' },
146
160
  { apiKey: 'art_live_...' }
147
161
  );
148
162
  ```
@@ -155,11 +169,11 @@ const series = await getHistory(
155
169
  source: 'USD',
156
170
  target: 'DOP',
157
171
  from: '2026-01-01',
158
- to: '2026-08-10',
172
+ to: '2026-09-08',
159
173
  count: 152,
160
174
  rates: [
161
175
  // one entry per publication date
162
- { date: '2026-08-10', rate: 58.199, rate_type: 'reference', derived: false, method: 'published' },
176
+ { date: '2026-09-08', rate: 58.8666, rate_type: 'sell', derived: false, method: 'published' },
163
177
  // …
164
178
  ],
165
179
  disclaimer: '…'
@@ -172,9 +186,42 @@ Pass `{ symbol: 'USD' }` instead of `source`/`target` to get the raw published r
172
186
 
173
187
  ## 🗺️ Currencies covered
174
188
 
175
- Banco Central de la República Dominicana currently publishes rates covering **15 currencies** (as of the latest table):
189
+ Banco Central de la República Dominicana currently publishes rates covering **14 currencies** against the DOP (as of the latest table):
190
+
191
+ 🇦🇺 `AUD` · 🇧🇷 `BRL` · 🇨🇦 `CAD` · 🇨🇭 `CHF` · 🇨🇳 `CNY` · 🇩🇰 `DKK` · 🇪🇺 `EUR` · 🇬🇧 `GBP` · 🇯🇵 `JPY` · 🇳🇴 `NOK` · 🇸🇪 `SEK` · 🇺🇸 `USD` · 🇻🇪 `VES` · `XDR`
192
+
193
+ ## 🏛️ Source
194
+
195
+ The Banco Central de la República Dominicana publishes the reference buy and sell rates for the US dollar in the spot market each business day (history to 1991), plus a convertible-rate table for around 14 other currencies since 2004 — the official series behind peso invoicing, bank settlement, and DGII tax filings.
196
+
197
+ - Publisher's own page: [Tasas de cambio del mercado spot](https://www.bancentral.gov.do/a/d/2537-mercado-cambiario) · [www.bancentral.gov.do](https://www.bancentral.gov.do)
198
+ - Publication: every business day; the exact schedule, freshness status and any current delay are on the [Banco Central de la República Dominicana rates page](https://allratestoday.com/central-bank-rates-api/bcrd/)
199
+ - Values are stored unmodified, with the publisher's own `rate_date` on every row — see the [methodology](https://allratestoday.com/official-rates-methodology/)
176
200
 
177
- `AUD` · `BRL` · `CAD` · `CHF` · `CNY` · `DKK` · `DOP` · `EUR` · `GBP` · `JPY` · `NOK` · `SEK` · `USD` · `VES` · `XDR`
201
+ ## 🧭 Reading the numbers
202
+
203
+ - `value` is always **quote currency per 1 unit of base currency** (`base: "EUR", quote: "USD", value: 1.15` means 1 EUR = 1.15 USD).
204
+ - Banco Central de la República Dominicana quotes **DOP per 1 unit of foreign currency** (e.g. `base: "USD", quote: "DOP"` means DOP per one US dollar).
205
+ - Need the other way round? Ask `getRate(target, source)` and the API inverts or crosses for you, flagged `derived: true` — never divide a published rate yourself in a compliance workflow.
206
+ - `rate_type` tells you which of the central bank's series a row belongs to (`sell` here); some publishers print buy/sell or several fixings for the same pair.
207
+
208
+ ## 🧩 ERP & accounting systems
209
+
210
+ Loading the official Banco Central de la República Dominicana rate into an accounting system is a supported workflow, not a hack. Step-by-step guides with the direction each system expects:
211
+
212
+ - [Dynamics 365 Business Central](https://allratestoday.com/docs/integrations/business-central/) — built-in Currency Exchange Rate Service, no code
213
+ - [Xero](https://allratestoday.com/docs/integrations/xero/) · [QuickBooks Online](https://allratestoday.com/docs/integrations/quickbooks/) · [SAP S/4HANA and ECC](https://allratestoday.com/docs/integrations/sap/) · [Odoo](https://allratestoday.com/docs/integrations/odoo/)
214
+
215
+ The same keyed endpoints return `?format=csv`, `?format=xml` and `?format=xlsx`, and accept the key as `?api_key=` on the URL for importers that cannot send headers:
216
+
217
+ ```bash
218
+ curl "https://allratestoday.com/api/v1/central-bank/bcrd/latest?format=xml&api_key=art_live_..."
219
+ ```
220
+
221
+ ## 🤖 AI agents
222
+
223
+ - 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
224
+ - Machine-readable site guide: [llms.txt](https://allratestoday.com/llms.txt) · [for-ai-agents](https://allratestoday.com/for-ai-agents/)
178
225
 
179
226
  ## ⚖️ Published vs derived rates
180
227
 
@@ -238,11 +285,20 @@ getRate('USD', 'DOP', { apiKey: 'art_live_...' }).then((pair) => console.log(pai
238
285
  | `getRatesForDate(date, { apiKey, source?, target? })` | Paid | The official table (or one pair) for a YYYY-MM-DD date |
239
286
  | `getHistory({ symbol \| source+target, from?, to? }, { apiKey })` | Paid | Daily series since 1991 |
240
287
 
288
+ ## 📥 Bulk data (no key)
289
+
290
+ Need the whole archive rather than an API call? The same published tables are mirrored daily as open data:
291
+
292
+ - Hugging Face: [AllRates/central-bank-exchange-rates](https://huggingface.co/datasets/AllRates/central-bank-exchange-rates) — one CSV per institution (`rates/bcrd.csv`)
293
+ - Kaggle: [allratestoday/central-bank-exchange-rates](https://www.kaggle.com/datasets/allratestoday/central-bank-exchange-rates)
294
+ - CDN JSON: `https://cdn.jsdelivr.net/gh/AllRates-Today/central-bank-exchange-rates@main/data/bcrd/latest.json`
295
+
241
296
  ## 🔗 Links
242
297
 
243
298
  - [Banco Central de la República Dominicana rates page](https://allratestoday.com/central-bank-rates-api/bcrd/) — live table, publication cadence, FAQ
244
299
  - [All central bank sources](https://allratestoday.com/central-bank-rates-api/)
245
- - [API documentation](https://allratestoday.com/docs/#central-bank) · [Interactive reference](https://allratestoday.com/api-reference/)
300
+ - [Package docs on the site](https://allratestoday.com/docs/sdk/bcrd-exchange-rate/) · [ERP integration guides](https://allratestoday.com/docs/integrations/)
301
+ - [API documentation](https://allratestoday.com/docs/#central-bank) · [Interactive reference](https://allratestoday.com/api-reference/) · [Methodology](https://allratestoday.com/official-rates-methodology/)
246
302
  - [Register (free)](https://allratestoday.com/register) · [Pricing](https://allratestoday.com/pricing/)
247
303
  - [GitHub](https://github.com/AllRates-Today/bcrd-exchange-rate)
248
304
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bcrd-exchange-rate",
3
- "version": "1.2.2",
3
+ "version": "1.3.1",
4
4
  "description": "Official Banco Central de la República Dominicana (Dominican Republic) daily exchange rates — 14 currencies vs DOP, history since 1991. Zero-dependency Node.js/TypeScript client.",
5
5
  "keywords": [
6
6
  "bcrd",