The Pixcleaner API is powered by innovative machine learning models that have been adjusted on millions of images. You can request an API Key here or on your Account page.
Use the following code samples to get started quickly:
$curl -X POST -H "Content-Type: application/json" -H 'X-API-KEY: YOUR_API_KEY' --data '{"imageUrl":"https://pcressources.s3.us-east-2.amazonaws.com/photo.jpg"}' -f https://api.pixcleaner.com/v2/autoremove
import requests, json, shutil headers={ 'Content-Type':'application/json', 'X-API-KEY':'YOUR_API_KEY', } data='{"imageUrl":"https://pcressources.s3.us-east-2.amazonaws.com/photo.jpg"}' response= requests.post('https://api.pixcleaner.com/v2/autoremove', headers=headers, data=data) response_content = json.loads(response._content) result_url = response_content['resultImage']['url'] res = requests.get(result_url, stream =True) img_path = "my-result.png" if res.status_code == 200: with open(img_path,'wb') as f: shutil.copyfileobj(res.raw, f) print('Image sucessfully Downloaded: ', img_path) else: print('Image Couldn't be retrieved')
// Requires "axios" to be installed const axios = require('axios'); const fs = require('fs'); const path = require('path'); axios({ method: 'post', url: 'https://api.pixcleaner.com/v2/autoremove', data: { imageUrl: 'https://pcressources.s3.us-east-2.amazonaws.com/photo.jpg' }, headers: { contentType: 'application/json' 'x-api-key': 'INSERT_YOUR_API_KEY_HERE', }, }) .then((response) => { if (response.status != 200) return console.error('Error:', response.status, response.statusText); // do your processing... }) .catch((error) => { return console.error('Request failed:', error); });
2.0.0
OAS3
Remove the background and design any image
Remove background given an image
fetch and post process image (coming soon)
fetch user account info and remaining credits (coming soon)
The PixCleaner CDN performs on-demand image scaling and reformatting with ease.
In other words, you may use query parameters to change the format or size of your results when you are presented with them.
So given the following response result:
{ resultImage: { path: "https://cdn.pixcleaner.com/example/79b16743b257Pixcleaner.png", width: "720px", height: "640px" } }
d=desiredDimension
to the route, you can introduce a new size of your image:https://cdn.pixcleaner.com/example/79b16743b257Pixcleaner.png?d=400
f=desiredFormat
for example:https://cdn.pixcleaner.com/example/79b16743b257Pixcleaner.png?d=400&f=webp