PixelFlow

  • Home
  • Documentation

PixelFlow API Documentation

A simple, powerful image optimization API built for African developers. Compress, convert, and deliver images efficiently.

REST API WebP Conversion Lossless Compression

What is PixelFlow?

PixelFlow is a high-performance image optimization API built specifically for the African tech ecosystem. We help developers, bloggers, and businesses reduce bandwidth costs and improve website performance through intelligent image compression and modern format conversion.

🚀 For Developers

Simple REST API with clear documentation and quick integration.

📱 For Bloggers

Web interface for bulk processing without writing code.

🌍 For Africa

Optimized for high-bandwidth cost environments.

Key Features

Lossless Compression Reduce file size by 30-70% without visible quality loss
WebP Conversion Convert JPG, PNG, JPEG to modern WebP format
Bulk Processing Process multiple images with a single API call
Low-Data Mode Extra compression for high-bandwidth cost regions

⚡ Quick Start

Get your API key and make your first request in minutes:

1. Sign up for a free account → Get your API key
2. Make your first API call:
                                            curl -X POST https://pixelflow.veen.africa/api/v1/compress \
                                            -H "Authorization: Bearer YOUR_API_KEY" \
                                            -F "image=@/path/to/your/image.jpg" \
                                            -F "quality=80"
                                        
3. Receive optimized image in response

API Endpoints

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

POST /compress
Compress an image

Compress JPG, PNG, or JPEG images with optional quality settings.

Request Parameters:
Parameter Type Required Description
image file Yes Image file (JPG, PNG, JPEG)
quality integer No 1-100 (default: 85)
low_data_mode boolean No Extra compression (true/false)
Example Response:
                                            {
                                                "success": true,
                                                "data": {
                                                    "file_id": "a3f5c8e9b2d1f4a6c7e8b9d0",
                                                    "download_url": "https://pixelflow.veen.africa/api/download/a3f5c8e9b2d1f4a6c7e8b9d0",
                                                    "preview_url": "https://pixelflow.veen.africa/api/preview/a3f5c8e9b2d1f4a6c7e8b9d0",
                                                    "filename": "vacation_photo.webp",
                                                    "stats": {
                                                        "original_size": 2457600,
                                                        "original_size_formatted": "2.4 MB",
                                                        "compressed_size": 512000,
                                                        "compressed_size_formatted": "512 KB",
                                                        "savings_percentage": 79.2,
                                                        "compression_ratio": "4.8:1",
                                                        "format": "webp",
                                                        "quality": 80
                                                    },
                                                    "expires_at": "2024-01-20T15:30:00+00:00",
                                                    "expires_in": "48 hours"
                                                },
                                                "meta": {
                                                    "request_id": "req_5f8a9e2b3c4d5e6f7a8b9c0d",
                                                    "processing_time_ms": 234,
                                                    "timestamp": "2024-01-18T15:30:00+00:00"
                                                }
                                            }
                                        
POST /convert/webp
Convert image to WebP

Convert JPG, PNG, or JPEG images to WebP format.

Request Parameters:
Parameter Type Required Description
image file Yes Image file (JPG, PNG, JPEG)
quality integer No 1-100 (default: 80)
cURL Example:
                                            curl -X POST https://pixelflow.veen.africa/api/v1/convert/webp \
                                                -H "Authorization: Bearer YOUR_API_KEY" \
                                                -F "image=@/path/to/image.png" \
                                                -F "quality=75"
                                        
POST /batch
Batch process multiple images

Process up to 10 images in a single request.

Request Parameters:
Parameter Type Required Description
images[] file[] Yes Multiple image files (max 10)
Response includes ZIP download:
                                            {
                                                "success": true,
                                                "batch_id": "batch_abc123",
                                                "processed": 5,
                                                "zip_url": "https://pixelflow.veen.africa/api/download/batch_abc123.zip"
                                            }
                                        

Implementation Examples

Ready-to-use code snippets in popular languages

PHP
                                            <?php
                                            $ch = curl_init('https://pixelflow.veen.africa/api/v1/compress');
                                            curl_setopt($ch, CURLOPT_POST, true);
                                            curl_setopt($ch, CURLOPT_HTTPHEADER, [
                                                'Authorization: Bearer YOUR_API_KEY'
                                            ]);
                                            curl_setopt($ch, CURLOPT_POSTFIELDS, [
                                                'image' => new CURLFile('/path/to/image.jpg'),
                                                'quality' => '80'
                                            ]);
                                            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                            $response = curl_exec($ch);
                                            curl_close($ch);

                                            $result = json_decode($response, true);
                                            echo "Compressed size: " . $result['data']['stats']['compressed_size_formatted'];
                                            ?>
                                        
