PHP code example of pananames / api
1. Go to this page and download the library: Download pananames/api 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 / api example snippets
Pananames\Api\DomainsApi;
$domainsApi = new DomainsApi('SIGNATURE', 'URL');
$response = $domainsApi->check('domain-example.com');
if ($response->hasErrors()) {
$errors = $response->getErrors();
//Log etc.
return;
}
$data = $response->getData();
$httpCode = $response->getHttpCode();
$isSuccessful = $response->isSuccessful();
$isAvailable = $data->getAvailable();
$isPremium = $data->getPremium();