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

Visits

Importante
From August 2, 2021:

- Change the way visits are counted, they will be unique per day
Multiget will be disabled in /visits/items
- The number of visits will be available within 48 hours
- The time range to consult the visits will be 150 days

This resource retrieves information about visits on MercadoLibre items VIPs (View Product Page). You can query data by time windows and sites. Remember that relistings inherit the item historic visits of it’s parent_item, no matter how many times they are relisted.


Parameter description

Type Parameter Description
Integer user_id User ID.
String item_id Item ID.
Date date_from Date, ISO format, that defines the start of the query. The maximum is 150 days.
Date date_to Date, ISO format, that defines the end of the query. The maximum is 150 days.
Date ending Optional. Date, ISO format, which states the time of completion of the sample, by default it’s the current date and time.
String unit Query unit, possible values: [ “day”].
Integer last Optional. How many last days define the test.
Integer total_visits Total visits on an item.
Array visits_detail Visits detailed by country and site.
Array results Visits detail grouped by time intervals. The length is defined by the parameter Unit.


Total visits by user

Retrieves the total visits a user receives between date ranges.
Request:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/$USER_ID/items_visits?date_from=$DATE_FROM&date_to=$DATE_TO

Example:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/1000011398/items_visits?date_from=2021-01-01&date_to=2021-02-01

Response:

{
  "user_id": 1000011398,
  "date_from": "2021-01-01T00:00:00Z",
  "date_to": "2021-02-01T00:00:00Z",
  "total_visits": 323690,
  "visits_detail": [
    {
      "company": "mercadolibre",
      "quantity": 323690
    }
  ]
}


Total visits by article

Retrieve total visits to an article of the last two years.
Request:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/visits/items?ids=$ITEM_ID

Example:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/visits/items?ids=MLB9992242141

Response:

{
  "MLB9992242141": 552
}


Total visits by item between date ranges

Retrieves total visits on an item between date ranges and by site.
Request:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/visits?ids=$ITEM_ID&date_from=$DATE_FROM&date_to=$DATE_TO

Example:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/visits?ids=MCO473861358&date_from=2021-01-01&date_to=2021-02-01

Response:


  {
    "item_id": "MCO473861358",
    "date_from": "2021-01-01T00:00:00Z",
    "date_to": "2021-02-01T00:00:00Z",
    "total_visits": 536,
    "visits_detail": [
      {
        "company": "mercadolibre",
        "quantity": 536
      }
    ]
  }


Dated visits by user

Retrieves visits on every item of an user for a certain time window, by site. The information detail it’s grouped by time intervals.
Request:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/$USER_ID/items_visits/time_window?last=$LAST&unit=$UNIT&ending=$ENDING

Example:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/1000011398/items_visits/time_window?last=2&unit=day

Response:

{
  "user_id": 1000011398,
  "date_from": "2021-01-08T00:00:00Z",
  "date_to": "2021-01-10T00:00:00Z",
  "total_visits": 2923,
  "last": 2,
  "unit": "day",
  "results": [
    {
      "date": "2021-01-08T00:00:00Z",
      "total": 2205,
      "visits_detail": [
        {
          "company": "mercadolibre",
          "quantity": 2205
        }
      ]
    },
    {
      "date": "2021-01-09T00:00:00Z",
      "total": 718,
      "visits_detail": [
        {
          "company": "mercadolibre",
          "quantity": 718
        }
      ]
    }
  ]
}


Dated visits by item

Retrieves visits on an item for a certain time window, by site. The information detail it’s grouped by time intervals.
Request:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/$ITEM_ID/visits/time_window?last=$LAST&unit=$UNIT&ending=$ENDING

Example:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/items/MCO471870973/visits/time_window?last=2&unit=day&ending=2021-08-06

Response:

{
  "item_id": "MCO471870973",
  "date_from": "2021-08-04T00:00:00Z",
  "date_to": "2021-08-06T00:00:00Z",
  "total_visits": 26,
  "last": 2,
  "unit": "day",
  "results": [
    {
      "date": "2021-08-04T00:00:00Z",
      "total": 16,
      "visits_detail": [
        {
          "company": "mercadolibre",
          "quantity": 16
        }
      ]
    },
    {
      "date": "2021-08-05T00:00:00Z",
      "total": 10,
      "visits_detail": [
        {
          "company": "mercadolibre",
          "quantity": 10
        }
      ]
    }
  ]
}