The rules that matter more than the format
- Never invent an amount. An amount is the creator's own words:
4,1 can,about 1 cup,a good amount. If nothing was said, the amount isnulland its basis isunstated. The dashboard then shows amount not given. Vague filler such as some counts as unstated. - Steps come from the video. A method the creator kept back is not filled in with general cooking knowledge. The recipe is marked
partialand says what is missing undergaps. - The key is what you would shop and filter by. Lowercase and singular:
chicken, not skin-on chicken thighs. Things you buy separately stay separate, sochicken stockis its own key. Reuse the keys that already exist. - Add a timestamp to each step where you can. On a YouTube recipe the dashboard turns it into a play from here button. Other platforms show the time as text, because their players cannot start at a given moment.
- Validate before you commit. Run
npm run validate. When the recipe file exists, remove the matching entry fromdata/queue.json. - Captured material stays out of the repository. Transcripts, captions and frames are the creators' own content. Only the finished recipe, written in your own words with the creator credited, goes in
recipes/.
The file
One file per recipe, named after its id: recipes/gochujang-chicken-thighs.json holds the recipe with the id gochujang-chicken-thighs. The shape, with comments that are not part of a real file:
{
"id": "gochujang-chicken-thighs", // kebab-case, equals the file name
"title": "…",
"status": "analyzed", // or "partial": then gaps is required
"video": { "platform": "youtube", "id": "…", "url": "…" },
"creator": { "name": "…", "handle": "@…", "url": "…" },
"uploaded": "YYYY-MM-DD",
"analyzed": "YYYY-MM-DD",
"summary": "1 or 2 plain sentences",
"serves": "as stated, or null",
"tags": ["lowercase", "…"],
"components": [ // for example Chicken, Pan sauce, To serve
{
"name": "…",
"ingredients": [
{ "item": "Skin-on chicken thighs", "key": "chicken",
"amount": "2 per person", "basis": "spoken", "note": "optional" }
],
"steps": [
{ "text": "…", "t": 17 } // t: seconds into the video, optional
]
}
],
"nutrition": { "per": "sub", "basis": "description", "calories": 517,
"protein_g": 43, "carbs_g": 39, "fat_g": 21, "note": "…" },
"notes": ["…"],
"gaps": ["what the video does not say"],
"source": { "evidence": "what was checked", "quantity_basis": "…" }
}
Real files to read: recipes/ on GitHub. The one-page version of this page is the cheat sheet.
Fields
| Field | Required | What it holds |
|---|---|---|
id | Yes | A kebab-case slug. It must equal the file name without .json. |
title | Yes | The name of the dish. |
status | Yes | analyzed or partial. |
video | Yes | platform, id and url. The link must be one the project can parse, and platform and id must agree with it. |
creator | Yes | name is required. handle and url credit and link the creator. |
analyzed | Yes | The date the recipe was written, as YYYY-MM-DD. |
uploaded | No | The date the video was published, as YYYY-MM-DD. Leave it out when it is not known. |
summary | Yes | One or two plain sentences. |
serves | No | As the creator stated it, or null. |
tags | Yes | A list of lowercase strings. It may be empty. |
components | Yes | At least one part of the dish, each with a name, a list of ingredients and a list of steps. |
nutrition | No | Only what the creator states: what it is per, its basis, and the numbers given. |
notes | No | A list of strings: tips and remarks from the video. |
gaps | For partial | A list of strings: what the video does not say. An analyzed recipe may have gaps too. |
source | No | evidence: what was checked. quantity_basis: where the amounts came from. |
Ingredients and amounts
| Field | What it holds |
|---|---|
item | The ingredient as you would read it in a recipe: Skin-on chicken thighs. |
key | The filter key, lowercase: chicken. |
amount | The creator's words, or null. |
basis | Where the amount came from. One of the four values below. |
note | Optional. A remark about this ingredient. |
| Basis | Meaning | Amount |
|---|---|---|
spoken | The creator says it in the video. | Required |
on-screen | It is shown as text in the video. | Required |
description | It is written in the video description. | Required |
unstated | The video does not give it. | Must be null |
To see the keys that already exist, start the dashboard and read the chip list, or run this in the repository:
grep -h '"key"' recipes/*.json | sort -u
Steps and timestamps
A step has a text and, where the video supports it, a t: the number of seconds into the video where the step happens. Steps are written in your own words, not copied from captions. A timestamp is never guessed.
Partial recipes and gaps
Use status: "partial" when the creator withheld the method, or part of it, so the video itself does not give it. A partial recipe must list at least one gap. Say what is missing in plain words: the oven temperature for the chicken is not given. The dashboard shows the gaps on the recipe page.
Material you could not reach, such as captions behind a login or a failed download, is not a reason for partial. Record that limit in source.evidence. If nothing useful can be reached, write no recipe and mark the queue entry failed with a reason.
An analyzed recipe can have gaps as well. A complete method with an unnamed cut of meat is still analyzed; the unnamed cut is a gap.
What the validator enforces
npm run validate runs validateRecipe from lib/recipe.mjs over every file in recipes/ and exits with an error when one fails. The module is the source of truth. It checks that:
idis a kebab-case slug and equals the file name;titleandsummaryare not empty, andstatusis one of the two values;analyzedis a date, anduploadedis a date when present;video.urlis a supported link, andvideo.platformandvideo.idmatch what the link says;creator.nameis not empty, and every tag is a lowercase string;- there is at least one component, each with a name, an ingredient list and a step list;
- every ingredient has an
item, a lowercasekeyand a knownbasis, with an amount exactly when the basis is notunstated; - every step has a
text, andtis a number of seconds at or above zero when present; notesandgapsare lists of strings, and a partial recipe has at least one gap.
The validator cannot tell whether an amount was really said. That part is the rules at the top of this page.
Shipped This is on the main branch today.
The note above is about the versioned contract: a schema version that a file may state in schema, a migration command (npm run migrate) and a JSON Schema export of the format.
The queue file
data/queue.json lists the videos that wait for analysis. An entry is queued, then analyzing, and is removed once its recipe file exists. It is marked failed when analysis is impossible. The dashboard hides a queue entry whose video is already a recipe, and the validator checks the queue too.