Skip to main content

Official Python wrapper for forexrateapi.com

Project description

ForexRateAPI

forexrateapi is the official Python API wrapper for ForexRateAPI.com. This allows you to quickly integrate our foreign exchange rate API and currency conversion API into your application. Check https://forexrateapi.com documentation for more information.

Installation

Install the latest release with:

pip install forexrateapi

Usage

from forexrateapi.client import Client

api_key = 'SET_YOUR_API_KEY_HERE'
client = Client(api_key)

Documentation

fetchSymbols()

client.fetchSymbols()

Link


fetchLive(base, currencies)

  • base <string> Optional. Pass in a base currency, defaults to USD.
  • currencies <List<string>> Optional. Pass in an list of currencies to return values for.
client.fetchLive(base='USD', currencies=['AUD', 'CAD', 'GBP', 'JPY'])

Link


fetchHistorical(date, base, currencies)

  • date <string> Required. Pass in a string with format YYYY-MM-DD
  • base <string> Optional. Pass in a base currency, defaults to USD.
  • currencies <List<string>> Optional. Pass in an list of currencies to return values for.
client.fetchHistorical(date='2024-02-05', base='USD', currencies=['AUD', 'CAD', 'GBP', 'JPY'])

Link


ohlc(base, currency, date, date_type)

  • base <string> Optional. Pass in a base currency, defaults to USD.
  • currency <string> Required. Specify currency you would like to get OHLC for.
  • date <string> Required. Specify date to use historical midpoint value for conversion with format YYYY-MM-DD. Otherwise, it will use live exchange rate date if value not passed in.
  • date_type <string> Optional. Pass in a date type.
client.ohlc(base='USD', currency='EUR', date='2024-02-05', date_type=None)

Link


convert(from_currency, to_currency, amount, date)

  • from_currency <string> Optional. Pass in a base currency, defaults to USD.
  • to_currency <string> Required. Specify currency you would like to convert to.
  • amount <number> Required. The amount to convert.
  • date <string> Optional. Specify date to use historical midpoint value for conversion with format YYYY-MM-DD. Otherwise, it will use live exchange rate date if value not passed in.
client.convert(from_currency='USD', to_currency='EUR', amount=100, date='2024-02-05')

Link


timeframe(start_date, end_date, base, currencies)

  • start_date <string> Required. Specify the start date of your timeframe using the format YYYY-MM-DD.
  • end_date <string> Required. Specify the end date of your timeframe using the format YYYY-MM-DD.
  • base <string> Optional. Pass in a base currency, defaults to USD.
  • currencies <List<string>> Optional. Pass in an list of currencies to return values for.
client.timeframe(start_date='2024-02-05', end_date='2024-02-06', base='USD', currencies=['AUD', 'CAD', 'GBP', 'JPY'])

Link


change(start_date, end_date, base, currencies)

  • start_date <string> Required. Specify the start date of your timeframe using the format YYYY-MM-DD.
  • end_date <string> Required. Specify the end date of your timeframe using the format YYYY-MM-DD.
  • base <string> Optional. Pass in a base currency, defaults to USD.
  • currencies <List<string>> Optional. Pass in an list of currencies to return values for.
client.change(start_date='2024-02-05', end_date='2024-02-06', base='USD', currencies=['AUD', 'CAD', 'GBP', 'JPY'])

Link


usage()

client.usage()

Link

Official documentation


FAQ

  • How do I get an API Key?

    Free API Keys are available here.

  • I want more information

    Checkout our FAQs here.

Support

For support, get in touch using this form.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

forexrateapi-1.1.2.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

forexrateapi-1.1.2-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file forexrateapi-1.1.2.tar.gz.

File metadata

  • Download URL: forexrateapi-1.1.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for forexrateapi-1.1.2.tar.gz
Algorithm Hash digest
SHA256 044f0ab421d6c85c6a97fb2efaa72788f2c5f6256dcf31d6aea8da4bba8da019
MD5 c36abbb0f6df8883b06d5462a40c458c
BLAKE2b-256 b30a975c8d7a8c9c6761b2f2e5ab319e775946c6f81a5aafd51123eb402e26c6

See more details on using hashes here.

File details

Details for the file forexrateapi-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: forexrateapi-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for forexrateapi-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b8c3434f6766cc4dc2504b15fe3961df48fcd3964d8368bbfd3ee76562d9cc3f
MD5 1c712b5116f22e80aec813c377d73752
BLAKE2b-256 70f301db1de3745fc98a65eb1072ae50871f94b4ea37d8346e9207a590179d8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page