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

# Fetch a web page

> Fetches a single web page and returns clean extracted content (title, article text, metadata) as JSON, or LLM-ready markdown with format=context. The companion to /api/v1/search: search, pick a result, fetch it in full.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/fetch
openapi: 3.1.0
info:
  title: Andi AI Search API
  version: 1.7.0
  description: >-
    Web search and page-fetch API for people and AI agents. `GET`/`POST
    /api/v1/search` returns structured results with query operators, domain and
    date filtering, and multiple output formats. `GET /api/v1/fetch` retrieves
    and extracts a single page. `GET /api/v1/news/:topic` returns a curated,
    ranked news feed for one of 23 fixed topics — no query required. Search and
    fetch support `format=context`, which returns markdown suited to language
    models; the news endpoint returns JSON only. By default (`searchMode=auto`)
    the API sets the search effort per query — compute, models, and depth —
    automatically; the fixed modes (`low-cost`, `fast`, `balanced`, `deep`,
    `exhaustive`) pin an effort level when you want the same behavior on every
    call. Requests are billed on outcome-based pricing, reported per call in
    `metrics.cost_dollars`.
servers:
  - url: https://api.andiai.com
    description: Production
security:
  - apiKey: []
paths:
  /api/v1/fetch:
    get:
      summary: Fetch a web page
      description: >-
        Fetches a single web page and returns clean extracted content (title,
        article text, metadata) as JSON, or LLM-ready markdown with
        format=context. The companion to /api/v1/search: search, pick a result,
        fetch it in full.
      operationId: fetchPage
      parameters:
        - name: url
          in: query
          required: true
          description: Full http(s) URL of the page to fetch.
          schema:
            type: string
            format: uri
        - name: format
          in: query
          required: false
          description: >-
            Response format: json (structured, default) or context (LLM-ready
            markdown).
          schema:
            type: string
            enum:
              - json
              - context
            default: json
        - name: effort
          in: query
          required: false
          description: >-
            How thoroughly to retrieve the page: `low` favors speed, `max`
            spends the most time extracting content — useful for pages that are
            slow to load or render content client-side. Omit for the server's
            adaptive default. Invalid values return a `400` listing the valid
            tiers. Fetch failures (`422`, `503`) are never billed, regardless of
            `effort`.
          schema:
            type: string
            enum:
              - low
              - medium
              - high
              - max
        - name: maxContentLength
          in: query
          required: false
          description: Maximum content characters to return (default 200000).
          schema:
            type: integer
            minimum: 1
        - name: query
          in: query
          required: false
          description: >-
            Optional query string to scope extraction to. When set, the response
            includes `query_extracts`, `query_snippet`, and `query_hash` fields
            scoped to this query.
          schema:
            type: string
      responses:
        '200':
          description: Extracted page content
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                  title:
                    type: string
                  description:
                    type: string
                  content:
                    type: string
                    description: Clean extracted text content
                  markdown:
                    type: string
                    description: Clean extracted content as markdown, when available.
                  extracts:
                    type: array
                    items:
                      type: string
                    description: Key passage extracts from the page, when available.
                  snippet:
                    type: string
                    description: Short excerpt from the page.
                  author:
                    type: string
                  date:
                    type: string
                  site_name:
                    type: string
                  image:
                    type: string
                  lang:
                    type: string
                  word_count:
                    type: integer
                  truncated:
                    type: boolean
                  query_extracts:
                    type: array
                    items:
                      type: string
                    description: >-
                      Text extracts from the page most relevant to `query`. Only
                      present when `query` is set.
                  query_snippet:
                    type: string
                    description: >-
                      Short excerpt from the page most relevant to `query`. Only
                      present when `query` is set.
                  query_hash:
                    type: string
                    description: >-
                      Hash identifying the `query` used to scope this response.
                      Only present when `query` is set.
                  partial:
                    type: boolean
                    description: >-
                      Whether this is a partial response returned before the
                      page finished retrieving. Only present when true.
                  retry_after_seconds:
                    type: integer
                    description: >-
                      Seconds to wait before retrying for the full content. Only
                      present on partial responses.
                  metrics:
                    type: object
                    properties:
                      duration_ms:
                        type: integer
                      cost_dollars:
                        type: number
                        description: >-
                          Actual cost of this fetch in USD (post-discount).
                          Failed fetches are not billed.
            text/markdown:
              schema:
                type: string
        '400':
          description: Missing or invalid url parameter
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: Credit balance exhausted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            The page was reached but its content could not be extracted. Not
            retriable. Not billed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            The page is still being retrieved, or a transient failure occurred.
            Retriable — retry after the number of seconds in the `Retry-After`
            header. Not billed.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: Content warming
                message: >-
                  The page is still being retrieved. Retry in 5s for the full
                  content.
                retry_after_seconds: 5
                url: https://example.com/article
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
          description: Error type or message.
        message:
          type: string
          description: Detailed error description.
      required:
        - error
        - message
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API key from the [API Console](https://console.andiai.com).

````