# africa.kandake.asha.recipe.scrapeUrl

> Published by [kandake.africa](https://lexicon.garden/identity/did:plc:lrphxvv25aibthe7xoc2eeyy)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:lrphxvv25aibthe7xoc2eeyy/africa.kandake.asha.recipe.scrapeUrl)
- [Documentation](https://lexicon.garden/lexicon/did:plc:lrphxvv25aibthe7xoc2eeyy/africa.kandake.asha.recipe.scrapeUrl/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:lrphxvv25aibthe7xoc2eeyy/africa.kandake.asha.recipe.scrapeUrl/examples)

## Definitions

### `africa.kandake.asha.recipe.scrapeUrl`

**Type**: `procedure`

Scrape a URL to extract structured recipe data. Tries schema.org parsing first, falls back to LLM extraction.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `url` | `string` (uri) | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `recipe` | `ref` → `#scrapedRecipe` | Yes |  |
| `imageUrl` | `string` (uri) | No | URL of the discovered header image, if any. |

#### Errors

- **ScrapeFailed**: Unable to extract recipe data from the provided URL.
- **InvalidUrl**: The URL is not reachable or not a valid recipe page.

### `africa.kandake.asha.recipe.scrapeUrl#scrapedRecipe`

**Type**: `object`

Recipe data extracted from a URL, presented for user confirmation before writing to PDS.

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `notes` | `string` | No |  |
| `title` | `string` | Yes |  |
| `source` | `string` | No |  |
| `servings` | `integer` | No |  |
| `nutrition` | `string` | No |  |
| `categories` | `array` | No |  |
| `description` | `string` | No |  |
| `ingredients` | `array` | Yes |  |
| `instructions` | `array` | Yes |  |
| `cookTimeMinutes` | `integer` | No |  |
| `prepTimeMinutes` | `integer` | No |  |
| `totalTimeMinutes` | `integer` | No |  |

## Raw Schema

```json
{
  "id": "africa.kandake.asha.recipe.scrapeUrl",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "url"
          ],
          "properties": {
            "url": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "encoding": "application/json"
      },
      "errors": [
        {
          "name": "ScrapeFailed",
          "description": "Unable to extract recipe data from the provided URL."
        },
        {
          "name": "InvalidUrl",
          "description": "The URL is not reachable or not a valid recipe page."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "recipe"
          ],
          "properties": {
            "recipe": {
              "ref": "#scrapedRecipe",
              "type": "ref"
            },
            "imageUrl": {
              "type": "string",
              "format": "uri",
              "description": "URL of the discovered header image, if any."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Scrape a URL to extract structured recipe data. Tries schema.org parsing first, falls back to LLM extraction."
    },
    "scrapedRecipe": {
      "type": "object",
      "required": [
        "title",
        "ingredients",
        "instructions"
      ],
      "properties": {
        "notes": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "servings": {
          "type": "integer"
        },
        "nutrition": {
          "type": "string"
        },
        "categories": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "description": {
          "type": "string"
        },
        "ingredients": {
          "type": "array",
          "items": {
            "ref": "africa.kandake.asha.recipe.recipe#ingredient",
            "type": "ref"
          }
        },
        "instructions": {
          "type": "array",
          "items": {
            "ref": "africa.kandake.asha.recipe.recipe#instruction",
            "type": "ref"
          }
        },
        "cookTimeMinutes": {
          "type": "integer"
        },
        "prepTimeMinutes": {
          "type": "integer"
        },
        "totalTimeMinutes": {
          "type": "integer"
        }
      },
      "description": "Recipe data extracted from a URL, presented for user confirmation before writing to PDS."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
