Introduction

Welcome to the Developer Portal for the SmartWithFood Recipe API. This API is designed to provide developers with access to a vast collection of recipes, allowing you to integrate culinary delights into your applications, websites, and services. Whether you are building a meal planning app, a cooking blog, or a nutrition tracker, our API has you covered.

Getting started

Follow the following steps to easily get started with our Recipe API.

  1. Express your interest in using our API: Contact us via support@smartwithfood.com and we will provide you with all of the information you need to get started with our API.
  2. Explore Documentation: Dive into our detailed API documentation, where you will find information on endpoints, request parameters, response formats, and usage examples.
  3. Integrate and Innovate: Use the API to access recipes and leverage the productize endpoint to enhance your application's shopping list capabilities

Support

Should you have any questions or need further assistance, please do not hesitate to contact our support team at support@smartwithfood.com or at https://smartwithfood.atlassian.net/servicedesk/customer/portal/6..

Non-Functional Requirements

We are committed to providing you with a seamless and reliable experience when integrating our API into your applications. Below you can find the non-functional requirements you can expect from our API.

Performance

For all endpoints:

  • 99% of requests are expected to have a response time of less than 2 seconds.
  • 95% of requests are expected to have a response time of less than 1 second.

Availability

Our API aims for an availability of 99.9%. This translates to approximately 8.5 hours of planned downtime per year.

Throughput

Normal Circumstances

  • Up to 2 requests per second.
  • Up to 40 concurrent requests per minute.
  • Up to 60,000 requests per day.

Peak Circumstances

  • Up to 30 requests per second.
  • Up to 700 concurrent requests per minute.
  • Up to 140,000 requests per day.
  • Up to 33,500 requests per hour.

API Reference

With this Recipe API you can:

  • retrieve details of a specific recipe by providing its unique identifier by using the GET /recipes/{id};
  • retrieve all recipes by using the GET /recipes;
  • perform a quick search to find recipes that match specific criteria, returning limited information (for performance reasons) by using the POST /quick_search;
  • perform a search to find recipes that match specific criteria by using the POST /search;
  • get related recipes by using the POST /suggestions;
  • get the aggregations for all recipes (ingredients, tags, allergens, lifestyles, preferences, …) by using the POST /aggregation.

Recipe by Id

Retrieve details of a specific recipe by providing its unique identifier.

SecurityoAuth2-clientCredentials
Request
path Parameters
id
required
string

Unique id of the recipe.

query Parameters
languages
string

If no language is specified in the request, all languages will be returned.

If a language is specified in the request, only this language will be returned. A fall back mechanism is in place if the requested language is not available. The standard fall back order is nl - fr - fr-FR - en.

Responses
200

Succesful operation.

400

The request could not be understood by the server due to malformed syntax.

401

The caller is not authorized to execute the endpoint.

404

Resource not found.

500

The server could not process the request.

get/recipes/{id}
Request samples
Response samples
application/json
{
  • "recipeId": "9BF104F0-957C-11EC-A6C0-B92742570A34",
  • "source": "Name of the source.",
  • "sourceId": 6543,
  • "createdAt": 1619254606873,
  • "publishedAt": "2019-08-24",
  • "publishingEntries": [
    ],
  • "publishingState": {
    },
  • "modifiedAt": 1619254606873,
  • "name": [
    ],
  • "description": [
    ],
  • "cookingDifficulty": 1,
  • "cookTime": 900,
  • "cookUnit": {
    },
  • "prepTime": 700,
  • "prepUnit": {
    },
  • "totalTime": 1600,
  • "totalUnit": {
    },
  • "servingsUnit": "portions",
  • "numberOfServings": 4,
  • "manualNutriscore": "A",
  • "calculatedNutriscore": "A",
  • "nutriscore": "A",
  • "recipeAllergens": [
    ],
  • "recipeLifestyles": [
    ],
  • "recipePreferences": [
    ],
  • "recipeHasLines": [
    ],
  • "recipeUtensil": [
    ],
  • "recipeInstruction": [],
  • "recipeTip": [
    ],
  • "recipeTag": [
    ],
  • "recipeNutritional": [
    ],
  • "referenceRecipe": [],
  • "recipeHasImages": [],
  • "recipeHasVideos": [],
  • "recipeHasWarehouses": [
    ]
}

Recipes

Retrieve all recipes.

SecurityoAuth2-clientCredentials
Request
query Parameters
page
integer

The requested page.

limit
integer
Default: 10

The number of items that should be returned per page.

Responses
200

Succesful operation.

400

The request could not be understood by the server due to malformed syntax.

401

The caller is not authorized to execute the endpoint.

404

Resource not found.

500

The server could not process the request.

get/recipes
Request samples
Response samples
application/json
[
  • {
    }
]

Search

Perform a search to find recipes that match specific criteria.

SecurityoAuth2-clientCredentials
Request
Request Body schema: application/json
ids
Array of strings <UUID>

Search on recipe ids.

limit
integer

The amount of recipes returned per page.

page
integer

The requested page number.

skip
integer

The number of recipes that will be skipped.

search
string

User input of the search bar.

object

