GET /campaign-products

Campaign Products

Get the products inside one section of Mercadona's online home page, such as a seasonal banner or the price-drop carousel.

Mercadona API

Returns the products inside one home-page section, identified by the campaign_id (UUID or slug) from Home Campaigns . It works for carousels, grids and banners: banner campaigns also return products even though /campaigns reports their items_count as null. The built-in sections have fixed ids, so 00000000-0000-0000-0000-000000000002 always returns the “Bajadas de precio” carousel. Rows don’t include ean, brand, category_path or popularity_score; call Product Details when you need them.

HTTP Request

GET /campaign-products

Parameters

ParameterTypeRequiredDefaultDescription
campaign_idstringYes-Section id (UUID or slug) from /campaigns . Built-in sections: 00000000-0000-0000-0000-000000000001 (Novedades), ...0002 (Bajadas de precio), ...0003 (Han vuelto)
warehousestringNovlc1Hub or 4-digit store code (see Warehouses ). Ignored when postal_code is given
postal_codestringNo-Spanish 5-digit postal code, resolved to the warehouse that serves it. Takes precedence over warehouse
pageintegerNo11-indexed page over the section’s items (local pagination)
per_pageintegerNo20Items per page, max 20
freshbooleanNofalseBypass the 10-minute cache
languagestringNoesLanguage for product and category names: es, en or ca

Response

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
{
  "status": true,
  "request_id": "8c6b59cf-b7ba-2328-54ff-44b537b9",
  "cached_at": null,
  "data": {
    "campaign_id": "221d53b1-3372-48a6-bcc9-0fea5cf460af",
    "title": "Nuevo en Perfumería",
    "section_code": "PS",
    "items": [
      {
        "product_id": "18390",
        "name": "Laca de uñas color & queratina Deliplus 159 lavanda",
        "slug": "laca-unas-color-queratina-deliplus-159-lavanda",
        "url": "https://tienda.mercadona.es/product/18390/laca-unas-color-queratina-deliplus-159-lavanda",
        "thumbnail": "https://prod-mercadona.imgix.net/images/6b26f7d5833ced0f1aeb6b802395a556.jpg?fit=crop&h=300&w=300",
        "packaging": null,
        "main_feature": "159 lavanda",
        "is_water": false,
        "requires_age_check": false,
        "category": {
          "category_id": 20,
          "name": "Cuidado facial y corporal"
        },
        "availability": {
          "in_stock": true,
          "status": null,
          "unavailable_from": null,
          "unavailable_weekdays": [],
          "order_limit": 999
        },
        "price": "2.50",
        "price_value": 2.5,
        "previous_price": null,
        "previous_price_value": null,
        "is_price_drop": false,
        "unit_price": "2.500",
        "unit_price_value": 2.5,
        "unit_price_format": "ud",
        "bulk_price_value": 2.5,
        "size_format": "l",
        "unit_size": 0.011,
        "is_pack": false,
        "pack_size": null,
        "total_units": 1,
        "unit_name": "ud.",
        "iva_percent": 21,
        "approx_size": false,
        "drained_weight": null,
        "currency": "EUR",
        "color_variants": null,
        "warehouse": "vlc1"
      },
      {
        "product_id": "18389",
        "name": "Serum uñas & cutículas Double Action Deliplus suaviza e hidrata",
        "slug": "serum-unas-cuticulas-double-action-deliplus-suaviza-hidrata",
        "url": "https://tienda.mercadona.es/product/18389/serum-unas-cuticulas-double-action-deliplus-suaviza-hidrata",
        "thumbnail": "https://prod-mercadona.imgix.net/images/a285f73ad4baa966444799a79bf4ac72.jpg?fit=crop&h=300&w=300",
        "packaging": null,
        "main_feature": "suaviza e hidrata",
        "is_water": false,
        "requires_age_check": false,
        "category": {
          "category_id": 20,
          "name": "Cuidado facial y corporal"
        },
        "availability": {
          "in_stock": true,
          "status": null,
          "unavailable_from": null,
          "unavailable_weekdays": [],
          "order_limit": 999
        },
        "price": "3.50",
        "price_value": 3.5,
        "previous_price": null,
        "previous_price_value": null,
        "is_price_drop": false,
        "unit_price": "3.500",
        "unit_price_value": 3.5,
        "unit_price_format": "ud",
        "bulk_price_value": 3.5,
        "size_format": "l",
        "unit_size": 0.0145,
        "is_pack": false,
        "pack_size": null,
        "total_units": 1,
        "unit_name": "ud.",
        "iva_percent": 21,
        "approx_size": false,
        "drained_weight": null,
        "currency": "EUR",
        "color_variants": null,
        "warehouse": "vlc1"
      }
    ],
    "total": 36,
    "page": 1,
    "per_page": 2,
    "total_pages": 18,
    "has_next_page": true,
    "resolved_filters": {
      "warehouse": {
        "input": null,
        "resolved": "vlc1",
        "source": "default"
      }
    },
    "language": "es"
  },
  "request_params": {
    "campaign_id": "221d53b1-3372-48a6-bcc9-0fea5cf460af",
    "per_page": "2"
  }
}

Response Fields

