Skip to main content

Exchange Rate API

Exchange Rate looks up the conversion rate between two currency codes across 170+ currencies, with both currency names and the last-updated time. Paid plans add the inverse rate, the pair's 1-day to 1-year change, its 30-day high, low, average and volatility, past dates, and hourly and 30-day daily history.

PyPI version

This is a Python wrapper for the Exchange Rate API


Installation

Using pip:

pip install apiverve-exchangerate

Using pip3:

pip3 install apiverve-exchangerate

Configuration

Before using the Exchange Rate API client, you have to setup your account and obtain your API Key. You can get it by signing up at https://apiverve.com


Quick Start

Here's a simple example to get you started quickly:

from apiverve_exchangerate.apiClient import ExchangerateAPIClient

# Initialize the client with your APIVerve API key
api = ExchangerateAPIClient("[YOUR_API_KEY]")

query = {
    "currency1": "USD",
    "currency2": "EUR",
    "date": "2025-06-02",
    "history": true,
    "hourly": true
}

try:
    # Make the API call
    result = api.execute(query)

    # Print the result
    print(result)
except Exception as e:
    print(f"Error: {e}")

Usage

The Exchange Rate API documentation is found here: https://docs.apiverve.com/ref/exchangerate. You can find parameters, example responses, and status codes documented here.

Setup

# Import the client module
from apiverve_exchangerate.apiClient import ExchangerateAPIClient

# Initialize the client with your APIVerve API key
api = ExchangerateAPIClient("[YOUR_API_KEY]")

Perform Request

Using the API client, you can perform requests to the API.

Define Query
query = {
    "currency1": "USD",
    "currency2": "EUR",
    "date": "2025-06-02",
    "history": true,
    "hourly": true
}
Simple Request
# Make a request to the API
result = api.execute(query)

