PHP code example of pananames / php-api-client

1. Go to this page and download the library: Download pananames/php-api-client 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/ */

    

pananames / php-api-client example snippets




ananames\Api\Client;

// Create client
$client = Client::make('example95-8888-11e0-a7e8-04aafc84test');

try {
    // Get current balance.
    $response = $client->account()->getBalance();

    // Get paged list of domains available in your account.
    $response = $client->domains()->getList();

    // Get name server records.
    $response = $client->nameServers()->getDnsRecords('newexample.xyz');

    // Get full list of available TLDs.
    $response = $client->other()->getTlds();

    // Get current redirect URL.
    $response = $client->redirect()->getRedirect('newexample.xyz');

    // Get active transfers in.
    $response = $client->transferIn()->getTransfersList(1, 20);

    // Init transfer out.
    $response = $client->transferOut()->initTransferOut('newexample.xyz');

    // Get WHOIS information.
    $response = $client->whois()->getWhois('newexample.xyz', true);
} catch (Exception $e) {
    echo "Error: ". $e->getMessage() . "\n";
}