protected function getUrl($ip)
    {
        // default to free service
        // free service does not support https
        $baseUrl = 'http://ip-api.com/json/';
        $key = '';

        // if key is set change to pro service
        if (array_get($this->config, 'key', false)) {
            $baseUrl = 'https://pro.ip-api.com/json/';
            $key = array_get($this->config, 'key');
        }

        return $baseUrl.$ip.(($key) ? '?key='.$key : '');
    }