API Documentation
Integrate image conversion into your applications with our REST API.
Authentication
All API requests require a Bearer token in the Authorization header.
Authorization: Bearer ic_your_token_here
Generate API tokens in your API Settings page. Tokens are shown once at creation — store them securely.
Endpoints
GET /api/v1/convert
Returns your current usage info, plan details, and supported formats.
Response
{
"plan": "api_free",
"label": "Free",
"usage": {
"used": 12,
"limit": 50,
"remaining": 38,
"period": "day"
},
"maxFileSize": 10485760,
"formats": ["png","jpg","webp","gif","bmp","tiff","avif","ico"]
}POST /api/v1/convert
Convert an image file. Send as multipart/form-data.
| Field | Type | Required | Description |
|---|---|---|---|
file | File | Yes | The image file to convert |
format | String | Yes | Target format (see supported formats below) |
quality | Integer | No | Quality 1–100 (for formats that support it) |
On success, returns the converted image binary with appropriate Content-Type and Content-Disposition headers.
Supported Formats
| Format | Value | MIME Type | Quality Support |
|---|---|---|---|
| PNG | png | image/png | Yes |
| JPG | jpg | image/jpeg | Yes |
| WebP | webp | image/webp | Yes |
| GIF | gif | image/gif | No |
| BMP | bmp | image/bmp | No |
| TIFF | tiff | image/tiff | Yes |
| AVIF | avif | image/avif | Yes |
| ICO | ico | image/x-icon | No |
Rate Limits
Rate limits reset daily. Upgrade your plan for higher limits.
| Plan | Daily Limit | Max File Size | API Keys |
|---|---|---|---|
| Free | 50 | 10 MB | 1 |
| Developer | 500 | 25 MB | 3 |
| Business | 5,000 | 50 MB | 10 |
Response Headers
Successful conversion responses include rate limit headers:
| Header | Description |
|---|---|
X-RateLimit-Limit | Your daily conversion limit |
X-RateLimit-Remaining | Conversions remaining today |
X-RateLimit-Reset | ISO 8601 timestamp when the limit resets |
Error Codes
Errors return JSON with an error field.
| Status | Meaning | Common Causes |
|---|---|---|
400 | Bad Request | Missing file, invalid format, invalid quality value, malformed form data |
401 | Unauthorized | Missing or invalid API token |
413 | Payload Too Large | File exceeds your plan's size limit |
429 | Too Many Requests | Daily conversion limit reached |
500 | Internal Server Error | Conversion failed (corrupt file, unsupported input format) |
{
"error": "Daily API conversion limit reached",
"limit": 50,
"resetAt": "2025-01-02T00:00:00.000Z"
}Code Examples
curl
curl -X POST https://format.select/api/v1/convert \ -H "Authorization: Bearer ic_your_token_here" \ -F "file=@photo.png" \ -F "format=webp" \ -F "quality=80" \ -o photo.webp
JavaScript (fetch)
const form = new FormData();
form.append("file", fileInput.files[0]);
form.append("format", "webp");
form.append("quality", "80");
const res = await fetch("https://format.select/api/v1/convert", {
method: "POST",
headers: { "Authorization": "Bearer ic_your_token_here" },
body: form,
});
if (!res.ok) {
const err = await res.json();
throw new Error(err.error);
}
const blob = await res.blob();
// Use the converted image blobPython (requests)
import requests
url = "https://format.select/api/v1/convert"
headers = {"Authorization": "Bearer ic_your_token_here"}
with open("photo.png", "rb") as f:
res = requests.post(url, headers=headers, files={
"file": ("photo.png", f, "image/png"),
}, data={
"format": "webp",
"quality": "80",
})
res.raise_for_status()
with open("photo.webp", "wb") as out:
out.write(res.content)