问题
For my shopping site I need to implement an automatic currency converter and I have the current user's country code/name.Is there any api methods to get the currency code for the user's country?
回答1:
If you're working with python, I'd suggest you look into babel, which may well have what you need.
http://babel.pocoo.org/
回答2:
There is no API method for this, you have to roll your own, which in itself is pretty trivial.
It seems there's also existing solutions
回答3:
I know you asked for the currency code, but the closest I found is the currency symbol -
https://www.mashape.com/parsify/format#!endpoint-Currency
Here's a sample response
来源:https://stackoverflow.com/questions/18356194/api-to-get-currency-code-for-country-code-name