Working with pictures

Pictures are optional when listing an item, but they sure make a big difference in terms of quality and it will improve your possibilities of selling by attracting more visits to your items. When you list a new item, you can add pictures at that moment. This tutorial shows how to upload pictures to our servers and add them on your items.

Contents:

Considerations & Best Practices

RGB pictures are highly recommended over CMYK pictures.
There is um maximum imagens per item allowed to publish according to the category.
You’re allowed to upload pictures up to 10 MB in the following formats:

  • JPG
  • JPEG
  • PNG
  • not animated GIF

Zooming

For pictures wider than 800 pixels, a zoom widget is activated so when buyers roll over they can take a close-up look. This is highly recommended for Clothes and Real Estate properties.
Upload a picture
Now is the time to upload your first image file to be stored on our servers. This is really easy to do, just take note of the exact path where you have your image saved:

curl -F file=@/home/user/picture.jpg

https://api.mercadolibre.com/pictures?access_token=$ACCESS_TOKEN



As a response you’ll get a JSON describing the picture details.
Remember to keep the picture id. The other fields represent different picture sizes.

{
   "id":"MLA430387888_032012",
   "quality":"",
   "variations":[...]
}


Link a picture to your Item

Using the picture_id obtained before you can link the picture to your item, like this:

curl -X POST -H "Content-Type: application/json" -H "Accept: application/json" -d
'{"id":"MLA430387888_032012"}'

https://api.mercadolibre.com/items/MLA421101451/pictures?access_token=$ACCESS_TOKEN



That’s all! Go to your item’s description page (using the permalink field) and check how your picture displays.

Replace pictures

If you need to replace the current pictures of an item, you need to make a PUT including the Item ID and the picture url, with your access_token like in the example that follows:

curl -X PUT -H "Content-Type: application/json" -H "Accept: application/json" -d
'{
  "pictures":[
    {"source":"http://www.apertura.com/export/sites/revistaap/img/Tecnologia/Logo_ML_NUEVO.jpg_33442984.jpg"},
    {"source":"http://appsuser.net/www/wp-content/uploads/2012/10/logo-mercadolibre.jpg"}
  ]
}' https://api.mercadolibre.com/items/{item_id}?access_token=$ACCESS_TOKEN



Great! now the new picture will be showing on your item. Now you know how to add or replace pictures, remember good pictures will attract more buyers!

Please rate this