• API Docs
  • Mercado Ads
  • Campaigns, Ads and Metrics
Last update 27/09/2022

Campaigns, Ads and Metrics

The following APIs allow you to get information about campaigns, users, update advertising and get a lot of types of metrics to integrate the Mercado Ads solution.

Get seller’s reputation

Mercado Ads is available only for sellers with yellow or green reputation. So, you can check the seller reputation with the /users API. See more How does Reputation work.


Example:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/users/734321111

Response:

{
   "id": 734321111,
   "nickname": "TESTNAME",
   "registration_date": "2021-03-25T22:47:08.000-04:00",
   "country_id": "MX",
   "address": {...},
   "user_type": "normal",
   "tags": [...],
   "logo": null,
   "points": 15,
   "site_id": "MLM",
   "permalink": "http://perfil.mercadolibre.com.mx/TESTNAME",
   "seller_reputation": {
       "level_id": "5_green",
       "power_seller_status": null,
       "transactions": {
           "canceled": 88,
           "completed": 1664,
           "period": "historic",
           "ratings": {
               "negative": 0.13,
               "neutral": 0,
               "positive": 0.87
           },
           "total": 1752
       }
   },
   "buyer_reputation": {...},
   "status": {...}
}

Get user campaigns

To get information about campaigns from users, please send the marketplace user_id as param.


Request:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/users/$USER_ID/campaigns

Example:

curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/users/348252660/campaigns

Response:

{
    "campaigns": [{
        "id": 223493019,
        "name": "Campanha Principal",
        "user_id": 348252660,
        "status": "active",
        "daily_budget": 225,
        "acos_target": 15.0,
        "strategy": "visibility"
        "last_update": "2018-08-23T18:31:11.897Z",
        "creation_date": "2018-08-23T18:31:11.897Z"
    },
   [...]
]
}

Response fields

id: campaign id.
name: campaign name. You can give a name, assign a daily budget and manage it according to your goals.
user_id: marketplace user with this campaign
status: campaign status. It can be: active or paused.

daily_budget: daily money amount to campaign. Value expressed in local currency.
acos_target: ACOS is the advertising cost of sales. The ACOS target is the percentage of the cost of the campaign/advertisement in relation to the revenue obtained. It is a key data to understand the return on your advertising investment. For example, if your ACOS is 10%, it means that you invest $10 for every $100 that you generate from sales with advertisement.