FieldTypeDescription
statusbooleantrue on success
request_idstringUnique request identifier
cached_atstring | nullISO timestamp when the answer came from cache, null when fetched for this request
dataobjectResponse payload
data.campaign_idstringId of the section
data.titlestringSection title
data.section_codestring | nullMercadona section code, e.g. PS
data.items[]array of objectsProducts in the section. Rows have no ean, brand, category_path or popularity_score
data.items[].product_idstringMercadona product id. Pass it verbatim: decimal ids like 81241.3 exist
data.items[].namestringProduct name, translated with language
data.items[].slugstringURL slug of the product
data.items[].urlstringProduct URL on tienda.mercadona.es
data.items[].thumbnailstringProduct image URL (imgix)
data.items[].packagingstring | nullPackaging, e.g. "Tableta", "Botella", "Pieza"
data.items[].main_featurestring | nullHighlighted feature shown under the name
data.items[].is_waterbooleanWater product flag
data.items[].requires_age_checkbooleanAlcohol or other age-restricted product
data.items[].categoryobjectLevel-0 category of the product
data.items[].category.category_idintegerLevel-0 category id
data.items[].category.namestringLevel-0 category name, translated with language
data.items[].availabilityobjectAvailability at the resolved warehouse
data.items[].availability.in_stockbooleanIn stock at the resolved warehouse
data.items[].availability.statusstring | nullRestriction status, null when there is none
data.items[].availability.unavailable_fromstring | nullDate the product stops being available
data.items[].availability.unavailable_weekdaysarrayWeekdays the product can’t be delivered
data.items[].availability.order_limitintegerMaximum units per order (e.g. 999)
data.items[].pricestringDisplay price in EUR, e.g. "1.25"
data.items[].price_valuefloatNumeric price in EUR
data.items[].previous_pricestring | nullPrevious display price, null when there is none
data.items[].previous_price_valuefloat | nullPrevious numeric price in EUR
data.items[].is_price_dropbooleantrue when the current price is below previous_price. Computed from the previous price, not Mercadona’s own flag
data.items[].unit_pricestringDisplay unit price, e.g. "0.800"
data.items[].unit_price_valuefloatNumeric unit price
data.items[].unit_price_formatstringUnit the unit price refers to, e.g. "L", "kg", "ud"
data.items[].bulk_price_valuefloatBulk price
data.items[].size_formatstringSize unit, e.g. "l", "kg"
data.items[].unit_sizefloatSize in size_format units
data.items[].is_packbooleanWhether the product is a pack
data.items[].pack_sizefloat | nullSize of each unit in the pack
data.items[].total_unitsinteger | nullUnits in the pack
data.items[].unit_namestring | nullUnit name, e.g. "ud.", "briks"
data.items[].iva_percentintegerVAT percentage
data.items[].approx_sizebooleanSize is approximate (e.g. fruit sold by the piece)
data.items[].drained_weightfloat | nullDrained weight
data.items[].currencystringAlways "EUR"
data.items[].color_variantsarray | nullColour variants
data.items[].warehousestringWarehouse that answered
data.totalintegerProducts in the section
data.pageintegerCurrent page (1-indexed)
data.per_pageintegerItems per page
data.total_pagesintegerTotal number of pages
data.has_next_pagebooleanWhether another page follows
data.resolved_filters.warehouseobjectThe warehouse that answered
data.resolved_filters.warehouse.inputstring | nullThe postal_code or warehouse you sent, null if none
data.resolved_filters.warehouse.resolvedstringWarehouse code used, e.g. mad3
data.resolved_filters.warehouse.sourcestringHow it was chosen: postal_code, param or default
data.languagestringLanguage used for names: es, en or ca
request_paramsobjectThe query parameters you sent, echoed back as strings

Error Responses

An unknown campaign_id returns HTTP 200 with status: false and error.code set to not_found:

1
2
3
4
5
6
{
  "status": false,
  "request_id": "...",
  "error": { "code": "not_found", "message": "..." },
  "data": null
}

Invalid input returns HTTP 400, and error is a plain string:

1
2
3
4
5
6
7
8
{
  "status": false,
  "request_id": "b757e855-4127-3b96-509a-8b573904",
  "error": "Invalid parameter 'warehouse': String should match pattern '^(?:[a-z]{3}[0-9]|[0-9]{4})$'",
  "request_params": {
    "warehouse": "xyz"
  }
}
Status CodeCauseDescription
200status: false, error.code: not_foundThe campaign_id doesn’t match any current section. Get current ids from /campaigns
400Invalid parameterMissing campaign_id, malformed warehouse, or per_page above 20

Code Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
import requests

url = "https://mercadona-api.p.rapidapi.com/campaign-products"

params = {
    "campaign_id": "00000000-0000-0000-0000-000000000002"
}

headers = {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "mercadona-api.p.rapidapi.com"
}

response = requests.get(url, headers=headers, params=params)
data = response.json()["data"]

print(f"{data['title']}: {data['total']} products")
for item in data["items"]:
    print(f"{item['name']}: {item['price_value']} EUR (was {item['previous_price']})")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
const url = "https://mercadona-api.p.rapidapi.com/campaign-products";

const params = new URLSearchParams({
  campaign_id: "00000000-0000-0000-0000-000000000002"
});

const response = await fetch(`${url}?${params}`, {
  headers: {
    "X-RapidAPI-Key": "YOUR_API_KEY",
    "X-RapidAPI-Host": "mercadona-api.p.rapidapi.com"
  }
});

const { data } = await response.json();
console.log(`${data.title}: ${data.total} products`);
data.items.forEach(item => {
  console.log(`${item.name}: ${item.price_value} EUR (was ${item.previous_price})`);
});
1
2
3
4
curl -G "https://mercadona-api.p.rapidapi.com/campaign-products" \
  --data-urlencode "campaign_id=00000000-0000-0000-0000-000000000002" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: mercadona-api.p.rapidapi.com"
Start building today

Get your API key and make your first request in under a minute.

Get Your API Key on RapidAPI