Currency Converter Template

  • Python
  • Flask

Convert an amount between 21 currencies at today’s exchange rate.

A Python and Flask app that converts money between currencies. Enter an amount, pick the currencies from 21 including the dollar, euro, pound, yen and rupee, and get the converted amount, the rate and when it was last updated. Use it to show prices in a visitor’s currency, or convert from the command line.

The currency converter app running

What it does

21 currencies
The most-used currencies in the menus, and any other 3-letter code the API supports.
Rate and inverse
Shows the rate both ways and when it was last updated.
Formatted properly
Amounts are written the way each currency is, with the right symbol.
Keeps your key private
The page calls a server route that holds the key, checks the input and limits each visitor to 10 conversions a minute.
A web app and a CLI
python app.py runs the page and its route locally. The same lookups work from the terminal, sharing one small API helper.

How it works

The Flask route: it checks the currency codes and calls Exchange Rate.

app.py
CURRENCY = re.compile(r'^[A-Z]{3}$')


@app.get('/api/rate')
def rate():
    """GET /api/rate?from=USD&to=EUR: the current exchange rate between two currencies."""
    source = request.args.get('from', '').strip().upper()
    target = request.args.get('to', '').strip().upper()
    if not CURRENCY.match(source) or not CURRENCY.match(target):
        return fail('Use 3-letter currency codes, like USD or EUR.')
    return jsonify(call_api('exchangerate', {'currency1': source, 'currency2': target}))

See the whole file on GitHub

Deploy it

  1. Get a free API key

    The free plan includes 200 credits a month, no card needed. Create your key.

  2. Deploy it

    Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for APIVERVE_API_KEY: paste your key there.

  3. Open your app

    Vercel builds it and gives you a live URL, usually in about a minute. Every push to the repo redeploys it.

Try the Exchange Rate API — the call this template makes

Request
GETapi.apiverve.com/v1/exchangerate?currency1=USD&currency2=EUR
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "currency1": "USD",
    "currency2": "EUR",
    "exchangeRate": "0.870572",
    "inverseRate": "1.148670",
    "lastUpdated": "2026-09-18T21:00:09.196Z"
  }
}

Build your own with Exchange Rate. Start with 200 free credits. One key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs