Categories predictor

The new category prediction resource helps sellers and developers to best predict which category they should publish a particular item to. Unlike the old predictor, this new one allows us to recognize the domain and attributes achieving better quality in publications.
Currently, the new predictor is available for all the places where Mercado Libre operates. We recommend you migrate your development and start using it.

Contents

→New categories predictor
    ↳Mandatory parameters
    ↳Optional parameters
    ↳Response fields

→Old categories predictor
    ↳Predicting by GET
    ↳Predicting by POST
    ↳Parameters
    ↳Response fields
   


New categories predictor

Make a GET request to predict one article at a time and thus, you will be able to recognize the category with the attributes that you must load in order for the publication to have quality. Keep in mind that the answer will be made up of a list of predictions from the title provided, the first being the one with the highest probability.


Mandatory parameters

site_id: the site where you make the publication.
q: the title of the article to be predicted and must be completely in the language of the site.


Optional parameters

limit: By default, the limit will be 4 with a maximum of 8, so you could define a limit between 1 to 8.
target: It can be composed of core (Product) or classified (Classified) depending on the vertical in which you are publishing.


Request:

curl -X GET https://api.mercadolibre.com/sites/$SITE_ID/domain_discovery/search?q=$Q

Example:

curl -X GET https://api.mercadolibre.com/sites/MLA/domain_discovery/search?limit=1&q=celular%20iphone

Response:

[
  {
    "domain_id": "MLA-CELLPHONES",
    "domain_name": "Celulares",
    "category_id": "MLA1055",
    "category_name": "Celulares y Smartphones",
    "attributes": [
      {
        "id": "BRAND",
        "value_id": "9344",
        "value_name": "Apple"
      },
      {
        "id": "LINE",
        "value_id": "58993",
        "value_name": "iPhone"
      },
      {
        "id": "MODEL",
        "value_id": "14608",
        "value_name": "iPhone"
      }
    ]
  }
]

Response fields

domain_id: ID of the domain you predict for the article.
domain_name: domain name you predict.
category_id: ID of the category you predict for the article.
category_name: name of the category you predict.
attributes: list of attributes for the predicted category.


Note:
This predictor will not return information that the old category_predict returned, therefore in the case of the path_from_root, shipping_modes and variations fields they can be obtained from the resource /categories.

Old categories predictor

Important:
Soon the old category predictor will not be available. We recommend you migrate your development and start using the new categories predictor.


Predicting by GET

Using the GET method it’s possible to predict one item at a time:

curl -X GET https://api.mercadolibre.com/sites/MLB/category_predictor/predict?title=Ipod%20Touch%20Apple%2016gb%205%20Gera%C3%A7%C3%A3o`

Predicción mediante POST

Using the POST method it’s possible to predict multiple (up to 1K) items at a time. When multiple items needs to be predicted, this method is recommended. To do this you need to send an array of JSON encoded titles and categories to predict, like in the following example:

curl -X POST -H "Content-Type: application/json" -d '[{"title": "Ipod Touch Apple 16gb 5 Geração","category_from": "MLB1743"},{"title": "Ipod Touch Apple 16gb 5 Geração","category_from": "MLB1743"}]' https://api.mercadolibre.com/sites/MLB/category_predictor/predict

Parameters

title: The title of the item to predict. It must be a complete title in the language of the site. This parameter is mandatory.
category_from: This parameter accepts a level 1 category, and it is used to limit the prediction to the subtree that spans from category_from to the root. This parameter is optional.

Importante:
The category_from parameter will not available on October, 9 2020. Keep in mind that the response will not return an error when used, but the results may contain categories outside of the one sent in the parameter.

price: The price of the item to predict. The purpose of this parameter is to provide additional information in order to improve the prediction. This parameter is optional.
seller_id: Seller’s ID of the item to predict. The purpose of this parameter is to provide additional information in order to improve the prediction. This parameter is optional.


Response fields

id: ID of predicted category for the item.
name: Name of the predicted category.
prediction_probability: Confidence of the prediction. This value ranges between [0, 1], values closer to zero indicate low confidence whereas values closer to 1 indicate high confidence.
path_from_root: List with the categories from the root to the leaf (the predicted category). Every category is represented by ID and NAME attributes.
variations: This field appears only when the predicted category supports variations.
shipping_modes: Shipping modes supported by the predicted category.

or register to recieve the latest news about our API