You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initial release of the official Erlang client library for the Ipregistry API.
ipregistry:lookup/2,3 for single IP address lookups, ipregistry:origin_lookup/1,2 for origin (requester)
lookups returning parsed User-Agent data, and ipregistry:batch_lookup/2,3 for resolving many IP addresses at
once. Batch lookups transparently split lists larger than the API's 1024-address limit into concurrently dispatched
sub-requests (configurable via the max_batch_size and batch_concurrency client options) and reassemble results
in input order.
ipregistry:parse_user_agents/2 for parsing raw User-Agent strings into structured data.
IP addresses are accepted as binaries, strings, or inet:ip_address() tuples.
Responses are maps with binary keys mirroring the API's JSON; ipregistry:get/2,3 walks nested fields with atom,
binary, or string path elements.
Clients are plain immutable maps created with ipregistry:new/1,2, safe to share between processes. Options: base_url, timeout, max_retries, retry_interval, retry_on_server_error, retry_on_too_many_requests, max_batch_size, batch_concurrency, cache, and user_agent. ipregistry:eu_base_url/0 returns the EU base
URL for EU-only data processing.
Optional in-memory caching via the ipregistry_cache gen_server (ETS-backed, TTL plus bounded size with
oldest-first eviction), embeddable in a supervision tree with ipregistry_cache:child_spec/1. Caching is disabled
by default; origin lookups are never cached and batch lookups reuse cached entries. Cache reads bypass the server
process and writes degrade gracefully when the cache is down.
Automatic retries with exponential backoff for transient transport errors and 5xx responses, honoring the Retry-After header. Retries on 429 Too Many Requests are disabled by default.
Errors as tagged tuples: {api_error, #{code, message, resolution, status}} for API-reported failures and {client_error, Reason} for client-side ones.
HTTPS with explicit TLS peer verification (verify_peer, OS trust store, hostname checking).
Offline unit tests (EUnit) and behavior tests (Common Test) against a local mock API server, plus opt-in live
system tests that run when IPREGISTRY_API_KEY is set.
Zero external dependencies (Erlang/OTP standard library only); requires OTP 27+.