Skip to main content

Output Schemas

An output schema defines the exact JSON structure you want Meter to return from extractions. Instead of getting whatever field names the AI chooses, you specify the fields, types, and nesting — and Meter maps the extracted data to match.

When to use output schemas

  • You need consistent field names across different strategies (e.g., all product scrapers return price, not cost or product_price)
  • You want type coercion (prices as numbers, not strings like "$19.99")
  • Your downstream system expects a specific JSON shape
  • You’re using strategy groups and want uniform output across all members

Defining a schema

A schema is a JSON object where keys are field names and values are type strings:

Supported types

Nested schemas

You can define nested structures:
Meter flattens extracted data internally using underscore-separated keys (e.g., product_name, product_pricing_amount) and then re-nests it to match your schema structure.

Wrapper array pattern

For schemas with a single top-level key containing an array, Meter automatically wraps results:
This produces output like:

Where schemas apply

Strategy generation

Pass an output_schema when generating a strategy to guide extraction and get consistent output from the start:

Strategy groups

Apply a schema to all strategies in a group at once:
See Strategy Groups for details.

Bulk upload

When using Bulk Upload, you can define an output schema that applies to all generated strategies in the batch.

URL field handling

Meter automatically detects URL fields in your schema (keys containing url, link, or href) and optimizes extraction to capture the href attribute rather than link text. You don’t need to configure this — it happens automatically.

Examples

E-commerce product schema

Job listing schema

Next steps

Strategy Groups

Apply schemas to many strategies at once

Filtering

Filter extraction results post-processing

Strategies

Learn how strategies use output schemas

Bulk Upload

Create many strategies with a shared schema

Need help?

Email me at mckinnon@meter.sh