---
title: "Structured data extraction via JSON Schema"
method: POST
path: "/tabs/{tabId}/extract"
tags: ["Content"]
---

# Structured data extraction via JSON Schema

`POST /tabs/{tabId}/extract`

Extracts structured data from the current page using a JSON Schema whose properties
carry `x-ref` hints pointing at snapshot element refs (e.g. `e1`, `e2`).  
Call `GET /tabs/{tabId}/snapshot` first to populate the ref table.

## Path parameters

- `tabId` string, required

## Request body

- object
  - `userId` string, required
  - `schema` object, required — JSON Schema with `type: "object"` and a `properties` map. Each property may include `x-ref` (a snapshot element ref) and an optional `type` (`string`, `number`, `integer`, `boolean`).
    - `type` 'object', required
    - `properties` object, required
    - `required` string[] — Property names that must resolve to a non-null value.

## Response `200`

Extraction succeeded.

- object
  - `ok` boolean
  - `data` object — Extracted key-value pairs matching the input schema.

## Other responses

- `400` — Missing userId, missing schema, or invalid schema.
- `404` — Tab not found.
- `409` — No refs available -- call snapshot first.
- `422` — Extraction failed (e.g. required ref not found).
- `500` — Internal server error.

## Changes

- **2026-04-25** `642132c20aeb` — 1 info
  - endpoint added
- **2026-04-25** `80bb18f1c19f` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/jo-inc/apis/camofox-browser/changes/tabs/:tabId/extract/post.md)

---

[API](https://skmtc.dev/jo-inc/apis/camofox-browser.md) · [All operations](https://skmtc.dev/jo-inc/apis/camofox-browser/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/jo-inc/camofox-browser/revisions/d007e73dad3d/schema)
