Visits resource

This API 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.
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 total_vistis 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 on every item of an user, by site and between date ranges. This also applies for visits on other MercadoLibre sites like TuCarro, TuInmueble, Autoplaza, etc.
Resource:

https://api.mercadolibre.com/users/{User_id}/items_visits?date_from={Date_from}&date_to={Date_to}

Example:

curl -X GET ‘https://api.mercadolibre.com/users/52366166/items_visits?date_from=2014-06-01T00:00:00.000-00:00&date_to=2014-06-10T00:00:00.000-00:00’

Response:

{
"user_id": 52366166,
"date_from": "2014-06-01T00:00:00.000-00:00",
"date_to": "2014-06-10T00:00:00.000-00:00",
"total_visits": 120,
"visits_detail": [
{
"company": "mercadolibre",
"quantity": 59,
},
{
"company": "tuinmueble",
"quantity": 61,
},
],
}


Total visits by item

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

https://api.mercadolibre.com/items/{Items_id}/visits?date_from={Date_from}&date_to={Date_to}

Example:

curl -X GET ‘https://api.mercadolibre.com/items/MCO496961166/visits?date_from=2014-04-14T00:00:00.000-03:00&date_to=2014-05-30T23:59:59.999-03:00’

Response:

{
"item_id": "MCO496961166",
"date_from": "2014-04-14T00:00:00.000-03:00",
"date_to": "2014-05-30T23:59:59.999-03:00",
"total_visits": 152,
"visits_detail": [
{
"company": "mercadolibre",
"quantity": 70,
},
{
"company": "tucarro",
"quantity": 82,
},
],
}


Total visits by item MULTI-GET

Retrieves the total visitas according to an array of items concatenated within a date range, by site.
Resource:

https://api.mercadolibre.com/items/visits?ids={Id1, Id2}date_from={Date_from}&date_to={Date_to}

Example:

curl -X GET ‘https://api.mercadolibre.com/items/visits?ids=MLA506635149,MLA506634973,MLA503004418&date_from=2014-06-01T00:00:00.000-00:00&date_to=2014-06-10T00:00:00.000-00:00’

Response:

[
{
"item_id": "MLA506635149",
"date_from": "2014-06-01T00:00:00.000-00:00",
"date_to": "2014-06-10T00:00:00.000-00:00",
"total_visits": 134,
"visits_detail": [
{
"company": "mercadolibre",
"quantity": 134,
},
],
},
{
"item_id": "MLA506634973",
"date_from": "2014-06-01T00:00:00.000-00:00",
"date_to": "2014-06-10T00:00:00.000-00:00",
"total_visits": 122,
"visits_detail": [
{
"company": "mercadolibre",
"quantity": 122,
},
],
},
{
"item_id": "MLA503004418",
"date_from": "2014-06-01T00:00:00.000-00:00",
"date_to": "2014-06-10T00:00:00.000-00:00",
"total_visits": 355,
"visits_detail": [
{
"company": "mercadolibre",
"quantity": 355,
},
],
},
]


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.
Resource:

https://api.mercadolibre.com/users/{User_id}/items_visits/time_window?last={Last}&unit={Unit}&ending={Ending}

Example:

curl -X GET ‘https://api.mercadolibre.com/users/52366166/items_visits/time_window?last=2&unit=day’

Response:

{
"user_id": 52366166,
"total_visits": 2083,
"date_from": "2014-06-10T04:00:00Z",
"date_to": "2014-06-12T04:00:00Z",
"last": 2,
"unit": "day",
"results": [
{
"date": "2014-06-10T04:00:00Z",
"total": 1637,
"visits_detail": [
{
"company": "mercadolibre",
"quantity": 1637,
},
],
},
{
"date": "2014-06-11T04:00:00Z",
"total": 446,
"visits_detail": [
{
"company": "mercadolibre",
"quantity": 446,
},
],
},
],
}


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.
Resource:

https://api.mercadolibre.com/users/{Item_id}/visits/time_window?last={Last}&unit={Unit}&ending={Ending}

Example:

curl -X GET ‘https://api.mercadolibre.com/items/MLA506635149/visits/time_window?last=2&unit=day&ending=2014-06-11’

Response:

{
"item_id": "MLA506635149",
"total_visits": 15,
"date_from": "2014-06-09T04:00:00Z",
"date_to": "2014-06-11T04:00:00Z",
"last": 2,
"unit": "day",
"results": [
{
"date": "2014-06-09T04:00:00Z",
"total": 10,
"visits_detail": - [
{
"company": "mercadolibre",
"quantity": 10,
},
],
},
{
"date": "2014-06-10T04:00:00ZZ",
"total": 5,
"visits_detail": - [
{
"company": "mercadolibre",
"quantity": 5,
},
],
},
],
}


Dated visits by item MULTI-GET

Retrieves the visits according to an item array (max 50), by site. The information detail it’s grouped by time intervals.
Resource:

https://api.mercadolibre.com/items/visits/time_window?ids={Id1, Id2}last={Last}&unit={Unit}&ending={Ending}

Example:

curl -X GET ‘https://api.mercadolibre.com/items/visits/time_window?ids=MLA506635149,MLA506634973,MLA503004418&last=3&unit=day‘

Response:

[
{
"item_id": "MLA506635149",
"total_visits": 0,
"date_from": "2015-08-30T04:00:00Z",
"date_to": "2015-09-02T04:00:00Z",
"last": 3,
"unit": "day",
"results": [
{
"date": "2015-08-30T04:00:00Z",
"total": 0,
"visits_detail": []
},
{
"date": "2015-08-31T04:00:00Z",
"total": 0,
"visits_detail": []
},
{
"date": "2015-09-01T04:00:00Z",
"total": 0,
"visits_detail": []
}
]
},
{
"item_id": "MLA506634973",
"total_visits": 0,
"date_from": "2015-08-30T04:00:00Z",
"date_to": "2015-09-02T04:00:00Z",
"last": 3,
"unit": "day",
"results": [
{
"date": "2015-08-30T04:00:00Z",
"total": 0,
"visits_detail": []
},
{
"date": "2015-08-31T04:00:00Z",
"total": 0,
"visits_detail": []
},
{
"date": "2015-09-01T04:00:00Z",
"total": 0,
"visits_detail": []
}
]
},
{
"item_id": "MLA503004418",
"total_visits": 169,
"date_from": "2015-08-30T04:00:00Z",
"date_to": "2015-09-02T04:00:00Z",
"last": 3,
"unit": "day",
"results": [
{
"date": "2015-08-30T04:00:00Z",
"total": 42,
"visits_detail": [
{
"company": "mercadolibre",
"quantity": 42
}
]
},
{
"date": "2015-08-31T04:00:00Z",
"total": 38,
"visits_detail": [
{
"company": "mercadolibre",
"quantity": 38
}
]
},
{
"date": "2015-09-01T04:00:00Z",
"total": 89,
"visits_detail": [
{
"company": "mercadolibre",
"quantity": 89
}
]
}
]
}
]

If you need more information about relistings, please check Relist Your Items tutorial.

Please rate this