How to get the Country Flag from an IP address

Getting the Flag

This example shows you how to get the country flag from an IP address.

// The API returns the ISO ALPHA-2 Country Code and the Country Name

<div id="country-name"></div>
<div id="emoji-flag"></div>
<img src=""id="img-flag">

// Getting the country code and name from the user's IP
$.get("", function (response) {
}, "jsonp");