ip2location/ip2location-ipv4-country-asn
Open repository in Console
 
Readme
Updated almost 2 years ago
Indexed almost 2 years ago

IP2Location™ LITE IPv4-Country and ASN

This is IP2Location™ LITE IPv4-Country and ASN data which imported from csv file generated in October 2023. It contains two tables which contain country and ASN data respectively. You can get more information about the data schema at here:

Note: It is free for personal or commercial use with attribution required by mentioning the use of this data as follows,

This site or product includes IP2Location LITE data available from <a href="https://lite.ip2location.com">https://lite.ip2location.com</a>.

Example usage

Query country information for IPv4 address 1.1.1.1 Open in console

SELECT
    "ip_from",
    "ip_to",
    "country_code",
    "country_name"
FROM
    "ip2location/ip2location-ipv4-country-asn:latest"."ipv4-country"
WHERE ('1.1.1.1'::inet - '0.0.0.0'::inet) >= ip_from
AND ip_to >= ('1.1.1.1'::inet - '0.0.0.0'::inet);

Query ASN information for IPv4 address 1.1.1.1 Open in Console

SELECT
    "ip_from",
    "ip_to",
    "cidr",
    "asn",
    "as"
FROM
    "ip2location/ip2location-ipv4-country-asn:latest"."ipv4-asn"
WHERE ('1.1.1.1'::inet - '0.0.0.0'::inet) >= ip_from
AND ip_to >= ('1.1.1.1'::inet - '0.0.0.0'::inet)
 
Preview
All 2 Tables
  • ipv4-asn
    2 Objects
     | 11 MB | 
    591k Rows