Skip to content

UniRate-API/unirate-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unirate CLI

Currency exchange rates, conversion, and VAT lookups from the UniRate API — straight from your terminal.

$ unirate convert 100 USD EUR
100 USD = 92.5 EUR

$ unirate rate USD JPY
1 USD = 150 JPY

$ unirate rates EUR --json | jq '.rates.USD'
1.08
  • Real-time rates between 170+ currencies (fiat + crypto)
  • Currency conversion, all-rates tables, and supported-currency listing
  • VAT rates for countries worldwide
  • Historical rates + time series (Pro)
  • --json on every command for clean piping into jq
  • Single static binary, zero third-party dependencies beyond the official Go client
  • Free tier, no credit card required — get a key

Install

Homebrew (macOS):

brew install --cask UniRate-API/unirate/unirate

Scoop (Windows):

scoop bucket add unirate https://github.com/UniRate-API/scoop-unirate
scoop install unirate

Go (any platform with a Go toolchain):

go install github.com/UniRate-API/unirate-cli@latest

Binaries: prebuilt archives for linux/macOS/windows (amd64 + arm64) are attached to each GitHub release.

Authentication

Every command needs an API key. Set it once in your environment:

export UNIRATE_API_KEY="your-api-key"

or pass it per-invocation with --api-key.

Commands

Command Description
unirate convert <amount> <from> <to> Convert an amount between two currencies
unirate rate <from> <to> Exchange rate for a single pair
unirate rates [base] All rates for a base currency (default USD)
unirate currencies List supported currency codes
unirate vat [country] VAT rates — all countries, or one ISO-3166 code
unirate historical <date> <from> <to> Historical rate on a date (Pro)
unirate timeseries <start> <end> Historical rates over a range (Pro)
unirate version Print the CLI version

Common flags

Available on every data command:

  • --api-key <key> — API key (defaults to $UNIRATE_API_KEY)
  • --json — emit JSON instead of human-readable text
  • --timeout <dur> — per-request timeout (default 30s, e.g. --timeout 5s)

Command-specific flags

  • historical --amount <n> — convert <n> units instead of returning the unit rate
  • timeseries --base <code> / --amount <n> / --currencies <a,b,c>

Examples

unirate convert 49.99 USD GBP
unirate rate EUR USD --json
unirate rates JPY
unirate vat FR
unirate historical 2024-01-01 USD EUR --amount 250
unirate timeseries 2024-01-01 2024-01-07 --base USD --currencies EUR,GBP,JPY

See examples/usage.sh for a full session.

Error handling

The CLI maps API failures to friendly messages and exit codes:

Exit code Meaning
0 success
1 runtime / API error (auth, rate limit, unknown currency, Pro-gated, network)
2 usage error (bad arguments or flags)

Historical and time-series endpoints are Pro-gated and return a clear "requires a UniRate Pro subscription" message on the free tier.

Distribution

Releases are cut by pushing a v* tag; GoReleaser builds the cross-platform archives, checksums, and the Homebrew/Scoop manifests in CI. The Homebrew tap and Scoop bucket live in sibling repos (UniRate-API/homebrew-unirate, UniRate-API/scoop-unirate); pushing to them requires the TAP_GITHUB_TOKEN repo secret (a PAT with repo scope).

Related clients

This CLI wraps the official Go client. UniRate also ships native libraries for many languages and frameworks.

Other UniRate clients

UniRate ships official client libraries and framework integrations across the ecosystem. The repos below are all maintained under the UniRate-API org.

Get a free API key at unirateapi.com.

License

MIT — see LICENSE.

About

Command-line interface for the UniRate API — currency conversion, exchange rates, and VAT in your terminal.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages