GET /campaigns

Home Campaigns

List the sections on Mercadona's online home page (banners, carousels and grids) for any Spanish postal code, in display order.

Mercadona API

Returns the sections of Mercadona’s online home page for the warehouse that serves a postal code, in the order they are displayed: seasonal banners, product carousels such as “Bajadas de precio”, and the Novedades grid. Use the campaign_id of any section with Campaign Products to get its products. The response is not paginated and has no request_params field.

HTTP Request

GET /campaigns

Parameters

ParameterTypeRequiredDefaultDescription
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
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
{
  "status": true,
  "request_id": "c08dbdb1-1857-be2a-9933-3c76643e",
  "cached_at": null,
  "data": {
    "items": [
      {
        "campaign_id": "d3569402-e847-4008-b101-13978e6f1e9a",
        "title": "¡Boo! Llega Halloween",
        "subtitle": null,
        "type": "banner",
        "section_code": null,
        "image_url": "https://prod-mercadona.imgix.net/images/cca7d1157fce04561b54f6e02d70ebd6.jpg?h=500",
        "items_count": null
      },
      {
        "campaign_id": "00000000-0000-0000-0000-000000000002",
        "title": "Bajadas de precio",
        "subtitle": null,
        "type": "carousel",
        "section_code": "PD",
        "image_url": null,
        "items_count": 10
      }
    ],
    "total": 5,
    "resolved_filters": {
      "warehouse": {
        "input": null,
        "resolved": "vlc1",
        "source": "default"
      }
    },
    "language": "es"
  }
}

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.items[]array of objectsHome-page sections in display order
data.items[].campaign_idstringSection UUID. Built-in sections use fixed ids: 00000000-0000-0000-0000-000000000001 (Novedades), 00000000-0000-0000-0000-000000000002 (Bajadas de precio), 00000000-0000-0000-0000-000000000003 (Han vuelto)
data.items[].titlestringSection title as shown on the home page
data.items[].subtitlestring | nullSection subtitle
data.items[].typestringSection type: banner, carousel or grid
data.items[].section_codestring | nullMercadona section code, e.g. PD, PS, NA. null on banners
data.items[].image_urlstring | nullBanner image URL. null on carousels and grids
data.items[].items_countinteger | nullNumber of products in the section. null for banners
data.totalintegerNumber of sections
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

Error Responses

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
400Invalid parameterMalformed warehouse or postal_code, or unsupported language

Code Examples

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

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

params = {
    "warehouse": "mad1"
}

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

for section in data["items"]:
    print(f"[{section['type']}] {section['title']}: {section['campaign_id']} ({section['items_count']} items)")
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
const url = "https://mercadona-api.p.rapidapi.com/campaigns";

const params = new URLSearchParams({
  warehouse: "mad1"
});

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();
data.items.forEach(section => {
  console.log(`[${section.type}] ${section.title}: ${section.campaign_id}`);
});
1
2
3
4
curl -G "https://mercadona-api.p.rapidapi.com/campaigns" \
  --data-urlencode "warehouse=mad1" \
  -H "X-RapidAPI-Key: YOUR_API_KEY" \
  -H "X-RapidAPI-Host: mercadona-api.p.rapidapi.com"
  • Campaign Products : products inside a section, by campaign_id
  • New Products : the Novedades grid plus every “Nuevo en …” section in one list
  • Price Drops : every product on a price drop, not only the home carousel
Start building today

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

Get Your API Key on RapidAPI