Welcome to the ImgLink API! Our RESTful API allows you to integrate image hosting directly into your applications, websites, and workflows.
https://imglink.io/api/v1/
The ImgLink API supports both authenticated and anonymous usage:
For basic image uploads, no authentication is required. Simply make requests to our endpoints.
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
/api/v1/upload
Upload a single image and receive direct links in multiple formats.
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) |
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);
});
{
"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": ""
}
}
}
/api/v1/upload/bulk
Upload multiple images in a single request for efficient batch processing.
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())
/api/v1/image/{id}
Retrieve detailed information about an uploaded image.
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://imglink.io/api/v1/image/abc123
/api/v1/image/{id}
Permanently delete an uploaded image (requires authentication).
curl -X DELETE \
-H "Authorization: Bearer YOUR_API_KEY" \
https://imglink.io/api/v1/image/abc123
All API responses are returned in JSON format with a consistent structure:
{
"success": true,
"data": {
// Response data here
},
"message": "Operation completed successfully"
}
{
"success": false,
"error": {
"code": "INVALID_FILE_TYPE",
"message": "Only image files are allowed"
}
}
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 |
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 |
We provide official SDKs and community libraries for popular programming languages:
npm install imglink-js
pip install imglink-python
composer require imglink/php-sdk
go get github.com/imglink/go-sdk
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);
}
}
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
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;
?>
Integrate ImgLink into your online store for product image management:
Power your mobile app with reliable image hosting:
Enhance your CMS with powerful image capabilities:
Build automated image processing workflows: