Documentación Mercado Libre

Descubre toda la información que debes conocer sobre las APIs de Mercado Libre.
circulos azuis em degrade

Documentación

Última actualización 28/12/2022

Paging results

You can define the page size of the result list. There are 2 parameters: Limit and Offset. Both parameters define the size block of the results. This article is based on the search example, but you can use paging on every resource that presents on its response information about "paging", like follows:

[...]
  "paging": {
    "total": 285,
    "offset": 0,
    "limit": 50,
  }
[...]

range-slider

Default values

Default values are offset=0 and limit=50.

curl -X GET https://api.mercadolibre.com/sites/MLM/search?q=ipod nano

In the paging section of the JSON response, you can see the total number of items that match the search and the offset value with the default limit applied.

[...]
  "paging": {
    "total": 285,
    "offset": 0,
    "limit": 50,
  }
[...]

Limit

To reduce the page size you can change the limit parameter. For example, if you are interested in retrieving just the first 3 items:

curl -X GET https://api.mercadolibre.com/sites/MLM/search?q=ipod nano&limit=3

This action retrieves a JSON data with an array of 3 items as shown:

{
  "site_id": "MLM",
  "query": "ipod nano",
  "paging": {
    "total": 284,
    "offset": 0,
    "limit": 3,
  },
  "results": [
    {...},
    {...},
    {...},
  ],
  "sort": {...},
  "available_sorts": [...],
  "filters": [...],
  "available_filters": [...],
}

Offset

By using the offset attribute, you can move the lower limit of the result block. For example, if you are interested in retrieving the 50 items that follow the default response:

curl https://api.mercadolibre.com/sites/MLM/search?q=ipod nano&offset=50
{
  "site_id": "MLM",
  "query": "ipod nano",
  "paging": {
    "total": 285,
    "offset": 50,
    "limit": 50,
  },
  "results": [...],
  "sort": {...},
  "available_sorts": [...],
  "filters": [...],
  "available_filters": [...],
}

This response retrieves 50 items starting from the first fifty items.


Define a range of results

It is possible to combine both parameters. You can retrieve items from the third to the sixth item in the original search result:

curl https://api.mercadolibre.com/sites/MLM/search?q=ipod nano&offset=3&limit=3

This action retrieves a JSON data with an array of 5 items as shown:
{
  "site_id": "MLM",
  "query": "ipod nano",
  "paging": {
    "total": 285,
    "offset": 3,
    "limit": 3,
  },
  "results": [
    {...},
    {...},
    {...},
  ],
  "sort": {...},
  "available_sorts": [...],
  "filters": [...],
  "available_filters": [...],
}