javascriptnode.js

Deleting images in Imgbb via API


I'm using the imgbb API since it is very straightforward to use and quite cheap. The problem is that the documentation is very poor and it does not explain how to delete an image through the API. I want to be able to delete the photo from my server in the case something happens (example: if I delete a user). My server is written in node.js.

ps. Also the response object I get after uploading an image is this one:

{
  data: {
    id: 'c3VRs4x',
    title: 'client1-Bali',
    url_viewer: 'https://ibb.co/c3VRs4x',
    url: 'https://i.ibb.co/Pj0JVqt/client1-Bali.jpg',
    display_url: 'https://i.ibb.co/1QjB4Fb/client1-Bali.jpg',
    size: 60385,
    time: '1594835546',
    expiration: '0',
    image: {
      filename: 'client1-Bali.jpg',
      name: 'client1-Bali',
      mime: 'image/jpeg',
      extension: 'jpg',
      url: 'https://i.ibb.co/Pj0JVqt/client1-Bali.jpg'
    },
    thumb: {
      filename: 'client1-Bali.jpg',
      name: 'client1-Bali',
      mime: 'image/jpeg',
      extension: 'jpg',
      url: 'https://i.ibb.co/c3VRs4x/client1-Bali.jpg'
    },
    medium: {
      filename: 'client1-Bali.jpg',
      name: 'client1-Bali',
      mime: 'image/jpeg',
      extension: 'jpg',
      url: 'https://i.ibb.co/1QjB4Fb/client1-Bali.jpg'
    },
    delete_url: 'https://ibb.co/c3VRs4x/b3072de2f5287a39f81c7dec3cd8a236'
  },
  success: true,
  status: 200
}

Edit: Here is the link to the imgbb API documentation: https://api.imgbb.com/


Solution

  • Imgbb does not allow you to delete images. I just tried going to the delete URL to delete the image and the image got deleted on that page but not on the other links in the JSON. If the functionality is not implemented on the site itself there is no use trying on the API. If they did have the functionality to entirely delete an image then you could have used web scraping to press the buttons.