REST API for Background Removal

Integrate AI-powered background removal into any application using our simple REST API. HTTP requests, JSON responses, and support for all programming languages.

Any Language JSON API Fast Response

API Endpoint

Simple HTTP POST request to remove backgrounds from images.

Base URL
https://api.yourdomain.com
Endpoint
POST /api/v1/remove

Request Examples

Simple HTTP requests in different programming languages.

cURL

curl -X POST "https://api.yourdomain.com/api/v1/remove" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "image_url": "https://example.com/image.jpg"
  }'

JavaScript

const response = await fetch('https://api.yourdomain.com/api/v1/remove', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    image_url: 'https://example.com/image.jpg'
  })
});

Python

import requests

url = "https://api.yourdomain.com/api/v1/remove"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
}
data = {
    "image_url": "https://example.com/image.jpg"
}

response = requests.post(url, headers=headers, json=data)

PHP

$url = 'https://api.yourdomain.com/api/v1/remove';
$data = json_encode([
    'image_url' => 'https://example.com/image.jpg'
]);

$options = [
    'http' => [
        'method' => 'POST',
        'header' => 'Content-Type: application/json\r\n' .
                   'Authorization: Bearer YOUR_API_KEY',
        'content' => $data
    ]
];

$response = file_get_contents($url, false, stream_context_create($options));

Request & Response Format

Simple JSON format for requests and responses.

Request

{
  "image_url": "https://example.com/image.jpg",
  "format": "png",
  "quality": "high"
}
Required

image_url

URL of the image to process

Optional

format

Output format: png, jpg (default: png)

Optional

quality

Processing quality: standard, high (default: standard)

Response

{
  "success": true,
  "result_url": "https://cdn.yourdomain.com/result.png",
  "processing_time": 2.3,
  "credits_used": 1
}

success

Boolean indicating success/failure

result_url

URL of the processed image

processing_time

Time taken in seconds

credits_used

API credits consumed

Authentication

Secure API access using Bearer token authentication.

Header Format

Authorization: Bearer YOUR_API_KEY

Include your API key in the Authorization header of every request.

Get Your API Key

Sign up for an account
Generate your API key
Start making API calls

Error Handling

Standard HTTP status codes and error messages.

400

Bad Request

{ "error": "Invalid image URL provided" }
401

Unauthorized

{ "error": "Invalid API key" }
429

Rate Limited

{ "error": "Rate limit exceeded" }

Ready to Start Building?

Get your API key and start integrating background removal into your applications today.