Skip to content
Scrappa Get API key
Knuspr API 1 credit / request

Knuspr Composition API Documentation

GET https://scrappa.co/api/knuspr/composition

Knuspr Composition API returns the public nutrition panel per 100 g or 100 ml for a product id from search: energy, fats, carbohydrates, sugars, protein, salt and fiber.

Set ingredients=true to include the public ingredients text. An optional slug helps locate the page for that text. An unknown id answers 404 and is free. Costs 1 credit per request; failed requests are free.

Knuspr Composition API Documentation 1 credit / request

Endpoint

Request preview
GET
https://scrappa.co/api/knuspr/composition
Auth header
x-api-key
Cost
1 credit / request
id = 1234567890
Response preview
200 OK
{
    "data": {
        "product": "1470",
        "composition": {
            "nutrients": [
                {
                    "name": "energyKCal",
                    "unit": "kcal",
                    "amount": 64
                }
            ],
            "plain_ingredients": "Water, oats."
        },
        "ingredients_requested": true
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

1 required parameter needed before sending a request.

2 optional filters available.

id string Required

Numeric id from search, for example 1470.

Example value 1234567890
ingredients boolean Optional

true to include the public ingredients text, default false.

Example value true
slug string Optional

Optional product slug, letters digits and dashes only.

Example value example

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "data": {
        "product": "1470",
        "composition": {
            "nutrients": [
                {
                    "name": "energyKCal",
                    "unit": "kcal",
                    "amount": 64
                }
            ],
            "plain_ingredients": "Water, oats."
        },
        "ingredients_requested": true
    },
    "meta": {
        "credits": 1,
        "billable": true,
        "endpoint_family": "composition"
    },
    "success": true
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

The id or a value is invalid. This response is not billable.

{
    "errors": {
        "id": [
            "A product id is required, e.g. id=1470."
        ]
    },
    "message": "The request validation failed"
}
503

Upstream Unavailable

The source could not be reached. This response is not billable.

{
    "meta": {
        "billable": false,
        "retryable": true,
        "endpoint_family": "composition"
    },
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "Knuspr could not be reached. Please retry shortly."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.