Documentación Mercado Libre
Descubre toda la información que debes conocer sobre las APIs de Mercado Libre.Documentación
Domains, products and attributes vehicle accessories references
Available domains
Country | Domain |
---|---|
ARGENTINA | MLA-CARS_AND_VANS |
BRASIL | MLB-CARS_AND_VANS |
MÉXICO | MLM-CARS_AND_VANS_FOR_COMPATIBILITIES |
URUGUAY | MLU-CARS_AND_VANS |
CHILE | MLC-CARS_AND_VANS_FOR_COMPATIBILITIES |
Main attributes
Attributes description | Attributes of CARS_AND_VANS (MLA, MLB and MLU) | Attributes of CARS_AND_VANS_FOR_COMPATIBILITIES (MLM and MLC) |
---|---|---|
BRAND | BRAND | BRAND |
MODEL | MODEL | CAR_AND_VAN_MODEL |
YEAR | VEHICLE_YEAR | YEAR |
TRIM | SHORT_VERSION | CAR_AND_VAN_SUBMODEL |
Secondary attributes
Attributes description | Atributos de CARS_AND_VANS (MLA, MLB and MLU) | Attributes of CARS_AND_VANS_FOR_COMPATIBILITIES (MLM and MLC) |
---|---|---|
ENGINE | ENGINE | CAR_AND_VAN_ENGINE |
VEHICLE BODY | VEHICLE_BODY_TYPE | CAR_AND_VAN_BODY_TYPE |
TRANSMISSION | TRANSMISSION_CONTROL_TYPE | TRANSMISSION_CONTROL_TYPE |
TRANSMISSION | TRANSMISSION | CAR_AND_VAN_TRANSMISSION_TYPE |
DRIVE TYPE | DRIVE_TYPE | DRIVE_TYPE |
FUEL TYPE | FUEL_TYPE | FUEL_TYPE |
Attributes by domain
Remember that the detail of the attributes of each Domain can be achieved with the following request:
curl -X GET --header 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog_domains/$domain_id
Example:
curl -X GET --header 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog_domains/MLA-CARS_AND_VANS
Attributes by category
The detail of the attributes of each category can be achieved with the following request:
curl -X GET --header 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/categories/:CATEGORY_ID/attributes
Example:
curl -X GET --header 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/categories/MLA12345/attributes
Product search
Through domain attributes, you can identify catalog products. For more information check the Catalog products search resource.
Example all sites (except MLM):
curl --location --request POST 'https://api.mercadolibre.com/products/search \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain_id": "MLA-CARS_AND_VANS",
"site_id": "MLA",
"attributes": [
{
"id": "BRAND",
"value_id": "60249"
},
{
"id": "VEHICLE_YEAR",
"value_id": "6730991"
},
{
"id": "MODEL",
"value_id": "1252874"
},
{
"id": "SHORT_VERSION",
"value_id": "2164329"
}
]
}'
Response:
{
"domain_id": "MLA-CARS_AND_VANS",
"paging": {
"total": 1,
"limit": 10,
"offset": 0
},
"results": [
{
"id": "MLA15520719",
"status": "inactive",
"domain_id": "MLA-CARS_AND_VANS",
"name": "Volkswagen Gol Trend 1.6 Serie 101cv 5p 2020",
"attributes": [...
],
"pictures": []
}
]
}
MLM example:
curl --location --request POST 'https://api.mercadolibre.com/products/search \
--header 'Authorization: Bearer $ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain_id":"MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"site_id":"MLM",
"attributes": [
{
"id": "BRAND",
"value_id": "60249"
},
{
"id": "YEAR",
"value_id": "64314"
},
{
"id": "CAR_AND_VAN_MODEL",
"value_id": "8237019"
}
]
}'
Response:
{
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"paging": {
"total": 1,
"limit": 10,
"offset": 0
},
"results": [
{
"id": "MLM15858556",
"status": "inactive",
"domain_id": "MLM-CARS_AND_VANS_FOR_COMPATIBILITIES",
"settings": {
"listing_strategy": "open"
},
"name": "Volkswagen Sedan 1964 Base",
"attributes": [...
],
"pictures": []
}
]
}
Obtain new products from the catalog
In order to always keep the compatibility of your listings updated, with the following resource you will be able to know which new vehicles have been added to the catalog in the last 30 days.
Request:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog_compatibilities/products_search/new?categoryId=$CATEGORY_ID
Query Params
- categoryId
- filterParents
- limit
Request example:
curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog_compatibilities/products_search/new?categoryId=MLA1234
Response example:
[
{
"id": "MLB25867468",
"attributes": [
{
"id": "BRAND",
"name": "Marca",
"value_id": "60285",
"value_name": "Subaru",
"values": [
{
"id": "60285",
"name": "Subaru"
}
]
} ],
"date_created": "2023-08-08T20:08:28Z"
},
{
"id": "MLB25867467",
"attributes": [
{
"id": "BRAND",
"name": "Marca",
"value_id": "60285",
"value_name": "Subaru",
"values": [
{
"id": "60285",
"name": "Subaru"
}
]
} ],
"date_created": "2023-08-09T20:08:28Z"
}
]
Parameters:
categoryId: Required parameter, where they must send a category that has the compatibilities experience enabled.
filterParents: Optional parameter that indicates whether to filter parent products or not, if you want to get all products including parents you must send false. Its default value is true.
limit: Optional parameter that indicates the number of products to return, if you want to get all products you must send zero (0). Its default value is 10.
Possible errors:
Error_code | Error message | Description |
---|---|---|
400 | There is no configured compatibility for the category $categoryId | The consulted category is not enabled to report compatibilities. |
401 | Invalid access token. | Access Token invalid. |
403 | Domain is not active. | Dominio inactive in buybox. |
400: Incorrect format / more than 200 products for the specified domain / more than 10 domains specified.
403: Invalid token or lack of permissions on the item.
404: Item or compatibility does not exist.
Top values
Now you can see how to implement the functionality of obtaining different lists with attribute values through the Top values feature and filter the results.
With the following feature you can obtain the values of each combination and refine the search each time.
Request:
curl -X POST --header 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog_domains/$DOMAIN_ID/attributes/$ATTRIBUTE_ID/top_values
"BRAND" example:
curl -X POST --header 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog_domains/MLA-CARS_AND_VANS/attributes/BRAND/top_values
Response:
[
{
"id": "60249",
"name": "Volkswagen",
"metric": 7781
},
{
"id": "66432",
"name": "Ford",
"metric": 5616
},
{
"id": "9909",
"name": "Renault",
"metric": 4327
},
{
"id": "60279",
"name": "Peugeot",
"metric": 4250
},
{
"id": "67781",
"name": "Fiat",
"metric": 4172
},
[…]
]
Example to filter models (MODEL) of a brand (BRAND):
curl -X POST --header 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog_domains/MLA-CARS_AND_VANS/attributes/MODEL/top_values
{
"known_attributes": [
{
"id": "BRAND",
"value_id": "60249"
}
]
}
Response:
[
{
"id": "63686",
"name": "Amarok",
"metric": 1516
},
{
"id": "1252874",
"name": "Gol Trend",
"metric": 925
},
{
"id": "62109",
"name": "Gol",
"metric": 684
},
{
"id": "1252871",
"name": "Suran",
"metric": 604
},
{
"id": "64016",
"name": "Vento",
"metric": 585
},
…
]
Example to get the available years (VEHICLE_YEAR) filtering by brand and model:
curl -X POST --header 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/catalog_domains/MLA-CARS_AND_VANS/attributes/VEHICLE_YEAR/top_values
{
"known_attributes": [
{
"id": "BRAND",
"value_id": "60249"
},
{
"id": "MODEL",
"value_id": "63686"
}
]
}
Response:
[
{
"id": "6730991",
"name": "2020",
"metric": 732
},
{
"id": "423549",
"name": "2015",
"metric": 130
},
{
"id": "436694",
"name": "2017",
"metric": 115
},
{
"id": "2451646",
"name": "2019",
"metric": 104
},
[…]
]
Back to: Compatibility between items and vehicle accessories.