Skip to content

This is a go wrapper over the NBP currency exchange rates API

License

Notifications You must be signed in to change notification settings

igor-kupczynski/gonbp

Repository files navigation

gonbp

This is a go wrapper over the NBP currency exchange rates API.

Narodowy Bank Polski (NBP) is the central bank of the Republic of Poland. Among other tasks it publishes the official exchange rate of Złoty (the Polish currency) against other currencies. NBP provides an API to access the exchange rates.

Use from CLI

Install

go install github.com/igor-kupczynski/gonbp/cmd/nbp@v0.1.0

Fetch current day CHF rate

nbp CHF
Table No: 078/A/NBP/2022
     Day: 2022-04-22
    Rate: 4.493

Fetch previous day USD rate

nbp -p USD
Table No: 077/A/NBP/2022
     Day: 2022-04-21
    Rate: 4.2596

Fetch EUR for a given day

nbp EUR 2022-04-15
Table No: 074/A/NBP/2022
     Day: 2022-04-15
    Rate: 4.6378

Fetch CZK for a last workday before given day

nbp -p CZK 2022-04-18
Table No: 074/A/NBP/2022
     Day: 2022-04-15
    Rate: 0.1897

Use as a library

See integration_test.go.

About

This is a go wrapper over the NBP currency exchange rates API

Topics

Resources

License

Stars

Watchers

Forks

Languages