Skip to content

abreksa4/extreme-ip-lookup-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eXTReMe IP LOOKUP Client

codecov workflow GitHub issues GitHub stars Latest Stable Version Total Downloads Latest Unstable Version License

A simple wrapper for eXTReMe-IP-LOOKUP.com

Installation

composer require andrewbreksa/extreme-ip-lookup

Usage

use AndrewBreksa\ExtremeIPLookup\Client;
use GuzzleHttp\Client as GuzzleClient;
use Http\Adapter\Guzzle7\Client as GuzzleAdapter;
use Http\Message\MessageFactory\GuzzleMessageFactory;

$client = new Client(
    new GuzzleAdapter(new GuzzleClient()),
    new GuzzleMessageFactory(),
    getenv('EXT_IP_KEY')
);

$ip = '63.70.164.200';

$result = $client->lookup($ip);
echo $result->isp . PHP_EOL;

\AndrewBreksa\ExtremeIPLookup\Client::lookup returns an instance of \AndrewBreksa\ExtremeIPLookup\IPResult on success, and throws \AndrewBreksa\ExtremeIPLookup\ExtremeIPLookupException on error.