API Documentation

Everything you need to integrate GoTiny into your application

Quick Start

Compress your first image in under a minute:

curl -X POST https://api.devrewoh.com/api/v1/batches \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image_urls": ["https://example.com/image.jpg"],
    "settings": {
      "quality": 80,
      "format": "webp"
    }
  }'

Base URL

https://api.devrewoh.com/api/v1

Authentication

All API requests require authentication via Bearer token. Include your API key in the Authorization header:

Authorization: Bearer ic_your_api_key_here

Get your API key by purchasing a plan on the pricing page.

Create Batch

POST /batches

Submit a batch of images for compression.

Request Body

{
  "image_urls": [
    "https://example.com/image1.jpg",
    "https://example.com/image2.png"
  ],
  "settings": {
    "quality": 80,
    "format": "webp",
    "max_width": 1920,
    "max_height": 1080
  }
}

Parameters

ParameterTypeRequiredDescription
image_urlsarrayYesURLs of images to compress (1-1000)
settings.qualityintegerNoOutput quality 1-100 (default: 80)
settings.formatstringNo"webp" or "jpeg" (default: webp)
settings.max_widthintegerNoMaximum output width in pixels
settings.max_heightintegerNoMaximum output height in pixels

Response

{
  "batch_id": "a27dcd6c-a701-43e9-9376-6a702d715426",
  "message": "Batch created successfully"
}

Get Batch Status

GET /batches/:batch_id/status

Check the processing status of a batch.

Example Request

curl https://api.devrewoh.com/api/v1/batches/a27dcd6c-a701-43e9-9376-6a702d715426/status \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "batch_id": "a27dcd6c-a701-43e9-9376-6a702d715426",
  "status": "completed",
  "total_images": 2,
  "completed": 2,
  "failed": 0,
  "images": [
    {
      "id": "661fc9f4-3125-4a1d-9acc-58bc6ab10729",
      "status": "completed",
      "original_size": 45230,
      "compressed_size": 12450
    }
  ]
}

Supported Formats

Input Formats

  • JPEG / JPG
  • PNG
  • GIF
  • WebP

Output Formats

  • WebP (recommended)
  • JPEG

Error Responses

All errors return JSON with an error message:

{
  "error": "Unsupported output format: 'png'. Supported formats: jpeg, webp"
}

HTTP Status Codes

200Success
400Bad request (invalid parameters)
401Unauthorized (invalid or missing API key)
429Rate limit exceeded
503Service temporarily unavailable

Rate Limits

  • 100 requests per second per API key
  • Maximum 1,000 images per batch
  • Monthly image limits based on your plan

Code Examples

Go

package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

func compressImages(apiKey string, urls []string) error {
    payload := map[string]interface{}{
        "image_urls": urls,
        "settings": map[string]interface{}{
            "quality": 80,
            "format":  "webp",
        },
    }

    body, _ := json.Marshal(payload)
    req, _ := http.NewRequest("POST",
        "https://api.devrewoh.com/api/v1/batches",
        bytes.NewBuffer(body))

    req.Header.Set("Authorization", "Bearer "+apiKey)
    req.Header.Set("Content-Type", "application/json")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        return err
    }
    defer resp.Body.Close()

    return nil
}

Python

import requests

def compress_images(api_key: str, urls: list[str]) -> dict:
    response = requests.post(
        "https://api.devrewoh.com/api/v1/batches",
        headers={
            "Authorization": f"Bearer {api_key}",
            "Content-Type": "application/json"
        },
        json={
            "image_urls": urls,
            "settings": {
                "quality": 80,
                "format": "webp"
            }
        }
    )
    return response.json()

JavaScript

async function compressImages(apiKey, urls) {
  const response = await fetch('https://api.devrewoh.com/api/v1/batches', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer ' + apiKey,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      image_urls: urls,
      settings: {
        quality: 80,
        format: 'webp'
      }
    })
  });
  return response.json();
}

Ready to get started?

View Pricing