---
title: "AI extract structured data from a web page"
method: POST
path: "/v1/web/ai-extract"
tags: ["Web"]
---

# AI extract structured data from a web page

`POST /v1/web/ai-extract`

AI extract JSON data or text content using AI-powered parsing

## Request body

- object
  - `url` string, uri, required
  - `waitTime` integer
  - `responseType` 'json' | 'text'
  - `prompt` string
  - `response_format` object
    - `type` 'json_schema', required
    - `json_schema` object, required
  - `instructions` string

## Response `200`

AI extract completed successfully

- object
  - `success` true, required
  - `data` object, required
    - `extracted` object
    - `text` string
    - `metadata` object, required
      - `url` string, required
      - `timestamp` string, required
      - `model` string, required
      - `responseType` 'json' | 'text', required
      - `extractionType` 'prompt' | 'schema', required
      - `fieldsExtracted` number
      - `inputTokens` number
      - `outputTokens` number
  - `creditsCost` number — Credits consumed by this operation
  - `requestId` string, uuid, required — Unique request identifier for tracing
  - `timestamp` string, date-time, required — ISO timestamp when the response was generated

## Other responses

- `401` — Authentication required
- `422` — Validation error
- `500` — Internal server error

---

[API](https://skmtc.net/weblinq/apis/weblinq-api.md) · [All operations](https://skmtc.net/weblinq/apis/weblinq-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/weblinq/weblinq-api/revisions/364690cf91b7/schema)
