Quick Navigation

Base: beeimg.com/api/
IPv6: ipv6.beeimg.com/api/

BeeIMG API Updated: 2 weeks ago

API Base: beeimg.com/api/ (HTTP or HTTPS)

IPv6 Base: ipv6.beeimg.com/api/ (use if Cloudflare returns 403)

API Endpoints

Submit Supports Output URL
File GET POST text json jsonp XML redirect //beeimg.com/api/upload/file/{Output}/
URL GET POST text json jsonp XML redirect //beeimg.com/api/upload/url/{Output}/

Note: We highly recommand using json output, as it is what we use have, have most support.

Test URLs

Choose method and output format. The URL updates automatically.

Ready

Inputs Keys

  • In the file method, send your file as "image" or "file" using either GET or POST.
  • In the URL method, send your URL as "url" using either GET or POST.
  • To add an image to an album, include the "albumid" along with your API key "apikey" in the request using either GET or POST.
  • For image deletion requests, send the deletion key as "delete_key" to the delete URL along with your API key "apikey" using only POST.
  • To set the privacy of the uploaded image, include the "privacy" parameter with values "public" or "private" in your request using either GET or POST. The default setting is public. This can be only set with users with API keys.

Duplicate Images

  • When a request includes an apikey, a new image ID will be issued for a deduplicated image, with the status set to duplicate.
  • When a request does not include an apikey, the original uploaded image ID will be returned, with the status set to duplicate.

API Key

Note: Send your API key as "apikey" in a GET query, POST data, or a cookie. (POST only for delete url)

Your public key is Not Available

Get your API key through https://beeimg.com/api/newkey

Example Code

Image Upload

		
// Initialize a cURL session
$ch = curl_init();

// Create an array containing the file to be uploaded and the API key
$postData['file'] = new CURLFile('localfile.jpg'); // Specify the local file to upload

// Add the API key (optional, required if authentication is needed)
$postData['apikey'] = "aaaa";

// Add optional parameters (e.g., album ID)
// $postData['albumid'] = "zzzz";

// Add optional parameters (e.g., privacy setting)
// $postData['privacy'] = "public"; // or "private"

// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Return the response as a string instead of outputting it
curl_setopt($ch, CURLOPT_POST, 1); // Use the HTTP POST method
curl_setopt($ch, CURLOPT_URL, 'https://beeimg.com/api/upload/file/json/'); // Set the API endpoint URL
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); // Attach the POST data (file and API key)

// Execute the API request and store the response
$response = curl_exec($ch);

// Close the cURL session to free resources
curl_close($ch);

// Decode the JSON response into an associative array
$jsonResponse = json_decode($response, true);

// Output the response (for debugging purposes)
var_dump($jsonResponse);
		
	

Image Delete

		
// Initialize a cURL session
$ch = curl_init();

// Create an array containing the delete key and API key
$postData = [
    'delete_key' => 'dddd', // The key required to delete the image from the upload request
    'apikey' => 'aaaa' // API key for authentication (if required)
];

// Set cURL options
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Return the response as a string instead of outputting it
curl_setopt($ch, CURLOPT_POST, 1); // Use the HTTP POST method
curl_setopt($ch, CURLOPT_URL, 'https://beeimg.com/delete/a123456789/'); // Set the API endpoint URL for deleting the image
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); // Attach the POST data (delete key and API key)

// Execute the API request and get the response
$response = curl_exec($ch);

// Close the cURL session to free resources
curl_close($ch);

// Output the response (for debugging purposes)
var_dump($response); //Returns "OK" or "ERROR"
		
	
	  curl -F [email protected] https://beeimg.com/api/upload/file/text/ 
  
	  
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');

// create a form and append the file
const form = new FormData();
form.append('file', fs.createReadStream('localfile.jpg'));

// add the api key
//form.append("apikey", "aaaa");
//form.append("albumid", "zzzz");
//form.append("privacy", "public"); // or "private"

// get the content-type header with the boundary
const headers = form.getHeaders();

// send the request with axios
axios.post('https://beeimg.com/api/upload/file/text/', form, {headers})
  .then(response => {
    console.log(response.data);
  })
  .catch(error => {
    console.error(error);
});
      
  
  • Need to import and install `axios`
  • Use LLM models to convert the code to your favorite language. Use the php code as the base. We currently recommend DeepSeek R1.

    Example data

      
      //beeimg.com/images/a123456789.webp
      
      

    Note: this only returns url

    Image Upload Success

      
      {
    	"files": {
    		"name": "a123456789",
    		"size": "100",
    		"url": "https://beeimg.com/images/a1234567891.webp",
    		"thumbnail_url": "https://i.beeimg.com/images/thumb/a1234567891-xs.webp",
    		"album_url": "https://beeimg.com/album/abcdf/view/", //# on empty
    		"view_url": "https://beeimg.com/view/a123456789/",
    		"delete_key": "", //# on empty - only returns on the first request
    		"delete_url": "https://beeimg.com/delete/a123456789/",  //# on empty
    		"status": "Success",
    		"code": "200"
    	 }
      }
      
      

    Image Upload Error

      
      {
        "files": {
          "status": "Please come back with a URL Thank you :)",
          "code": "0"
        }
      }
      
      
      
    	<?xml version="1.0"?>
    	<files>
    		<name>a123456789</name>
    		<size>100</size>
    		<url>https://beeimg.com/images/a1234567891.webp</url>
    		<thumbnail_url>https://i.beeimg.com/images/thumb/a1234567891-xs.webp</thumbnail_url>
    		<album_url>https://beeimg.com/album/abcdf/view/</album_url> //# on empty
    		<view_url>https://beeimg.com/view/a123456789/</view_url>
    		<delete_key></delete_key> //# on empty
    		<delete_url>"https://beeimg.com/delete/a123456789/</delete_url> //# on empty
    		<status>Success</status>
    		<code>200</code>
    	</files>
      
      

    Error Codes

    Code Meaning
    0Empty/missing request (no file or URL)
    1Empty file
    2File extension not allowed
    3File type not allowed (detected format)
    4File too large
    5Storage error: could not allocate a storage server
    6Not a valid image
    7Database error
    8Storage error: could not move the file to storage
    10Forbidden host (URL upload)
    11File upload error (HTTP/PHP)
    12Cannot fetch the URL (URL upload)
    13Cannot save to temporary folder (URL upload)
    15Uploaded data lost — retry the upload (resumable)
    223Maximum upload limit reached
    503Uploader temporarily disabled
    Note: Error codes might change in the future, when we migrate to a new backend. Use only the text status to handle errors.