Recipes API
Recipes API
Section titled “Recipes API”Endpoints for managing and retrieving recipes.
Base URL
Section titled “Base URL”https://api.os.eura.dev/api/v1Get All Recipes
Section titled “Get All Recipes”Retrieve a paginated list of approved recipes.
GET /recipesQuery Parameters
Section titled “Query Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page |
number | No | 1 | Page number (1-indexed) |
limit |
number | No | 20 | Results per page (max: 100) |
q |
string | No | - | Search query (title and description) |
tag |
string | No | - | Filter by tag |
Request Example
Section titled “Request Example”const params = new URLSearchParams({ page: '1', limit: '10', q: 'pasta', tag: 'Italian'});
const response = await fetch(`https://api.os.eura.dev/api/v1/recipes?${params}`);const data = await response.json();Response Example
Section titled “Response Example”{ "recipes": [ { "id": "rec_abc123", "slug": "spaghetti-carbonara", "title": "Spaghetti Carbonara", "description": "Classic Italian pasta dish with eggs, cheese, pancetta, and pepper.", "forkedFrom": null, "version": "1.0.0", "difficulty": "medium", "author": { "id": "usr_xyz", "username": "chef-marco", "avatarUrl": "https://github.com/chef-marco.png", "verified": true }, "yield": { "amount": 4, "unit": "servings" }, "times": { "prepMinutes": 15, "cookMinutes": 15, "totalMinutes": 30 }, "tags": ["Italian", "Pasta", "Classic"], "ingredients": [ { "id": "ing_spaghetti", "name": "Spaghetti", "amount": 400, "unit": "g", "notes": null } ], "instructions": [ { "step": 1, "text": "Cook spaghetti according to package instructions." } ], "media": [], "nutrition": null, "metadata": { "status": "approved", "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-01-15T10:30:00Z", "stars": 0 } } ], "pagination": { "page": 1, "limit": 10, "total": 1247, "hasMore": true }}Get Recipe by ID or Slug
Section titled “Get Recipe by ID or Slug”Retrieve a specific approved recipe.
GET /recipes/:idOrSlugPath Parameters
Section titled “Path Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
idOrSlug |
string | Yes | Recipe ID (starts with rec_) or slug |
Request Example
Section titled “Request Example”// By IDconst response = await fetch('https://api.os.eura.dev/api/v1/recipes/rec_abc123');
// By slugconst response = await fetch('https://api.os.eura.dev/api/v1/recipes/spaghetti-carbonara');Response
Section titled “Response”Returns a single recipe object (same schema as in the list response).