PHP code example of ortex / getyourbit

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

    

ortex / getyourbit example snippets




use GetYourBit\Api;

// create an instance
$api = new Api('https://ip.getyourbit.com/');

// login
$api->auth('login', 'password');

// request without scrolling
$body = $api->request("/lookup/8.8.8.8", array('locale': 'en-US'));
var_dump($body['data']);

// request with scrolling
$result = $api->scroll("/find/", array(
    'size': 500,
    'query' => array(
        'country' => 'nepal'
    )
));
echo count($result);

//logout
$api->logout();