Skip to main content

Official Python SDK for AllRatesToday exchange rate API

Project description

allratestoday

Official Python SDK for the AllRatesToday exchange rate API.

Real-time mid-market exchange rates for 160+ currencies, sourced from Reuters (Refinitiv) and interbank market feeds.

Installation

pip install allratestoday

Quick Start

Get your free API key at allratestoday.com/register (300 requests/month free).

from allratestoday import AllRatesToday

client = AllRatesToday(api_key="art_live_your_key_here")

# Get exchange rate
rate = client.get_rate("USD", "EUR")
print(f"1 USD = {rate[0]['rate']} EUR")

# Convert amount
result = client.convert("USD", "EUR", 100)
print(f"$100 = €{result['result']}")

# Get historical rates
history = client.get_historical_rates("USD", "EUR", "30d")
for point in history["rates"]:
    print(f"{point['time']}: {point['rate']}")

API Reference

AllRatesToday(api_key, base_url=None, timeout=10)

Parameter Type Default Description
api_key str required Your API key (register free)
base_url str https://allratestoday.com API base URL
timeout int 10 Request timeout in seconds

Methods

Method Description
get_rate(from, to, amount=None) Get exchange rate between two currencies
convert(from, to, amount) Convert amount between currencies
get_rates(source, target) Get rate data with metadata
get_historical_rates(source, target, period) Historical rates (1d/7d/30d/1y)

All methods require an API key.

Error Handling

from allratestoday import AllRatesToday, AllRatesTodayError

client = AllRatesToday(api_key="art_live_your_key_here")

try:
    rate = client.get_rate("USD", "INVALID")
except AllRatesTodayError as e:
    print(e)        # Error message
    print(e.status)  # HTTP status code (e.g., 400)

Zero Dependencies

This SDK uses only Python standard library (urllib, json). No external dependencies required.

Pricing

Plan Requests/Month Price
Free 300 Free
Small 5,000 €4.99/mo
Medium 10,000 €9.99/mo
Large 100,000 €49.99/mo

Links

License

MIT

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

allratestoday-1.2.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

allratestoday-1.2.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file allratestoday-1.2.1.tar.gz.

File metadata

  • Download URL: allratestoday-1.2.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for allratestoday-1.2.1.tar.gz
Algorithm Hash digest
SHA256 97e7105df52b1169135d6db9d10daf009f55ac03ea34480b81ecf92ccb82a5cf
MD5 74ac7e763cdc9f77fa7df8515a30ce61
BLAKE2b-256 879dd71e8a89ced2f1797e4342722972dae02c41498ab7e6c1e8a1b55264f9ff

See more details on using hashes here.

File details

Details for the file allratestoday-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: allratestoday-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for allratestoday-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c64042be2a628759670ec94f32a966ad1e212ff0713704282b969a5772fee9c7
MD5 f2b907a73cfc28f4c158a534c3dadde2
BLAKE2b-256 60fcfc919124ed93e59f38c96e88284c4b5f6b81732f975f6232e6d36d88769f

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