IP2Location Zig API
Database
Member |
Description |
|---|---|
|
Memory-maps a BIN file read-only. |
|
Releases the mapping and closes the file. |
|
Looks up one address in IPv4 or IPv6 notation and returns a |
|
Returns the database type, column count, build date and row counts. |
|
Whether the file carries IPv4 ranges. |
|
Whether the file carries IPv6 ranges. |
|
Returns one field as |
Record fields
Field Name |
Type |
Description |
|---|---|---|
|
|
Two-character country code based on ISO 3166. |
|
|
Country name based on ISO 3166. |
|
|
Region or state name. |
|
|
City name. |
|
|
City latitude. Defaults to capital city latitude if city is unknown. |
|
|
City longitude. Defaults to capital city longitude if city is unknown. |
|
|
Internet Service Provider or company’s name. |
|
|
Internet domain name associated with IP address range. |
|
|
ZIP code or postal code. |
|
|
UTC time zone, with daylight saving time applied. |
|
|
Internet connection type. |
|
|
The IDD prefix to call the city from another country. |
|
|
A varying length number assigned to geographic areas for calls between cities. |
|
|
The special code to identify the nearest weather observation station. |
|
|
The name of the nearest weather observation station. |
|
|
Mobile Country Code (MCC) as defined in ITU E.212. |
|
|
Mobile Network Code (MNC) used with the MCC to identify a mobile operator or carrier. |
|
|
Commercial brand associated with the mobile carrier. |
|
|
Average height of city above sea level in metres. |
|
|
Usage type classification of the ISP or company. |
|
|
IP address types as defined in IPv4 and IPv6. |
|
|
The domain category based on IAB Tech Lab Content Taxonomy. |
|
|
District or county name. |
|
|
Autonomous system number (ASN). |
|
|
Autonomous system (AS) name. |
|
|
Domain name of the AS registrant. |
|
|
Usage type of the AS registrant. |
|
|
CIDR range for the whole AS. |
A field is null when the database does not carry it or the record has no value for it. Every string is a slice into the BIN file as stored.
Errors
Error |
Meaning |
|---|---|
|
The text is not an IPv4 or IPv6 address. |
|
No range in the database contains the address. |
|
An IPv6 address was given to an IPv4-only database. |
|
The header or a record points outside the file, or the file is an IP2Proxy database. |
Database.open also returns the usual file and memory-map errors.