PHPackages                             mannydmorales/101domain-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mannydmorales/101domain-api

ActiveLibrary[API Development](/categories/api)

mannydmorales/101domain-api
===========================

PHP SDK for the 101domain Client API v1

v1.0.0(2d ago)00MITPHPPHP &gt;=8.1

Since Jun 7Pushed 2d agoCompare

[ Source](https://github.com/mannydmorales/101domain-api-php)[ Packagist](https://packagist.org/packages/mannydmorales/101domain-api)[ RSS](/packages/mannydmorales-101domain-api/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

101domain PHP SDK
=================

[](#101domain-php-sdk)

A PHP 8.1+ SDK for the [101domain Client API v1](https://api.101domain.com/api/documentation).

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- [Composer](https://getcomposer.org/)

Installation
------------

[](#installation)

```
composer require mannydmorales/101domain-api
```

Quick Start
-----------

[](#quick-start)

```
use mannydmorales\the101domain\api\Client;

$client = new Client('your-bearer-token');

// Check account balance
$balance = $client->account()->balance();
echo "Credit: {$balance->creditBalance} {$balance->currency}";

// List your domains
$page = $client->domains()->list(page: 1, perPage: 25);
foreach ($page->items as $domain) {
    echo "{$domain->domainName} — {$domain->status}\n";
}

// Check domain availability
$result = $client->domains()->search('my-new-domain.com');
if ($result->available) {
    echo "Available! Register for {$result->firstPrice()->register} {$result->firstPrice()->currency}";
}
```

Authentication
--------------

[](#authentication)

All API requests require a Bearer token issued by 101domain. Pass it to the constructor:

```
$client = new Client('your-bearer-token');
```

Different endpoints require different [scopes](https://help.101domain.com/kb/101domain-api-and-mcp-server):

ScopeUsed by`account_read``account()->balance()``domains_read``domains()->list()`, `get()``domains_write``domains()->addForwarding()`, …`dns_read``dns()->nameservers()`, `records()`Resources
---------

[](#resources)

### Account

[](#account)

```
$balance = $client->account()->balance();
// $balance->creditBalance  (string)
// $balance->amountDue      (string)
// $balance->currency       (string)
```

### Domains

[](#domains)

```
// List with optional filters
$page = $client->domains()->list(
    page: 1,
    perPage: 50,
    search: 'example',
    status: ['ACTIVE', 'EXPIRED'],
    expiresFrom: '2026-01-01',
    expiresTo: '2027-01-01',
);

echo $page->total;        // total number of matching domains
echo $page->totalPages;
echo $page->hasMorePages() ? 'more' : 'done';

// Single domain
$domain = $client->domains()->get('example.com');
$domain->isActive();      // bool
$domain->isExpired();     // bool
$domain->isTransferring(); // bool

// Domain search / availability
$avail = $client->domains()->search('example.com', pricingTerms: '1,2,5');
$avail->available;           // bool
$avail->firstPrice()->register; // cheapest available term register price

// Bulk search (up to 50 domains)
['results' => $results, 'invalid' => $invalid] = $client->domains()->bulkSearch(
    ['example.com', 'another.net'],
    pricingTerm: 1
);
```

### Web Forwarding

[](#web-forwarding)

```
// Get current config
$fwd = $client->domains()->getForwarding('example.com');

// Add forwarding (type: "301" or "cloak")
$fwd = $client->domains()->addForwarding('example.com', 'https://target.com', '301');

// Update
$fwd = $client->domains()->updateForwarding('example.com', destination: 'https://new-target.com');

// Remove
$client->domains()->removeForwarding('example.com');
```

### DNS

[](#dns)

```
// Nameservers for a domain
$ns = $client->dns()->nameservers('example.com');
// ['NS1.101DOMAIN.COM', 'NS2.101DOMAIN.COM', ...]

// All DNS records (domain must use 101domain nameservers)
$records = $client->dns()->records('example.com');

// Filter by type and/or host
$aRecords = $client->dns()->records('example.com', type: 'A');
$wwwRecords = $client->dns()->records('example.com', type: 'A', name: 'www');

foreach ($records as $r) {
    echo "{$r->name} {$r->type} {$r->value} (TTL: {$r->ttl})\n";
}
```

### TLDs

[](#tlds)

```
// Single TLD
$tld = $client->tlds()->get('.com', pricingTerms: 'all');
$tld->tldName;           // ".COM"
$tld->type;              // "gTLD"
$tld->hasRequirements;   // bool
$tld->availableTerms;    // [1, 2, 3, 4, 5, ...]

$price = $tld->priceForTerm(1);
echo "{$price->register} {$price->currency}";

// Bulk lookup (up to 50 TLDs)
['results' => $tlds, 'invalid' => $invalid] = $client->tlds()->bulkLookup(
    ['.com', '.net', '.ai'],
    pricingTerm: 1
);
```

### Products

[](#products)

```
$product = $client->products()->get(101);
// $product->productId   (int)
// $product->productName (string)
// $product->pricing     (ProductPrice[])

$price = $product->priceForTerm(12); // 12 months
echo "{$price->new} / {$price->renew} {$price->currency}";
```

Error Handling
--------------

[](#error-handling)

All exceptions extend `mannydmorales\the101domain\api\Exceptions\ApiException`.

```
use mannydmorales\the101domain\api\Exceptions\ApiException;
use mannydmorales\the101domain\api\Exceptions\AuthenticationException;
use mannydmorales\the101domain\api\Exceptions\ForbiddenException;
use mannydmorales\the101domain\api\Exceptions\NotFoundException;
use mannydmorales\the101domain\api\Exceptions\RateLimitException;
use mannydmorales\the101domain\api\Exceptions\ValidationException;

try {
    $domain = $client->domains()->get('example.com');
} catch (AuthenticationException $e) {
    // 401 — token is invalid or expired
} catch (ForbiddenException $e) {
    // 403 — token lacks the required scope
} catch (NotFoundException $e) {
    // 404 — domain not found in your account
} catch (RateLimitException $e) {
    // 429 — slow down!
} catch (ValidationException $e) {
    // 422 — check $e->getErrors() for field-level messages
    foreach ($e->getErrors() ?? [] as $field => $messages) {
        echo "{$field}: " . implode(', ', $messages) . "\n";
    }
} catch (ApiException $e) {
    // Everything else
    echo $e->getStatusCode() . ' ' . $e->getApiCode() . ': ' . $e->getMessage();
}
```

Custom Guzzle Options
---------------------

[](#custom-guzzle-options)

Pass any [Guzzle request options](https://docs.guzzlephp.org/en/stable/request-options.html) as a second argument:

```
$client = new Client('your-token', [
    'timeout'  => 60,
    'proxy'    => 'tcp://localhost:8125',
    'verify'   => false, // disable SSL verification (dev only)
]);
```

Running Tests
-------------

[](#running-tests)

```
composer install
./vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please fork the repository and create a pull request with your changes.

License
-------

[](#license)

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

Contact
-------

[](#contact)

For any questions or suggestions, please contact .

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e4270bf32188f4d424b07cfc8c1eb329ccf6156978350f3e7c15ed547a14e50?d=identicon)[mannydmorales](/maintainers/mannydmorales)

---

Tags

apisdkdnsdomain101domain

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mannydmorales-101domain-api/health.svg)

```
[![Health](https://phpackages.com/badges/mannydmorales-101domain-api/health.svg)](https://phpackages.com/packages/mannydmorales-101domain-api)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k532.1M2.5k](/packages/aws-aws-sdk-php)[saloonphp/saloon

Build beautiful API integrations and SDKs with Saloon

2.4k11.0M641](/packages/saloonphp-saloon)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[resend/resend-php

Resend PHP library.

596.2M34](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.5M10](/packages/checkout-checkout-sdk-php)[clicksend/clicksend-php

351.6M11](/packages/clicksend-clicksend-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
