IP to Geolocation Database Developer Resource
IP to Geolocation database provides geolocation information such as city, region/state, country, postal code, timezone, geographic coordinates (latitude & longitude) etc. identified from IP addresses.
Database Schema
IP Location database contains the following fields:
Field Name | Example | Data Type | Description |
---|---|---|---|
network | 71.50.174.48/28 | TEXT | CIDR or single Address of the IP address block |
city | Spring Lake | TEXT | City of the IP address |
region | North Carolina | TEXT | Region/State of the IP address |
region_code | NC | TEXT | Region code in two-letter format in ISO 3166 |
country | United States | TEXT | Name of the country of the IP address |
country_code | US | TEXT | ISO 3166 country code of the IP address |
continent | North America | TEXT | Name of the continent |
continent_code | NA | TEXT | Continent name code in two-letter format |
latitude | 35.16794 | FLOAT | Latitude value of the IP address |
longitude | -78.97281 | FLOAT | Longitude value of the IP address |
timezone | America/New_York | TEXT | Local timezone of the IP address location |
postal_code | 28390 | TEXT | Postal code or zip code of the IP address |
Sample Database
- IP Geolocation Sample Database — CSV
- IP Geolocation Sample Database — JSON
- IP Geolocation Sample Database — MMDB
Filename references:
File Format | Filename / Slug | Terminal Command |
---|---|---|
CSV | ipinfo_location.csv.gz | curl -L https://ipinfo.io/data/ipinfo_location.csv.gz?token=$YOUR_TOKEN -o ipinfo_location.csv.gz |
MMDB | ipinfo_location.mmdb | curl -L https://ipinfo.io/data/ipinfo_location.mmdb?token=$YOUR_TOKEN -o ipinfo_location.mmdb |
JSON | ipinfo_location.json.gz | curl -L https://ipinfo.io/data/ipinfo_location.json.gz?token=$YOUR_TOKEN -o ipinfo_location.json.gz |
Parquet | ipinfo_location.parquet | curl -L https://ipinfo.io/data/ipinfo_location.parquet?token=$YOUR_TOKEN -o ipinfo_location.parquet |
Alternative Database Schema
standard_location
The standard_location
data download is structured based on IP ranges (start_ip
and end_ip
). It includes the join_key
column but does not include the columns region_code
and country_code
(as the country code is contained in the country
column and it does not provide the name of the country). Additionally, it does not include the columns continent
and continent_name
.
Field Name | Example | Data Type | Description |
---|---|---|---|
start_ip | 1.253.242.0 | TEXT | Starting IP address of an IP address range |
end_ip | 1.253.242.255 | TEXT | Ending IP address of an IP address range |
join_key | 1.253.0.0 | TEXT | Special variable to facilitate database join operation |
city | Yangsan | TEXT | City of the IP address |
region | Gyeongsangnam-do | TEXT | Region of the IP address |
country | KR | TEXT | ISO 3166 country code of the IP address |
latitude | 35.34199 | FLOAT | Latitude value of the IP address |
longitude | 129.03358 | FLOAT | Longitude value of the IP address |
postal_code | 50593 | TEXT | Postal code or zip code of the IP address |
timezone | Asia/Seoul | TEXT | Local timezone of the IP address |
Samples
- Standard IP Geolocation Database Sample - CSV
- Standard IP Geolocation Database Sample - JSON
- Standard IP Geolocation Database Sample - MMDB
standard_location_mmcompat
The standard_location_mmcompat
database schema is a custom database that provides easier migration from alternative providers by offering the geonames_id
field and other location data. Even though the migration process will not be plug and play from an alternative provider, we provide all the necessary information for users to account for only the schema.
Field Name | Example | Data Type | Descrption |
---|---|---|---|
Network | 50.62.0.0/15 | TEXT | CIDR or IP network of the IP address block |
City | Tempe | TEXT | City of the IP address |
Continent | NA | TEXT | Continent name code in two-letter format |
Country | US | TEXT | ISO 3166 country code of the IP address |
Country_name | United States | TEXT | Name of the country of the IP address |
Geoname_id | 5317058 | TEXT | Geoname_id that corresponds to geonames.org database |
Lat | 33.41477 | FLOAT | Latitude value of the location |
Lng | -111.90931 | FLOAT | Longitude value of the location |
Postal | 85285 | TEXT | Postal code or zip code of the IP address |
Region | AZ | TEXT | Region code in two-letter format in ISO 3166 |
Region_name | Arizona | TEXT | Region of the IP address |
Subregion | 013 | INTEGER | Subregion code |
Subregion_name | Maricopa County | TEXT | Subregion name |
Timezone | America/Phoenix | TEXT | Local timezone of the IP address location |
Samples