đ API Overview
The KBMB Image Tools API provides programmatic access to our powerful image processing capabilities. You can integrate compression, resizing, conversion, flipping, rotation, and more into your own applications, websites, or workflows.
Key Features:
- 100% Free: No API keys, no rate limits, no hidden costs
- Simple REST API: Easy to integrate with any programming language
- Multiple Operations: Compress, resize, convert, flip, rotate, and more
- Multiple Formats: Support for JPG, PNG, and WebP
- Privacy First: All processing is done locally in your browser
đ Getting Started
Using the KBMB API is straightforward. Since all processing is done locally, you don't need any API keys or authentication. Simply make a request to our API endpoint with your image and desired operation.
Base URL
https://image.kbmb.net/api/v1/
Authentication
No authentication required. All endpoints are open and free to use.
đ§ API Endpoints
POST /compress
Compress an image to a target size in KB.
image
The image file to compress (multipart/form-data)
file
target_kb
Target size in KB (e.g., 150)
integer
format
Output format: jpg, png, or webp
string
curl -X POST https://image.kbmb.net/api/v1/compress \
-F "image=@photo.jpg" \
-F "target_kb=150" \
-F "format=webp"
POST /resize
Resize an image to specific dimensions.
image
The image file to resize (multipart/form-data)
file
width
Target width in pixels
integer
height
Target height in pixels
integer
curl -X POST https://image.kbmb.net/api/v1/resize \
-F "image=@photo.jpg" \
-F "width=800" \
-F "height=600"
POST /convert
Convert an image to a different format.
image
The image file to convert (multipart/form-data)
file
format
Target format: jpg, png, or webp
string
curl -X POST https://image.kbmb.net/api/v1/convert \
-F "image=@logo.png" \
-F "format=webp"
POST /flip
Flip an image horizontally or vertically.
image
The image file to flip (multipart/form-data)
file
direction
h (horizontal) or v (vertical)
string
curl -X POST https://image.kbmb.net/api/v1/flip \
-F "image=@photo.jpg" \
-F "direction=h"
POST /rotate
Rotate an image by a specified number of degrees.
image
The image file to rotate (multipart/form-data)
file
degrees
90, 180, or 270
integer
curl -X POST https://image.kbmb.net/api/v1/rotate \
-F "image=@photo.jpg" \
-F "degrees=90"
đģ Code Examples
JavaScript (Node.js)
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
async function compressImage() {
const form = new FormData();
form.append('image', fs.createReadStream('photo.jpg'));
form.append('target_kb', '150');
form.append('format', 'webp');
const response = await axios.post(
'https://image.kbmb.net/api/v1/compress',
form,
{ headers: form.getHeaders(), responseType: 'stream' }
);
response.data.pipe(fs.createWriteStream('compressed.webp'));
}
Python
import requests
url = 'https://image.kbmb.net/api/v1/compress'
files = {'image': open('photo.jpg', 'rb')}
data = {'target_kb': '150', 'format': 'webp'}
response = requests.post(url, files=files, data=data)
with open('compressed.webp', 'wb') as f:
f.write(response.content)
PHP
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://image.kbmb.net/api/v1/compress');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'image' => new CURLFile('photo.jpg'),
'target_kb' => '150',
'format' => 'webp'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
file_put_contents('compressed.webp', $response);
đ¤ Response Format
All successful API requests return the processed image as the response body with the appropriate content type. Error responses return a JSON object with an error message.
Success Response
Content-Type: image/webp
Content-Length: 15360
[Binary image data]
Error Response
{
"error": "Invalid image format. Please upload JPG, PNG, or WebP."
}
⥠Rate Limits & Usage
The KBMB API is completely free and open. There are no rate limits, no API keys, and no usage restrictions. You can use it as much as you want for any purpose â commercial or personal.
- No Rate Limits: Make as many requests as you need
- No Authentication: No API keys or tokens required
- File Size Limit: 10MB per image
- Supported Formats: JPG, PNG, WebP
- Privacy: All processing is done locally in your browser
đ Privacy & Security
Like all KBMB tools, the API processes images 100% locally in your browser. This means:
- Your images never leave your device
- No upload to any server
- No storage of your images
- No privacy concerns â even for sensitive photos
- Fast processing with zero latency
This makes our API the most secure and private image processing API available.