> ## Documentation Index
> Fetch the complete documentation index at: https://docs.critique-labs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Contents

> This endpoint is used to retrieve the post-processed contents of a web page in the format that the agentic search engine processes.



## OpenAPI

````yaml https://api.critique-labs.ai/openapi.json post /v1/contents
openapi: 3.1.0
info:
  title: Critique Flow API
  summary: >-
    Gives you researched in-line cited search responses from Critique's in-built
    LLM powered agentic search engine
  description: >

    **URL**: `https://api.critique-labs.ai/v1/search`  

    **Method**: `POST`  

    **Content-Type**: `application/json`  


    #### Headers

    - **X-API-Key**: (Required) Your unique API key for authentication.

    - **Content-Type**: (Required) Should be set to `application/json`.


    #### Request Body Parameters

    | Parameter        | Type              |
    Description                                                                                                                                                                                                                        
    |

    |------------------|-------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|

    | **image**        | `string` (optional) | A base64-encoded string of the
    image or a URL to the image. Providing this parameter allows the API to
    incorporate visual data into the search. If both `image` and `prompt` are
    included, they are combined to refine the search. |

    | **prompt**       | `string`          | A natural language question or
    statement that specifies the information you are seeking. The prompt can
    include specific instructions about the expected answer type, timeframe, or
    content source.                                  |

    | **source_blacklist** | `array` of `string` (optional) | A list of URLs or
    domains (e.g., `"expedia.com"`) that should be excluded from the search
    results. Cannot be used together with
    source_whitelist.                              |

    | **source_whitelist** | `array` of `string` (optional) | A list of URLs or
    domains that should be exclusively used in the search results. Cannot be
    used together with source_blacklist.                              |

    | **output_format**   | `object` (optional) | A JSON object that specifies
    the expected structure of the response. This allows for control over the
    format and detail level of the results, making integration into structured
    applications seamless. See details below.      |


    #### `output_format` Parameter

    The `output_format` parameter is a JSON object that defines the desired
    structure of the API response. Each key in this object represents a field in
    the response, and the value defines its data type or structure.


    ##### Supported Data Types

    - **Primitive Types**: `"string"`, `"number"`, `"boolean"`

    - **Nested Objects**: An object can have other fields, each with types or
    nested structures.

    - **Arrays of Objects**: Arrays can contain objects with defined structures.


    ##### Example of `output_format`

    ```json

    {
      "flights": [
        {
          "destination": "string",
          "price": "number",
          "date": "string"
        }
      ],
      "summary": "string",
      "isAvailable": "boolean"
    }

    ```


    In this example:

    - `flights` is an array where each object has `destination` (a string),
    `price` (a number), and `date` (a string).

    - `summary` is a single string.

    - `isAvailable` is a boolean value.


    ##### Request Example

    Here's an example request using the parameters defined:


    ```json

    {
      "image": "https://cdn.britannica.com/95/94195-050-FCBF777E/Golden-Gate-Bridge-San-Francisco.jpg",
      "prompt": "What are the current flight prices to this location from Hong Kong?",
      "source_blacklist": ["expedia.com"],
      "output_format": {
        "flights": [
          {
            "destination": "string",
            "price": "number",
            "date": "string"
          }
        ],
        "response": "string"
      }
    }

    ```


    In this request:

    - `image` provides an image URL.

    - `prompt` specifies the information sought.

    - `source_blacklist` excludes results from `"expedia.com"`.

    - `output_format` requests a structured response with `flights` (each with
    `destination`, `price`, and `date`) and an additional `response` as a
    summary string.


    #### Response

    The API returns a JSON object formatted according to the `output_format`,
    providing flexibility in structuring the data based on application needs.
  termsOfService: https://api.critique-labs.ai/en/docs/terms-of-service
  contact:
    email: support@critique-labs.ai
  version: 1.5.0
  x-logo:
    url: >-
      https://critique-labs.ai/_next/image?url=%2Fimages%2Ficon_only.png&w=96&q=75
servers:
  - url: https://api.critique-labs.ai
  - url: http://localhost
security: []
paths:
  /v1/contents:
    post:
      summary: Contents
      description: >-
        This endpoint is used to retrieve the post-processed contents of a web
        page in the format that the agentic search engine processes.
      operationId: contents_v1_contents_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContentRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContentOutput'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - api_key: []
components:
  schemas:
    ContentRequest:
      properties:
        url:
          type: string
          title: Url
          description: The url of the web page you want to retrieve the contents of
        query:
          anyOf:
            - type: string
            - type: 'null'
          title: Query
          description: Optional, a query to be used to search the contents of the url
      type: object
      required:
        - url
      title: ContentRequest
    ContentOutput:
      properties:
        response:
          type: string
          title: Response
        info:
          anyOf:
            - type: object
            - type: 'null'
          title: Info
          default: {}
      type: object
      required:
        - response
      title: ContentOutput
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    api_key:
      type: apiKey
      description: >-
        Your API key for authentication. Get one at
        https://critique-labs.ai/en/dashboard
      in: header
      name: X-API-Key

````