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 search runs a full-text Algolia search against the Mercadona catalog. No authentication required. Results include product ID, name, price, reference price, and category. The index is per-warehouse and per-language, so results reflect the prices and availability of your configured warehouse.

Synopsis

mercadona search [flags] <term...>

Flags

FlagDefaultDescription
--limit N24Maximum number of results to return
--category <id|name>Filter to a specific category (by numeric ID or name)
--freshfalseExclude frozen (Congelados, id 17) and canned (Conservas, id 14) results
--wh <code>config/mad1Warehouse code
--lang <code>config/esLanguage
--jsonfalseEmit raw JSON to stdout

Examples

# Basic search
mercadona search queso

# Limit results, structured output
mercadona search --limit 5 --json mayonesa

# Filter by category name
mercadona search --category "Marisco y pescado" gambas

# Exclude frozen/canned to get fresh results
mercadona search mejillon --fresh --limit 1

# Different warehouse
mercadona search sobrasada --wh 3842

Human output format

query="queso"  nbHits=142  (index=products_prod_mad1_es)
  [51110] Queso rallado mozzarella pizza-Roma Hacendado — 1.60€ (8.000€/kg) (Quesos y mantequilla)
  [51111] Queso manchego curado Hacendado — 2.40€ (12.000€/kg) (Quesos y mantequilla)

JSON output shape

With --json, the full Algolia response is emitted to stdout:
{
  "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
      }
    }
  ]
}
id is the product ID you pass to cart add, cart set, and total. unit_price is the price you pay for the item as sold; reference_price / reference_format is the per-unit comparison price (e.g. 8.000 €/kg).

Category filtering

When --category receives a numeric ID it is used directly as an Algolia facet filter. When it receives a name, the CLI resolves it case-insensitively against the full warehouse category tree: an exact match wins over a partial match, and an ambiguous name errors and lists all candidates with their IDs. Pass a numeric ID to disambiguate. Run mercadona categories to browse all IDs and names.

Algolia credential self-healing

The CLI caches Algolia credentials in ~/.mercadona/algolia.json and ships a compiled-in fallback. When credentials rotate (the app ID has been observed changing), the CLI automatically re-discovers them by scraping the live SPA bundle and retries the query transparently — no user action required.

Build docs developers (and LLMs) love