API Documentation

Complete PNG to ICO conversion interface for developers

Overview
The PNG to ICO API provides an easy-to-use image conversion service that supports multiple input formats and output sizes.
Supports PNG, JPG, WEBP and other formats
Batch conversion processing
Multiple ICO size outputs
Preserves transparent backgrounds
High-quality conversion algorithms
RESTful API design
Authentication

API key authentication may be added in the future.

API Endpoints
POST/api/converter

Convert uploaded images to ICO format

Request Parameters

filesFile[]Required

Image files to convert (supports PNG, JPG, WEBP)

sizesnumber[]Optional

Array of output ICO sizes, defaults to [16, 32, 48]

[16, 32, 48, 64, 128, 256]

Response Format

{
  "success": true,
  "data": {
    "files": [
      {
        "originalName": "image.png",
        "icoUrl": "/api/download/abc123.ico",
        "sizes": [
          16,
          32,
          48
        ]
      }
    ],
    "zipUrl": "/api/download/batch_abc123.zip"
  }
}
Usage Examples
// POST request - Convert image
fetch('/api/convert-to-ico', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    imageUrl: 'https://example.com/image.png',
    sizes: [16, 32, 48]
  })
})
.then(response => response.json())
.then(data => {
  if (data.success) {
    console.log('Conversion successful:', data.data);
    // data.data.results contains base64 data for each size
    Object.entries(data.data.results).forEach(([size, base64]) => {
      const blob = new Blob([atob(base64)], { type: 'image/x-icon' });
      const url = URL.createObjectURL(blob);
      const a = document.createElement('a');
      a.href = url;
      a.download = `icon_${size}px.ico`;
      a.click();
    });
  }
});

// GET request - Get API information
fetch('/api/convert-to-ico', {
  method: 'GET'
})
.then(response => response.json())
.then(data => {
  console.log('API info:', data);
});
Online API Testing
Test API endpoints directly in your browser and view actual request and response results

Supports PNG, JPG, WEBP, GIF format image links

Supported size range: 16-256 pixels

Error Codes
400Bad Request

Missing required parameters or incorrect parameter format

413File Too Large

Uploaded file exceeds maximum limit (10MB)

415Unsupported Media Type

Only PNG, JPG, WEBP formats are supported

500Internal Server Error

Error occurred during conversion process

Usage Limits
Maximum 10MB per file
Maximum 10 files per request
Supported ICO sizes: 16×16 to 256×256
Supported input formats: PNG, JPG, WEBP
Technical Support
If you encounter any issues while using the API, please contact us through: