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.

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.
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}))Deploy it
- Get a free API key
The free plan includes 200 credits a month, no card needed. Create your key.
- Deploy it
Click Deploy to Vercel. Vercel copies the repo to your GitHub account and asks for
APIVERVE_API_KEY: paste your key there. - 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
No key required to try it. Get a key to use it in your app.
{
"status": "ok",
"error": null,
"data": {
"currency1": "USD",
"currency2": "EUR",
"exchangeRate": "0.870572",
"inverseRate": "1.148670",
"lastUpdated": "2026-09-18T21:00:09.196Z"
}
}