PHP code example of qasimleoo / whoisfreaks-php

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

    

qasimleoo / whoisfreaks-php example snippets





 Configure API key authorization: ApiKeyAuth
$config = WhoisFreaks\Configuration::getDefaultConfiguration()->setApiKey('apiKey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = WhoisFreaks\Configuration::getDefaultConfiguration()->setApiKeyPrefix('apiKey', 'Bearer');


$apiInstance = new WhoisFreaks\Api\ASNWHOISApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$apiKey = 'apiKey_example'; // string | Your WHOISFreaks API key
$asn = as15169; // string
$format = 'json'; // string

try {
    $result = $apiInstance->asnWhois($apiKey, $asn, $format);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ASNWHOISApi->asnWhois: ', $e->getMessage(), PHP_EOL;
}