enesigneci enesigneci - 13 days ago 6
jQuery Question

Getting Currency Information From Country Code in PHP

I want to get the currency code information (for example:USD etc.) from country code.I tried most of methods but I cannot have this data.I had the country code from geolocation.
How can I solve this problem and get the currency code?

Answer

You can do with this following api its very easy and good

https://restcountries.eu/rest/v1/alpha/in "in" be the country code for india.

Eg with jquery

jQuery.getJSON(
"https://restcountries.eu/rest/v1/alpha/in,
   function (data) {
    console.log(data.currencies)
     }
);

in data: you get almost every information related to country