# Print the result
print(result)
Example Response
{
  "status": "ok",
  "error": null,
  "data": {
    "currency1": "USD",
    "currency2": "EUR",
    "exchangeRate": "0.895099",
    "inverseRate": "1.117195",
    "date": "2026-10-27",
    "lastUpdated": "2026-10-27T17:41:09.810Z",
    "currency1Name": "US Dollar",
    "currency2Name": "Euro",
    "change1d": 0.4467,
    "change7d": 0.5739,
    "change30d": 1.9699,
    "change1y": 4.1682,
    "high30d": 0.895099,
    "low30d": 0.878037,
    "average30d": 0.889911,
    "volatility30d": 0.2427,
    "history": [
      {
        "date": "2026-09-28",
        "rate": 0.878037
      },
      {
        "date": "2026-09-29",
        "rate": 0.880226
      },
      {
        "date": "2026-09-30",
        "rate": 0.882434
      },
      {
        "date": "2026-10-01",
        "rate": 0.883652
      },
      {
        "date": "2026-10-02",
        "rate": 0.888626
      },
      {
        "date": "2026-10-03",
        "rate": 0.888626
      },
      {
        "date": "2026-10-04",
        "rate": 0.888246
      },
      {
        "date": "2026-10-05",
        "rate": 0.894174
      },
      {
        "date": "2026-10-06",
        "rate": 0.891674
      },
      {
        "date": "2026-10-07",
        "rate": 0.890419
      },
      {
        "date": "2026-10-08",
        "rate": 0.892463
      },
      {
        "date": "2026-10-09",
        "rate": 0.889796
      },
      {
        "date": "2026-10-10",
        "rate": 0.892716
      },
      {
        "date": "2026-10-11",
        "rate": 0.892571
      },
      {
        "date": "2026-10-12",
        "rate": 0.892822
      },
      {
        "date": "2026-10-13",
        "rate": 0.894845
      },
      {
        "date": "2026-10-14",
        "rate": 0.891987
      },
      {
        "date": "2026-10-15",
        "rate": 0.890861
      },
      {
        "date": "2026-10-16",
        "rate": 0.88987
      },
      {
        "date": "2026-10-17",
        "rate": 0.889757
      },
      {
        "date": "2026-10-18",
        "rate": 0.889761
      },
      {
        "date": "2026-10-19",
        "rate": 0.890515
      },
      {
        "date": "2026-10-20",
        "rate": 0.889991
      },
      {
        "date": "2026-10-21",
        "rate": 0.890629
      },
      {
        "date": "2026-10-22",
        "rate": 0.889437
      },
      {
        "date": "2026-10-23",
        "rate": 0.891773
      },
      {
        "date": "2026-10-24",
        "rate": 0.892532
      },
      {
        "date": "2026-10-25",
        "rate": 0.892668
      },
      {
        "date": "2026-10-26",
        "rate": 0.891118
      },
      {
        "date": "2026-10-27",
        "rate": 0.895099
      }
    ],
    "hourly": [
      {
        "hour": 18,
        "rate": 0.891512,
        "timestamp": "2026-10-26T18:41:09.810Z"
      },
      {
        "hour": 19,
        "rate": 0.891173,
        "timestamp": "2026-10-26T19:41:09.810Z"
      },
      {
        "hour": 20,
        "rate": 0.8911,
        "timestamp": "2026-10-26T20:41:09.810Z"
      },
      {
        "hour": 21,
        "rate": 0.891849,
        "timestamp": "2026-10-26T21:41:09.810Z"
      },
      {
        "hour": 22,
        "rate": 0.89212,
        "timestamp": "2026-10-26T22:41:09.810Z"
      },
      {
        "hour": 23,
        "rate": 0.891692,
        "timestamp": "2026-10-26T23:41:09.810Z"
      },
      {
        "hour": 0,
        "rate": 0.891922,
        "timestamp": "2026-10-27T00:41:09.810Z"
      },
      {
        "hour": 1,
        "rate": 0.892681,
        "timestamp": "2026-10-27T01:41:09.810Z"
      },
      {
        "hour": 2,
        "rate": 0.892646,
        "timestamp": "2026-10-27T02:41:09.810Z"
      },
      {
        "hour": 3,
        "rate": 0.892287,
        "timestamp": "2026-10-27T03:41:09.810Z"
      },
      {
        "hour": 4,
        "rate": 0.892805,
        "timestamp": "2026-10-27T04:41:09.810Z"
      },
      {
        "hour": 5,
        "rate": 0.893422,
        "timestamp": "2026-10-27T05:41:09.810Z"
      },
      {
        "hour": 6,
        "rate": 0.893135,
        "timestamp": "2026-10-27T06:41:09.810Z"
      },
      {
        "hour": 7,
        "rate": 0.892984,
        "timestamp": "2026-10-27T07:41:09.810Z"
      },
      {
        "hour": 8,
        "rate": 0.8937,
        "timestamp": "2026-10-27T08:41:09.810Z"
      },
      {
        "hour": 9,
        "rate": 0.894058,
        "timestamp": "2026-10-27T09:41:09.810Z"
      },
      {
        "hour": 10,
        "rate": 0.89364,
        "timestamp": "2026-10-27T10:41:09.810Z"
      },
      {
        "hour": 11,
        "rate": 0.893781,
        "timestamp": "2026-10-27T11:41:09.810Z"
      },
      {
        "hour": 12,
        "rate": 0.894553,
        "timestamp": "2026-10-27T12:41:09.810Z"
      },
      {
        "hour": 13,
        "rate": 0.894604,
        "timestamp": "2026-10-27T13:41:09.810Z"
      },
      {
        "hour": 14,
        "rate": 0.894209,
        "timestamp": "2026-10-27T14:41:09.810Z"
      },
      {
        "hour": 15,
        "rate": 0.894651,
        "timestamp": "2026-10-27T15:41:09.810Z"
      },
      {
        "hour": 16,
        "rate": 0.895323,
        "timestamp": "2026-10-27T16:41:09.810Z"
      },
      {
        "hour": 17,
        "rate": 0.895099,
        "timestamp": "2026-10-27T17:41:09.810Z"
      }
    ]
  }
}

Error Handling

The API client provides comprehensive error handling through the ExchangerateAPIClientError exception. Here are some examples:

Basic Error Handling

from apiverve_exchangerate.apiClient import ExchangerateAPIClient, ExchangerateAPIClientError

api = ExchangerateAPIClient("[YOUR_API_KEY]")

query = {
    "currency1": "USD",
    "currency2": "EUR",
    "date": "2025-06-02",
    "history": true,
    "hourly": true
}

try:
    result = api.execute(query)
    print("Success!")
    print(result)
except ExchangerateAPIClientError as e:
    print(f"API Error: {e.message}")
    if e.status_code:
        print(f"Status Code: {e.status_code}")
    if e.response:
        print(f"Response: {e.response}")

