GET /warehouses

Warehouses

List all 274 Mercadona warehouses (7 online hubs and 267 store codes) with product counts and example postal codes for each hub.

Mercadona API

Returns the list of Mercadona warehouses you can pass as the warehouse parameter on any warehouse-scoped endpoint. There are 274 in total: 7 online hubs with letter codes (such as vlc1 or mad3) and 267 physical stores with 4-digit numeric codes. Each row includes the number of products in that warehouse’s assortment, and hubs also include example postal codes they serve. The list is static and refreshed monthly, so you can cache it on your side.

HTTP Request

GET /warehouses

Parameters

ParameterTypeRequiredDefaultDescription
typestringNoallWhich warehouses to return: all (7 hubs and 267 stores), hub (the 7 hubs only) or store (the 267 store codes only)

To get the full list of store codes, call /warehouses?type=store. The hubs are also listed in the API overview .

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
{
  "status": true,
  "request_id": "6f071aa2-35a8-e4f2-d54f-f1d581a8",
  "cached_at": null,
  "data": {
    "items": [
      {
        "warehouse": "vlc1",
        "warehouse_type": "hub",
        "products_count": 4340,
        "example_postal_codes": [
          "46001",
          "46002"
        ]
      },
      {
        "warehouse": "mad1",
        "warehouse_type": "hub",
        "products_count": 4301,
        "example_postal_codes": [
          "28030",
          "28031"
        ]
      }
      // ... more items
    ],
    "total": 274
  }
}

Response Fields

FieldTypeDescription
statusbooleantrue when the request succeeded
request_idstringUnique request identifier
cached_atstring | nullISO timestamp when the answer came from cache, null when fetched for this request
dataobjectResponse payload
data.items[]arrayOne entry per warehouse
data.items[].warehousestringWarehouse code: a hub code (vlc1) or a 4-digit store code (2004). Pass it as warehouse on other endpoints
data.items[].warehouse_typestringhub or store
data.items[].products_countintegerNumber of products in that warehouse’s assortment
data.items[].example_postal_codes[]array of stringsExample postal codes served by the hub. Empty list for stores
data.totalintegerNumber of warehouses returned (274 with type=all)

Unlike the catalog endpoints, /warehouses returns no request_params and no data.resolved_filters.

Error Responses

Invalid input returns HTTP 400 with error as a plain string:

1
2
3
4
5
6
{
  "status": false,
  "request_id": "7174180d-17a3-faa0-88c7-ffb1695d",
  "error": "Invalid parameter 'type': Input should be 'hub', 'store' or 'all'",
  "request_params": { "type": "bad" }
}
Status CodeCauseDescription
400Invalid typetype must be all, hub or store

Code Examples

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

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

params = {
    "type": "hub"
}

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"Hubs: {data['total']}")
for item in data["items"]:
    postal_codes = ", ".join(item["example_postal_codes"])
    print(f"{item['warehouse']}: {item['products_count']} products ({postal_codes})")
 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/warehouses";

const params = new URLSearchParams({
  type: "hub"
});

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();
for (const item of data.items) {
  console.log(`${item.warehouse}: ${item.products_count} products`);
}
1
2
3
4
curl -G "https://mercadona-api.p.rapidapi.com/warehouses" \
  --data-urlencode "type=hub" \
  -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