Sign inSign up

letstool/http2registry

By letstool

Updated 3 months ago

Fast & lightweight HTTP gateway that serves Internet registry allocation data as a JSON REST API.

Image
Networking
API management
Web servers
0

615

letstool/http2registry repository overview

http2registry

Lightweight HTTP gateway that resolves IP addresses and AS numbers against Internet registry allocation data through a JSON REST API.

Send a POST /api/v1/registry request with an IP address or an AS number, get back structured JSON telling you which Regional Internet Registry (ARIN, APNIC, RIPE NCC, LACNIC, AFRINIC) the resource belongs to — along with the matched prefix, country, allocation status and date, and, for AS numbers, the organization and abuse contact.

Two MMDB databases are built automatically from gzipped CSVs served by the letstool CDN and refreshed every 24 hours at 12:30 UTC. No registry account, no manual download, no setup.

The binary embeds a web UI (dark/light mode, 15 languages, RTL support) and an OpenAPI 3.1 spec — no external files, no runtime dependencies.

Quick start

docker run -p 8080:8080 letstool/http2registry:latest

Open http://localhost:8080 to use the web UI, or query the API directly:

# Resolve an IP address to its prefix and Internet registry record
curl -s -X POST http://localhost:8080/api/v1/registry \
  -H "Content-Type: application/json" \
  -d '{"query":"1.1.1.1"}' | jq

# Resolve an AS number to its Internet registry record
curl -s -X POST http://localhost:8080/api/v1/registry \
  -H "Content-Type: application/json" \
  -d '{"query":"AS13335"}' | jq

Example response — IP address lookup:

{
  "status": "SUCCESS",
  "query_type": "ip",
  "query": "1.1.1.1",
  "answer": {
    "ip": "1.1.1.1",
    "prefix": "1.1.1.0/24",
    "size": "256",
    "registry": "apnic",
    "reg_country": "AU",
    "status": "assigned",
    "since": 1313020800,
    "ip_version": 4
  }
}

Example response — AS number lookup:

{
  "status": "SUCCESS",
  "query_type": "asnum",
  "query": "AS13335",
  "answer": {
    "asnum": 13335,
    "registry": "arin",
    "reg_country": "US",
    "status": "assigned",
    "since": 1055721600,
    "abuse_email": "[email protected]",
    "organization": "Cloudflare, Inc.",
    "last_update": 1718740034
  }
}

Query type auto-detection:

  • A valid IPv4 or IPv6 addressprefix2reg lookup — returns the matched prefix and its registry, country, status and allocation date
  • An AS number in the format AS<n> (case-insensitive: AS13335, as13335) → asn2reg lookup — returns the registry record, including organization and abuse contact

Configuration

CLI flagEnvironment variableDefault
-listen-addrLISTEN_ADDR127.0.0.1:8080
-db-dirDB_DIR/data
-db-urlDB_URL(none)
-license-keyLICENSE_KEY(none)

CLI flags take priority over environment variables.

Proxy is supported via the standard HTTPS_PROXY, HTTP_PROXY, and NO_PROXY environment variables (same behaviour as curl).

docker run -p 8080:8080 \
  -v ./db:/data:rw \
  -e LISTEN_ADDR=0.0.0.0:8080 \
  letstool/http2registry:latest

Peer sync mode

Set DB_URL to another running http2registry instance to download both MMDB databases directly from its /db/prefix2reg and /db/as2reg endpoints instead of fetching from the CDN. Useful for air-gapped environments or clusters where only one node hits the CDN.

docker run -p 8080:8080 \
  -e DB_URL=http://upstream-host:8080 \
  -v ./db:/data:rw \
  letstool/http2registry:latest

Persistent storage

Mount a volume to /data to cache the databases across container restarts:

docker run -p 8080:8080 \
  -e LISTEN_ADDR=0.0.0.0:8080 \
  -v ./db:/data:rw \
  letstool/http2registry:latest

On restart, if the cached MMDB files are recent enough, they are reloaded immediately without refetching.

Repo

https://github.com/letstool/http2registry


License

This project is licensed under the Apache License, Version 2.0.

Copyright (c) 2026 letstool.net

See also

ProjectGitHubDocker HubDescription
http2dnsletstool/http2dnsletstool/http2dnsFast & lightweight HTTP gateway that serves DNS queries as a JSON REST API
http2whoisletstool/http2whoisletstool/http2whoisFast & lightweight HTTP gateway that serves WHOIS queries as a JSON REST API
http2rdapletstool/http2rdapletstool/http2rdapFast & lightweight HTTP gateway that serves RDAP queries as a JSON REST API
http2geoipletstool/http2geoipletstool/http2geoipFast & lightweight HTTP gateway that serves IP geolocation database as a JSON REST API
http2certletstool/http2certletstool/http2certFast & lightweight HTTP gateway that serves X.509 certificate inspection as a JSON REST API
http2torletstool/http2torletstool/http2torFast & lightweight HTTP gateway that serves Tor IP database as a JSON REST API
http2sunletstool/http2sunletstool/http2sunFast & lightweight HTTP gateway that serves solar position algorithm as a JSON REST API
http2macletstool/http2macletstool/http2macFast & lightweight HTTP gateway that serves MAC address OUI database as a JSON REST API
http2countryletstool/http2countryletstool/http2countryFast & lightweight HTTP gateway that serves country database as a JSON REST API
http2prefixletstool/http2prefixletstool/http2prefixFast & lightweight HTTP gateway that serves Internet BGP routing database as a JSON REST API
http2registryletstool/http2registryletstool/http2registryFast & lightweight HTTP gateway that serves RIR/NIR Internet registry database as a JSON REST API

Internet registry data sourced from the public RIR delegated statistics via the letstool CDN. This project is not affiliated with any RIR or registry data provider. The five Regional Internet Registries — ARIN, APNIC, RIPE NCC, LACNIC and AFRINIC — publish delegated statistics describing IP address and AS number allocations. These files are the canonical public source of the allocation, country, status and date information exposed by this service.

Tag summary

Content type

Image

Digest

sha256:f03df10ad

Size

3.1 MB

Last updated

3 months ago

docker pull letstool/http2registry