package ip2location

  1. Overview
  2. Docs
IP2Location OCaml module to get geolocation data

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v8.2.0.tar.gz
md5=e5ebdee925555000053b7b4688c76b91
sha512=31b8d765ed5ccc3e01390449d22424d1a736f36f3f7e0336ff51e657f72cfd2bc677f3d5c18bf5186fc9bc01667f2fe909c3fbb8d5af97a2312c439229cc5db6

Description

IP2Location IP Geolocation OCaml module enables you to get your visitors' country, region, city, latitude, longitude, ZIP code, ISP, domain name, timezone, connection speed, IDD code, area code, weather station code, weather station name, MCC, MNC, mobile brand name, elevation, usage type, address type, IAB category, district, autonomous system number (ASN), autonomous system (AS), AS domain, AS usage type and AS CIDR based on IP address.

Tags

ip2location geolocation

Published: 10 Sep 2025

README

IP2Location OCaml Module

Static Badge

This OCaml module provides a fast lookup of country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, usage type, address type, IAB category, district, autonomous system number (ASN) and autonomous system (AS) from IP address by using IP2Location database. This module uses a file based database available at IP2Location.com. This database simply contains IP blocks as keys, and other information such as country, region, city, latitude, longitude, ZIP code, time zone, ISP, domain name, connection type, IDD code, area code, weather station code, station name, mcc, mnc, mobile brand, elevation, usage type, address type, IAB category, district, autonomous system number (ASN), autonomous system (AS), AS domain, AS usage type and AS CIDR as values. It supports both IP address in IPv4 and IPv6.

This module can be used in many types of projects such as:

  • select the geographically closest mirror
  • analyze your web server logs to determine the countries of your visitors
  • credit card fraud detection
  • software export controls
  • display native language and currency
  • prevent password sharing and abuse of service
  • geotargeting in advertisement

The database will be updated in monthly basis for the greater accuracy. Free LITE databases are available at https://lite.ip2location.com/ upon registration.

The paid databases are available at https://www.ip2location.com under Premium subscription package.

Developer Documentation

To learn more about installation, usage, and code examples, please visit the developer documentation at https://ip2location-ocaml.readthedocs.io/en/latest/index.html.

IPv4 BIN vs IPv6 BIN

Use the IPv4 BIN file if you just need to query IPv4 addresses.

Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.

Dependencies (8)

  1. yojson >= "1.6.0"
  2. cohttp-lwt-unix
  3. cohttp
  4. lwt
  5. ipaddr >= "4.0.0"
  6. stdint
  7. dune >= "3.4"
  8. ocaml >= "4.08"

Dev Dependencies (1)

  1. odoc with-doc

Used by

None

Conflicts

None