CINXE.COM
IP2Location™ LITE IP-COUNTRY Database
<!doctype html> <html lang="en" class="h-100"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="author" content="IP2Location"> <meta name="description" content="IP2Location LITE IP geolocation databases allow you to query IP address for country, region or state, city, latitude/longitude, ZIP code and time zone"> <meta name="keywords" content="ip2location, ip2location lite, geo lite database, ip lite database, ip country, ip country city, ip country region, ip latitude, ip longitude, ip zipcode, ip postal code, ip timezone"> <meta property="og:type" content="website"> <meta property="og:title" content="IP2Location™ LITE IP-COUNTRY Database"> <meta property="og:site_name" content="IP2Location"> <meta property="og:description" content="IP2Location LITE IP geolocation databases allow you to query IP address for country, region or state, city, latitude/longitude, ZIP code and time zone"> <meta property="og:image" content="https://cdn-lite.ip2location.com/img/og-lite-ip2location.png"> <title>IP2Location™ LITE IP-COUNTRY Database</title> <link rel="shortcut icon" href="/favicon.ico" /> <!--link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/fonts/fontawesome-webfont.woff2?v=4.7.0" as="font" type="font/woff2" crossorigin--> <!-- Experiment on establish early connections to required origins --> <link rel="preconnect" href="https://cdn-lite.ip2location.com"> <link rel="dns-prefetch" href="https://cdn-lite.ip2location.com"> <link rel="preconnect" href="https://cdnjs.cloudflare.com"> <link rel="dns-prefetch" href="https://cdnjs.cloudflare.com"> <link rel="alternate" hreflang="en" href="https://lite.ip2location.com/database/ip-country?lang=en_US" /> <link rel="alternate" hreflang="ja" href="https://lite.ip2location.com/database/ip-country?lang=ja" /> <link rel="alternate" hreflang="zh-Hans" href="https://lite.ip2location.com/database/ip-country?lang=zh_CN" /> <link rel="alternate" hreflang="zh-Hant" href="https://lite.ip2location.com/database/ip-country?lang=zh_TW" /> <link rel="alternate" hreflang="et" href="https://lite.ip2location.com/database/ip-country?lang=et" /> <link rel="alternate" hreflang="ms" href="https://lite.ip2location.com/database/ip-country?lang=ms" /> <link rel="alternate" hreflang="da" href="https://lite.ip2location.com/database/ip-country?lang=da" /> <link rel="alternate" hreflang="nl" href="https://lite.ip2location.com/database/ip-country?lang=nl" /> <link rel="alternate" hreflang="pt" href="https://lite.ip2location.com/database/ip-country?lang=pt" /> <link rel="alternate" hreflang="tr" href="https://lite.ip2location.com/database/ip-country?lang=tr" /> <link rel="alternate" hreflang="it" href="https://lite.ip2location.com/database/ip-country?lang=it" /> <link rel="alternate" hreflang="vi" href="https://lite.ip2location.com/database/ip-country?lang=vi" /> <link rel="alternate" hreflang="es" href="https://lite.ip2location.com/database/ip-country?lang=es" /> <link rel="alternate" hreflang="sv" href="https://lite.ip2location.com/database/ip-country?lang=sv" /> <link rel="alternate" hreflang="ru" href="https://lite.ip2location.com/database/ip-country?lang=ru" /> <link rel="alternate" hreflang="de" href="https://lite.ip2location.com/database/ip-country?lang=de" /> <link rel="alternate" hreflang="fr" href="https://lite.ip2location.com/database/ip-country?lang=fr" /> <link rel="alternate" hreflang="fi" href="https://lite.ip2location.com/database/ip-country?lang=fi" /> <link rel="alternate" hreflang="cs" href="https://lite.ip2location.com/database/ip-country?lang=cs" /> <link rel="alternate" hreflang="ar" href="https://lite.ip2location.com/database/ip-country?lang=ar" /> <link rel="alternate" hreflang="ko" href="https://lite.ip2location.com/database/ip-country?lang=ko" /> <!--link rel="alternate" hreflang="x-default" href="https://lite.ip2location.com/database/ip-country" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.1/css/bootstrap.min.css" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="/css/styles.css"--> <link rel="preload" as="style" href="https://cdn-lite.ip2location.com/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdn-lite.ip2location.com/css/bootstrap.min.css"> <link rel="canonical" href="https://lite.ip2location.com/database/ip-country" /> <link href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/themes/prism-tomorrow.min.css" rel="stylesheet" type="text/css" media="screen" /> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KNCBNCG');</script> <!-- End Google Tag Manager --> <!--style> /*IPL Contest Bar CSS*/ #sticky_bar {padding: 9px 5px; background: #272727; position: fixed; top: 0; left:0; width:100%; margin-bottom:25px;z-index: 999; text-align: center; box-shadow: 0px 1px 11px #888888; color: #fff; font-size: 14.5px;} #sticky_bar_text, #sticky_bar_btn {display: inline-block;} #sticky_bar_btn a {background:#e74c3c; color:#fff; padding:3px 10px; text-decoration:none; border-radius:3px;} .pt-header{padding-top:40px;} @media only screen and (max-width: 710px) { .pt-header{padding-top:105px;}} </style--> </head> <body class="d-flex flex-column h-100 mt-5" style="padding-top:2.5rem;"> <script> var _0x291603=_0x2bc5;function _0x2bc5(_0x566d96,_0x59dafd){var _0x38e1a3=_0x38e1();return _0x2bc5=function(_0x2bc519,_0x519617){_0x2bc519=_0x2bc519-0x18c;var _0x5eb920=_0x38e1a3[_0x2bc519];return _0x5eb920;},_0x2bc5(_0x566d96,_0x59dafd);}function _0x38e1(){var _0x5e954c=['313995zpaZFk','Access\x20denied.','4sFRQfr','5060mcVnQK','2108631ZVQiIz','30640eoRzfd','6317739RKUqMi','2994632KkEdMg','2151140YDjoNT','body','6BfsXzE','4aTfEFf','1854375hQPcrt','location'];_0x38e1=function(){return _0x5e954c;};return _0x38e1();}(function(_0x3762ac,_0x2114cb){var _0x335525=_0x2bc5,_0x1c2f82=_0x3762ac();while(!![]){try{var _0x5c394c=parseInt(_0x335525(0x18d))/0x1*(-parseInt(_0x335525(0x18f))/0x2)+parseInt(_0x335525(0x199))/0x3*(-parseInt(_0x335525(0x198))/0x4)+-parseInt(_0x335525(0x195))/0x5+parseInt(_0x335525(0x197))/0x6*(parseInt(_0x335525(0x191))/0x7)+-parseInt(_0x335525(0x194))/0x8+parseInt(_0x335525(0x193))/0x9+parseInt(_0x335525(0x192))/0xa*(parseInt(_0x335525(0x190))/0xb);if(_0x5c394c===_0x2114cb)break;else _0x1c2f82['push'](_0x1c2f82['shift']());}catch(_0x4e4729){_0x1c2f82['push'](_0x1c2f82['shift']());}}}(_0x38e1,0x585f4));top['location']!=self[_0x291603(0x18c)]&&(document[_0x291603(0x196)]['innerHTML']=_0x291603(0x18e)); </script> <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm fixed-top"> <!-- IPL Contest Bar --> <!--div id="sticky_bar"> <div id="sticky_bar_text"> <strong>IP2Location Programming Contest 2024</strong> is happening now! Stay a chance to win amazing prizes. </div> <div id="sticky_bar_btn"> <a id="btn-join" target="_blank" class="btn btn-contest" href="https://contest.ip2location.com/">Join Now</a> </div> </div--> <div class="container d-flex justify-content-between pt-header"> <a class="navbar-brand" href="/"><img src="https://cdn-lite.ip2location.com/img/logo-sm.png" width="128" height="42" alt="IP2Location LITE IP Geolocation"></a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#nav-bar" aria-controls="nav-bar" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="nav-bar"> <ul class="navbar-nav mr-auto"> <li class="nav-item mr-3"> <a class="nav-link" href="/"><b>Home</b></a> </li> <li class="nav-item dropdown mr-3"> <a class="nav-link" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><b>Free Databases</b></a> <ul class="dropdown-menu mt-2 dropdown-menu-product"> <li class="px-3 py-2"> <div class="row"> <a href="/ip2location-lite" class="col-md-6 mb-5"> <h5 class="text-info"><b>IP2Location™ LITE</b></h5> <small>FREE database solution to determine the country, region or state, city, latitude, longitude, ZIP code and time zone of origin for any IP address.</small> </a> <a href="/ip2proxy-lite" class="col-md-6 mb-5"> <h5 class="text-info"><b>IP2Proxy™ LITE</b></h5> <small>FREE database solution to detect open proxies (PUB) and information such as proxy type, country, region, city, ISP, domain, usage type, ASN, last seen proxy and residential proxy.</small> </a> <a href="/database-asn" class="col-md-6"> <h5 class="text-info"><b>ASN LITE</b></h5> <small>FREE database solution to translates IP address to autonomous system (AS) and autonomous system number (ASN).</small> </a> </div> </li> </ul> </li> <li class="nav-item mr-3"> <a class="nav-link" href="https://www.ip2location.io?utm_source=ip2location-lite&utm_medium=referral&utm_campaign=migration&utm_term=new-header" target="_blank"><b>Web Services</b></a> </li> <li class="nav-item dropdown mr-3"> <a class="nav-link" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><b>Resources</b></a> <ul class="dropdown-menu mt-2 dropdown-menu-product"> <li class="px-3 py-2"> <div class="row"> <a href="https://www.ip2location.com/free/plugins" target="_blank" class="col-md-6 mb-5"> <h5 class="text-info"><b>Free Plugins</b></h5> <small>Free plugins or extensions for various platforms, such as blog, forum, CMS, Analytics, Advertisement, Framework, E-commerce and so on.</small> </a> <a href="/ip-address-ranges-by-country" class="col-md-6 mb-5"> <h5 class="text-info"><b>IP Address</b></h5> <small>IPv4 address ranges organized by country.</small> </a> <a href="https://blog.ip2location.com/" target="_blank" class="col-md-6"> <h5 class="text-info"><b>Articles</b></h5> <small>Free articles and tutorials on getting started and integrating your apllications with our products.</small> </a> </div> </li> </ul> </li> <li class="nav-item mr-3"> <a class="nav-link" href="/faq"><b>FAQs</b></a> </li> </ul> <ul class="nav navbar-nav justify-content-between ml-auto my-3 my-md-auto" > <li class="dropdown order-1" > <button class="btn dropdown-toggle ml-md-3 mb-md-0 mb-3" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-globe"></i> English</button> <ul class="dropdown-menu mb-3 dropdown-menu-columns-2 dropdown-res"> <li class="px-3 py-2"> <div class="row"> <a href="https://lite.ip2location.com/database/ip-country?lang=en_US" class="col-md-6 dropdown-item" >English</a> <a href="https://lite.ip2location.com/database/ip-country?lang=ja" class="col-md-6 dropdown-item" >日本語</a> <a href="https://lite.ip2location.com/database/ip-country?lang=zh_CN" class="col-md-6 dropdown-item" >简体中文</a> <a href="https://lite.ip2location.com/database/ip-country?lang=zh_TW" class="col-md-6 dropdown-item" >繁體中文</a> <a href="https://lite.ip2location.com/database/ip-country?lang=et" class="col-md-6 dropdown-item" >Eesti keel </a> <a href="https://lite.ip2location.com/database/ip-country?lang=ms" class="col-md-6 dropdown-item" >Malay </a> <a href="https://lite.ip2location.com/database/ip-country?lang=da" class="col-md-6 dropdown-item" >Dansk </a> <a href="https://lite.ip2location.com/database/ip-country?lang=nl" class="col-md-6 dropdown-item" >Nederlands </a> <a href="https://lite.ip2location.com/database/ip-country?lang=pt" class="col-md-6 dropdown-item" >Português </a> <a href="https://lite.ip2location.com/database/ip-country?lang=tr" class="col-md-6 dropdown-item" >Türkçe </a> <a href="https://lite.ip2location.com/database/ip-country?lang=it" class="col-md-6 dropdown-item" >Italiano</a> <a href="https://lite.ip2location.com/database/ip-country?lang=vi" class="col-md-6 dropdown-item" >Tiếng Việt </a> <a href="https://lite.ip2location.com/database/ip-country?lang=es" class="col-md-6 dropdown-item" >Español </a> <a href="https://lite.ip2location.com/database/ip-country?lang=sv" class="col-md-6 dropdown-item" >Svenska </a> <a href="https://lite.ip2location.com/database/ip-country?lang=ru" class="col-md-6 dropdown-item" >Pусский язык </a> <a href="https://lite.ip2location.com/database/ip-country?lang=de" class="col-md-6 dropdown-item" >Deutsch </a> <a href="https://lite.ip2location.com/database/ip-country?lang=fr" class="col-md-6 dropdown-item" >Français </a> <a href="https://lite.ip2location.com/database/ip-country?lang=fi" class="col-md-6 dropdown-item" >Suomen kieli </a> <a href="https://lite.ip2location.com/database/ip-country?lang=cs" class="col-md-6 dropdown-item" >Česky </a> <a href="https://lite.ip2location.com/database/ip-country?lang=ar" class="col-md-6 dropdown-item" >العربية</a> <a href="https://lite.ip2location.com/database/ip-country?lang=ko" class="col-md-6 dropdown-item" >한국어</a> </div> </li> </ul> </li> <li class="dropdown order-2 d-none d-md-inline"> <button class="dropdown-toggle btn-block btn ml-md-2 mb-md-0 mb-3" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Log In</button> <ul class="dropdown-menu dropdown-menu-right mt-2" style="width:280px"> <li class="px-3 py-2"> <form id="form-header-log-in" class="form" action="/log-in" method="post"> <div class="form-group"> <input class="form-control py-2" type="text" name="emailAddress" placeholder="Email Address" autocapitalize="off" data-custom-message="Required." required> </div> <div class="form-group"> <input class="form-control py-2" type="password" name="password" placeholder="Password" autocapitalize="off" autocomplete="off" data-custom-message="Required." required> </div> <div class="form-group form-check mb-2"> <label><input type="checkbox" name="rememberMe" value="true" class="form-check-input"> Remember me</label> </div> <div class="form-group"> <button type="button" id="btn-header-log-in" class="btn btn-info btn-block">Log In <i class="fa fa-sign-in"></i></button> </div> <div class="py-1"></div> <div class="text-center w-100 position-relative" style="border-top:1px solid #cccdcd;height: 20px;"> <span class="position-absolute bg-white px-2 text-center" style="font-size:0.65rem;top: 5%;left: 50%;transform: translate(-50%, -50%);">OR</span> </div> <div class="py-1"></div> <div class="row mb-4"> <div class="col-12 col-lg-6"> <a href="https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=https%3A%2F%2Flite.ip2location.com%2Flog-in%3Fvendor%3Dgoogle&response_type=code&client_id=96144748144-u0oabdght127692n5b3mkn82seh4v8p5.apps.googleusercontent.com&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&access_type=online" class="btn btn-outline-secondary btn-block btn-sm btn-auth mb-3 mb-lg-0" style="border-width:1.5px;border-color: #919aa1;"><i class="fa-brands fa-google" style="font-size:1.1rem;margin-top:0.2rem;background: conic-gradient(from -45deg, #ea4335 110deg, #4285f4 90deg 180deg, #34a853 180deg 270deg, #fbbc05 270deg) 73% 55%/150% 150% no-repeat;-webkit-background-clip: text; background-clip: text;color: transparent;-webkit-text-fill-color: transparent;"></i> </a> </div> <div class="col-12 col-lg-6"> <a href="https://github.com/login/oauth/authorize?client_id=aa7b63ad28bb3876e7c5&redirect_uri=https%3A%2F%2Flite.ip2location.com%2Flog-in%3Fvendor%3Dgithub&scope=user%3Aemail" class="btn btn-outline-secondary btn-block btn-sm btn-auth" style="border-width:1.5px;border-color: #919aa1;"><i class="fa-brands fa-github" style="font-size:1.1rem;margin-top:0.2rem;color:#000000;"></i></a> </div> </div> <div class="form-group text-center mb-1"> <small><a href="/forgot-password">Forgot password?</a></small> </div> <div class="form-group text-center mb-2"> <small><a href="/resend-verification-email">Resend verification email</a></small> </div> <input type="hidden" name="_NoCSRF_RTCYJzsdgx" value="tPfF1kHqnVaRHRXtOcfKCuiPa4STOrekaxYsaiKynCk5SynnDuVwc1ywDT7Luw9PENmmcCaHYFMVYoOoQuhU4oooBcUg75fzvDV63uljGKkJTiKd42RcmRKHIlQBuqyM"> </form> </li> </ul> </li> <li class="nav-item order-3"> <a href="/sign-up" class="btn btn-info btn-block ml-md-3 mb-md-0 mb-3">Sign Up</a> </li> <li class="nav-item order-4 d-md-none"> <a href="/log-in" class="btn btn-outline-secondary btn-block">Log In</a> </li> </ul> </div> </div> </nav> <!-- Contest Padding --> <!--div class="py-5 py-md-3"></div--> <div class="container mt-4"> <nav aria-label="breadcrumb"> <ol class="breadcrumb bg-transparent pl-0"> <li class="breadcrumb-item"><a href="/">Home</a></li> <li class="breadcrumb-item"><a href="/ip2location-lite">IP2Location™ LITE</a></li> <li class="breadcrumb-item active" aria-current="page">IP2Location™ LITE IP-COUNTRY Database</li> </ol> </nav> <div class="row mt-5"> <div class="col"> <h1 id="product-title" class="text-info" style="font-size:2rem!important;">IP2Location™ LITE IP-COUNTRY Database</h1> </div> </div> </div> <div class="container my-5"> <div class="row"> <div class="col-md-3"> <div class="nav flex-column nav-pills" role="tablist" aria-orientation="vertical"> <a class="nav-link py-3 active" data-toggle="pill" href="#introduction" role="tab" aria-controls="introduction" aria-selected="true">Introduction</a> <a class="nav-link py-3" data-toggle="pill" href="#features" role="tab" aria-controls="features" aria-selected="false">Features</a> <a class="nav-link py-3" data-toggle="pill" href="#database-fields" role="tab" aria-controls="database-fields" aria-selected="false">Database Fields</a> <a class="nav-link py-3" data-toggle="pill" href="#database-setup" role="tab" aria-controls="database-setup" aria-selected="false">Database Setup</a> <a class="nav-link py-3" data-toggle="pill" href="#ami-images" role="tab" aria-controls="ami-images" aria-selected="false">AMI & Images</a> <a class="nav-link py-3" data-toggle="pill" href="#sdk-libraries" role="tab" aria-controls="sdk-libraries" aria-selected="false">SDK & Libraries</a> <a class="nav-link py-3" data-toggle="pill" href="#free-tools" role="tab" aria-controls="free-tools" aria-selected="false">Free Tools/Plugins</a> </div> </div> <div class="col-md-9 mt-3 mt-md-0"> <div class="tab-content border min-h-db"> <div class="tab-pane px-4 px-sm-5 py-5 show active" id="introduction" role="tabpanel" aria-labelledby="introduction-tab"> <h3 class="mb-5"><b>Introduction</b></h3> <p class="mb-4"> <img src="https://cdn-lite.ip2location.com/img/product-db1.png" class="img-fluid" alt="IP2Location LITE Database"> </p> <p class="mt-4"> <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png"></a> </p> <p> This database provides a solution to determine the country of origin for any IP address in a few simple steps. First, retrieve the IP address from the networking protocol or server-side variable of the Web server. Next, translate the IP address to an IP number in decimal format to speed up the database query. Lastly, reverse lookup the IP number from the IP2Location™ database to pinpoint the exact geographical location. </p> <p class="mb-4"> It is free for personal or commercial use with attribution required by mentioning the use of this data as follows, </p> <p> <div class="input-group mb-4"> <textarea id="codes" rows="2" class="form-control" readonly>[Your site name or product name] uses the IP2Location LITE database for <a href="https://lite.ip2location.com">IP geolocation</a>.</textarea> <button type="button" class="btn btn-secondary input-group-addon btn-copy rounded-0" data-clipboard-target="#codes"><i class="fa fa-copy"></i><span class="d-none d-sm-inline"> Copy</span></button> </div> </p> <p class="mb-4"> Please get the <a href="https://www.ip2location.com/databases/db1-ip-country" target="_blank"> commercial edition </a> if you are looking for high data accuracy, more records & customer support. Please visit <a href="/edition-comparison"> product comparison page </a> for more information. </p> <p>Let's explore this database which provides a valuable resource of geolocation data for free now!</p> <a style="font-size:1.1rem;" class="btn btn-info col-md-3 mb-3 py-2 px-4" href="/sign-up?ref=DB1">Sign Up For Free</a> </div> <div class="tab-pane px-4 px-sm-5 py-5" id="features" role="tabpanel" aria-labelledby="features-tab"> <h3 class="mb-3"><b>Features</b></h3> <p class="mb-5">Translates IP address to country.</p> <div style="overflow-x:auto;"> <table class="table table-hover"> <tbody> <tr> <th class="border-0">Current Version</th> <td class="border-0">February 2025</td> </tr> <tr> <th class="border-0">Next Update</th> <td class="border-0">March 2025</td> </tr> <!--tr> <th></th> <td></td> </tr--> <tr> <th>IPv4 Database Size</th> <td> BIN: 2.5 MB<br> CSV: 12.12 MB (261,235 Rows) </td> </tr> <tr> <th>IPv6 Database Size</th> <td> BIN: 9.55 MB<br> CSV: 48.48 MB (604,565 Rows) </td> </tr> <tr> <th>Database Format</th> <td> <a href="https://blog.ip2location.com/knowledge-base/what-is-ip2location-bin-data-file" target="_blank">Binary (BIN)</a> <br /> ASCII Text File (CSV) </td> </tr> </tbody> </table> </div> </div> <div class="tab-pane px-4 px-sm-5 py-5" id="database-fields" role="tabpanel" aria-labelledby="database-fields-tab"> <h3 class="mb-3"><b>Database Fields</b></h3> <div style="overflow-x:auto;"> <table class="table table-hover"> <thead> <tr> <th class="border-0">Name</th> <th class="border-0">Type</th> <th class="border-0">Description</th> </tr> </thead> <tbody> <tr> <td>ip_from</td> <td>INT (10)<sup>†</sup> / DECIMAL (39,0)<sup>††</sup></td> <td>First IP address show netblock.</td> </tr> <tr> <td>ip_to</td> <td>INT (10)<sup>†</sup> / DECIMAL (39,0)<sup>††</sup></td> <td>Last IP address show netblock.</td> </tr> <tr> <td>country_code</td> <td>CHAR(2)</td> <td>Two-character country code based on ISO 3166.</td> </tr> <tr> <td>country_name</td> <td>VARCHAR(64)</td> <td>Country name based on ISO 3166.</td> </tr> </tbody> </table> </div> <p> <sup>†</sup> IPv4<br/> <sup>††</sup> IPv6<br/> <sup>†††</sup> Latitude and Longitude are often near the center of population. These values are not precise and should not be used to identify a particular address or household. </p> </div> <div class="tab-pane px-4 px-sm-5 py-5" id="database-setup" role="tabpanel" aria-labelledby="database-setup-tab"> <h3 class="mb-3"><b>Database Setup</b></h3> <p> Below are the steps to set up the database for both IPv4 and IPv6 data. </p> <div> <ul class="nav nav-pills mb-2" role="tablist"> <li class="nav-item"><a href="#ipv4" data-toggle="tab" class="nav-link active">IPv4</a></li> <li class="nav-item"><a href="#ipv6" data-toggle="tab" class="nav-link">IPv6</a></li> </ul> <div class="tab-content pt-3"> <div class="tab-pane fade show active" id="ipv4"> <ul class="nav nav-tabs"> <li class="nav-item"><a href="#ipv4-mysql" data-toggle="tab" class="nav-link active">MySQL</a></li> <li class="nav-item"><a href="#ipv4-mssql" data-toggle="tab" class="nav-link">MS-SQL</a></li> <li class="nav-item"><a href="#ipv4-postgresql" data-toggle="tab" class="nav-link">PostgreSQL</a></li> <li class="nav-item"><a href="#ipv4-mongodb" data-toggle="tab" class="nav-link">MongoDB</a></li> </ul> <div class="tab-content px-4 px-sm-5 py-5"> <div class="tab-pane fade show active" id="ipv4-mysql"> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Create Database</h6> <span data-clipboard-target="#code" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">CREATE DATABASE ip2location; USE ip2location; CREATE TABLE `ip2location_db1`( `ip_from` INT(10) UNSIGNED, `ip_to` INT(10) UNSIGNED, `country_code` CHAR(2), `country_name` VARCHAR(64), PRIMARY KEY (`ip_to`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;</code></pre> </div> </div> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Import Database</h6> <span data-clipboard-target="#code2" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code2" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">LOAD DATA LOCAL INFILE 'IP2LOCATION-LITE-DB1.CSV' INTO TABLE `ip2location_db1` FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 0 LINES;</code></pre> </div> </div> </div> <div class="tab-pane fade" id="ipv4-mssql"> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Create Database</h6> <span data-clipboard-target="#code3" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code3" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">CREATE DATABASE ip2location GO USE ip2location GO CREATE TABLE [ip2location].[dbo].[ip2location_db1]( [ip_from] bigint NOT NULL, [ip_to] bigint NOT NULL, [country_code] nvarchar(2) NOT NULL, [country_name] nvarchar(64) NOT NULL ) ON [PRIMARY] GO CREATE CLUSTERED INDEX [ip_to] ON [ip2location].[dbo].[ip2location_db1]([ip_to]) ON [PRIMARY] GO</code></pre> </div> </div> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Import Database</h6> <span data-clipboard-target="#code4" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code4" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">BULK INSERT [ip2location].[dbo].[ip2location_db1] FROM '{PATH TO IP2LOCATION-LITE-DB1.CSV}' WITH ( FORMATFILE = '{PATH TO DB1.FMT}' ) GO</code></pre> </div> </div> <p> NOTE: You will need to copy the FMT code below and save it as a file named <strong>DB1.FMT</strong> on your computer. </p> <p> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <div class="pull-left nav-codes-div"> <ul class="nav nav-codes" style="margin-left:-5px;"> <li class="nav-item dropdown" style="cursor:pointer;"> <a style="color:#b5b5b5;" class="dropdown-toggle btn btn-dropdown py-0 px-2 mr-2 my-1" data-toggle="dropdown" href="javascript:void(0);" role="button" aria-haspopup="true" aria-expanded="false">SQL Server 2016 </a> <div id="dropdown-ver" class="dropdown-menu" style="font-size:.85rem;"> <a id="12.0" class="dropdown-item">SQL Server 2016</a> <a id="12.0" class="dropdown-item">SQL Server 2014</a> <a id="11.0" class="dropdown-item">SQL Server 2012</a> <a id="10.0" class="dropdown-item">Azure SQL</a> <a id="10.0" class="dropdown-item">SQL Server 2008/2008R2</a> <a id="9.0" class="dropdown-item">SQL Server 2005</a> <a id="8.0" class="dropdown-item">SQL Server 2000</a> <a id="7.0" class="dropdown-item">SQL Server 7.0</a> <a id="6.5" class="dropdown-item">SQL Server 6.5</a> </div> </li> </ul> </div> <span class="px-0 py-0 pull-right" ><span class="btn btn-codes"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span></span> <div class="clearfix"></div> </div> <div> <pre class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code id="version" class="language-sql">12.0 5 1 SQLCHAR 0 1 "\"" 0 first_double_quote Latin1_General_CI_AI 2 SQLCHAR 0 20 "\",\"" 1 ip_from "", 3 SQLCHAR 0 20 "\",\"" 2 ip_to "", 4 SQLCHAR 0 2 "\",\"" 3 country_code Latin1_General_CI_AI, 5 SQLCHAR 0 64 "\",\"" 4 country_name Latin1_General_CI_AI</code></pre> </div> </div> </p> </div> <div class="tab-pane fade" id="ipv4-postgresql"> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Create Database</h6> <span data-clipboard-target="#code5" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code5" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">CREATE DATABASE ip2location WITH ENCODING 'UTF8'; \c ip2location CREATE TABLE ip2location_db1( ip_from bigint NOT NULL, ip_to bigint NOT NULL, country_code character(2) NOT NULL, country_name character varying(64) NOT NULL, CONSTRAINT ip2location_db1_pkey PRIMARY KEY (ip_from, ip_to) );</code></pre> </div> </div> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Import Database</h6> <span data-clipboard-target="#code6" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code6" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">COPY ip2location_db1 FROM 'IP2LOCATION-LITE-DB1.CSV' WITH CSV QUOTE AS '"';</code></pre> </div> </div> </div> <div class="tab-pane fade" id="ipv4-mongodb"> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Import Database</h6> <span data-clipboard-target="#code13" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code13" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">mongoimport -u USERNAME -p PASSWORD --authenticationDatabase admin --drop --db ip2location --collection ip2location_db1 --type csv --file "IP2LOCATION-LITE-DB1.CSV" --fields ip_from,ip_to,country_code,country_name</code></pre> </div> </div> </div> </div> </div> <div class="tab-pane fade" id="ipv6"> <ul class="nav nav-tabs"> <li class="nav-item"><a href="#ipv6-mysql" data-toggle="tab" class="nav-link active">MySQL</a></li> <li class="nav-item"><a href="#ipv6-mssql" data-toggle="tab" class="nav-link">MS-SQL</a></li> <li class="nav-item"><a href="#ipv6-postgresql" data-toggle="tab" class="nav-link">PostgreSQL</a></li> <li class="nav-item"><a href="#ipv6-mongodb" data-toggle="tab" class="nav-link">MongoDB</a></li> </ul> <div class="tab-content px-4 px-sm-5 py-5"> <div class="tab-pane fade show active" id="ipv6-mysql"> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Create Database</h6> <span data-clipboard-target="#code7" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code7" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">CREATE DATABASE ip2location; USE ip2location; CREATE TABLE `ip2location_db1_ipv6`( `ip_from` DECIMAL(39,0) UNSIGNED, `ip_to` DECIMAL(39,0) UNSIGNED, `country_code` CHAR(2), `country_name` VARCHAR(64), PRIMARY KEY (`ip_to`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;</code></pre> </div> </div> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Import Database</h6> <span data-clipboard-target="#code8" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code8" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">LOAD DATA LOCAL INFILE 'IP2LOCATION-LITE-DB1.IPV6.CSV' INTO TABLE `ip2location_db1_ipv6` FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' IGNORE 0 LINES;</code></pre> </div> </div> </div> <div class="tab-pane fade" id="ipv6-mssql"> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Create Database</h6> <span data-clipboard-target="#code9" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code9" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">CREATE DATABASE ip2location GO USE ip2location GO CREATE TABLE [ip2location].[dbo].[ip2location_db1_ipv6]( [ip_from] char(39) NOT NULL, [ip_to] char(39) NOT NULL, [country_code] nvarchar(2) NOT NULL, [country_name] nvarchar(64) NOT NULL ) ON [PRIMARY] GO CREATE CLUSTERED INDEX [ip_to] ON [ip2location].[dbo].[ip2location_db1_ipv6]([ip_to]) ON [PRIMARY] GO</code></pre> </div> </div> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Import Database</h6> <span data-clipboard-target="#code10" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code10" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">BULK INSERT [ip2location].[dbo].[ip2location_db1_ipv6] FROM '{PATH TO IP2LOCATION-LITE-DB1.IPV6.CSV}' WITH ( FORMATFILE = '{PATH TO DB1.FMT}' ) GO</code></pre> </div> </div> <p> NOTE: You will need to copy the FMT code below and save it as a file named <strong>DB1.FMT</strong> on your computer. The first line of the FMT code indicates the version of bcp. Please change the version as according to your MS-SQL installed. </p> <p> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <div class="pull-left nav-codes-div"> <ul class="nav nav-codes" style="margin-left:-5px;"> <li class="nav-item dropdown" style="cursor:pointer;"> <a style="color:#b5b5b5;" class="dropdown-toggle btn btn-dropdown py-0 px-2 mr-2 my-1" data-toggle="dropdown" href="javascript:void(0);" role="button" aria-haspopup="true" aria-expanded="false">SQL Server 2016 </a> <div id="dropdown-ver2" class="dropdown-menu" style="font-size:.85rem;"> <a id="12.0" class="dropdown-item">SQL Server 2016</a> <a id="12.0" class="dropdown-item">SQL Server 2014</a> <a id="11.0" class="dropdown-item">SQL Server 2012</a> <a id="10.0" class="dropdown-item">Azure SQL</a> <a id="10.0" class="dropdown-item">SQL Server 2008/2008R2</a> <a id="9.0" class="dropdown-item">SQL Server 2005</a> <a id="8.0" class="dropdown-item">SQL Server 2000</a> <a id="7.0" class="dropdown-item">SQL Server 7.0</a> <a id="6.5" class="dropdown-item">SQL Server 6.5</a> </div> </li> </ul> </div> <span class="px-0 py-0 pull-right" ><span class="btn btn-codes2"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span></span> <div class="clearfix"></div> </div> <div> <pre class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code id="version2" class="language-sql">12.0 5 1 SQLCHAR 0 1 "\"" 0 first_double_quote Latin1_General_CI_AI 2 SQLCHAR 0 39 "\",\"" 1 ip_from "", 3 SQLCHAR 0 39 "\",\"" 2 ip_to "", 4 SQLCHAR 0 2 "\",\"" 3 country_code Latin1_General_CI_AI, 5 SQLCHAR 0 64 "\",\"" 4 country_name Latin1_General_CI_AI</code></pre> </div> </div> </p> </div> <div class="tab-pane fade" id="ipv6-postgresql"> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Create Database</h6> <span data-clipboard-target="#code11" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code11" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">CREATE DATABASE ip2location WITH ENCODING 'UTF8'; \c ip2location CREATE TABLE ip2location_db1_ipv6( ip_from decimal(39,0) NOT NULL, ip_to decimal(39,0) NOT NULL, country_code character(2) NOT NULL, country_name character varying(64) NOT NULL, CONSTRAINT ip2location_db1_pkey PRIMARY KEY (ip_from, ip_to) );</code></pre> </div> </div> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Import Database</h6> <span data-clipboard-target="#code12" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code12" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">COPY ip2location_db1_ipv6 FROM 'IP2LOCATION-LITE-DB1.IPV6.CSV' WITH CSV QUOTE AS '"';</code></pre> </div> </div> </div> <div class="tab-pane fade" id="ipv6-mongodb"> <div class="panel my-4"> <div class="panel-heading px-3 py-2" style="background-color:#202020;"> <h6 class="pull-left my-2" style="color:#b5b5b5;">Import Database</h6> <span data-clipboard-target="#code14" class="btn btn-copy pull-right"><i class="fa fa-copy" style="color:#b5b5b5;"></i></span> <div class="clearfix"></div> </div> <div> <pre id="code14" class="p-3 mt-0 mb-2 border-0" style="font-size:.85rem"><code class="language-sql">mongoimport -u USERNAME -p PASSWORD --authenticationDatabase admin --drop --db ip2location --collection ip2location_db1_ipv6 --type csv --file "IP2LOCATION-LITE-DB1.IPV6.CSV" --fields ip_from,ip_to,country_code,country_name</code></pre> </div> </div> </div> </div> </div> </div> </div> </div> <div class="tab-pane px-4 px-sm-5 py-5" id="ami-images" role="tabpanel" aria-labelledby="ami-images-tab"> <h3 class="mb-3"><b>AMI & Images</b></h3> <p> IP2Location provides a free, pre-configured & ready-to-run AMI and images to easily set up the database. </p> <div class="row mt-4"> <div class="col-md-5"> <div class="card p-3 border-0"> <img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/aws-logo.png" class="card-img-top my-3 lazy" alt="Amazon Web Services"> <ul class="list-group list-group-flush border-0"> <li class="list-group-item border-0"><a href="https://aws.amazon.com/marketplace/pp/prodview-y6ep2u5ckmw5q" target="_blank" rel="nofollow">IP2Location MySQL Server</a></li> <li class="list-group-item border-0"><a href="https://aws.amazon.com/marketplace/pp/B00QJEKQRS" target="_blank" rel="nofollow">IP2Location PostgreSQL Server</a></li> </ul> </div> </div> <div class="v-line"></div> <div class="col-md-5"> <div class="card p-3 border-0"> <img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/docker-logo.png" class="card-img-top my-3 lazy" alt="Docker Images"> <ul class="list-group list-group-flush border-0"> <li class="list-group-item border-0"><a href="https://registry.hub.docker.com/r/ip2location/mysql" target="_blank" rel="nofollow">IP2Location MySQL Server</a></li> <li class="list-group-item border-0"><a href="https://registry.hub.docker.com/r/ip2location/postgresql" target="_blank" rel="nofollow">IP2Location PostgreSQL Server</a></li> <li class="list-group-item border-0"><a href="https://registry.hub.docker.com/r/ip2location/mongodb" target="_blank" rel="nofollow">IP2Location MongoDB Server</a></li> </ul> </div> </div> </div> </div> <div class="tab-pane px-4 px-sm-5 py-5" id="sdk-libraries" role="tabpanel" aria-labelledby="sdk-libraries-tab"> <h3 class="mb-3"><b>SDK & Libraries</b></h3> <div class="row"> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/c" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-c.png" class="img-fluid lazy" width="150" alt="C Library"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/c" target="_blank">C Library</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/php" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-php.png" class="img-fluid lazy" width="150" alt="PHP Module"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/php" target="_blank">PHP Module</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/perl" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-perl.png" class="img-fluid lazy" width="150" alt="Perl Module"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/perl" target="_blank">Perl Module</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/ruby" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-ruby.png" class="img-fluid lazy" width="150" alt="Ruby Library"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/ruby" target="_blank">Ruby Library</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/python" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-python.png" class="img-fluid lazy" width="150" alt="Python Library"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/python" target="_blank">Python Library</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/apache" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-apache.png" class="img-fluid lazy" width="150" alt="Apache Module"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/apache" target="_blank">Apache Module</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/nginx" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-nginx.png" class="img-fluid lazy" width="150" alt="Nginx Module"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/nginx" target="_blank">Nginx Module</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/nodejs" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-nodejs.png" class="img-fluid lazy" width="150" alt="Node.js Module"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/nodejs" target="_blank">Node.js Module</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/cocoa" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-cocoa.png" class="img-fluid lazy" width="150" alt="Cocoa / Objective C Library"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/cocoa" target="_blank">Cocoa / Objective C Library</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/pascal" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-pascal.png" class="img-fluid lazy" width="150" alt="Pascal Library"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/pascal" target="_blank">Pascal Library</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/d" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-d.png" class="img-fluid lazy" width="150" alt="D Library"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/d" target="_blank">D Library</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/go" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-go.png" class="img-fluid lazy" width="150" alt="Go Package"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/go" target="_blank">Go Package</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/erlang" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-erlang.png" class="img-fluid lazy" width="150" alt="Erlang Module"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/erlang" target="_blank">Erlang Module</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/lua" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-lua.png" class="img-fluid lazy" width="150" alt="Lua Package"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/lua" target="_blank">Lua Package</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/haskell" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-haskell.png" class="img-fluid lazy" width="150" alt="Haskell Package"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/haskell" target="_blank">Haskell Package</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/debian-package" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-debian.png" class="img-fluid lazy" width="150" alt="Debian Package"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/debian-package" target="_blank">Debian Package</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/software/dot-net-component" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-dot-net.png" class="img-fluid lazy" width="150" alt=".NET Component"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/software/dot-net-component" target="_blank">.NET Component</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/software/java-component" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-java.png" class="img-fluid lazy" width="150" alt="Java Component"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/software/java-component" target="_blank">Java Component</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/software/http-module" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-http.png" class="img-fluid lazy" width="150" alt="HTTP Module"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/software/http-module" target="_blank">HTTP Module</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/software/active-x" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-active-x.png" class="img-fluid lazy" width="150" alt="ActiveX/COM-DLL"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/software/active-x" target="_blank">ActiveX/COM-DLL</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-3"> <a href="https://www.ip2location.com/development-libraries/ip2location/scala" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/sdk-scala.png" class="img-fluid lazy" width="150" alt="Scala"></a> <div class="card-body"> <p class="card-text text-center"> <a href="https://www.ip2location.com/development-libraries/ip2location/scala" target="_blank">Scala</a> </p> </div> </div> </div> </div> </div> <div class="tab-pane px-4 px-sm-5 py-5" id="free-tools" role="tabpanel" aria-labelledby="free-tools-tab"> <h3 class="mb-3"><b>Free Tools</b></h3> <a href="https://github.com/ip2location/ip2location-python-csv-converter" target="_blank">Script to convert IP range in numeric to dotted format or CIDR</a> <h3 class="mt-5 mb-3"><b>Free Plugins</b></h3> <div class="row"> <div class="col-md-4"> <div class="card border-0 p-2"> <a href="https://wordpress.org/plugins/ip2location-country-blocker/" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/free-plugin-country-blocker.png" class="img-fluid lazy" width="150" alt="IP2Location Country Blocker"></a> <div class="card-body pt-1"> <p class="card-text text-center"> <a href="https://wordpress.org/plugins/ip2location-country-blocker/" target="_blank">IP2Location Country Blocker in WordPress</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-2"> <a href="https://wordpress.org/plugins/ip2location-redirection/" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/free-plugin-redirector.png" class="img-fluid lazy" width="150" alt="IP2Location Redirection"></a> <div class="card-body pt-1"> <p class="card-text text-center"> <a href="https://wordpress.org/plugins/ip2location-redirection/" target="_blank">IP2Location Redirection in WordPress</a> </p> </div> </div> </div> <div class="col-md-4"> <div class="card border-0 p-2"> <a href="https://www.ip2location.com/free/plugins" target="_blank" style="margin:0 auto;"><img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/free-plugin-more.png" class="img-fluid lazy" width="150" alt="Other Plugins"></a> <div class="card-body pt-1"> <p class="card-text text-center"> <a href="https://www.ip2location.com/free/plugins" target="_blank">More Plugins</a> </p> </div> </div> </div> </div> </div> </div> </div> </div> </div> <div class="container mt-5" > <div class="row"> <div class="col"> <h3>License</h3> <p> Please review the <a href="/terms-of-use" target="_blank"> General Terms and Conditions </a> for the database licensing. </p> </div> </div> </div> <div class="container my-5"> <div class="row"> <div class="col"> <h3>Similar Products</h3> <ul class="list-unstyled my-4"> <li class="mb-4" style="display: none"><h3 style="font-size: .9375rem;"><span class="label label-black label-product text-uppercase">db1 </span> <a href="/database/db1-ip-country">IP2Location™ LITE IP-COUNTRY Database</a></h3></li> <li class="mb-4" style="display:block"><h3 style="font-size: .9375rem;"><span class="label label-black label-product text-uppercase">db3 </span> <a href="/database/db3-ip-country-region-city">IP2Location™ LITE IP-COUNTRY-REGION-CITY Database</a></h3></li> <li class="mb-4" style="display:block"><h3 style="font-size: .9375rem;"><span class="label label-black label-product text-uppercase">db5 </span> <a href="/database/db5-ip-country-region-city-latitude-longitude">IP2Location™ LITE IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE Database</a></h3></li> <li class="mb-4" style="display:block"><h3 style="font-size: .9375rem;"><span class="label label-black label-product text-uppercase">db9 </span> <a href="/database/db9-ip-country-region-city-latitude-longitude-zipcode">IP2Location™ LITE IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE Database</a></h3></li> <li class="mb-4" style="display:block"><h3 style="font-size: .9375rem;"><span class="label label-black label-product text-uppercase">db11 </span> <a href="/database/db11-ip-country-region-city-latitude-longitude-zipcode-timezone">IP2Location™ LITE IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE-TIMEZONE Database</a></h3></li> </ul> </div> </div> </div> <div class="container my-5"> <div class="row"> <div class="col"> <h3>Articles & Tutorials</h3> <ul class="list-unstyled my-4"> <li><a href="https://blog.ip2location.com/knowledge-base/how-to-detect-the-location-from-a-visitors-ip-using-the-free-ip2location-lite-database-in-symfony-4/" target="_blank">How to detect the location from a visitor’s IP using the Free IP2Location™ LITE Database in Symfony</a></li> <li><a href="https://blog.ip2location.com/knowledge-base/lookup-ip-address-in-bulk-using-php-and-mysql-database/" target="_blank">IP Address Lookup in Bulk Using PHP and MySQL Database</a></li> <li><a href="https://blog.ip2location.com/knowledge-base/how-to-redirect-on-varnish-using-ip2location-data/" target="_blank">How to redirect on Varnish using IP2Location data</a></li> <li><a href="https://blog.ip2location.com/knowledge-base/how-to-use-ip2location-geolocation-data-with-awesomplete-autocomplete-plugin/" target="_blank">How to use IP2Location geolocation data with with Awesomplete Autocomplete Plugin</a></li> <li><a href="https://blog.ip2location.com/knowledge-base/display-the-nearest-cities-from-visitors-ip-address/" target="_blank">Display the nearest cities from visitor’s IP address using PHP and MySQL</a></li> </ul> </div> </div> </div> <div class="jumbotron mt-3 mb-0" style="background-color:#F8F8FF;"> <div class="container mb-3"> <div class="row" > <div class="col-md-8 my-auto"> <h2 class="mb-2" style="font-size:2rem!important;">IP2Location™ IP Address Geolocation Database </h2> <h3 class="h5 mb-5">In Commercial Edition, you'll get much more than just IP address lookup:</h3> <ul class="fa-ul mb-3" style="font-size:20px;"> <li><i class="fa-li fa fa-check-square text-success"></i> Better data accuracy</li> <li><i class="fa-li fa fa-check-square text-success"></i> Access to up-to-date database</li> <li><i class="fa-li fa fa-check-square text-success"></i> Additional level of support via email</li> </ul> <div class="row"> <div class="col-md-5"> <a class="btn btn-info btn-lg btn-block my-3" id="btn-click" href="https://www.ip2location.com/buy-online" target="_blank" role="button">Upgrade Now</a> </div> <div class="col-md-5"> <a class="btn btn-outline-info btn-lg btn-block my-3" href="/edition-comparison" role="button" id="btn-click">Learn More</a> </div> </div> </div> <div class="col-md-4 my-auto"> <img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/upgrade-img.png" style="margin:0 auto;" width="400" height="290" class="img-fluid lazy" alt="Product Upgrade"> </div> </div> </div> </div> <div id="pop-out" class="p-4 d-none text-white" style="background-color:#31314b;box-shadow: 0 3px 8px rgba(0,0,0,30%);position:fixed;z-index: 9999;width: 100%; bottom: 0; left: 50%; transform: translate(-50%);"> <button id="btn-close" type="button" class="close" aria-label="Close"><span aria-hidden="true">×</span></button> <div class="row"> <div class="col-md-1 my-md-auto mb-3"> <img src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/ico-pop-out.png" style="margin:0 auto;" width="50" height="50" class="img-fluid lazy" alt="Sign Up Pop Out"> </div> <div class="col-md-8 mb-md-auto mb-3"> <h3>Geolocate Your Visitors Location</h3> <p class="mb-0">Enhance your applications with essential geolocation data by using our FREE databases.</p> </div> <div class="col-md-3 text-center my-auto"> <a href="/sign-up" class="btn btn-warning btn-lg">Get Started For Free Now</a> </div> </div> </div> <footer class="pt-4 mb-md-4 pt-md-5 bg-light text-dark"> <div class="container mt-3 mb-5"> <div class="row"> <div class="col-md-3 mb-3"> <a href="/"><img class="mb-3 img-fluid lazy" src="https://cdn-lite.ip2location.com/img/placeholder-image.png" data-src="https://cdn-lite.ip2location.com/img/logo.png" width="220" height="72" alt="IP2Location LITE IP Geolocation"></a> <p>IP2Location™ is an open source geolocation database with limited accuracy.</p> <p> <a href="https://www.facebook.com/ip2location" target="_blank" class="social-icon" aria-label="IP2Location Facebook" style="margin-right:-0.44rem;"> <span class="fa-stack"> <i class="fa fa-square fa-stack-2x"></i> <i class="fa-brands fa-facebook-f fa-stack-1x fa-inverse"></i> </span> </a> <a href="https://www.x.com/ip2location" target="_blank" class="social-icon" aria-label="IP2Location Twitter" style="margin-right:-0.44rem;"> <span class="fa-stack"> <i class="fa-solid fa-square fa-stack-2x"></i> <i class="fa-brands fa-x-twitter fa-stack-1x fa-inverse"></i> </span> </a> <a href="https://www.reddit.com/r/ip2location" target="_blank" class="social-icon" aria-label="IP2Location Reddit" style="margin-right:-0.44rem;"> <span class="fa-stack"> <i class="fa-solid fa-square fa-stack-2x"></i> <i class="fa-brands fa-reddit fa-stack-1x fa-inverse"></i> </span> </a> <a href="https://github.com/ip2location" target="_blank" class="social-icon" aria-label="IP2Location Github" style="margin-right:-0.44rem;"> <span class="fa-stack"> <i class="fa-solid fa-square fa-stack-2x"></i> <i class="fa-brands fa-github fa-stack-1x fa-inverse"></i> </span> </a> <a href="https://www.youtube.com/@ip2locationipgeolocation" target="_blank" class="social-icon" aria-label="IP2Location YouTube" style="margin-right:-0.44rem;"> <span class="fa-stack"> <i class="fa-solid fa-square fa-stack-2x"></i> <i class="fa-brands fa-youtube fa-stack-1x fa-inverse"></i> </span> </a> <a href="https://www.instagram.com/ip2location.ip" target="_blank" class="social-icon" aria-label="IP2Location Instagram" style="margin-right:-0.44rem;"> <span class="fa-stack"> <i class="fa-solid fa-square fa-stack-2x"></i> <i class="fa-brands fa-instagram fa-stack-1x fa-inverse"></i> </span> </a> <a href="https://www.linkedin.com/company/ip2location" target="_blank" class="social-icon" aria-label="IP2Location LinkedIn"> <span class="fa-stack"> <i class="fa-solid fa-square fa-stack-2x"></i> <i class="fa-brands fa-linkedin fa-stack-1x fa-inverse"></i> </span> </a> </p> </div> <div class="col-md-3 mb-3"> <h5>Explore</h5> <ul class="list-unstyled"> <li><a href="/" class="text-secondary">Home</a></li> <li><a href="/ip-address-ranges-by-country" class="text-secondary">IP Address</a></li> <li><a href="https://www.ip2location.com/affiliates" target="_blank" class="text-secondary">Affiliate Program</a></li> <li><a href="https://www.ip2location.com" target="_blank" class="text-secondary">Commercial Databases</a></li> <li><a href="/edition-comparison" class="text-secondary">Edition Comparison</a></li> <li><a href="/contact" class="text-secondary">Contact</a></li> <li><a href="/faqs" class="text-secondary">FAQ</a></li> </ul> </div> <div class="col-md-2 mb-3"> <h5>Products</h5> <ul class="list-unstyled"> <li><a href="/ip2location-lite" class="text-secondary">IP2Location™ LITE</a></li> <li><a href="/ip2proxy-lite" class="text-secondary">IP2Proxy™ LITE</a></li> <li><a href="/database-asn" class="text-secondary">ASN LITE</a></li> </ul> </div> <div class="col-md-4 mb-3"> <h5>Featured Sites</h5> <ul class="list-unstyled"> <li><a href="https://www.ip2location.com" rel="noopener" target="_blank" class="text-secondary">IP2Location Geolocation Technology</a></li> <li><a href="https://www.ip2location.io" rel="noopener" target="_blank" class="text-secondary">IP Geolocation API</a></li> <li><a href="https://www.fraudlabspro.com" rel="noopener" target="_blank" class="text-secondary">FraudLabs Pro Credit Card Fraud Detection</a></li> <li><a href="https://www.mailboxvalidator.com" rel="noopener" target="_blank" class="text-secondary">MailboxValidator Email Validation</a></li> <li><a href="https://www.geodatasource.com" rel="noopener" target="_blank" class="text-secondary">GeoDataSource World Cities Database</a></li> </ul> </div> </div> <div class="row mt-2 mb-1"> <div class="col-md clearfix"> <div class="float-left"> © 2011 - 2025 <a href="https://www.ip2location.com" rel="noopener">IP2Location.com</a>. All Rights Reserved. </div> <div class="float-right"> <a href="/terms-of-use">Terms of Service</a> | <a href="/privacy">Privacy Policy</a> </div> </div> </div> </div> </footer> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> <script defer src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/4.6.1/js/bootstrap.bundle.min.js"></script> <script defer src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.8/clipboard.min.js"></script> <script defer src="https://www.google.com/recaptcha/api.js?render=6LdhN3IpAAAAAJfSi02aqK44ttoTpliXlElzBST6"></script> <script defer src="https://cdn-lite.ip2location.com/js/scripts.js"></script> <script defer src="https://cdn-lite.ip2location.com/js/lazy.min.js"></script> <script defer src="https://cdn-lite.ip2location.com/js/cookie-notice.js"></script> <link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" as="style"> <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css" rel="stylesheet" type="text/css" /> <link rel="preload" as="style" href="https://cdn-lite.ip2location.com/css/styles.min.css"> <link rel="stylesheet" href="https://cdn-lite.ip2location.com/css/styles.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/components/prism-core.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.24.1/plugins/autoloader/prism-autoloader.min.js"></script> <script> <!-- $(function() { // $('.nav-link').on('click', function() { // $('html, body').animate({ // scrollTop: $('body').offset().top // }, 500); // }); $(".dropdown-menu .dropdown-item").click(function(){ $(this).parents(".nav-codes").find('.btn-dropdown').html($(this).text()+ '  '); $(this).parents(".nav-codes").find('.btn-dropdown').val($(this).data('value')); }); $("#dropdown-ver .dropdown-item").click(function(){ var ver = $(this).attr('id'); var lines = $('#version').text().split('\n'); lines.splice(0,1); $('#version').html(ver + '\n' + lines.join('\n')); document.querySelectorAll('pre code').forEach((el) => { Prism.highlightAll(el); }); }); $("#dropdown-ver2 .dropdown-item").click(function(){ var ver2 = $(this).attr('id'); var lines2 = $('#version2').text().split('\n'); lines2.splice(0,1); $('#version2').html(ver2 + '\n' + lines2.join('\n')); document.querySelectorAll('pre code').forEach((el) => { Prism.highlightAll(el); }); }); var clipboard = new Clipboard('.btn-copy'); $('.btn-copy').tooltip({trigger: 'click',placement: 'top'}); clipboard.on('success', function(e) { $(e.trigger).tooltip('hide').attr('data-original-title', 'Copied!').tooltip('show'); setTimeout(function(){$(e.trigger).tooltip('hide');}, 1000); }); //Copy Sample Codes $('.btn-codes').tooltip({trigger: 'click', placement: 'top'}); $('.btn-codes').click(function(){ if (window.getSelection && document.createRange) { // IE 9 and non-IE var activeTabId = document.querySelector('#version'); var range = document.createRange(); range.selectNodeContents(activeTabId); var sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range); document.execCommand("copy"); if (document.execCommand('copy')){ $('.btn-codes').tooltip('hide').attr('data-original-title', 'Copied!').tooltip('show'); setTimeout(function(){$('.btn-codes').tooltip('hide');}, 1000); } } else if (document.body.createTextRange) { // IE < 9 var textRange = document.body.createTextRange(); textRange.moveToElementText(); textRange.select(); document.execCommand("copy"); if (document.execCommand('copy')){ $('.btn-codes').tooltip('hide').attr('data-original-title', 'Copied!').tooltip('show'); setTimeout(function(){$('.btn-codes').tooltip('hide');}, 1000); } } }); //Copy Sample Codes2 $('.btn-codes2').tooltip({trigger: 'click', placement: 'top'}); $('.btn-codes2').click(function(){ if (window.getSelection && document.createRange) { // IE 9 and non-IE var activeTabId = document.querySelector('#version2'); var range = document.createRange(); range.selectNodeContents(activeTabId); var sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(range); document.execCommand("copy"); if (document.execCommand('copy')){ $('.btn-codes2').tooltip('hide').attr('data-original-title', 'Copied!').tooltip('show'); setTimeout(function(){$('.btn-codes2').tooltip('hide');}, 1000); } } else if (document.body.createTextRange) { // IE < 9 var textRange = document.body.createTextRange(); textRange.moveToElementText(); textRange.select(); document.execCommand("copy"); if (document.execCommand('copy')){ $('.btn-codes2').tooltip('hide').attr('data-original-title', 'Copied!').tooltip('show'); setTimeout(function(){$('.btn-codes2').tooltip('hide');}, 1000); } } }); if (document.cookie.includes('CookieConsent') === true) { $(window).scroll(function (e) { var available = $(document).height(); var percentage_of_page = 0.5; var half_screen = available * percentage_of_page; var height = $(window).scrollTop(); if ( height > half_screen ) { $('#pop-out').removeClass('d-none'); } }); $('#btn-close').click(function(){ $('#pop-out').addClass('d-none'); $(window).scroll(function (e) { var available = $(document).height(); var percentage_of_page = 0.5; var half_screen = available * percentage_of_page; var height = $(window).scrollTop(); if ( height > half_screen ) { $('#pop-out').addClass('d-none'); } }); }); } }); //--> </script> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-KNCBNCG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <script type='application/ld+json'>{"@context":"http:\/\/schema.org","@type":"Organization","url":"https:\/\/lite.ip2location.com\/","name":"IP2Location","logo":"https:\/\/cdn-lite.ip2location.com\/img\/logo-sm.png"}</script> </body> </html>