Visits

This resource retrieves information about visits on MercadoLibre items VIPs (View Item Page). You can query data by time window and site. So you can change the way visits are counted, they will be unique per day, the number of visits will be available within 48 hours and the time range to consult the visits will be 150 days.

Contents

→Parameters
→Total visits by user
→Total visits by article
→Total visits by item between date ranges
→Dated visits by user
→Dated visits by item

Parameters

user_id: user ID.

item_id: item ID.

date_from: date, ISO format, that defines the start of the query. The maximum is 150 days .

date_to: date, ISO format, that defines the end of the query. The maximum is 150 days.

ending (optional): date, ISO format, which states the time of completion of the sample, by default it’s the current date and time.

unit: query unit, possible values: [“day”].

last (optional): how many last days define the test.

total_visits: total visits on an item.

visits_detail: visits detailed by country and site.

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
        }
      ]
    }
  ]
}