Skip to main content

A Python client for Fixer API_

|Build Status| |Coverage Status| |Supports Wheel format| |Latest PyPI version| |Documentation Status| |Requirements Status|

Fixer API_ (formerly known as Fixer.io) is a free JSON API for current and historical foreign exchange rates published by the European Central Bank.

The rates are updated daily around 3 pm CET.

Installation

Install fixerio with:

::

pip install fixerio-client

Or with:

::

easy_install fixerio-client

Or you can get the source from GitHub at https://github.com/xsaren11/fixerio.

Usage

Get the latest foreign exchange reference rates in JSON format.

.. code:: python

>>> from fixerio import Fixerio

>>> fxrio = Fixerio(access_key='YOUR ACCESS KEY')
>>> fxrio.latest()
'''
 {'base': 'EUR',
 'date': '2016-05-27',
 'rates': {'AUD': 1.5483,
  'BGN': 1.9558,
  'BRL': 4.031,
  'CAD': 1.456,
  'CHF': 1.1068,
  'CNY': 7.3281,
  'CZK': 27.028,
  'DKK': 7.4367,
  'GBP': 0.76245,
  'HKD': 8.6735,
  'HRK': 7.4905,
  'HUF': 314.21,
  'IDR': 15157.25,
  'ILS': 4.2938,
  'INR': 74.867,
  'JPY': 122.46,
  'KRW': 1316.98,
  'MXN': 20.6611,
  'MYR': 4.5554,
  'NOK': 9.282,
  'NZD': 1.6586,
  'PHP': 52.096,
  'PLN': 4.3912,
  'RON': 4.5034,
  'RUB': 73.7516,
  'SEK': 9.2673,
  'SGD': 1.536,
  'THB': 39.851,
  'TRY': 3.2928,
  'USD': 1.1168,
  'ZAR': 17.4504}}
'''

Get historical rates for any day since 1999.

.. code:: python

>>> import datetime
>>> from fixerio import Fixerio

>>> today = datetime.date.today()
>>> fxrio = Fixerio(access_key='YOUR ACCESS KEY')
>>> fxrio.historical_rates(today)
'''
{'base': 'EUR',
 'date': '2016-05-27',
 'rates': {'AUD': 1.5483,
  'BGN': 1.9558,
  'BRL': 4.031,
  'CAD': 1.456,
  'CHF': 1.1068,
  'CNY': 7.3281,
  'CZK': 27.028,
  'DKK': 7.4367,
  'GBP': 0.76245,
  'HKD': 8.6735,
  'HRK': 7.4905,
  'HUF': 314.21,
  'IDR': 15157.25,
  'ILS': 4.2938,
  'INR': 74.867,
  'JPY': 122.46,
  'KRW': 1316.98,
  'MXN': 20.6611,
  'MYR': 4.5554,
  'NOK': 9.282,
  'NZD': 1.6586,
  'PHP': 52.096,
  'PLN': 4.3912,
  'RON': 4.5034,
  'RUB': 73.7516,
  'SEK': 9.2673,
  'SGD': 1.536,
  'THB': 39.851,
  'TRY': 3.2928,
  'USD': 1.1168,
  'ZAR': 17.4504}}
'''

Request specific exchange rates by setting the symbols parameter.

.. code:: python

>>> from fixerio import Fixerio

>>> fxrio = Fixerio(access_key='YOUR ACCESS KEY', symbols=['USD', 'GBP'])
>>> fxrio.latest()
'''
{'base': 'EUR',
 'date': '2016-05-27',
 'rates': {'GBP': 0.76245, 'USD': 1.1168}}
'''

.. code:: python

>>> from fixerio import Fixerio

>>> fxrio = Fixerio(access_key='YOUR ACCESS KEY')
>>> fxrio.latest(symbols=['USD', 'GBP'])
'''
{'base': 'EUR',
 'date': '2016-05-27',
 'rates': {'GBP': 0.76245, 'USD': 1.1168}}
'''

.. :changelog:

Release History

1.0.0 (2024-04-12)

- Update to the `new Fixer API endpoint on API Layer <https://api.apilayer.com/fixer/>`_.
- Re-add support for changing base currency. This option is once again supported by Free Plan.
- Always use TLS encrypted endpoint, since this is once again supported by Free Plan.
- Add new API function, available_currencies(), for listing supported currency symbols.
- Replace unit tests based on nosetest with unit tests based on pytest (nose is not supported
  by modern Python 3 versions).
- Remove support for Python 2.
- Add type hints for all methods.
- Update to the `new Fixer endpoint <https://data.fixer.io/api/>`_.
- Add Fixer API Access Key support.
- Drop Changing base currency support. This option is not supported by Free Plan.
- Drop SSL Encryption support. This option is not supported by Free Plan.

0.1.1 (2016-06-16)
  • Initial version.

Release files for fixerio-client 1.0.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 fixerio-client 1.0.0
File Size Uploaded
fixerio_client-1.0.0.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fixerio-client 1.0.0
File Interpreter ABI Platform
fixerio_client-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / fixerio_client-1.0.0.tar.gz

Download URL fixerio_client-1.0.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
971f7986af4f86f4305e7403dad7868d2b605114572cef07c2a8086645937c3a
BLAKE2b-256 checksum
How to use checksums
2e20471846a75e8c5269178fcd82a340878661b62a8e6108ea75038ec74ca4b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.0

Release files / fixerio_client-1.0.0-py3-none-any.whl

Download URL fixerio_client-1.0.0-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23230371db152b8282e0e0a4614296c4c1597cbaf5953c24b28d61026e5b1ef1
BLAKE2b-256 checksum
How to use checksums
eedd73e7471ed1098e39374c6228973dc313a3090a75d7f9ed652896c81a5a05
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.0

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

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