Nightsec API v1

Database downloads

Pro and Business plans include MMDB and JSONL snapshots. Each release has a version, checksum and change-stream cursor.

1. Get the latest manifest

GET/v1/releases/latest
curl 'https://nightsec.io/v1/releases/latest' \
  -H "Authorization: Bearer $NIGHTSEC_API_KEY"

The manifest contains id, created_at, cursor, count and files. Each file entry provides its relative url, sha256 and bytes.

2. Download and verify

Download the file URL from files["iplens.mmdb"] or files["iplens.jsonl"], using the same API key. Check its SHA-256 against the manifest before replacing your local file.

Releases are immutable. Keep the manifest’s cursor to start incremental updates from the same point.

3. Read the database

pip install maxminddb
import maxminddb

with maxminddb.open_database("iplens.mmdb") as database:
    record = database.get("203.0.113.42")
    print(record)

A missing address returns None. Use a generic MMDB reader: the file uses Nightsec’s IPLens-Proxy schema, not the GeoIP2 City schema. The filename and schema identifier are retained for compatibility.