DEV Community

Yaroslav Polyakov
Yaroslav Polyakov

Posted on

How to get country by IP address

ipdeny.com provides nice free service for this. Download country block for any country you want and use it in your code.

country block is simple CIDR list, e.g. for Afghanistan it starts with:

23.88.192.0/19
43.230.209.0/24
43.250.136.0/22
...
Enter fullscreen mode Exit fullscreen mode

Top comments (0)