Download the PHP package webtigers/tld-rules without Composer
On this page you can find all versions of the php package webtigers/tld-rules. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webtigers/tld-rules
More information about webtigers/tld-rules
Files in webtigers/tld-rules
Package tld-rules
Short Description Zero-dependency catalog + query API of per-TLD domain-registration rules: required registrant extended attributes (OpenSRS tld_data), WHOIS-privacy availability, and registration-period bounds. Language-neutral JSON data included.
License BSD-3-Clause
Homepage https://github.com/WebTigers/TldRules
Informations about the package tld-rules
TldRules
A zero-dependency catalog of per-TLD domain-registration rules, with a small query API.
Registries impose rules a reseller must satisfy to register a domain — residency/eligibility, extra registrant fields ("extended attributes"), whether WHOIS privacy is offered, and the allowed registration period. No registrar API lets you interrogate these, so they end up hardcoded per project, over and over. This library collects them as plain, language-neutral JSON and wraps them in a tiny PHP class.
- Data:
data/tld-rules.json— use it from any language. - No dependencies, PHP 8.1+.
- BSD-3-Clause. Free for anyone, any project.
The extended-attribute field keys follow OpenSRS's tld_data
naming (e.g. nexus.category for .us, registrant_extra_info.legal_type for .ca) — the most widely
documented scheme — but the data is useful whatever registrar you use.
Install
Use
Longest registrable suffix wins: example.com.au resolves the com.au rules, example.co.uk resolves
the .uk ruleset. Unknown TLDs return the catalog defaults (privacy available, 1–10 year period, no
extra fields).
Loading your own data
Data shape
type is one of select | text | country | date. required_if makes a field required when another
field holds one of the listed values.
Coverage
TLDs with explicit rules include .us, .ca, .uk, .eu, .au (+ com/net/org/asn/id.au), .it,
.de, .es, .fr (+ French overseas), .nl, .no, .se, .nu, .ru, .hk, .my, .sg, .in
family, .mx, .com.br, .com.ar, .cl, .co.za, .ie, .pro, .travel, .aero, .coop, .jobs,
.law, .abogado, .xxx, and more. Anything not listed inherits the permissive defaults.
Privacy-availability flags are encoded from registry policy (no API returns them); corrections welcome.
Contributing
The catalog is data — add or fix a TLD in data/tld-rules.json and send a PR. Run composer test.
License
BSD-3-Clause © WebTigers. Part of making the web more free and open.