> ## 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 JSON

> Render a page and extract structured JSON with Cloudflare AI.

`cloudflare.extractJson` renders a page and uses Cloudflare AI to extract structured data.

```ts automations/extract-cloudflare-json.automation.ts theme={null}
import { automation, onDashboardRun, sendEmail } from "automate.ax"
import { cloudflare } from "automate.ax/cloudflare"

export default automation("Extract product data", () => {
  onDashboardRun({ title: "Extract product data" })
  const product = cloudflare.extractJson({
    accountId: "cloudflare-account-id",
    prompt: "Return the product name, SKU, and current price.",
    url: "https://example.com/products/1",
  })
  sendEmail({ subject: "Product data", text: JSON.stringify(product) })
})
```

## Inputs

Provide `accountId`, exactly one of `url` or `html`, and at least one of `prompt` or `responseFormat`. `responseFormat` accepts a `type` and optional JSON Schema. `customAi` supplies an ordered fallback list of model names and optional authorization values. `cacheTtl` defaults to 5 seconds, and the common Browser Run page controls are available.

## Output

Returns the extracted JSON object. JSON Schema property names and extra HTTP-header names are preserved exactly. The action consumes Browser Run duration and is not replay-safe.
