---
title: "Query website data using AI"
method: POST
path: "/brand/ai/query"
tags: ["Web Extraction"]
---

# Query website data using AI

`POST /brand/ai/query`

Use AI to extract specific data points from a brand's website. The AI will crawl the website and extract the requested information based on the provided data points.

## Request body

- object
  - `domain` string, required — The domain name to analyze
  - `specific_pages` object — Optional object specifying which pages to analyze
    - `home_page` boolean — Whether to analyze the home page
    - `blog` boolean — Whether to analyze the blog
    - `terms_and_conditions` boolean — Whether to analyze the terms and conditions page
    - `privacy_policy` boolean — Whether to analyze the privacy policy page
    - `about_us` boolean — Whether to analyze the about us page
    - `contact_us` boolean — Whether to analyze the contact us page
    - `careers` boolean — Whether to analyze the careers page
    - `faq` boolean — Whether to analyze the FAQ page
    - `pricing` boolean — Whether to analyze the pricing page
  - `data_to_extract` object[], required — Array of data points to extract from the website
    - `datapoint_name` string, required — Name of the data point to extract
    - `datapoint_type` 'text' | 'number' | 'date' | 'boolean' | 'list' | 'url', required — Type of the data point
    - `datapoint_list_type` 'string' | 'text' | 'number' | 'date' | 'boolean' | 'list' | 'url' | 'object' — Type of items in the list when datapoint_type is 'list'. Defaults to 'string'. Use 'object' to extract an array of objects matching a schema.
    - `datapoint_object_schema` object — Schema definition for objects when datapoint_list_type is 'object'. Provide a map of field names to their scalar types.
    - `datapoint_description` string, required — Description of what to extract
    - `datapoint_example` string, required — Example of the expected value
  - `timeoutMS` integer — Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
  - `tags` string[] — Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.

## Response `200`

Successful response

- object
  - `status` string — Status of the response, e.g., 'ok'
  - `domain` string — The domain that was analyzed
  - `urls_analyzed` string[] — List of URLs that were analyzed
  - `data_extracted` object[] — Array of extracted data points
    - `datapoint_name` string — Name of the extracted data point
    - `datapoint_value` union — Value of the extracted data point. Can be a primitive type, an array of primitives, or an array of objects when datapoint_list_type is 'object'.
      - string
      - number
      - boolean
      - string[]
      - number[]
      - object[]
  - `key_metadata` KeyMetadata — Metadata about the API key used for the request. Included in every response whenever a valid API key is provided, even when the response status is not 200.
    - `credits_consumed` integer, required — The number of credits consumed by this request.
    - `credits_remaining` integer, required — The number of credits remaining for your organization after this request.

## Other responses

- `400` — Bad Request - validation error
- `401` — Unauthorized
- `408` — Request Timeout
- `429` — Rate limit exceeded
- `500` — Internal server error

---

[API](https://skmtc.net/context/apis/context-dev.md) · [All operations](https://skmtc.net/context/apis/context-dev/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/context/context-dev/versions/182f532c2552/schema)