Brands the returned recipes should (not) be part of.

object

Ingredient the returned recipes should (not) contain.

object

Ingredient attribute values the returned recipes should (not) contain.

object

Allergens the returned recipes should (not) contain.

object

Lifestyles the returned recipes should (not) contain.

object

Preferences the returned recipes should (not) contain.

Array of objects

List of tags to filter on.

object

Budget the returned recipes should (not) have.

description
string

Search on recipe description.

object

Only return recipes within a specific cook time range.

object

Nutriscore the returned recipes should (not) have.

Array of objects

Order the recipes will be returned in.

Array of objects

Aggregation bucket filter. Specifies which buckets of the aggregation will be returned.

publishingSpaceIds
Array of strings

Only return recipes with the specified publishingSpaceIds.

publishingDate
string

Only return recipes with the specified publishingDate.

object

Publishing states the returned recipes should (not) have.

languages
Array of strings

List of languages in which the recipes should be returned. If no language is specified, all languages will be returned.

Array of objects

Aggregation filter. Specifies which aggregations will be returned.

object

Only return recipes within a specific prep time range.

object

Only return recipes within a specific total time range.

hasVideos
boolean

If true, only return recipes that contain videos.

Responses
200

Succesful operation.

400

The request could not be understood by the server due to malformed syntax.

401

The caller is not authorized to execute the endpoint.

404

Resource not found.

500

The server could not process the request.

post/recipes/search
Request samples
application/json
{
  • "ids": [
    ],
  • "limit": 10,
  • "page": 1,
  • "skip": 2,
  • "search": "bloemkool",
  • "warehouses": {
    },
  • "ingredientIds": {
    },
  • "ingredientAttributeValueIds": {
    },
  • "allergens": {
    },
  • "lifestyles": {
    },
  • "preferences": {
    },
  • "tags": [
    ],
  • "budget": {
    },
  • "description": "Heerlijke vegetarische maaltijd.",
  • "cookTime": {
    },
  • "nutriscore": {
    },
  • "orderBy": [
    ],
  • "bucketFilter": [
    ],
  • "publishingSpaceIds": [
    ],
  • "publishingDate": "2022-11-09",
  • "publishingStates": {
    },
  • "languages": [
    ],
  • "bucketSelections": [
    ],
  • "prepTime": {
    },
  • "totalTime": {
    },
  • "hasVideos": true
}
Response samples
application/json
{
  • "totalQuantityOfRecipes": 12,
  • "recipes": [
    ],
  • "aggregations": [
    ],
  • "quantityOfRecipesReturned": 5
}

Suggestions

Get related recipes.

SecurityoAuth2-clientCredentials
Request
Request Body schema: application/json
recipeId
required
string <UUID>

Unique id of the recipe.

object

Brands the returned recipes should (not) be part of.

limit
integer

The amount of recipes returned per page.

useName
boolean

Indicates if suggested recipes will be based on the title of the recipe in the request.

useTags
boolean

Indicates if suggested recipes will be based on the tags of the recipe in the request.

useNutriscore
boolean

Indicates if suggested recipes will be based on the nutriscore of the recipe in the request.

useIngredients
boolean

Indicates if suggested recipes will be based on the ingredients of the recipe in the request.

useAttributeValue
boolean

Indicates if suggested recipes will be based on the attribute values of the recipe in the request.

Responses
200

Succesful operation.

400

The request could not be understood by the server due to malformed syntax.

401

The caller is not authorized to execute the endpoint.

404

Resource not found.

500

The server could not process the request.

post/recipes/suggestions
Request samples
application/json
{
  • "recipeId": "9BF104F0-957C-11EC-A6C0-B92742570A34",
  • "warehouses": {
    },
  • "limit": 10,
  • "useName": true,
  • "useTags": true,
  • "useNutriscore": true,
  • "useIngredients": true,
  • "useAttributeValue": true
}
Response samples
application/json
{
  • "data": [
    ],
  • "results": 10
}

Aggregation

Get the aggregations for all recipes (ingredients, tags, allergens, lifestyles, preferences, …)

SecurityoAuth2-clientCredentials
Request
Request Body schema: application/json
languages
Array of strings

List of languages in which the aggregations should be returned. If no language is specified, all languages will be returned.

object

Brands that should (not) be returned in the aggregations.

Array of objects

Aggregation bucket filter. Specifies which buckets of the aggregation will be returned.

Array of objects

Aggregation bucket filter. Specifies how many buckets of the aggregation will be returened.

object

Publishing states that should (not) be returned in the aggregations.

Array of objects

Aggregation filter. Specifies which aggregations will be returned.

Responses
200

Succesful operation.

400

The request could not be understood by the server due to malformed syntax.

401

The caller is not authorized to execute the endpoint.

404

Resource not found.

500

The server could not process the request.

post/recipes/aggregation
Request samples
application/json
{
  • "languages": [
    ],
  • "warehouses": {
    },
  • "bucketFilter": [
    ],
  • "bucketOptions": [
    ],
  • "publishingStates": {
    },
  • "bucketSelections": [
    ]
}
Response samples
application/json
[
  • {
    }
]