How can I get user's country flag on my site

前端 未结 5 1832
野性不改
野性不改 2021-02-10 13:04

I wanna display user\'s/visitor\'s country flag on my site.

I am using different technologies like php,jsp and simple html. So I want a code which by placing on my site,

5条回答
  •  攒了一身酷
    2021-02-10 13:20

    My service, ipdata.co provides an IP Geolocation API on https://api.ipdata.co and serves flags on for example https://ipdata.co/flags/cu.png.

    All you have to do is know your visitors' country's iso code and you can fill it in

    ipdata.co/flags/country-code.png
    

    You can of course get the user's country code by calling https://api.ipdata.co/user-ip.

    Sample embed;

    Smiley face
    

    Gives

    Smiley face

    Edit

    We now also provide you with the country emoji flag and country emoji unicode.

提交回复
热议问题