small vedios 1 min code example
Example: small vedios 1 min
var request = require('request');
var fs = require('fs');
request.post({
url: 'https://api.remove.bg/v1.0/removebg',
formData: {
image_file: fs.createReadStream('/path/to/file.jpg'),
size: 'auto',
},
headers: {
'X-Api-Key': 'INSERT_YOUR_API_KEY_HERE'
},
encoding: null
}, function(error, response, body) {
if(error) return console.error('Request failed:', error);
if(response.statusCode != 200) return console.error('Error:', response.statusCode, body.toString('utf8'));
fs.writeFileSync("no-bg.png", body);
});