Handling Specific Error Types

from apiverve_exchangerate.apiClient import ExchangerateAPIClient, ExchangerateAPIClientError

api = ExchangerateAPIClient("[YOUR_API_KEY]")

query = {
    "currency1": "USD",
    "currency2": "EUR",
    "date": "2025-06-02",
    "history": true,
    "hourly": true
}

try:
    result = api.execute(query)

    # Check for successful response
    if result.get('status') == 'success':
        print("Request successful!")
        print(result.get('data'))
    else:
        print(f"API returned an error: {result.get('error')}")

except ExchangerateAPIClientError as e:
    # Handle API client errors
    if e.status_code == 401:
        print("Unauthorized: Invalid API key")
    elif e.status_code == 429:
        print("Rate limit exceeded")
    elif e.status_code >= 500:
        print("Server error - please try again later")
    else:
        print(f"API error: {e.message}")
except Exception as e:
    # Handle unexpected errors
    print(f"Unexpected error: {str(e)}")

The client supports the context manager protocol for automatic resource cleanup:

from apiverve_exchangerate.apiClient import ExchangerateAPIClient, ExchangerateAPIClientError

query = {
    "currency1": "USD",
    "currency2": "EUR",
    "date": "2025-06-02",
    "history": true,
    "hourly": true
}

# Using context manager ensures proper cleanup
with ExchangerateAPIClient("[YOUR_API_KEY]") as api:
    try:
        result = api.execute(query)
        print(result)
    except ExchangerateAPIClientError as e:
        print(f"Error: {e.message}")
# Session is automatically closed here

Advanced Features

Debug Mode

Enable debug logging to see detailed request and response information:

from apiverve_exchangerate.apiClient import ExchangerateAPIClient

# Enable debug mode
api = ExchangerateAPIClient("[YOUR_API_KEY]", debug=True)

query = {
    "currency1": "USD",
    "currency2": "EUR",
    "date": "2025-06-02",
    "history": true,
    "hourly": true
}

# Debug information will be printed to console
result = api.execute(query)

Manual Session Management

If you need to manually manage the session lifecycle:

from apiverve_exchangerate.apiClient import ExchangerateAPIClient

api = ExchangerateAPIClient("[YOUR_API_KEY]")

query = {
    "currency1": "USD",
    "currency2": "EUR",
    "date": "2025-06-02",
    "history": true,
    "hourly": true
}

try:
    result = api.execute(query)
    print(result)
finally:
    # Manually close the session when done
    api.close()

Customer Support

Need any assistance? Get in touch with Customer Support.


Updates

Stay up to date by following @apiverveHQ on Twitter.


All usage of the APIVerve website, API, and services is subject to the APIVerve Terms of Service and all legal documents and agreements.


License

Licensed under the MIT License (MIT)

Copyright (©) 2026 APIVerve, and EvlarSoft LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for apiverve-exchangerate 1.2.4

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

Source distribution (sdist)

Source distribution for apiverve-exchangerate 1.2.4
File Size Uploaded Provenance Actions
apiverve_exchangerate-1.2.4.tar.gz 12.0 kB Without provenance Details for apiverve_exchangerate-1.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for apiverve-exchangerate 1.2.4
File Interpreter ABI Platform Actions
apiverve_exchangerate-1.2.4-py3-none-any.whl Python 3 none any Details for apiverve_exchangerate-1.2.4-py3-none-any.whl

Total release size: 23.2 kB

Release files / apiverve_exchangerate-1.2.4.tar.gz

Download URL apiverve_exchangerate-1.2.4.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b639b1575e9d7fef490013ecb90994cafed132cad01b06465124ec263e0bbbb4
BLAKE2b-256 checksum
How to use checksums
8afa5b570ac234f4fcc7388049a2d196fb76b74276cc3397ef35ee9c60b24dd6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / apiverve_exchangerate-1.2.4-py3-none-any.whl

Download URL apiverve_exchangerate-1.2.4-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a8885ea8f78f72285b723fc58d686f65295844648b337706701d6a2fce7cb79
BLAKE2b-256 checksum
How to use checksums
8cf08c2c6ae71b2f3054b5e7c9ea5c30dc32db1c281cf6cab2c84308dd6b1bb4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for apiverve-exchangerate 1.2.4

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.

Release history Release notifications | RSS feed

This release

1.2.4 This release

2 release files No provenance

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