Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ivorpad/mercadona-cli/llms.txt

Use this file to discover all available pages before exploring further.

The read commands (search, batch, product, categories, total) require no login and work immediately after install. These recipes show real use cases with actual command output — every example below is live CLI output from the live catalog.

Recipe 1 — Price a shopping list written in plain words

You think in names; the cart API thinks in IDs. batch bridges them in a single request — returning the top hit per term with its price and reference unit:
printf 'arroz redondo hacendado\ngambón grande congelado\nmejillón mediterráneo\ntomate triturado hacendado\naceite oliva virgen extra hacendado\n' | mercadona batch -f -
• arroz redondo hacendado         → [5044] Arroz redondo Hacendado — 1.20€ (1.200€/kg)
• gambón grande congelado         → [60393] Gambón grande congelado — 6.00€ (12.000€/kg)
• mejillón mediterráneo           → [85499] Mejillón mediterráneo — 5.80€ (5.800€/kg)
• tomate triturado hacendado      → [16044] Tomate triturado Hacendado — 0.55€ (1.375€/kg)
• aceite oliva virgen extra hacendado → [4740] Aceite de oliva virgen extra Hacendado — 4.95€ (4.950€/L)
Put the resolved IDs in a basket file. The format supports inline # comments, so it reads like the original list rather than a wall of numbers (paella.txt):
# paella base — 3 personas
5044  1    # Arroz redondo Hacendado
60393 1    # Gambón grande congelado
85499 1    # Mejillón mediterráneo
16044 1    # Tomate triturado Hacendado
4740  0.5  # Aceite de oliva virgen extra
Then price it — total sums unit_price × qty in integer cents, so fractional quantities work correctly for weight items:
mercadona total -f paella.txt
  [5044] Arroz redondo Hacendado — 1 × 1.20€ = 1.20€
  [60393] Gambón grande congelado — 1 × 6.00€ = 6.00€
  [85499] Mejillón mediterráneo — 1 × 5.80€ = 5.80€
  [16044] Tomate triturado Hacendado — 1 × 0.55€ = 0.55€
  [4740] Aceite de oliva virgen extra Hacendado — 0.5 × 4.95€ = 2.48€
  total: 16.03€  (5 líneas)
16.03€ for the basket — a paella base for 3 at roughly 5.34€ per serving. The same #-commented basket file feeds cart set-many to fill the cart in a single write; add --json to get structured output with {lines, total, count, complete}.

Recipe 2 — Get the fresh item, not the frozen or canned one

A bare search term often top-ranks the frozen or canned version. The --fresh flag drops the Congelados (id 17) and Conservas, caldos y cremas (id 14) top-level categories as Algolia facet filters, surfacing the fresh product instead:
# Without --fresh: gets the canned version
mercadona search mejillon --limit 1
  [18615] Mejillones de Chile en escabeche Hacendado pequeños — 2.65€   (Conservas, caldos y cremas)
# With --fresh: gets the fresh seafood
mercadona search mejillon --fresh --limit 1
  [85499] Mejillón mediterráneo — 5.80€   (Marisco y pescado)
The same flag works on batch, so you can apply it across a whole list at once:
printf 'gambas\nmejillón\nmerluza\n' | mercadona batch -f - --fresh
--fresh is a heuristic, not a guarantee. When no fresh variant exists in the catalog (e.g. some guisantes are only sold frozen or canned), excluding those categories can let Algolia typo-match unrelated items. Eyeball the results. To pin to a specific aisle, combine with --category <id|name>.

Recipe 3 — Sort a whole category by price-per-kilo

Every product carries a reference_price field — the unit-normalised price in €/kg, €/L, or equivalent. Pull a whole category and rank by it to surface genuine value:
mercadona categories --id 118 --json   # 118 = Arroz
idproductpriceper kg
5044Arroz redondo Hacendado1.20€1.200 €/kg
5063Arroz largo Hacendado1.20€1.200 €/kg
5020Arroz vaporizado Hacendado1.55€1.550 €/kg
5042Arroz redondo J Sendra Hacendado1.60€1.600 €/kg
5184Arroz integral largo Hacendado1.65€1.650 €/kg
The reference_price and reference_format fields appear on every search hit and product — use them whenever comparing products of different pack sizes.

