Background Remover API from Images
Last updated 1 year ago
Endpoint
POST https://api.magicapi.dev/api/v1/capix/rembg/rembg
Request Headers
Content-Type: application/json
x-magicapi-key: API_TOKEN
Request Body
{ "image_url": "https://storage.ws.pho.to/s2/7aa4876bc1f50bc92fc54cb3c326181ac5bbf5ef_m.jpeg" }
image_url: URL of the image for which the background needs to be removed.
curl -X 'POST' \ 'https://api.magicapi.dev/api/v1/capix/rembg/rembg' \ -H 'accept: application/json' \ -H 'x-magicapi-key: API_KEY' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d 'image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2F46a973ad6ff03f32b40a0.png'
import requests headers = { 'accept': 'application/json', 'x-magicapi-key': 'API_KEY', 'Content-Type': 'application/x-www-form-urlencoded', } data = { 'image_url': 'https://telegra.ph/file/46a973ad6ff03f32b40a0.png', } response = requests.post('https://api.magicapi.dev/api/v1/capix/rembg/rembg', headers=headers, data=data)
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://api.magicapi.dev/api/v1/capix/rembg/rembg'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'accept: application/json', 'x-magicapi-key: API_KEY', 'Content-Type: application/x-www-form-urlencoded', ]); curl_setopt($ch, CURLOPT_POSTFIELDS, 'image_url=https%3A%2F%2Ftelegra.ph%2Ffile%2F46a973ad6ff03f32b40a0.png'); $response = curl_exec($ch); curl_close($ch);
import axios from 'axios'; const response = await axios.post( 'https://api.magicapi.dev/api/v1/capix/rembg/rembg', new URLSearchParams({ 'image_url': 'https://telegra.ph/file/46a973ad6ff03f32b40a0.png' }), { headers: { 'accept': 'application/json', 'x-magicapi-key': 'API_KEY' } } );
fetch('https://api.magicapi.dev/api/v1/capix/rembg/rembg', { method: 'POST', headers: { 'accept': 'application/json', 'x-magicapi-key': 'API_KEY' }, body: new URLSearchParams({ 'image_url': 'https://telegra.ph/file/46a973ad6ff03f32b40a0.png' }) });