ImgLink API Documentation

Welcome to the ImgLink API! Our RESTful API allows you to integrate image hosting directly into your applications, websites, and workflows.

Quick Start: The ImgLink API is designed to be simple and developer-friendly. You can start uploading images in minutes!

API Features

  • ✅ RESTful architecture
  • ✅ JSON response format
  • ✅ Bulk upload support
  • ✅ Multiple image formats
  • ✅ High-speed uploads
  • ✅ Global CDN delivery
  • ✅ No file size restrictions
  • ✅ 99.9% uptime SLA

Base URL

https://imglink.io/api/v1/

Authentication

The ImgLink API supports both authenticated and anonymous usage:

Anonymous Usage (No Auth Required)

For basic image uploads, no authentication is required. Simply make requests to our endpoints.

API Key Authentication (Recommended)

For higher rate limits and advanced features, obtain an API key:

curl -H "Authorization: Bearer YOUR_API_KEY" \
     -X POST https://imglink.io/api/v1/upload
Get Your API Key: Register for a free account to receive your API key and access advanced features.

API Endpoints

POST Upload Single Image

/api/v1/upload

Upload a single image and receive direct links in multiple formats.

Parameters
Parameter Type Required Description
file File Yes Image file to upload (max 64MB)
album String No Album/folder name for organization
expiry Integer No Auto-delete after X hours (0 = permanent)
Example Request
const formData = new FormData();
formData.append('file', fileInput.files[0]);
formData.append('album', 'my-project');

fetch('https://imglink.io/api/v1/upload', {
    method: 'POST',
    headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
    },
    body: formData
})
.then(response => response.json())
.then(data => {
    console.log('Upload successful:', data);
});
Example Response
{
    "success": true,
    "data": {
        "id": "abc123",
        "filename": "my-image.jpg",
        "size": 1024576,
        "width": 1920,
        "height": 1080,
        "format": "JPEG",
        "uploaded_at": "2025-07-07T12:00:00Z",
        "links": {
            "direct": "https://imglink.io/i/abc123.jpg",
            "thumbnail": "https://imglink.io/t/abc123.jpg",
            "view_page": "https://imglink.io/image/abc123",
            "bbcode": "[img]https://imglink.io/i/abc123.jpg[/img]",
            "html": "<img src=\"https://imglink.io/i/abc123.jpg\">",
            "markdown": "![Image](https://imglink.io/i/abc123.jpg)"
        }
    }
}

POST Bulk Upload

/api/v1/upload/bulk

Upload multiple images in a single request for efficient batch processing.

Example Request
import requests

files = [
    ('files', open('image1.jpg', 'rb')),
    ('files', open('image2.png', 'rb')),
    ('files', open('image3.gif', 'rb'))
]

response = requests.post(
    'https://imglink.io/api/v1/upload/bulk',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    files=files
)

print(response.json())

GET Get Image Information

/api/v1/image/{id}

Retrieve detailed information about an uploaded image.

Example Request
curl -H "Authorization: Bearer YOUR_API_KEY" \
     https://imglink.io/api/v1/image/abc123

DELETE Delete Image

/api/v1/image/{id}

Permanently delete an uploaded image (requires authentication).

Example Request
curl -X DELETE \
     -H "Authorization: Bearer YOUR_API_KEY" \
     https://imglink.io/api/v1/image/abc123

Response Formats

All API responses are returned in JSON format with a consistent structure:

Success Response

{
    "success": true,
    "data": {
        // Response data here
    },
    "message": "Operation completed successfully"
}

Error Response

{
    "success": false,
    "error": {
        "code": "INVALID_FILE_TYPE",
        "message": "Only image files are allowed"
    }
}

Error Handling

The API uses conventional HTTP status codes to indicate success or failure:

Status Code Meaning Description
200 OK Request successful
400 Bad Request Invalid request parameters
401 Unauthorized Invalid or missing API key
413 Payload Too Large File size exceeds limit
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error - try again later

Rate Limits

To ensure fair usage and maintain service quality, the API implements rate limiting:

Plan Requests per Hour Upload Limit Bulk Upload
Anonymous 100 64MB per file 10 files max
Free Account 1,000 64MB per file 50 files max
Pro Account 10,000 256MB per file 500 files max
Enterprise Unlimited 1GB per file Unlimited

SDKs & Libraries

We provide official SDKs and community libraries for popular programming languages:

JavaScript/Node.js

npm install imglink-js

Python

pip install imglink-python

PHP

composer require imglink/php-sdk

Go

go get github.com/imglink/go-sdk

Code Examples

JavaScript (Browser)

async function uploadImage(file) {
    const formData = new FormData();
    formData.append('file', file);
    
    try {
        const response = await fetch('https://imglink.io/api/v1/upload', {
            method: 'POST',
            body: formData
        });
        
        const result = await response.json();
        
        if (result.success) {
            console.log('Image uploaded:', result.data.links.direct);
            return result.data.links.direct;
        } else {
            console.error('Upload failed:', result.error.message);
        }
    } catch (error) {
        console.error('Network error:', error);
    }
}

Python

import requests

def upload_image(file_path, api_key=None):
    url = 'https://imglink.io/api/v1/upload'
    
    headers = {}
    if api_key:
        headers['Authorization'] = f'Bearer {api_key}'
    
    with open(file_path, 'rb') as file:
        files = {'file': file}
        response = requests.post(url, headers=headers, files=files)
    
    result = response.json()
    
    if result['success']:
        return result['data']['links']['direct']
    else:
        raise Exception(f"Upload failed: {result['error']['message']}")

# Usage
image_url = upload_image('my-photo.jpg', 'your-api-key')
print(f"Image uploaded: {image_url}")

PHP

<?php
function uploadImage($filePath, $apiKey = null) {
    $url = 'https://imglink.io/api/v1/upload';
    
    $headers = [];
    if ($apiKey) {
        $headers[] = 'Authorization: Bearer ' . $apiKey;
    }
    
    $file = new CURLFile($filePath);
    $data = ['file' => $file];
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    
    $response = curl_exec($ch);
    curl_close($ch);
    
    $result = json_decode($response, true);
    
    if ($result['success']) {
        return $result['data']['links']['direct'];
    } else {
        throw new Exception('Upload failed: ' . $result['error']['message']);
    }
}

// Usage
$imageUrl = uploadImage('my-photo.jpg', 'your-api-key');
echo "Image uploaded: " . $imageUrl;
?>

Common Use Cases

E-commerce Integration

Integrate ImgLink into your online store for product image management:

  • Automatic product image uploads
  • Bulk catalog imports
  • Customer photo reviews
  • Dynamic image optimization

Mobile App Backend

Power your mobile app with reliable image hosting:

  • User profile pictures
  • Photo sharing features
  • Image-based content
  • Social media integrations

Content Management

Enhance your CMS with powerful image capabilities:

  • Blog post images
  • Media library management
  • Automated resizing
  • CDN acceleration

Automation & Workflows

Build automated image processing workflows:

  • Scheduled batch uploads
  • Image processing pipelines
  • Backup automation
  • API-driven workflows

Support & Resources

API Support

Get help with API integration and troubleshooting.

Contact API Support
GitHub Examples

Find code examples and community contributions.

View on GitHub
Developer Community

Join our developer community for discussions and updates.

Join Discord