Recipe 4 — Find products actually on offer

Each product carries price_decreased and previous_unit_price fields in the API response, so you can catch genuine price drops rather than marketing labels. A jq filter on a category scan surfaces them all:
mercadona categories --id 112 --json | jq '.. | objects | select(.price_decreased==true)'
A scan of ~440 staples in the Aceite (oils) category turned up dozens of real reductions:
idproductwasnowdrop
4717Aceite de oliva virgen extra Hacendado14.55€14.40€-1%
4706Aceite de oliva virgen extra Gran Selección5.95€5.75€-3%
4718Aceite de oliva virgen extra Hacendado2.70€2.60€-4%
5063Arroz largo Hacendado1.25€1.20€-4%
26029Garbanzo cocido Hacendado0.85€0.80€-6%
6305Pajaritas vegetales Hacendado1.00€0.90€-10%
Run mercadona categories first (no --id) to browse the full category tree and find the ID for any section you want to scan.

Recipe 5 — Read nutrition info and allergens

mercadona product <id> fetches product detail including the per-100g nutrition table for products that carry one:
mercadona product 17559
[17559] Empanadilla de bacon 11% y queso 32%
  precio: 1.40€  (12.728 kg)
  formato: Pieza
  url: https://tienda.mercadona.es/product/17559/empanadilla-bacon-11-queso-32-pieza
  nutrición (Por 100 g):
    energía: 385 kcal / 1598 kJ
    Grasas: 29 g
      Saturadas: 15 g
    Hidratos de carbono: 21 g
      Azúcares: 2 g
    Proteínas: 9.2 g
    Sal: 1.1 g
With --json, the structured nutrition table lives at product_information.nutritional_information, and allergen + ingredient text is at nutrition_information.allergens:
mercadona product 17559 --json | jq '{kcal: .product_information.nutritional_information[0].energy_calories.amount, allergens: .nutrition_information.allergens}'
{
  "kcal": "385.0",
  "allergens": "Contiene huevos y productos a base de huevo. Contiene leche y sus derivados..."
}
The numeric nutrition table is present for only a minority of products — most staples (pasta, plain eggs, rice) and many prepared items return none. By contrast, nutrition_information (allergens and ingredients text) is available for nearly all products and is the more reliable field for diet-safe basket building.

Recipe 6 — Discover regional specialties

Prices are uniform nationwide (see Recipe 7), but the catalog is not — each warehouse stocks local products. Use the --wh flag to query any warehouse’s catalog:
mercadona search sobrasada --wh mad1 --json | jq .nbHits   # Madrid:   19
mercadona search sobrasada --wh 3842 --json | jq .nbHits   # Baleares: 28
Ten sobrasada products are in the Baleares warehouse but not Madrid — including [20869] Sobrasada de Mallorca Can Pere Joan — 5.25€, [53114] Sobrasada cerdo negro de Mallorca — 14.84€, con miel, picante, and more. The same technique surfaces local cheeses, wines, and other regional products at each warehouse.

Recipe 7 — Verify price consistency across regions

Query the same product ID in five warehouses to verify Mercadona’s “Siempre Precios Bajos” policy:
for wh in mad1 bcn1 vlc1 svq1 3842; do
  mercadona product 5044 --wh $wh --json
done
idproductMadridBarcelonaValenciaSevillaBaleares
5044Arroz redondo1.20€1.20€1.20€1.20€1.20€
4740AOVE Hacendado4.95€4.95€4.95€4.95€4.95€
10379Leche entera5.76€5.76€5.76€5.76€5.76€
60393Gambón6.00€6.00€6.00€6.00€6.00€
64000Helado bombón2.90€2.90€2.90€2.90€2.90€
Prices are identical to the cent, islands included. The catalog differs; the prices do not.
These read recipes compose naturally with agent-driven workflows. You can build a personal inflation tracker by running mercadona total --json on a fixed basket file on a cron schedule, pipe batch output into a budget optimizer, or drive the full cart workflow by chat. See the Agent Integration guide for the safe patterns.

Build docs developers (and LLMs) love