10

I want to show country flag depending on ip address I receive at server side. Are fixed ip addresses are assigned to countries ? Where can I get database for ip address to country mapping ?

Ben Dowling
  • 17,187
  • 8
  • 87
  • 103
Xinus
  • 29,617
  • 32
  • 119
  • 165
  • 1
    Quite straight forward. Get [country flag icons](http://365icon.com/icon-styles/ethnic/classic2/) & map [IP address to country](https://ipapi.co/api/?shell#specific-field-for-an-ip) name. The icon & country names are linked via country [codes](https://en.wikipedia.org/wiki/ISO_3166-1). – Ken Jun 16 '16 at 17:55

5 Answers5

3

You're looking for an IP geolocation service such as MaxMind.

Rob
  • 47,999
  • 5
  • 74
  • 91
1

ip2location.com provides an IP range database which can be used to tag IP addresses

they provide it in different formats as well so you can choose which one is useful to you

Kristina
  • 15,859
  • 29
  • 111
  • 181
1

Maxmind is the one we use

Grumpy
  • 2,140
  • 1
  • 25
  • 38
0

Open Sourced self contained flag rendering based on IP: ip2ensign

It will lookup UV coordinates in a flag texture atlas that matches an arbitrary IP. And it comes with the IP range database and the texture.

Bram
  • 7,440
  • 3
  • 52
  • 94