|MISSING_FILE|The BIN file path is wrong or the BIN file is unreadable.| |INVALID_IP_ADDRESS|The format of the IP address is wrong.| |EMPTY_IP_ADDRESS|The IP address is empty.| |OK|The query has been successfully performed.| These categories are comprised of Tier-1 and Tier-2 (if available) level categories widely used in services like advertising, Internet security and filtering appliances. The domain category is based on IAB Tech Lab Content Taxonomy. IP address types as defined in Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6).(A) Anycast - One to the closest(U) Unicast - One to one(M) Multicast - One to multiple(B) Broadcast - One to all Usage type classification of ISP or company:(COM) Commercial(ORG) Organization(GOV) Government(MIL) Military(EDU) University/College/School(LIB) Library(CDN) Content Delivery Network(ISP) Fixed Line ISP(MOB) Mobile ISP(DCH) Data Center/Web Hosting/Transit(SES) Search Engine Spider(RSV) Reserved Name of the nearest weather observation station.Īverage height of city above sea level in meters (m). Special code to identify the nearest weather observation station. The IDD prefix to call the city from another country.Ī varying length number assigned to geographic areas for call between cities. Internet connection speed (DIAL) Dial-up(DSL) DSL/Cable(COMP) Company/T1 Time zone in UTC (Coordinated Universal Time).ĭomain name associated to IP address range. Two-character country code based on ISO 3166. This method returns results in IP2Location.IPResult object.ĭestroy memory accessors & memory mapped file (only use in specific cases, otherwise don't use). Initialize component and preload BIN file. Open(ByVal DBPath As String, Optional ByVal UseMMF As Boolean = False) It is set to False by default.īelow are the methods supported in this class. This will increase query speed but require more memory. Set to True to enable memory mapped file feature. QUERY USING THE BIN FILE Parametersīelow are the parameters to set before using this class. If you don't have an existing API key, you can subscribe for one at the below:Ĭompatible with. Commercial IP2Location IP Geolocation BIN Data: Īs an alternative, this geolocation component can also call the IP2Location Web Service.Free IP2Location IP Geolocation BIN Data:.It lookup the IP address from IP2Location BIN Data file. NET component allows user to query an IP address for useful IP geolocation information such as the ISO3166 country code, country name, region or state, city, latitude and longitude, ZIP/Postal code, time zone, Internet Service Provider (ISP) or company name, domain name, net speed, area code, weather station code, weather station name, mobile country code (MCC), mobile network code (MNC) and carrier brand, elevation, usage type, address type, IAB category, district, autonomous system number (ASN) and autonomous system (AS). Geo_pattern = '''^(GeoIP Country Edition: ()\, (.*))'''Ĭountry_match = re.IP2Location IP Geolocation. Geo_str = subprocess.check_output(get_geo_cmd, shell=True) # The regular expression for validating an IP-address Example- python GeoIP.py path-to-file-containing-IP addresses: # Get Geolocation(Country) and hostname by passing a file having a bunch of IP addresses as the argument from the command line. Github link: IP2Location Python library Github A sample code is like this: import osĭatabase = IP2Location.IP2Location(os.path.join("data", "IPV4-COUNTRY.BIN"))ĭepends on your requirement, for example if you want to get the user's country name and region name, you can do this: import osįor more details, you can visit here: IP2Location Python library Assuming that you got the ip address already, you can try to use the IP2Location Python Library to get the user location.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |