# IP Country: continent, country, timezone, currency and flag

IP Country maps every IPv4 and IPv6 range to its continent, country, timezone, currency and flag, free with any account under CC BY-SA 4.0.

[IP Country](https://internetdata.io/databases/ip-country) is out, under Geolocation: every IPv4 and IPv6 range with its continent and country, each as a code and a name, the range's IANA timezone, and the country's currency and flag. It's an Open database, free to download with any account under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).

## One country and one zone per row

| Range | Continent | Country | Timezone | Currency |
|---|---|---|---|---|
| `1.6.0.0/15` | `AS` Asia | `IN` India | `Asia/Kolkata` | `INR` Rupee, ₹ |
| `1.179.103.0/24` | `NA` North America | `US` United States | `America/Chicago` | `USD` Dollar, $ |
| `1.178.32.0/20` | `SA` South America | `BR` Brazil | `America/Sao_Paulo` | `BRL` Real, R$ |
| `2.27.26.128/27` | `AN` Antarctica | `AQ` Antarctica | `Antarctica/Syowa` | |
| `2400:1000::/32` | `AS` Asia | `JP` Japan | `Asia/Tokyo` | `JPY` Yen, ¥ |

Each row also carries the flag, as an emoji and as its two Unicode code points (`U+1F1EF U+1F1F5` for Japan) for a system that can't render emoji. Antarctica has no currency of its own, so its ranges keep their country and zone and leave the currency blank.

The country and the zone are the ones [IP Geolocation](https://internetdata.io/databases/ip-geolocation) gives the same range, and neighboring ranges with the same country and zone are merged into one row. A country that spans several zones has rows in each: 28 zones for the United States, 23 for Russia, 20 for Canada and 15 for Brazil.

## What's in it

The October 16 build holds 2,455,119 ranges, 1,740,693 IPv4 and 714,426 IPv6. They cover 3,702,257,663 IPv4 addresses in 250 countries and territories, with 400 IANA timezones and 154 currencies.

| Continent | Countries and territories | IPv4 addresses |
|---|---|---|
| North America | 41 | 1,642,994,735 (44.4%) |
| Asia | 51 | 952,163,593 (25.7%) |
| Europe | 53 | 771,258,766 (20.8%) |
| South America | 14 | 152,593,719 (4.1%) |
| Africa | 58 | 117,650,791 (3.2%) |
| Oceania | 28 | 65,588,964 (1.8%) |
| Antarctica | 5 | 7,095 |

[IP Country Flag](https://internetdata.io/databases/ip-country-flag) and [IP Country Currency](https://internetdata.io/databases/ip-country-currency), free as well, carry its flag and currency columns on their own, and [IP Timezone](https://internetdata.io/databases/ip-timezone) its zones. For the network behind each range, [IP ASN](https://internetdata.io/databases/ip-asn) is free too.

## Getting access

[Sign up](https://app.internetdata.io/auth/signup), and IP Country is in the console with a download button, already licensed to your organization: nothing to request. With an API key, the [CLI](https://docs.internetdata.io/integrations/cli) and the client libraries download it as they do any database:

```sh
internetdata db download ip_country_v1
```

In BigQuery, subscribe to the free `InternetData Open` listing, or `InternetData Open EU`, and look addresses up inline ([BigQuery](https://docs.internetdata.io/integrations/bigquery) has the details):

```sql
SELECT
    l.ip,
    internetdata_open.ip_country_v1(l.ip).country AS country,
    internetdata_open.ip_country_v1(l.ip).timezone AS timezone,
    internetdata_open.ip_country_v1(l.ip).currency_code AS currency
FROM mydataset.logins AS l
```

CC BY-SA 4.0 asks two things: credit InternetData with a link to [internetdata.io](https://internetdata.io), and share what you build from the data under the same license. Building it into something you sell without sharing alike takes a [redistribution license](https://internetdata.io/pricing). Its [docs page](https://docs.internetdata.io/database/ip-country) has the schema.

