Skip to content
Back to projects

Live

API Tasa Dólar RD — the dollar rate as open data

A free, public API — no sign-up, no key — that returns the dollar rate from more than twenty Dominican institutions as JSON.

Year
2026
Role
Personal project, solo
Stack
Node.js · Express · TypeScript · Axios · Docker
Overview of API Tasa Dólar RD — the dollar rate as open data

Context

After building Precio Dólar RD, people wrote to me several times asking the same thing: whether there was a way to consume those rates from another program. Accountants dropping them into a spreadsheet, shops charging in dollars, someone building their own project. In the Dominican Republic no institution publishes its rate in a format a machine can read, so I exposed mine: an open endpoint, free and without sign-up.

The problem

Collecting the rate wasn't the problem —that was already solved— it was that everyone who needed it had to write their own scraper and maintain it whenever the source changed. And a keyless API is exposed to a single badly written consumer saturating it for everyone else.

The solution

An Express service with a single endpoint, `GET /api/dolar`, returning the individual institutions, the market average and the Central Bank's official rate in a response with a stable shape. Open CORS so it can be called from the browser without a proxy, a limit of 100 requests per minute per IP, and a multi-stage Docker deployment behind a reverse proxy.

Technical decisions

  • No API key, no sign-up: requiring an account to look up a public rate turns something that should be one line of code into paperwork.
  • The limit is per IP rather than per token, precisely because there is no token. A hundred requests a minute is plenty for any legitimate use and stops a runaway script.
  • Express needs `trust proxy` behind the reverse proxy: without it every request arrives with the proxy's IP and the limit would apply to all traffic as if it were a single client.
  • The average is computed here, not copied from the source: the page stopped emitting that row, and depending on a value that can disappear is more fragile than deriving it from the banks.
  • The sell average excludes institutions reporting 0, because a missing value isn't a rate of zero and would drag the average down.
  • I identify the Central Bank by its `isOfficial` flag rather than by name: that row's label has already changed once, and comparing strings would have broken the field silently.
  • The response contract holds even when the source fails: whoever consumes the API codes against a fixed shape, not against whatever came back today.

Results

  • Public endpoint at apitasadolar.yagua.site, consumable from the browser with no key and no proxy.
  • More than twenty institutions, the market average and the official rate in a single JSON response.
  • Two-stage Docker container: the final image carries only production dependencies and the compiled code.

Project screenshots

Click any image to enlarge it.