PHPackages                             aronduby/namecheap - 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. aronduby/namecheap

ActiveLibrary[API Development](/categories/api)

aronduby/namecheap
==================

A PHP wrapper for the Namecheap API

1500PHP

Since Aug 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/aronduby/Namecheap)[ Packagist](https://packagist.org/packages/aronduby/namecheap)[ RSS](/packages/aronduby-namecheap/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Overview
========

[](#overview)

This is library for the Namecheap API. It supports all of the latest namecheap API methods and is installable using composer. Started off as just a fork of [Humen/Namecheap](https://github.com/Humen/Namecheap) but I ended up making a whole lot of breaking changes including how you interact with the class and the parser so switching to it's own repo.

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

[](#requirements)

- PHP 5.3.0 or greater

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

[](#installation)

To install Namecheap, use the following composer require statement:

```
    "require": {
        "aronduby/namecheap": "dev-master"
    }

```

Usage
-----

[](#usage)

```
require 'vendor/autoload.php';

$api_user = 'YOUR-API-USERNAME';
$api_key = 'YOUR-API-KEY';
$client_ip = 'YOUR-IP-ADDRESS';
$sandbox = true;

$namecheap = new Namecheap\Wrapper($api_user, $api_key, $client_ip, $sandbox);
$response = $namecheap->domains()->getTldList();

if($response->success === true){
	$response->getData();
} else {
	$response->getErrors();
}
```

### Parser

[](#parser)

The XML to Array parsing is done via [this function from Outlandish blog](http://outlandish.com/blog/xml-to-json/). The nodes, starting at CommandResponse, will be returned as nested associative arrays where the node name is a key, attributes are prefixed with `@` and the text value is `$`.

So this call:

```
$rsp = $namecheap->domains()->dns()->getEmailForwarding(['DomainName' => 'test.com']);
```

results in the following XML from `$rsp->getRaw()`:

```

 namecheap.domains.dns.getEmailForwarding

     test@gmail.com
     test@grcmc.org

 PHX01SBAPI01
 --4:00
 1.379

```

which results in the follow array from `$rsp->getData()`:

```
[
 "@Type" => "namecheap.domains.dns.getEmailForwarding",
 "DomainDNSGetEmailForwardingResult" => [
   [
     "@Domain" => "test.com",
     "Forward" => [
       [
         "@mailboxid" => "19935",
         "@mailbox" => "info",
         "$" => "test@gmail.com",
       ],
       [
         "@mailboxid" => "19936",
         "@mailbox" => "webmaster",
         "$" => "test@gmail.com",
       ],
     ],
   ],
 ],
]
```

If you prefer to work directly with the `SimpleXml` object just call `$response->getXml()`

TODO
----

[](#todo)

- Write unit tests
- Write DTOs to enforce strictness in calls

License
-------

[](#license)

The MIT License (MIT)

Copyright (c) 2013 Vouga Labs

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/d816e65aa6b55b39549f8bd8fdd4c7ad05e0d98117b699b03d6586aa8b938ec6?d=identicon)[aronduby](/maintainers/aronduby)

---

Top Contributors

[![aronduby](https://avatars.githubusercontent.com/u/650070?v=4)](https://github.com/aronduby "aronduby (8 commits)")[![mcampa](https://avatars.githubusercontent.com/u/1934727?v=4)](https://github.com/mcampa "mcampa (4 commits)")

### Embed Badge

![Health badge](/badges/aronduby-namecheap/health.svg)

```
[![Health](https://phpackages.com/badges/aronduby-namecheap/health.svg)](https://phpackages.com/packages/aronduby-namecheap)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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