POST /v1/harness/read
Read a source
A URL, a markdown or a text: the recipe it holds, in the shape validate reads.
POSThttps://api.rikaido.app/v1/harness/read
The request
sourcestring · requiredA web address, markdown or the text of a recipe. At most 60,000 characters.
locale'fr' | 'en'The source’s language, for the copyist.
fr by default.How it is read
The recipe is first located, in the source’s own words — never paraphrased before it is judged:
markup— the page’s schema.org markup, when it has one. Nothing is guessed.as-written— the text as written, when it is headed into ingredients and steps.transcribed— the model, as a copyist, under a fidelity check, last.
Then every ingredient line is laid out into { name, quantity, unit } by a verified reader. A line it cannot read arrives whole in name, with no quantity, and read.unread counts them.
The answer
200
{
"recipe": {
"title": "Cherry tomato focaccia",
"servings": 6,
"ingredients": [{ "name": "all-purpose flour", "quantity": "500", "unit": "g" }],
"steps": [{ "instruction": "Mix the flour, water, yeast and salt." }]
},
"read": { "how": "markup", "url": "https://…", "site": "example.com" }
}Send recipe as is to validate: it is the same shape.
Errors
| Code | code | When |
|---|---|---|
400 | empty | The source is empty. |
413 | too-large | More than 60,000 characters. |
422 | no-recipe | Nothing that looks like a recipe in the source. |
4xx | private-address, unreachable, not-a-page | The address points at a private network, does not answer, or is not a page. |
429 | More than 10 reads in a minute. |
What it costs
$0.050 per call. A read fetches a page and may call the model; the price follows the cost. Nothing is kept.