public function lookup($ip = null)
    {
        $uri = '/';

        if ($ip !== null) {
            $uri = sprintf('/%s', $ip);
        }

        if ($this->apiKey !== null) {
            $uri = sprintf('%s?api-key=%s', $uri, $this->apiKey);
        }

        try {
            $response = $this->client->get($uri);

            return json_decode($response->getBody());
        } catch (ClientException $e) {
            throw $e;
        }
    }
public function lookup($ip = null)
    {
        $uri = '/';

        if ($ip !== null) {
            $uri = sprintf('/%s', $ip);
        }

        if ($this->apiKey !== null) {
            $uri = sprintf('%s?api-key=%s', $uri, $this->apiKey);
        }

        try {
            $response = $this->client->get($uri);

            return json_decode($response->getBody());
        } catch (ClientException $e) {
            throw $e;
        }
    }
public function lookup ( $ ip = null ) { $ uri = '/' ; if ( $ ip !== null ) { $ uri = sprintf ( '/%s' , $ ip ) ; } if ( $ this -> apiKey !== null ) { $ uri = sprintf ( '%s?api-key=%s' , $ uri , $ this -> apiKey ) ; } try { $ response = $ this -> client -> get ( $ uri ) ; return json_decode ( $ response -> getBody ( ) ) ; } catch ( ClientException $ e ) { throw $ e ; } }
Lookup IP data of a given IP address. If no address is passed the API
will return the data of the IP address initiating the API request.

@param  sting $ip
@return stdClass
Lookup IP data of a given IP address . If no address is passed the API will return the data of the IP address initiating the API request .