Skip to content
smallPict
Start free
HomeIntegrationsREST API

Simple HTTP REST API for any language or platform

Send images via multipart/form-data or binary buffer to POST https://api.smallpict.app/v1/optimize. Get back optimized AVIF/WebP assets, metadata, and CDN links.

Install

BASH Package
$ curl -X POST https://api.smallpict.app/v1/optimize ...

Implementation example

bash
curl -X POST https://api.smallpict.app/v1/optimize \
  -H "Authorization: Bearer sp_live_key_xxxxxxxx" \
  -H "Content-Type: multipart/form-data" \
  -F "file=@/path/to/product.jpg" \
  -F "format=avif" \
  -F "quality=80" \
  -F "width=1200" \
  -F "destination_bucket=my-s3-vault"

# Response JSON:
{
  "success": true,
  "original_size": 3412090,
  "optimized_size": 284102,
  "savings_percentage": 91.67,
  "format": "avif",
  "width": 1200,
  "height": 800,
  "cdn_url": "https://cdn.smallpict.app/media/abc123xyz.avif",
  "processing_time_ms": 38
}

Integration steps

  1. Get API key

    Create a free scoped API key from your SmallPict developer dashboard.

  2. POST /v1/optimize

    Send image binary or public image URL with target format and quality parameters.

  3. Receive CDN URL

    Get a JSON response with the new dimensions, the bytes saved and the CDN URL.

Key benefits

  • Standard HTTP/2 endpoint compatible with any programming language
  • HMAC-SHA256 signature support for tamper-proof requests
  • Results delivered from a worldwide edge network
  • Detailed JSON telemetry with byte sizes and dimension metadata

Need complete implementation guides & API specs?

Explore parameter references, authentication mechanisms, error codes, and local testing instructions in our official REST API developer guide.

Read REST API Docs

Speed Up Your REST API Image Pipeline

Try AVIF and WebP image optimization in your application. No setup fee, and sandbox keys right away.