Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danyashorokh/0cf0be6e49864fb83222512a439ad213 to your computer and use it in GitHub Desktop.
Save danyashorokh/0cf0be6e49864fb83222512a439ad213 to your computer and use it in GitHub Desktop.
[Python] Get actual currency rates (api)
# https://www.exchangerate-api.com
import requests
proxies = {
"https": "https://User:Password@fx-proxy:8080",
}
api_key = 'pifpaf'
# Where USD is the base currency you want to use
url = 'https://v3.exchangerate-api.com/bulk/' + api_key + '/USD'
# Making our request
response = requests.get(url, proxies=proxies)
data = response.json()
# Your JSON object
print(data['rates']['RUB'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment