// User wants to make a grass-fed beef stew near Portland, OR
const ingredients = ["grass-fed beef", "carrots", "potatoes"];
const sourcing = await Promise.all(
ingredients.map(async (product) => {
const res = await fetch(
`https://api.bhumifarms.co/v1/food?product=${encodeURIComponent(product)}&lat=45.52&lng=-122.68&radius=30`,
{ headers: { "X-API-Key": process.env.BHUMI_API_KEY } }
);
const { data } = await res.json();
return { product, farms: data };
})
);
// sourcing[0].farms → farms with grass-fed beef near Portland
// sourcing[1].farms → farms with carrots near Portland