Mercadona API
Complete documentation for the Mercadona API. Search products, look up barcodes, browse categories and brands, and track price drops for any Spanish postal code.
Mercadona APIEndpoints
14 endpoints/searchSearch Mercadona products by keyword for any Spanish postal code, with prices, unit …
/product-detailsGet the full Mercadona product sheet by product id or EAN barcode: price, unit price, …
/product-related-productsGet up to 10 products Mercadona suggests alongside a given product, with prices and …
/categoriesGet Mercadona's full category tree in Spanish, English or Catalan: 26 top-level …
/category-productsList every Mercadona product in a level-1 category or level-2 group, with prices, unit …
/brandsList the brand names Mercadona sells with their product counts, across all hubs or for one …
/brand-productsList every Mercadona product of one brand for any warehouse or postal code, with price …
/price-dropsList Mercadona products currently on a price drop for any Spanish postal code, with the …
/new-productsGet new arrivals at Mercadona for any Spanish postal code, from the Novedades grid or …
/best-sellersRank Mercadona products by Mercadona's own popularity score for any Spanish postal code, …
/campaignsList the sections on Mercadona's online home page (banners, carousels and grids) for any …
/campaign-productsGet the products inside one section of Mercadona's online home page, such as a seasonal …
/warehousesList all 274 Mercadona warehouses (7 online hubs and 267 store codes) with product counts …
/resolve-warehouseFind which Mercadona warehouse (online hub or physical store) serves a Spanish postal …
Overview
The Mercadona API returns product and price data from Mercadona’s online catalog: search by keyword, look up a product by id or barcode (EAN), walk the category tree and every brand, and pull discovery feeds like price drops, new arrivals, home-page campaigns and best sellers. Prices and assortment depend on the warehouse that serves each address, so every catalog endpoint accepts a Spanish postal code and answers for the warehouse that delivers there.
All 14 endpoints are GET requests that return JSON. Names and categories can be returned in Spanish, English or Catalan.
Authentication
All requests require a valid RapidAPI key. Include the following headers with every request:
| Header | Value |
|---|---|
X-RapidAPI-Key | YOUR_API_KEY |
X-RapidAPI-Host | mercadona-api.p.rapidapi.com |
You can obtain an API key by subscribing to the Mercadona API on RapidAPI .
Base URL
| |
Endpoints
Products
| Endpoint | Method | Path | Description |
|---|---|---|---|
| Product Search | GET | /search | Free-text, typo-tolerant search with barcodes, brand and category facets. Up to 100 best matches per query |
| Product Details | GET | /product-details | Full product sheet by product id or EAN barcode: price, unit price, ingredients, allergens, origin, photos |
| Related Products | GET | /product-related-products | Up to 10 products Mercadona suggests alongside a given product |
Catalog
| Endpoint | Method | Path | Description |
|---|---|---|---|
| Category Tree | GET | /categories | The full category tree: 26 top-level categories, 152 subcategories, optional level-2 groups |
| Category Products | GET | /category-products | Every product in a level-1 category, paginated |
| Brands | GET | /brands | Brand names with product counts, globally or per warehouse |
| Brand Products | GET | /brand-products | Every product of one brand, with price range filters and sorting |
Discovery
| Endpoint | Method | Path | Description |
|---|---|---|---|
| Price Drops | GET | /price-drops | Products currently on a price drop, with the discount in euros and percent |
| New Products | GET | /new-products | New arrivals from the Novedades grid, or every “Nuevo en …” section |
| Best Sellers | GET | /best-sellers | Products ranked by Mercadona’s own popularity score |
| Home Campaigns | GET | /campaigns | Home-page sections (banners, carousels, grids) in display order |
| Campaign Products | GET | /campaign-products | Products inside one home-page section |
Warehouses
| Endpoint | Method | Path | Description |
|---|---|---|---|
| Warehouses | GET | /warehouses | All 274 warehouses: 7 online hubs and 267 store codes |
| Resolve Warehouse | GET | /resolve-warehouse | Which warehouse serves a given postal code |
Warehouses and Postal Codes
Mercadona’s prices and range depend on the warehouse that serves each address. On every warehouse-scoped endpoint you can pass either:
| Parameter | Description |
|---|---|
postal_code | A Spanish 5-digit postal code. It is resolved to the warehouse that serves that address and takes precedence over warehouse |
warehouse | A hub or store code from /warehouses
. Defaults to vlc1 |
Every response tells you which warehouse answered in data.resolved_filters.warehouse, with the input you sent, the resolved code and its source (postal_code, param or default).
Hubs
| Code | Area | Example postal codes |
|---|---|---|
vlc1 (default) | Valencia | 46001, 46002, 46900 |
mad1 | Madrid | 28030, 28031, 28051 |
mad2 | Madrid | 28023, 28034, 28220 |
mad3 | Madrid | 28001, 28010, 28850 |
bcn1 | Barcelona | 08001, 08002, 08010 |
svq1 | Seville, Cádiz, Huelva | 41001, 11001, 21001 |
alc1 | Alicante, Murcia | 03001, 03201, 30001 |
The other 267 warehouses are physical stores with 4-digit numeric codes (e.g. 4701). Store codes are served live, so popularity_score is null on their rows and brand, ean or category_path may be null. Any warehouse value that is not a hub or a 4-digit code returns HTTP 400.
Response Format
Every successful call returns the same envelope:
| |
| Field | Description |
|---|---|
cached_at | ISO timestamp when the answer came from cache, null when it was fetched for your request |
data.resolved_filters | What your filters resolved to, such as the warehouse a postal code mapped to |
request_params | The query parameters you sent, echoed back as strings |
List endpoints return their rows in data.results[] (/search, /brands, /brand-products) or data.items[] (all the others), with total, page, per_page, total_pages and has_next_page.
Errors
When the thing you asked for doesn’t exist, you get HTTP 200 with status: false and an error code you can act on:
| |
error.code | Meaning |
|---|---|
ean_not_found | No product with that barcode in the catalog |
not_found_in_warehouse | The product exists but isn’t stocked in the requested warehouse |
not_found | Unknown product or campaign |
level_0_category | A top-level category was passed to /category-products; error.children lists its level-1 ids |
out_of_area | The postal code is outside Mercadona’s delivery area |
Invalid input returns HTTP 400, and error is a plain string:
| |
Pagination
List endpoints take page (1-indexed) and per_page (max 20). /search returns at most the 100 best matches for a query, which is Mercadona’s own limit. For complete listings use /category-products
or /brand-products
.
Languages
Pass language=es (default), en or ca to translate product names and category names. Prices and barcodes don’t change. Searches match product names in the chosen language, so search milk with language=en and llet with language=ca.
Caching
Responses are cached for 10 to 15 minutes depending on the endpoint (product details for up to 1 hour). Pass fresh=true to bypass the cache and fetch live data.
Rate Limits
Rate limits depend on your RapidAPI subscription plan. Check your plan details on the RapidAPI listing for specific limits.