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 API

Endpoints

14 endpoints
GET
Product Search
/search

Search Mercadona products by keyword for any Spanish postal code, with prices, unit …

GET
Product Details
/product-details

Get the full Mercadona product sheet by product id or EAN barcode: price, unit price, …

GET
Related Products
/product-related-products

Get up to 10 products Mercadona suggests alongside a given product, with prices and …

GET
Category Tree
/categories

Get Mercadona's full category tree in Spanish, English or Catalan: 26 top-level …

GET
Category Products
/category-products

List every Mercadona product in a level-1 category or level-2 group, with prices, unit …

GET
Brands
/brands

List the brand names Mercadona sells with their product counts, across all hubs or for one …

GET
Brand Products
/brand-products

List every Mercadona product of one brand for any warehouse or postal code, with price …

GET
Price Drops
/price-drops

List Mercadona products currently on a price drop for any Spanish postal code, with the …

GET
New Products
/new-products

Get new arrivals at Mercadona for any Spanish postal code, from the Novedades grid or …

GET
Best Sellers
/best-sellers

Rank Mercadona products by Mercadona's own popularity score for any Spanish postal code, …

GET
Home Campaigns
/campaigns

List the sections on Mercadona's online home page (banners, carousels and grids) for any …

GET
Campaign Products
/campaign-products

Get the products inside one section of Mercadona's online home page, such as a seasonal …

GET
Warehouses
/warehouses

List all 274 Mercadona warehouses (7 online hubs and 267 store codes) with product counts …

GET
Resolve Warehouse
/resolve-warehouse

Find 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:

HeaderValue
X-RapidAPI-KeyYOUR_API_KEY
X-RapidAPI-Hostmercadona-api.p.rapidapi.com

You can obtain an API key by subscribing to the Mercadona API on RapidAPI .

Base URL

1
https://mercadona-api.p.rapidapi.com

Endpoints

Products

EndpointMethodPathDescription
Product SearchGET/searchFree-text, typo-tolerant search with barcodes, brand and category facets. Up to 100 best matches per query
Product DetailsGET/product-detailsFull product sheet by product id or EAN barcode: price, unit price, ingredients, allergens, origin, photos
Related ProductsGET/product-related-productsUp to 10 products Mercadona suggests alongside a given product

Catalog

EndpointMethodPathDescription
Category TreeGET/categoriesThe full category tree: 26 top-level categories, 152 subcategories, optional level-2 groups
Category ProductsGET/category-productsEvery product in a level-1 category, paginated
BrandsGET/brandsBrand names with product counts, globally or per warehouse
Brand ProductsGET/brand-productsEvery product of one brand, with price range filters and sorting

Discovery

EndpointMethodPathDescription
Price DropsGET/price-dropsProducts currently on a price drop, with the discount in euros and percent
New ProductsGET/new-productsNew arrivals from the Novedades grid, or every “Nuevo en …” section
Best SellersGET/best-sellersProducts ranked by Mercadona’s own popularity score
Home CampaignsGET/campaignsHome-page sections (banners, carousels, grids) in display order
Campaign ProductsGET/campaign-productsProducts inside one home-page section

Warehouses

EndpointMethodPathDescription
WarehousesGET/warehousesAll 274 warehouses: 7 online hubs and 267 store codes
Resolve WarehouseGET/resolve-warehouseWhich 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:

ParameterDescription
postal_codeA Spanish 5-digit postal code. It is resolved to the warehouse that serves that address and takes precedence over warehouse
warehouseA 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

CodeAreaExample postal codes
vlc1 (default)Valencia46001, 46002, 46900
mad1Madrid28030, 28031, 28051
mad2Madrid28023, 28034, 28220
mad3Madrid28001, 28010, 28850
bcn1Barcelona08001, 08002, 08010
svq1Seville, Cádiz, Huelva41001, 11001, 21001
alc1Alicante, Murcia03001, 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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "status": true,
  "request_id": "c08dbdb1-1857-be2a-9933-3c76643e",
  "cached_at": null,
  "data": {
    "resolved_filters": {
      "warehouse": { "input": "28001", "resolved": "mad3", "source": "postal_code" }
    },
    "language": "es"
  },
  "request_params": { "q": "leche", "postal_code": "28001" }
}
FieldDescription
cached_atISO timestamp when the answer came from cache, null when it was fetched for your request
data.resolved_filtersWhat your filters resolved to, such as the warehouse a postal code mapped to
request_paramsThe 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:

1
2
3
4
5
6
7
8
{
  "status": false,
  "request_id": "51cec14a-674b-1fb6-d6d7-af41ea3b",
  "cached_at": null,
  "error": { "code": "ean_not_found", "message": "No product with EAN 0000000000000 in the catalog; ...", "warehouse": null },
  "data": null,
  "request_params": { "ean": "0000000000000" }
}
error.codeMeaning
ean_not_foundNo product with that barcode in the catalog
not_found_in_warehouseThe product exists but isn’t stocked in the requested warehouse
not_foundUnknown product or campaign
level_0_categoryA top-level category was passed to /category-products; error.children lists its level-1 ids
out_of_areaThe postal code is outside Mercadona’s delivery area

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

1
{ "status": false, "request_id": "c52553ca-846a-5c27-e2e4-70de3665", "error": "Invalid parameter 'q': Field required" }

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.

Ready to get started?

Get your API key and start making requests in minutes.

Get Your API Key