1. Go to this page and download the library: Download lyhiving/namecheap-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lyhiving / namecheap-sdk example snippets
#getDoaminList.php
me = 'ncusername';
$apiKey = '****************************';
$clientIp = '198.168.0.123';
// Return type can be: xml (default), array, json
$returnType = 'json';
$client = new Namecheap\Api($apiUser, $apiKey, $userName, $clientIp, $returnType);
$client->setCurlOption(CURLOPT_SSL_VERIFYPEER, false); // For local development env (if needed)
$ncDomains = new Namecheap\Domain\Domains($client);
$ncDomains->enableSandbox(); // Enable sandbox mode for the current instance
$domainList = $ncDomains->getList();
print_r($domainList);