Every IP range, with its country's flag.
Every IPv4 and IPv6 range matched to its country, with the flag as both an emoji and its Unicode code points โ ready to render or to log as plain text where emoji are not an option.
Schema at a glance.
See documentation โThe database's schema and metadata are documented carefully. It is published as CSVGZ and MMDB.
| start_ip | end_ip | country | country_name | flag_emoji | flag_unicode |
|---|---|---|---|---|---|
| 37.59.158.52 | 37.59.158.55 | ES | Spain | ๐ช๐ธ | U+1F1EA U+1F1F8 |
| 201.35.200.208 | 201.35.200.215 | BR | Brazil | ๐ง๐ท | U+1F1E7 U+1F1F7 |
| 1.0.0.0 | 1.0.0.255 | AU | Australia | ๐ฆ๐บ | U+1F1E6 U+1F1FA |
| 2a09:4c0:3e0:20:: | 2a09:4c0:3e0:20:ffff:ffff:ffff:ffff | FI | Finland | ๐ซ๐ฎ | U+1F1EB U+1F1EE |
| 2001:470:19:d7:: | 2001:470:19:d7:ffff:ffff:ffff:ffff | CN | China | ๐จ๐ณ | U+1F1E8 U+1F1F3 |
Downloading it from code.
Database API reference โOne call gets you the current IP Country Flag build. Every official client wraps it three ways: straight to disk, a time-limited link you hand to your own runner, or bytes in memory. A file written to disk lands only once the whole transfer has arrived, and checksums() returns the published digests to verify it against.
download()downloadUrl()downloadBytes()metadata()checksums()import osfrom internetdata import InternetDataclient = InternetData(os.environ["INTERNETDATA_API_KEY"])# what is in today's build, without moving the filemeta = client.database.metadata("ip_country_flag_v1")client.database.download("ip_country_flag_v1", "mmdb", "./ip_country_flag_v1.mmdb")sums = client.database.checksums("ip_country_flag_v1", "mmdb")print(meta.updated, meta.entries, sums["sha256"])
Getting your hands on it.
The file is the product. Teams join IP Country Flag against traffic they already log, inside their own infrastructure, and never send an address anywhere to get an answer.
Interface localization
Show a flag next to a country name in a picker, a billing address or an account list without shipping your own icon set.
An official client for every major language.
All SDKs on GitHub โTwelve official clients for the languages you ship in, each wrapping the database endpoints โ list what you are licensed for, poll a build, follow the download redirect, verify what landed. Install commands are in the docs.
No loose ends.
How often does this database rebuild?
Daily. The metadata call answers when the current build landed and how many rows it holds, before you fetch it.
Where does the country come from?
It's the country IP Geolocation gives the same range, so the two files agree.
Why two flag columns?
flag_emoji for systems that render emoji, flag_unicode for logs and terminals that only take plain text.
Which formats does a build ship in?
Gzipped CSV and MMDB, both cut from the same build. The schema section above names them.
Test the real build first.
An evaluation license puts a full current build in your hands โ every row, every column, no sampling โ so you can measure it against your own traffic before anyone talks about terms.