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

# Extract

> Turn any public web page into clean Markdown, or into a typed object you describe with a JSON Schema.

Read a public web page and get back something a program can use: Markdown with
the navigation and boilerplate stripped, or a typed object whose shape you
define. Pages that build themselves in the browser are handled at
`effort: max`.

Both endpoints share the same page options.

| Field     | Type   | Notes                                                                                                                         |
| --------- | ------ | ----------------------------------------------------------------------------------------------------------------------------- |
| `effort`  | enum   | `min`, `standard`, or `max`. Default `standard`. `min` is fastest; `max` handles pages that render themselves in the browser. |
| `country` | string | ISO 3166-1 alpha-2 code (e.g. `CO`) for pages that serve different content by country. Omit for the default route.            |

## Page as Markdown

`POST /global/extract/markdown/v1`

| Field              | Type    | Notes                                                                                            |
| ------------------ | ------- | ------------------------------------------------------------------------------------------------ |
| `url`              | string  | **Required.** Public http or https URL. Loopback and private addresses are rejected.             |
| `scope`            | enum    | `main` keeps the article body and drops navigation; `full` keeps the whole page. Default `main`. |
| `include_metadata` | boolean | Include the page's title, author and dates. Default `false`.                                     |

```bash theme={"dark"}
curl https://api.croma.run/global/extract/markdown/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://www.funcionpublica.gov.co/eva/gestornormativo/norma.php?i=304", "include_metadata": true }'
```

| Field      | Notes                                                                                                                 |
| ---------- | --------------------------------------------------------------------------------------------------------------------- |
| `url`      | The page that was read, after any redirects.                                                                          |
| `markdown` | The page as Markdown.                                                                                                 |
| `metadata` | Title, description, author, site name, dates, image, keywords, page count. `null` unless `include_metadata` was true. |

## Page as JSON

`POST /global/extract/json/v1`

Describe the object you want with a JSON Schema and the fields are located on
the page and returned under `result`, already typed. Describe each field: the
description is what the field is matched on.

| Field         | Type   | Notes                                                                                |
| ------------- | ------ | ------------------------------------------------------------------------------------ |
| `url`         | string | **Required.** Public http or https URL. Loopback and private addresses are rejected. |
| `json_schema` | object | **Required.** JSON Schema for the object to return.                                  |

```bash theme={"dark"}
curl https://api.croma.run/global/extract/json/v1 \
  -H "Authorization: Bearer $CROMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://www.funcionpublica.gov.co/eva/gestornormativo/norma.php?i=304", "json_schema": { "type": "object", "required": ["title"], "properties": { "title": { "type": "string", "description": "Nombre de la norma." }, "issued_on": { "type": "string", "description": "Fecha de expedición." } } } }'
```

| Field    | Notes                                               |
| -------- | --------------------------------------------------- |
| `url`    | The page that was read, after any redirects.        |
| `result` | The object described by the `json_schema` you sent. |

<Note>
  A page with no readable body returns `404` telling you which option to change.
  A `json_schema` that is not valid JSON Schema returns `400` naming the field.
  Fields the page does not carry come back absent or empty rather than invented.
  To produce values that are not on the page — a summary, a classification, a
  translation — use [Generate](/guides/global/generate) instead.
</Note>

<Warning>
  Extract has a tighter quota than most endpoints: **60 requests per hour** per
  organization. See [Rate limits](/rate-limits).
</Warning>

<Card title="Full reference" icon="code" href="/api-reference/overview">
  Schemas, all response fields, and an interactive playground.
</Card>
