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.

mercadona batch sends all search terms in a single multi-query Algolia request — approximately 100 items per call. It’s the fastest way to price a shopping list or check availability across many products at once. Like search, it requires no authentication.

Synopsis

mercadona batch [-f file] [flags] [term...]

Flags

FlagDefaultDescription
-f <file>File with one term per line (- = stdin)
--hits N1Results per term (default: top hit only)
--category <id|name>Apply a category filter to every term
--freshfalseExclude frozen and canned results for every term
--wh <code>config/mad1Warehouse code
--lang <code>config/esLanguage
--jsonfalseEmit raw JSON array to stdout

Input format

Provide terms one per line via -f <file> or -f - for stdin. Lines beginning with # are treated as comments and skipped. Alternatively, pass terms as positional arguments directly on the command line.

Examples

# Pipe from stdin
printf 'queso\ncarne\nmayonesa\n' | mercadona batch -f -

# From a file
mercadona batch -f lista.txt

# Fresh items only
printf 'gambas\nmejillon\nmerluza\n' | mercadona batch -f - --fresh

# Structured output
mercadona batch -f lista.txt --json

Human output format

• queso                   → [51110] Queso rallado mozzarella pizza-Roma Hacendado — 1.60€ (8.000€/kg)
• carne                   → [34157] Carne de pimiento choricero Hacendado — 1.55€ (11.072€/kg)
• mayonesa                → [13406] Mayonesa Hacendado — 1.20€ (2.400€/L)
Terms with no results are reported as (sin resultados) rather than silently omitted.

JSON output shape

With --json, the output is an array of search result objects aligned to the input term order, each with the same shape as mercadona search --json:
[
  {
    "query": "queso",
    "nbHits": 142,
    "hits": [
      {
        "id": "51110",
        "display_name": "Queso rallado mozzarella pizza-Roma Hacendado",
        "packaging": "Bolsa 200g",
        "share_url": "https://tienda.mercadona.es/product/51110/...",
        "categories": [{"name": "Quesos y mantequilla"}],
        "price_instructions": {
          "unit_price": "1.60",
          "reference_price": "8.000",
          "reference_format": "kg",
          "is_pack": false
        }
      }
    ]
  }
]

Using batch results downstream

The product IDs returned in each hit can be passed directly to cart add, cart set-many, and total. A typical agent workflow is: batch a shopping list → collect the top-hit IDs → pass them to total for a pre-cart price estimate → then cart set-many to write the basket.
--fresh is a heuristic. It works by excluding the Congelados (frozen, id 17) and Conservas, caldos y cremas (canned, id 14) top-level categories from the Algolia facet filter. If no fresh variant exists for a term, Algolia may typo-match an unrelated item from the remaining catalog. Always review results before committing them to a cart.

Build docs developers (and LLMs) love