https://discord.gg/botpress logo
#🌎general
Title
# 🌎general
f

freezing-eve-60762

07/10/2023, 11:18 AM
const url = 'https://api.spoonacular.com/recipes/complexSearch'; const query = workflow.baseQuery; const diet = workflow.dietType; const apiKey = env.apiKey; const number = '3'; const ignorePantry = 'false'; const sort = 'popularity'; const sortDirection = 'asc'; const addRecipeInformation = 'true'; const addRecipeNutrition = 'false'; const apiUrl = `${url}?query=${query}&diet=${diet}&apiKey=${apiKey}&number=${number}&ignorePantry=${ignorePantry}&sort=${sort}&sortDirection=${sortDirection}&addRecipeInformation=${addRecipeInformation}&addRecipeNutrition=${addRecipeNutrition}`; async function fetchData() { try { const response = await fetch(apiUrl); if (response.status === 200) { const data = await response.json(); workflow.recipeInfo = data.results; } else { console.log('Request failed with status:', response.status); } } catch (error) { console.log('Error:', error); } } await fetchData();