Python Sample Code: Real-time Currency Rates API

Here is an example that will retrieve current exchange rates for over 90 global currencies. This code requires the "requests" library to run. If it is not installed, you can install it on the command line with the following:

            
> pip install requests
            

Python code:

            
import requests

response = requests.get('https://api.interzoid.com/getcurrencyrate?license=
                YOURLICENSEKEY&symbol=AUD')

print(response.text)

if response.status_code == 200:
  data = response.json()
  print(data["Rate"])
            

To execute from the command line:

            
> python YOURFILENAME.py
            

Results:

            
{"Symbol":"AUD","Name":"Dollar","Country":"Australia","Rate":"1.391",
                "Code":"Success","Credits":"57628"}

1.391
            

If you do not have an API License Key, you can obtain one by registering here.

Return to Get Currency Rate API page

Free API Credits
Register for an Interzoid API account and receive free trial credits
Company Name Matching API
Generate similarity keys to identify duplicate and inconsistent company name data
More Info...
Other Matching APIs
Generate similarity keys for other data types
More Info...
International Phone Demographics API
Test page load and other Web asset performance time with a simple API call
More Info...
Email Information API
Get email address validation and enhancement data
More Info...