strategy: type of strategy campaign. It can be: profitability, increase or visibility.

  • If you are looking for Profitability: you are going to improve your return on investment. This is recommended to boost your best-selling products.
  • With the objective of Growth: we can increase the exposure of your medium-notation products with medium levels of profitability.
  • And if we are looking for Visibility: we will get the best positions, promoting new products or competitive categories. This way we will achieve greater visibility over profitability.
  • last_update: last date update of the campaign.
    creation_date: creation date of the campaign.


    Get campaign details

    To get information about a campaign, send the campaign_id as a param achieved with the previous endpoint.


    Request:

    curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/campaigns/$CAMPAIGN_ID

    Example:

    curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/campaigns/223493019

    Response:

    {
        "id": 223493019,
        "name": "Campanha Principal",
        "user_id": 348252660,
        "status": "active",
        "daily_budget": 225,
        "acos_target": 15.0,
        "strategy": "visibility"
        "last_update": "2018-08-23T18:31:11.897Z",
        "creation_date": "2018-08-23T18:31:11.897Z"
    }

    Create a new campaign

    Request:

    curl -X POST -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/campaigns -d 
    {
        "name": "Campanha Principal",
        "user_id": 348252660,
        "daily_budget": 225,
        "acos_target": 15.0,
        "strategy": "visibility"
        "channel": "marketplace"
    }

    Response:

    
     {
        "id": 223493019,
        "name": "Campanha Principal",
        "user_id": 348252660,
        "status": "active",
        "daily_budget": 225,
        "acos_target": 15.0,
        "strategy": "visibility"
        "last_update": "2018-08-23T18:31:11.897Z"
        "creation_date": "2018-08-23T18:31:11.897Z"
    }

    Update campaign

    To update a campaign you have to send the name, budget, strategy, acos_target and status attributes.


    Request:

    curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/campaigns/$CAMPAIGN_ID -d
    {
        "name": "Campanha Principal",
        "daily_budget": 225,
        "acos_target": 15.0,
        "strategy": "visibility"
        "status" : "paused"
    }

    Response:

    {
        "id": 223493019,
        "name": "Campanha Principal",
        "user_id": 348252660,
        "status": "paused",
        "daily_budget": 225,
        "acos_target": 15.0,
        "strategy": "visibility"
        "last_update": "2018-08-23T18:31:11.897Z",
        "creation_date": "2018-08-23T18:31:11.897Z"
    }

    Get item ads

    Request:

    curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/ads/$ITEM_ID

    Example:

    curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/ads/MLM951330214

    Response:

    {
      "ads": [
        {
          "item_id": "MLM951330214",
          "campaign_id": 316572243,
          "user_id": 726488718,
          "site_id": "MLM",
          "status": "active",
          "title": "Item de Test", 
          "permalink": "http://articulo.mercadolibre.com.ar/MLA-657316800-item-de-testeo_JM",
          "thumbnail": "http://mla-s2-p.mlstatic.com/471325-MLA25424154856_032017-I.jpg",
          "picture_id": "471325-MLA25424154856_032017",
          "creation_date": "2017-03-10T02:27:32.325+0000",
          "last_update": "2017-03-10T02:27:32.325+0000",
          "channel": "marketplace"
        }
      ]
    }

    Update specific ad

    It will include the new status for the updated ad.


    Request:

    curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/ads/$ITEM_ID?channel=marketplace -d
    {
        "status": "active"
    }

    Response:

    {
          "item_id": "MLM951330214",
          "campaign_id": 141072850,
          "user_id": 246460082,
          "site_id": "MLM",
          "status": "active",
          "title": "Item de Test", 
          "permalink": "http://articulo.mercadolibre.com.ar/MLM-657316800-item-de-testeo_JM",
          "thumbnail": "http://mla-s2-p.mlstatic.com/471325-MLM25424154856_032017-I.jpg",
          "picture_id": "471325-MLA25424154856_032017",
          "creation_date": "2017-03-10T02:27:32.325+0000",
          "last_update": "2017-03-10T02:27:32.325+0000",
          "channel": "marketplace"
    }

    Move ads to campaigns

    If you want to move ads from one campaign to another, by default the ads keep their status. If the items (ads) have status paused and you want to move them with status active to another campaign, use the optional field "activate_all": true / false in the body.

    Request:

    curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/ads/move -d
    {
        "user_id": 615162762,
        "campaign_id": 321129959,
        "items": [
            "MCO834185796"
        ]
    }

    Response: status code 200.


    Example moving ads with status active

    curl -X PUT -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/ads/move -d
    {
        "user_id": 615162762,
        "campaign_id": 321129959,
        "items": ["MCO834185796"]
        "activate_all":true
    }

    Get ads metrics

    The date_from and date_to are mandatory parameter to define the start and end date for metrics search.


    Mandatory parameter

    Limit (numeric): limit of results that receives at most the value 1000.

    Offset (numeric)


    Request:

    curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/campaigns/$CAMPAIGN_ID/ads/metrics?date_from=$YYYY-MM-DD&date_to=$YYYY-MM-DD&offset=$OFFSET&limit=$LIMIT

    Example:

    curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/campaigns/$CAMPAIGN_ID/ads/metrics?date_from=2022-04-22&date_to=2022-04-29&offset=0&limit=2

    Response:

    {
        "paging": {
            "total": 29,
            "offset": 0,
            "limit": 2
        },
        "ads": [
            {
                "clicks": 0,
                "impressions": 0,
                "ctr": 0.0,
                "cost": 0.0,
                "cpc": 0.0,
                "acos": 0.0,
                "item_id": "MLC1030509956",
                "sold_quantity_direct": 0,
                "sold_quantity_indirect": 0,
                "sold_quantity_total": 0,
                "amount_direct": 0.0,
                "amount_indirect": 0.0,
                "amount_total": 0.0
            },
            {
                "clicks": 0,
                "impressions": 0,
                "ctr": 0.0,
                "cost": 0.0,
                "cpc": 0.0,
                "acos": 0.0,
                "item_id": "MLC1046469327",
                "sold_quantity_direct": 0,
                "sold_quantity_indirect": 0,
                "sold_quantity_total": 0,
                "amount_direct": 0.0,
                "amount_indirect": 0.0,
                "amount_total": 0.0
            }
        ]
    }

    Response fields

    clicks: ad clicks quantity in this time period.
    impressions: the times quantity your ads are shown with Mercado Ads on Mercado Libre pages in this time period.
    ctr: Click Through Rate. Ad clicks quantity in relation with ad impressions quantity.
    cos: The total cost generated by the clicks received in your Mercado Ads.
    cpc: cost per click, it is the average of the ad.
    sold_quantity_direct: Direct sale when a user clicks on your ad and buys that product.
    sold_quantity_indirect: Assisted sale when a user clicks on your ad and buys another one of your products.
    sold_quantity_total: sold_quantity_direct + sold_quantity_indirect.
    amount_direct: Amount for direct sales.
    amount_indirect: Amount for indirect sales


    Get campaign metrics

    As the previous endpoint, the date_from and date_to are mandatory parameter to define the start and end date for metrics search.


    Request:

    curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/campaigns/$CAMPAIGN_ID/metrics?date_from=$YYYY-MM-DD&date_to=$YYYY-MM-DD

    Example:

    curl -X GET -H 'Authorization: Bearer $ACCESS_TOKEN' https://api.mercadolibre.com/marketplace/advertising/product_ads/campaigns/223493019/metrics?date_from=2022-06-13&date_to=2022-06-18

    Response:

    [
       {
      "days": [
    {
    	"date": "2022-08-01",
    	"clicks": 5,
    	"impressions": 564,
    	"ctr": 0.89,
    	"cost": 1.16,
    	"cpc": 0.23,
    	"acos": 0.0,
    	"impression_share": 0.0,
    	"lost_impression_share_by_budget": 0.0,
    	"lost_impression_share_by_ad_rank": 0.0,
    	"acos_benchmark": 0,
    	"sold_quantity_direct": 0,
    	"sold_quantity_indirect": 0,
    	"sold_quantity_total": 0,
    	"amount_direct": 0.0,
    	"amount_indirect": 0.0,
    	"amount_total": 0.0
    }
     {...}
     ]
    }

    Response fields

    impression_share: percentage of times that your ads are shown considering the all times that your ads can be shown. Impressions seller wins.
    lost_impression_share_by_budget: percentage of times that your ads are not shown considering the all times that your ads can be shown and you lose because your budget is too low.
    lost_impression_share_by_ad_rank: percentage of times that your ads are not shown considering the all times that your ads can be shown and you lose because your rank is lower than other sellers.
    acos_benchmark: Acos target used by ads with good results in impressions and sales.


    Errors

    Error Code Details Solution
    400 Bad Request: Any wrong information in input data Service body will provide information about any wrong data in the provided input parameters. (Url params, Query params, Body, etc)
    401 Unauthorized: Failed authentication Send request with a valid login token.
    404 Not found: Any request with a wrong path Send request with a correct path.
    429 Client Error: The user has sent too many requests in a given amount of time. Reduce requests throughput. -
    5xx Internal Server Error Please, contact Support