Skip to content

Edsoncame/tipo-cambio-peru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tipo-cambio-peru

TypeScript client for Peru's official exchange rate APIs. ESM, no external dependencies, MIT.

Installation

npm install tipo-cambio-peru

Usage

import { getTCToday, getBCRPRange, calcStats, convert } from 'tipo-cambio-peru';

const today = await getTCToday();
// → { date: '2026-04-25', buy: 3.4592, sell: 3.4791 }

const range = await getBCRPRange('2026-03-26', '2026-04-26');
const stats = calcStats(range);

const soles = convert(1000, 'USD', 'PEN', today);

API

Function Description
getTCToday() Latest available exchange rate.
getBCRPRange(start, end) Historical interbank rate range.
getBCRPSeries(series, start, end) Specific series access.
calcStats(rows) Aggregate statistics over a series.
convert(amount, from, to, rate) Convert between PEN and USD.

License

MIT

About

Tipo de cambio oficial del Perú: BCRP, SBS, SUNAT en una sola llamada. TS+ESM, MIT. Mantenido por Securex (https://securex.pe).

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors