🇳🇴 Meny Example solution JavaScript /suggest + /products

500 NOK for a Week of Dinners at Meny

This tests whether 500 NOK is a realistic budget for 5 dinners at Meny Norway. Uses Pepesto's /suggest endpoint to find dinner recipes, /products to price each at meny.no, and totals the cost against the target to deliver a verdict.

Run this yourself

$ PEPESTO_API_KEY=your_key node meny-no-budget-week-500-nok.js

Full script: meny-no-budget-week-500-nok.js. You'll need an API key to run it — get one here.

Getting started

You need a Pepesto API key. Set it as an environment variable:

bash
export PEPESTO_API_KEY=pep_sk_your_key_here
node meny-no-budget-week-500-nok.js

The first call

Call POST /api/suggest to find the recipes. The query is free-text — the API returns structured recipes with ingredients and a kg_token that you pass to the next step.

js
const response = await fetch('https://s.pepesto.com/api/suggest', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${process.env.PEPESTO_API_KEY}`,
  },
  body: JSON.stringify({
    query: 'easy dinner for 2 few ingredients',
    num_to_fetch: 5,
  }),
});

const data = await response.json();
// data.recipes → array of recipe objects, each with a kg_token

The response comes back with recipe titles, ingredient lists, nutrition data, and a kg_token. The token is a compact encoding of the ingredients that the /products endpoint uses for matching.

json — suggest response (excerpt)
{
  "recipes": [
    {
      "title": "Sweet Potato and Beef Cypriot Meatballs",
      "ingredients": [
        "500g sweet potatoes (~4)",
        "1 onion (~150g)",
        "50g parsley",
        "2 eggs",
        "500g ground beef",
        "100g breadcrumbs",
        "cinnamon powder",
        "cumin seeds",
        "salt"
      ],
      "nutrition": { "calories": 2260, "protein_grams": 141 },
      "kg_token": "EikKJ1N3ZWV0IFBvdGF0byBhbmQgQmVlZi..."
    },
    {
      "title": "Baked Tortillas with Minced Meat, Vegetables, and Cheese",
      "ingredients": [
        "700g ground beef", "300g tortillas", "200g cheddar cheese",
        "1 red pepper (~110g)", "400g canned tomatoes", "1 onion (~150g)"
      ],
      "kg_token": "EjoKOEJha2VkIFRvcnRpbGxhcyB3aXRoIE1..."
    }
  ],
  "short_response": "How about trying a classic spaghetti carbonara or a creamy Alfredo?"
}

Then for each recipe I called POST /api/products with the kg_token and supermarket_domain: "meny.no". The API returns the best-matching SKU at Meny for each ingredient, with the current price in øre (divide by 100 to get NOK).

json — products response (excerpt, meny.no)
{
  "items": [
    {
      "item_name": "Ground beef",
      "products": [
        {
          "product": {
            "product_name": "Angus kjøttdeig 15% fett",
            "quantity": { "grams": 400 },
            "price": { "price": 7990, "promotion": {} }
          },
          "session_token": "eyJwcm9kdWN0...",
          "num_units_to_buy": 2
        }
      ]
    },
    {
      "item_name": "Sweet potatoes",
      "products": [
        {
          "product": {
            "product_name": "Søtpotet",
            "quantity": { "grams": 500 },
            "price": { "price": 3990, "promotion": {} }
          },
          "session_token": "eyJwcm9kdWN0...",
          "num_units_to_buy": 1
        }
      ]
    }
  ]
}

What the data showed

Over five recipes, the per-dinner costs varied a lot. Pasta-based dinners came in around 55–70 kr per couple. Anything with chicken or salmon pushed over 100 kr. The ingredients Meny struggled to match — obscure spice blends, specific cuts — often got substituted with the nearest SKU, which sometimes bumped the price up slightly.

The total across all five dinners landed at 412 kr. That's under 500. Not by a huge margin, but it worked.

The recipes that stayed cheapest used eggs, tinned tomatoes, root vegetables, and cheap cuts of pork. Meny's own-brand range matched well for those. Fresh fish and specialty cheeses were the main budget killers.

Next steps

Once you have the matched products back from /products, pass their session_token values to POST /api/session to build a checkout session. You get back a session_id which you pass to /checkout to open the prefilled Meny basket.

json — session response
{
  "session_id": "ses_meny_abc123"
}

The result

500 NOK for five weeknight dinners at Meny is achievable — with the right recipe choices. /suggest does the recipe hunting, /products does the price lookup, and /session closes the loop into an actual checkout. Staples at Meny are reasonably priced when you stay away from premium lines — Grovbrød, eggs, tinned tomatoes, and pork mince give the most budget headroom.

What else you could do?

Add a filter that rejects any recipe where the total cost at Meny exceeds a per-dinner ceiling — enforcing the 500 NOK constraint at the recipe selection stage rather than at the end. Add a fallback: if an ingredient gets a substitution flag, try a cheaper alternative recipe instead. Schedule the script to run every Monday morning and deliver the five cheapest dinners for the week — an automated budget meal planner with no manual steps.

Links

Ready to build?

Start building budget dinner plans at Meny

Use /suggest and /products to plan a week of dinners within a NOK budget at Meny Norway.

27supermarkets 13countries 1schema Instant access