Skip to main content
json returns an object in the shape you describe, filled from the text of the page. Describe it with a JSON Schema, or with a prompt in plain words.

Fill a schema

Get an API key in the Quickstart. Send json as an object with a schema. This request reads three facts from a documentation page.

Read the response

data.json holds the fields of your schema.
A field the page does not state comes back as null. Each value is checked against the page text before it is returned.

Fill a prompt

When you do not want to write a schema, send a prompt. The model picks the field names and returns up to 20 fields.
Use a schema when your code reads the fields by name, because a prompt can name fields differently from one call to the next.

Read attributes

To read attribute values such as link URLs, send the attributes format. It uses no model and adds no charge. Each entry in selectors names the elements to match with a CSS selector and the attribute to read. Send 1 to 50 entries. This request reads the URL of every link on a page.
data.attributes has one entry for each selector you sent, with its selector, its attribute and the values it found. The read costs $1 per 1,000 pages. attributes adds nothing.

Options

Pydantic’s model_json_schema() and zod’s toJSONSchema() output work as they are. enum, const, anyOf, oneOf, nullable types, $ref with $defs, required and description are all read.

Limits and errors

  • The model reads the first 50,000 characters of the page’s Markdown.
  • A json format with no schema, prompt, rules or parser returns 400 invalidRequest with the message formats: json needs a schema or a prompt for this page.
  • rules together with schema, prompt or parser returns 400 invalidRequest with the message rules cannot be combined with schema, prompt or parser.
  • If the page states none of your fields, the model fee is not charged.

Price

$4 per 1,000 pages: $1 for the page and $3 for json with a schema or a prompt. rules, parser and attributes add nothing.
  • Pre-built parsers return a site’s own data as JSON.
  • Product returns a product page in a fixed shape.
  • Extract pulls fields from one or more pages and checks each against the page.
  • Question answers one question in a sentence.