API Documentation
Public REST API for daily domain snapshots. Latest-only files (see Domain Data API), Bearer token auth, streaming gzip/zip. Base URL https://primitive.host/api/v1.
Overview
Daily snapshots refreshed once per day (02:00 UTC). The API lists available zones and streams the latest files — one domain per line, sorted and deduplicated, gzip-compressed. Files are overwritten daily and always represent the latest data — no history or date parameters.
- Base URL:
https://primitive.host/api/v1 - Auth:
Authorization: Bearer ph_…(create in Account Settings) - Latest-only: no
?date=— use the/dldownload endpoints
Authentication
Create a token in Account Settings → API Tokens (shown once, format ph_…). Send Authorization: Bearer ph_… with every request. Missing or invalid token → 401 {"error": …}.
Zones
List all zones with type (public or private) and domain counts. Includes last_run timestamp. 409 {"error":"No snapshots…"} if not yet generated. Rejects query params.
Detail for one zone. 404 if unknown.
Download the zone file — gzip-compressed text, one domain per line, sorted and deduplicated. 404 if not yet available.
New domains
Metadata for today’s new domains: size and last_modified. 404 if not yet generated.
Download today’s new domains as a gzip-compressed file.
Expired domains
Metadata for today’s expired domains: size and last_modified. 404 if not yet available.
Download today’s expired domains as a gzip-compressed file.
All zones bundle
Download a ZIP containing every zone file — one .txt.gz per zone.
Errors & limits
401— missing, invalid or revoked token404— unknown zone or file not yet generated409—/zones/empty state before first snapshot- No pagination — zone files are pre-sorted; use the download endpoints for bulk data.
Examples
List then download
Check token
Tokens: Account Settings → API Tokens (top section, shown once).