I got the solution. goqr.me api provides the 'download' parameter, we need to pass its value as '1' in the request to download image.
And then, we can set window location href to the resulted url.
$('#qrcode-dwnld-btn').click(function() {
var qrCodeBaseUri = 'https://api.qrserver.com/v1/create-qr-code/?',
params = {
data: data,
size: '200x200',
margin: 0,
// more configuration parameters ...
download: 1
};
window.location.href = qrCodeBaseUri + $.param(params);
});