Download the PHP package josuamarcelc/registrar-api without Composer
On this page you can find all versions of the php package josuamarcelc/registrar-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download josuamarcelc/registrar-api
More information about josuamarcelc/registrar-api
Files in josuamarcelc/registrar-api
Package registrar-api
Short Description Unified PHP Registrar API (NameSilo, GoDaddy, Namecheap, Dynadot) with pluggable adapters.
License MIT
Homepage https://github.com/josuamarcelc/registrar-api
Informations about the package registrar-api
Registrar API
A unified PHP library for managing domains across multiple registrars with a single, consistent API. Current adapters:
- NameSilo
- GoDaddy
- Namecheap
- Dynadot
- ....
Provides a consistent interface for common operations like domain availability checks, registration, renewal, transfer, and DNS record management.
Easily extendable via adapter classes to support additional registrars with minimal code changes.
Drop-in architecture: add your own registrar by creating one class in
src/adapters/.
Requirements
- PHP 7.4+ (8.x recommended)
- cURL extension
- Composer
Installation
If you’re developing locally from the repo, ensure PSR‑4 autoloading is refreshed:
Quick Start
Credentials per Adapter
Each adapter accepts a config array. The keys below are the minimum you usually need.
NameSilo
GoDaddy
Namecheap
Dynadot
Common Operations (Unified Shape)
All adapters implement these methods (see src/Core/BaseAdapter.php). Return values are normalized as associative arrays so you can handle responses consistently.
⚠️ Contacts & Required Fields differ slightly per registrar. The library forwards what you pass; check the registrar’s API docs if a call fails due to missing fields.
Adapter‑Specific Examples
NameSilo – Register a domain
GoDaddy – DNS update
Namecheap – Set custom nameservers
Dynadot – Check and register
Raw Passthrough (Escape Hatch)
Need a command the wrapper doesn’t expose yet? Call the adapter directly:
Adding a New Registrar
-
Create a class in
src/adapters/{Brand}.php: - Composer autoloading will pick it up automatically with:
Error Handling
Every method returns a structure with:
ok(bool) — quick success checkraw— original parsed payload (JSON/XML/array)http— HTTP status code (when available)err— transport‑level error string (if any)
You can also wrap calls in try/catch if you layer exceptions in your project.
Common Operations (Unified Shape)
All adapters implement these methods (see src/Core/BaseAdapter.php). Return values are normalized as associative arrays so you can handle responses consistently.
⚠️ Contacts & Required Fields differ slightly per registrar.
Full Tutorials per Adapter
NameSilo – Complete Flow
GoDaddy – Complete Flow
Namecheap – Complete Flow
Dynadot – Complete Flow
Adding a New Registrar
- Create
src/adapters/{Brand}.php - Extend
BaseAdapterand implement abstract methods - Example:
Cloudflare Adapter
Manage Cloudflare zones, DNS, cache, and free features from the same API.
- Create a zone and get assigned nameservers
- Upsert DNS records (A/AAAA/CNAME/TXT/MX, proxied or not)
- Purge cache (everything or specific URLs)
- Toggle free features: Always Use HTTPS, Auto HTTPS Rewrites, Brotli, Minify, Rocket Loader, Dev Mode
➡️ See the full guide: docs/cloudflare.md
License
MIT © josuamarcelc