JavaScript
                                            const formData = new FormData();
                                            formData.append('image', fileInput.files[0]);
                                            formData.append('quality', '80');

                                            fetch('https://pixelflow.veen.africa/api/v1/compress', {
                                                method: 'POST',
                                                headers: {
                                                    'Authorization': 'Bearer YOUR_API_KEY'
                                                },
                                                body: formData
                                            })
                                            .then(response => response.json())
                                            .then(data => {
                                                console.log('Compression ratio:', data.data.stats.compression_ratio);
                                                console.log('Saved:', data.data.stats.savings_percentage + '%');
                                            });
                                        
Python
                                            import requests

                                            url = "https://pixelflow.veen.africa/v1/compress"
                                            headers = {"Authorization": "Bearer YOUR_API_KEY"}
                                            files = {"image": open("image.jpg", "rb")}
                                            data = {"quality": "80"}

                                            response = requests.post(url, headers=headers, 
                                                                    files=files, data=data)
                                            result = response.json()
                                            print(f"Saved {result['data']['stats']['savings_percentage']}%")
                                            print(f"Download: {result['data']['download_url']}")
                                        
Node.js
                                            const axios = require('axios');
                                            const FormData = require('form-data');
                                            const fs = require('fs');

                                            const form = new FormData();
                                            form.append('image', fs.createReadStream('image.jpg'));
                                            form.append('quality', '80');

                                            axios.post('https://pixelflow.veen.africa/api/v1/compress', 
                                                form, {
                                                headers: {
                                                    ...form.getHeaders(),
                                                    'Authorization': 'Bearer YOUR_API_KEY'
                                                }
                                            }).then(response => {
                                                console.log('File ID:', response.data.data.file_id);
                                                console.log('Preview:', response.data.data.preview_url);
                                            });
                                        
cURL
                                            # Compress with JSON response
                                            curl -X POST https://pixelflow.veen.africa/api/v1/compress \
                                                -H "Authorization: Bearer YOUR_API_KEY" \
                                                -F "image=@vacation.jpg" \
                                                -F "quality=80"

                                            # Direct download
                                            curl -X POST "https://pixelflow.veen.africa/api/v1/compress?download=true" \
                                                -H "Authorization: Bearer YOUR_API_KEY" \
                                                -F "image=@vacation.jpg" \
                                                -F "quality=80" \
                                                --output compressed.webp

                                            # Convert to WebP
                                            curl -X POST https://pixelflow.veen.africa/api/v1/convert/webp \
                                                -H "Authorization: Bearer YOUR_API_KEY" \
                                                -F "image=@image.png" \
                                                -F "quality=75"
                                            
Go
                                            package main

                                            import (
                                                "bytes"
                                                "encoding/json"
                                                "fmt"
                                                "io"
                                                "mime/multipart"
                                                "net/http"
                                                "os"
                                            )

                                            func main() {
                                                url := "https://pixelflow.veen.africa/api/v1/compress"
                                                
                                                file, _ := os.Open("image.jpg")
                                                defer file.Close()
                                                
                                                body := &bytes.Buffer{}
                                                writer := multipart.NewWriter(body)
                                                part, _ := writer.CreateFormFile("image", "image.jpg")
                                                io.Copy(part, file)
                                                writer.WriteField("quality", "80")
                                                writer.Close()
                                                
                                                req, _ := http.NewRequest("POST", url, body)
                                                req.Header.Set("Content-Type", writer.FormDataContentType())
                                                req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
                                                
                                                client := &http.Client{}
                                                resp, _ := client.Do(req)
                                                defer resp.Body.Close()
                                                
                                                var result map[string]interface{}
                                                json.NewDecoder(resp.Body).Decode(&result)
                                                fmt.Println(result)
                                            }
                                        

Authentication

All API requests require authentication using your API key.

Via Bearer Token
                Authorization: Bearer YOUR_API_KEY
Get Your API Key

1. Sign up for a free account

2. Go to Dashboard → API Keys

3. Generate a new API key

Simple, Transparent Pricing

Start free. Scale as you grow.

Free

$0
  • ✓ 100 conversions/month
  • ✓ JPG, PNG → WebP
  • ✓ Basic compression
  • ✓ Community support
Get Started

Pro

$8/mo
  • ✓ 5,000 conversions/month
  • ✓ Advanced compression
  • ✓ Higher rate limits
  • ✓ Email support
Upgrade to Pro

Growth

$19/mo
  • ✓ 25,000 conversions/month
  • ✓ Priority processing
  • ✓ Faster API response
  • ✓ Priority support
Choose Growth