protected function buildUrl($type = 'email', $value)
    {
        $type = trim(strtolower($type));

        if (! in_array($type, ['ip', 'email', 'username'])) {
            throw new \InvalidArgumentException('Type of '.$type.' is not supported by the API');
        }

        $url = $this->apiUrl.'?'.$type.'='.urlencode($value).'&f=json';

        return $url;
    }