# Discover a page schema

Use `schema()` when you need to learn what a page contains before deciding what to extract. It returns a workflow envelope whose data describes the discovered schema and page-class key.

## Discover the page

```python
from makra import Makra

url = "https://shop.example/products/atlas-lamp"

with Makra() as client:
    response = client.schema(url)

if isinstance(response, dict):
    print(response.get("data"))
```

Schema discovery describes the page's information structure, not only fields from a previous extraction request. It is useful during exploration, schema authoring, and inspection of a new page class.

## Read memory without learning

Set `only_memoized=True` when you want the schema already stored for the page class and do not want this call to perform fresh page comprehension.

```python
from makra import Makra

with Makra() as client:
    response = client.schema(
        "https://shop.example/products/atlas-lamp",
        only_memoized=True,
    )
```

This mode can return no usable schema when the page class has not been learned. Use it for introspection and low-cost checks, not as a guaranteed cold-start discovery path.

## Discovery is a proposal

Treat the discovered schema as source material for your application contract. Review names, descriptions, nesting, and arrays. Remove fields you do not need. Clarify ambiguous concepts. Keep your own versioned target schema in code.

Do not let a newly discovered schema silently replace a production data contract. Page content changes, and the inferred description can change with it.

## Stream or defer long discovery

`schema_stream()` reports progress while the run executes. `submit_schema()` creates a durable run that can outlive the original request. Their lifecycle matches the extraction equivalents described in [Choose an execution style](/markdown/makra-sdk/v0.0.3-beta/features/choose-an-execution-style).

Next, [choose an execution style](/markdown/makra-sdk/v0.0.3-beta/features/choose-an-execution-style).
