Developer Documentation v1.0.0
This API provides a simple interface for uploading images to cloud storage. It supports both direct file uploads and URL-based uploads, returning a direct link to the hosted image.
BASE URL
https://img.geekhirusha.com/upload.php
Replace yourdomain.com with your actual domain name.
Test the API with a simple cURL command:
curl -X POST https://img.geekhirusha.com/upload.php \
-F "image=@/path/to/image.jpg"
POST
/upload.php
| Parameter | Type | Required | Description |
|---|---|---|---|
image |
File | Yes | Image file to upload |
POST
/upload.php
| Parameter | Type | Required | Description |
|---|---|---|---|
imageUrl |
String | Yes | Valid URL to image |
{
"success": true,
"url": "https://i.ibb.co/xxxxx/GHDev-2025-12-14_10-30-45.jpg"
}
{
"success": false,
"error": "Invalid file type"
}
// File Upload
const formData = new FormData();
formData.append('image', fileInput.files[0]);
fetch('https://img.geekhirusha.com/upload.php', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => {
if (data.success) {
console.log('Image URL:', data.url);
} else {
console.error('Error:', data.error);
}
})
.catch(error => console.error('Network error:', error));
// URL Upload
const formData2 = new FormData();
formData2.append('imageUrl', 'https://example.com/image.jpg');
fetch('https://img.geekhirusha.com/upload.php', {
method: 'POST',
body: formData2
})
.then(response => response.json())
.then(data => {
if (data.success) {
console.log('Image URL:', data.url);
}
});
import requests
# File Upload
url = "https://img.geekhirusha.com/upload.php"
files = {'image': open('image.jpg', 'rb')}
response = requests.post(url, files=files)
data = response.json()
if data['success']:
print(f"Image URL: {data['url']}")
else:
print(f"Error: {data['error']}")
# URL Upload
data = {'imageUrl': 'https://example.com/image.jpg'}
response = requests.post(url, data=data)
result = response.json()
if result['success']:
print(f"Image URL: {result['url']}")
<?php
// File Upload
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://img.geekhirusha.com/upload.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'image' => new CURLFile('/path/to/image.jpg')
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
if ($data['success']) {
echo "Image URL: " . $data['url'];
} else {
echo "Error: " . $data['error'];
}
// URL Upload
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://img.geekhirusha.com/upload.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'imageUrl' => 'https://example.com/image.jpg'
]);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
?>
# File Upload
curl -X POST https://img.geekhirusha.com/upload.php \
-F "image=@/path/to/image.jpg"
# URL Upload
curl -X POST https://img.geekhirusha.com/upload.php \
-d "imageUrl=https://example.com/image.jpg"
| Error Message | Cause | Solution |
|---|---|---|
Invalid file type |
Unsupported format | Use JPG, PNG, GIF, WebP, TIFF, or BMP |
No file or URL provided |
Missing parameters | Include 'image' file or 'imageUrl' |
Server error |
Backend issue | Try again later |
Network error |
Connection failed | Check internet connection |
You can test the API directly from this page using the interactive form below:
Developed by GeekHirusha Dev
API Documentation v1.0.0 | Last Updated: July 16, 2025