🇵🇱 Frisco Example solution JavaScript /parse + /products

Build a Frisco Basket from a Traditional Polish Recipe

This parses a traditional Polish recipe using Pepesto's /parse endpoint and matches each ingredient to the best available Frisco.pl product via /products — including products with Polish-language names in the response.

Run this yourself

$ PEPESTO_API_KEY=your_key node frisco-pl-family-shop-builder.js

Full script: frisco-pl-family-shop-builder.js. You'll need an API key to run it — get one here.

Getting started

bash
export PEPESTO_API_KEY=pep_sk_your_key_here
node frisco-pl-family-shop-builder.js

The first call

Step one is POST /api/parse. You give it a recipe URL and a locale. The API fetches the page, extracts the ingredient list, normalises quantities, and returns a structured object plus a kg_token.

js
const parseRes = await fetch('https://s.pepesto.com/api/parse', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${process.env.PEPESTO_API_KEY}`,
  },
  body: JSON.stringify({
    recipe_url: 'https://www.kwestiasmaku.com/przepis/bigos',
    locale: 'pl-PL',
  }),
});

const { recipe } = await parseRes.json();
// recipe.kg_token → pass this to /api/products
json — parse response (excerpt)
{
  "recipe": {
    "title": "Bigos — Hunter's Stew",
    "ingredients": [
      "500g kapusta kiszona",
      "300g kapusta biała",
      "200g kiełbasa wędzona",
      "200g boczek wędzony",
      "200g wieprzowina",
      "30g suszone grzyby",
      "2 liście laurowe",
      "1 cebula",
      "sól, pieprz"
    ],
    "kg_token": "EiMKIUJpZ29zIC0tIEh1bnRlcidzIFN0ZXcJ..."
  }
}

Pass the kg_token to POST /api/products with supermarket_domain: "frisco.pl". The response maps each ingredient to a real Frisco SKU, with the Polish product name, price in groszy, and a substitution flag where relevant.

js
const productsRes = await fetch('https://s.pepesto.com/api/products', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${process.env.PEPESTO_API_KEY}`,
  },
  body: JSON.stringify({
    recipe_kg_tokens: [recipe.kg_token],
    supermarket_domain: 'frisco.pl',
  }),
});

const { items } = await productsRes.json();
// items[i] = { item_name, products: [{ product, session_token, num_units_to_buy }] }
json — products response (excerpt, frisco.pl)
{
  "items": [
    {
      "item_name": "kapusta kiszona",
      "products": [
        {
          "product": {
            "product_name": "Prymat Kapusta kiszona łagodna 900g",
            "quantity": { "grams": 900 },
            "price": { "price": 699, "promotion": {} }
          },
          "session_token": "eyJwcm9kdWN0...",
          "num_units_to_buy": 1
        }
      ]
    },
    {
      "item_name": "jaja",
      "products": [
        {
          "product": {
            "product_name": "Jaja kurze z wolnego wybiegu rozmiar M, 10 szt",
            "quantity": { "pieces": 10 },
            "price": { "price": 1299, "promotion": {} }
          },
          "session_token": "eyJwcm9kdWN0...",
          "num_units_to_buy": 1
        }
      ]
    },
    {
      "item_name": "orzechy nerkowca",
      "products": [
        {
          "product": {
            "product_name": "BAKALLAND Orzechy nerkowca",
            "quantity": { "grams": 300 },
            "price": { "price": 1699, "promotion": { "promo": true } }
          },
          "session_token": "eyJwcm9kdWN0...",
          "num_units_to_buy": 1
        }
      ]
    }
  ]
}

What the data showed

Frisco's product catalogue is comprehensive and well-structured. The API matched core Polish ingredients — eggs, sauerkraut, pork cuts — with high confidence. The Polish product names came back exactly as they appear on the Frisco site: "Jaja kurze z wolnego wybiegu rozmiar M, 10 szt", "SM GOSTYŃ Mleko zagęszczone niesłodzone 4% z magnezem".

Where the API marked a substitution, it was usually because the exact cut or preparation wasn't available — "kiełbasa myśliwska" vs "kiełbasa śląska", that kind of thing. For a typical family shop that's fine. You still get a usable product in the basket.

The promo flag was a nice bonus: the BAKALLAND Orzechy nerkowca came back with promo: true, promo_percentage: 12. The API surfaces those automatically.

Next steps

The kg_token from the parse step is reusable. If I want to compare Frisco prices against another Polish supermarket, I just send the same token to /api/products with a different supermarket_domain. No re-parsing needed.

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

The result

Point the script at a Polish recipe URL and get back a Frisco basket with real product names and current prices. The match rate for traditional Polish recipes is high — the API has strong coverage of Polish grocery vocabulary including cuts and regional product names.

What else you could do?

Read the shopping list from a plain text file instead of a recipe URL — /parse can handle raw ingredient lists, not just recipe URLs. Filter results to prefer own-brand products where possible, since Frisco's private label is typically 20–30% cheaper. Add a price comparison against Auchan PL for the same kg_token — no re-parsing needed, just a second /products call with a different supermarket_domain.

Links

Ready to build?

Start parsing Polish recipes for Frisco

Turn any Polish recipe into a Frisco shopping list — /parse extracts ingredients, /products finds the right SKUs.

27supermarkets 13countries 1schema Instant access