Skip to main content

CurrencyApi Python wrapper

PyPI version Coverage Status

Note: API v1 is deprecated and will be retired on 31st July 2026, at which point all v1 traffic will be redirected to v2. This SDK (v2.0.0+) targets API v2. If you are on an older version of this SDK, please upgrade.

CurrencyApi.net provides live currency rates via a REST API. A live currency feed for over 166 currencies, including physical (USD, GBP, EUR + more) and cryptos (Bitcoin, Litecoin, Ethereum + more). A JSON and XML currency api updated every 60 seconds.

Features:

  • Live exchange rates (updated every 60 seconds).
  • 166 currencies world currencies.
  • Popular cryptocurrencies included; Bitcoin, Litecoin etc.
  • Convert currencies on the fly with the convert endpoint.
  • Historical currency rates back to year 2000.
  • OHLC (Open, High, Low, Close) data for technical analysis (Tier 3+).
  • Easy to follow documentation

Signup for a free or paid account here.

This package is a:

Python wrapper for CurrencyApi.net endpoints (API v2).

Developer Guide

For an easy to following developer guide, check out our Python Developer Guide.

Alternatively keep reading below.

Prerequisites

  • Minimum Python version 3.10
  • Last tested and working on Python 3.14
  • Free or Paid account with CurrencyApi.net

Test Coverage

  • 100% coverage

Installation

View our Python SDK guide

pip install currencyapinet

Usage

from currencyapinet import Currency

currency = Currency('YOUR_API_KEY')

Rates

Returns live currency rates for all supported currencies. Base currency defaults to USD.

result = currency.rates().get()

# With optional base currency
result = currency.rates().base('EUR').get()

# XML output
result = currency.rates().output('XML').get()

Convert

Converts an amount from one currency to another.

result = currency.convert().from_currency('USD').to_currency('EUR').amount(100).get()

History

Returns historical currency rates for a specific date.

result = currency.history().date('2023-12-25').get()

# With optional base currency
result = currency.history().base('GBP').date('2023-12-25').get()

Timeframe

Returns historical currency rates for a date range (max 365 days).

result = currency.timeframe().start_date('2023-12-01').end_date('2023-12-31').get()

# With optional base currency
result = currency.timeframe().base('GBP').start_date('2023-12-01').end_date('2023-12-31').get()

Currencies

Returns a list of all supported currencies.

result = currency.currencies().get()

OHLC

Returns OHLC (Open, High, Low, Close) data for a currency pair on a specific date. Requires a Tier 3 subscription.

Parameters:

Parameter Required Description
quote Yes Quote currency code (e.g. EUR, GBP, BTC)
date Yes Date in YYYY-MM-DD format (must be in the past)
base No Base currency code (defaults to USD)
interval No Time interval: 5m, 15m, 30m, 1h, 4h, 12h, 1d (defaults to 1d)
# Basic request (1-day interval)
result = currency.ohlc().quote('EUR').date('2023-12-25').get()

# With custom interval
result = currency.ohlc().quote('GBP').date('2023-12-25').interval('1h').get()

# With custom base currency and interval
result = currency.ohlc().quote('JPY').date('2023-12-25').base('EUR').interval('4h').get()

# XML output
result = currency.ohlc().quote('EUR').date('2023-12-25').output('XML').get()

Example response:

{
  "valid": true,
  "base": "USD",
  "quote": "EUR",
  "date": "2023-12-25",
  "interval": "1d",
  "ohlc": [
    {
      "start": "2023-12-25T00:00:00Z",
      "open": 0.92000000000000,
      "high": 0.92500000000000,
      "low": 0.91800000000000,
      "close": 0.92200000000000
    }
  ]
}

Metadata

Release files for currencyapinet 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for currencyapinet 2.1.0
File Size Uploaded Provenance Actions
currencyapinet-2.1.0.tar.gz 9.4 kB Without provenance Details for currencyapinet-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for currencyapinet 2.1.0
File Interpreter ABI Platform Actions
currencyapinet-2.1.0-py3-none-any.whl Python 3 none any Details for currencyapinet-2.1.0-py3-none-any.whl

Total release size: 22.4 kB

Release files / currencyapinet-2.1.0.tar.gz

Download URL currencyapinet-2.1.0.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bc80d54382cfeb648dd9906f70e1a8a4b1bf6c4724cd302c841c214be3d45bf7
BLAKE2b-256 checksum
How to use checksums
c61ecb99a006fecf7c6792a91f5365700801fdcc99a9b1834f8129687b6bee15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / currencyapinet-2.1.0-py3-none-any.whl

Download URL currencyapinet-2.1.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f3ed4befd4e74ecc5112a88cfcf03573f66d96df894754dae752748bf487c18
BLAKE2b-256 checksum
How to use checksums
30cb6d255b15d2d9097db41a0889541877049fb9855f81bc8193deece694327c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for currencyapinet 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page