> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Extract content with Scrapfly

> Extract prompted or structured data from supplied document content.

`scrapfly.extractContent` runs Scrapfly extraction on content you already have.

```ts theme={null}
import { automation, onInvocation } from "automate.ax"
import { scrapfly } from "automate.ax/scrapfly"

export default automation("Extract price", () => {
  onInvocation()
  scrapfly.extractContent({
    body: "<main><span>$42</span></main>",
    contentType: "text/html",
    prompt: "Return the price as JSON",
  })
})
```

| Input                                              | Type                                                           | Required    | Default           | Description                                                                   |
| -------------------------------------------------- | -------------------------------------------------------------- | ----------- | ----------------- | ----------------------------------------------------------------------------- |
| `body`                                             | `string`                                                       | Yes         | —                 | HTML, Markdown, text, or XML document.                                        |
| `contentType`                                      | `'text/html' \| 'text/markdown' \| 'text/plain' \| 'text/xml'` | Yes         | —                 | Body media type.                                                              |
| `prompt`, `model`, `template`, `ephemeralTemplate` | Extraction selector                                            | Exactly one | —                 | Natural-language prompt, automatic model, saved template, or inline template. |
| `charset`, `url`, `timeout`, `webhookName`         | Optional controls                                              | No          | Provider defaults | Supply source metadata, timeout in seconds, or a dashboard webhook.           |

Returns `{ contentType, data }`. JSON responses are decoded into JSON values; other content remains a string.
