---
title: "Data extraction"
method: POST
path: "/extract"
tags: ["extract"]
---

# Data extraction

`POST /extract`

Performs data extraction using LLM based on the specified data source, filter conditions, and JSON schema. Retrieves chunked data and uses the schema to extract and return the result as JSON via LLM.

Required roles: All, App

## Request body

- ExtractRequest
  - `tags` string[]
  - `tag_ids` string[]
  - `tag_filter_logic` 'AND' | 'OR' — Logical operator for combining filter conditions
  - `source_types` SourceType[]
  - `file_types` FileType[]
  - `date_from` integer — Start date for content search (Unix timestamp in seconds)
  - `date_to` integer — End date for content search (Unix timestamp in seconds)
  - `domains` string[]
  - `metadata` MetadataFilterGroup — (reserved for future use) Filter group with nested structure. Supports combining filters with AND/OR logic.
    - `logic` 'AND' | 'OR' — Logical operator for combining filter conditions
    - `filters` MetadataFilter[] — Filters within this group (combined using the logic operator)
      - `key` string, required — Metadata key
      - `val` unknown
      - `type` 'string' | 'integer' | 'float' | 'date', required — Data type of the metadata value
      - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'between', required — Comparison operator
      - `min` unknown
      - `max` unknown
    - `groups` MetadataFilterGroup[] — Nested subgroups
  - `source_metadata` MetadataFilterGroup — (reserved for future use) Filter group with nested structure. Supports combining filters with AND/OR logic.
    - `logic` 'AND' | 'OR' — Logical operator for combining filter conditions
    - `filters` MetadataFilter[] — Filters within this group (combined using the logic operator)
      - `key` string, required — Metadata key
      - `val` unknown
      - `type` 'string' | 'integer' | 'float' | 'date', required — Data type of the metadata value
      - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'between', required — Comparison operator
      - `min` unknown
      - `max` unknown
    - `groups` MetadataFilterGroup[] — Nested subgroups
  - `limit` integer
  - `offset` integer
  - `schema` object, required — JSON Schema for the data to be extracted.
  - `prompt` string — Additional prompt for the LLM (optional, if not specified, a default prompt in Japanese will be used).
  - `use_related` boolean — Whether to search for and use related content
  - `related_filter` object
    - `tags` string[]
    - `tag_ids` string[]
    - `tag_filter_logic` 'AND' | 'OR' — Logical operator for combining filter conditions
    - `source_types` SourceType[]
    - `file_types` FileType[]
    - `date_from` integer — Start date for content search (Unix timestamp in seconds)
    - `date_to` integer — End date for content search (Unix timestamp in seconds)
    - `domains` string[]
    - `metadata` MetadataFilterGroup — (reserved for future use) Filter group with nested structure. Supports combining filters with AND/OR logic.
      - `logic` 'AND' | 'OR' — Logical operator for combining filter conditions
      - `filters` MetadataFilter[] — Filters within this group (combined using the logic operator)
        - `key` string, required — Metadata key
        - `val` unknown
        - `type` 'string' | 'integer' | 'float' | 'date', required — Data type of the metadata value
        - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'between', required — Comparison operator
        - `min` unknown
        - `max` unknown
      - `groups` MetadataFilterGroup[] — Nested subgroups
    - `source_metadata` MetadataFilterGroup — (reserved for future use) Filter group with nested structure. Supports combining filters with AND/OR logic.
      - `logic` 'AND' | 'OR' — Logical operator for combining filter conditions
      - `filters` MetadataFilter[] — Filters within this group (combined using the logic operator)
        - `key` string, required — Metadata key
        - `val` unknown
        - `type` 'string' | 'integer' | 'float' | 'date', required — Data type of the metadata value
        - `operator` 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'between', required — Comparison operator
        - `min` unknown
        - `max` unknown
      - `groups` MetadataFilterGroup[] — Nested subgroups
    - `limit` integer
    - `offset` integer

## Response `200`

Successful extraction

- Extract200Response
  - `created` integer, required — 抽出実行時刻（Unix timestamp）
  - `result` ExtractResult, required — Extraction result as a JSON object conforming to the provided schema.

## Other responses

- `400` — Bad Request - The request was malformed or invalid
- `401` — Unauthorized - Authentication failed
- `403` — Forbidden - Insufficient permissions
- `429` — Too Many Requests - Rate limit exceeded
- `500` — Internal Server Error

## Changes

- **2026-03-05** `19a49e909676` — 2 breaking, 14 warning
  - added `#/components/schemas/CommonFilter, subschema #2` to the request body `allOf` list
  - the request's body type changed from `object` to no type
  - removed the request property `date_from`
  - removed the request property `date_to`
  - …12 more
- **2026-02-27** `288bf03b951a` — 1 info
  - added the new optional request property `source_metadata`
- **2026-02-26** `82b3e15cf947` — 1 info
  - added the new optional request property `tag_filter_logic`
- **2026-02-25** `13aa0e48bae9` — 1 info
  - added the new optional request property `metadata`
- **2026-02-10** `e5a84cf93911` — 1 info
  - added the new `aac` enum value to the request property `file_types/items/`

[Full history](https://skmtc.dev/qlonolink/apis/qaip-apis/changes/extract/post.md)

---

[API](https://skmtc.dev/qlonolink/apis/qaip-apis.md) · [All operations](https://skmtc.dev/qlonolink/apis/qaip-apis/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qlonolink/qaip-apis/revisions/e65327bc7016/schema)
