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;
        }
    }