IP2Location™ GeoName ID
IP2Location™ GeoNameID is a free data offered for your download. This data enables you to retrieve the ID of the record in GeoNames database for a given city name, region name and country code.
The download contains data such as country code, region name, city name and GeoNames ID. This information is available for download in a CSV text file (comma delimited).
Last Update | 16 July, 2024 |
---|---|
Database Format | CSV Text File (Comma Delimited) |
Name | Type | Description |
---|---|---|
country_code | CHAR(2) | Two-character country code based on ISO 3166. |
region_name | VARCHAR(128) | Region or state name. |
city_name | VARCHAR(128) | City name. |
geonameid | INT(10) | Integer ID of the record in GeoNames database. |
Sample Database
"country_code","region_name","city_name","geonameid"
"AD","Andorra la Vella","Andorra la Vella","3041563"
"AD","Andorra la Vella","Santa Coloma","3039181"
"AD","Canillo","Canillo","3041204"
"AD","Canillo","El Tarter","3039154"
"AD","Canillo","Ransol","3039320"
MySQL Statement
CREATE TABLE `ip2location_geonameid`(
`country_code` CHAR(2),
`region_name` VARCHAR(128),
`city_name` VARCHAR(128),
`geonameid` INT(10),
INDEX `idx_country_code` (`country_code`),
INDEX `idx_region_name` (`region_name`),
INDEX `idx_city_name` (`city_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
LOAD DATA LOCAL
INFILE 'IP2LOCATION-GEONAMEID.CSV' INTO TABLE `ip2location_geonameid`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n' IGNORE 1 LINES;
This works is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).
It is free for personal or commercial use with attribution required by mentioning the use of this works as follows:
"This site or product includes IP2Location™ GeoNameID which available from https://www.ip2location.com."