PixelFlow

  • Home
  • Documentation

PixelFlow API Documentation

A powerful image compression API designed for developers and businesses. Optimize images, reduce bandwidth usage, and deliver faster websites.

REST API WebP Conversion Image Compression

⚡ Quick Start

Get your API key and compress your first image:

1. Create an account and generate your API key
2. Send a POST request
curl -X POST https://pixelflow.veen.africa/api/v1/compress \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "image=@/path/to/image.jpg" \
-F "quality=60"
                        
3. Receive optimized WebP image with download URL

API Endpoint

Base URL: https://pixelflow.veen.africa/api/v1

POST /compress
Compress Image

Uploads an image, compresses it, and converts it to WebP format. Supported formats: JPG, JPEG, PNG. Maximum file size: 20MB.

Headers
Header Required Description
Authorization Yes Bearer API key
Request Body

{
    "image": "file",
    "quality": 60
}

                            

image — Image file (JPG, JPEG, PNG)

quality — Compression quality from 1–100. Default: 60

Example Response
                            {
                            "success": true,
                            "data": {
                                "file_id": "f8a7c9e2d5b4a1c3d6e7",
                                "download_url": "https://pixelflow.veen.africa/api/download/f8a7c9e2d5b4a1c3d6e7",
                                "preview_url": "https://pixelflow.veen.africa/api/preview/f8a7c9e2d5b4a1c3d6e7",
                                "filename": "image.webp",
                                "stats": {
                                "original_size": 2457600,
                                "compressed_size": 512000,
                                "savings_percentage": 78.4,
                                "format": "webp",
                                "quality": 60
                                }
                            }
                            }
                        

API Usage Examples

Below are examples showing how to use the PixelFlow API with PHP and Python. Replace YOUR_API_KEY with your actual API key.

PHP Example
<?php

$apiKey = "YOUR_API_KEY";

$url = "https://pixelflow.veen.africa/api/v1/compress";

$ch = curl_init();

curl_setopt_array($ch, [

    CURLOPT_URL => $url,

    CURLOPT_RETURNTRANSFER => true,

    CURLOPT_POST => true,

    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer $apiKey"
    ],

    CURLOPT_POSTFIELDS => [
        "image" => new CURLFile("image.jpg"),
        "quality" => 60,
        "api_key" => $apiKey
    ]

]);

$response = curl_exec($ch);

curl_close($ch);

$result = json_decode($response, true);

print_r($result);

?>
Python Example
import requests

api_key = "YOUR_API_KEY"

url = "https://pixelflow.veen.africa/api/v1/compress"

files = {
    "image": open("image.jpg", "rb")
}

data = {
    "quality": 60,
    "api_key": api_key
}

headers = {
    "Authorization": f"Bearer {api_key}"
}

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

print(response.json())