
📚 Documentation & Examples
Everything you need to integrate with Imgbb
🚀 Quick Start Examples
// Imgbb API Example
const response = await fetch('https://api.imgbb.com/', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
});
const data = await response.json();
console.log(data);Experience hassle-free private image sharing with the IMGBB API, designed for developers seeking a user-friendly solution for uploading and managing images. This API allows you to effortlessly upload images to a secure cloud storage service, enabling fast access and sharing while maintaining privacy. Whether you’re working on a web application or mobile project, the IMGBB API ensures that your images are protected from unauthorized access, making it perfect for sensitive or personal content. With its robust features and simple integration, you can enhance your applications and provide a seamless experience for end-users.
Utilizing the IMGBB API offers numerous benefits, including:
- Quick and easy image uploads with minimal setup.
- Enhanced privacy features to secure your images.
- A straightforward API structure that simplifies integration.
- Reliable cloud storage ensuring images are always accessible.
- Comprehensive documentation available at api.imgbb.com for seamless implementation.
Here’s a JavaScript code example for calling the IMGBB API to upload an image:
const apiKey = 'YOUR_API_KEY';
const imageFile = document.getElementById('imageInput').files[0];
const formData = new FormData();
formData.append('image', imageFile);
fetch(`https://api.imgbb.com/1/upload?key=${apiKey}`, {
method: 'POST',
body: formData,
})
.then(response => response.json())
.then(data => {
if(data.success) {
console.log('Image uploaded successfully', data);
} else {
console.error('Image upload failed', data);
}
})
.catch(error => {
console.error('Error:', error);
});
How to Get an ImgBB API Key
ImgBB's upload API is free and the key takes about a minute to create:
- Create a free account at https://imgbb.com/ (or sign in) — email or social login both work.
- Go to https://api.imgbb.com/ and click "Get API key".
- Copy the key it shows you.
Pass the key as the key query parameter and POST your image (as a file, a base64 string, or an image URL) to the upload endpoint:
curl "https://api.imgbb.com/1/upload?key=YOUR_API_KEY" \
--form "image=@/path/to/photo.jpg"
The response returns JSON with the hosted image's url, display_url, delete_url, and thumbnail links. Options you can add:
expiration=600— auto-delete the image after N seconds (60–15552000).name— set a custom file name.
The key is free with no per-request charge; keep it server-side (it's tied to your account) rather than exposing it in client-side code. Full reference: https://api.imgbb.com/.









