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

# Scrape

> Lisez jusqu'à 100 pages web en un seul appel et recevez pour chacune son texte ou son Markdown, les passages qui répondent à une requête et ses liens, dans la même réponse. Chaque page coûte 0,3 crédit.



## OpenAPI

````yaml POST /v1/scrape
openapi: 3.1.0
info:
  title: querying.ai
  description: >-
    One API for every AI answer engine. Every task is asynchronous: submit, then
    collect the result via webhook or polling.
  version: 1.0.0
servers:
  - url: https://api.querying.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/scrape:
    post:
      tags:
        - Search
      summary: Read web pages
      description: >-
        Reads up to 100 web pages and answers in the same call with what each
        page holds: its text or Markdown, the passages that answer a question,
        and its links. Each URL is read as a `WEB_SCRAPE` task and costs 0.3
        credits. The request stays open until every page has been read or
        `livecrawlTimeout` ends (10 seconds by default, 90 at most). A page
        still being read then is answered with the status
        `CRAWL_LIVECRAWL_TIMEOUT`; its task keeps running and is charged. A page
        that cannot be read does not fail the request: it is left out of
        `results` and its entry in `statuses` names the reason. A refusal that
        holds for every page, such as too few credits or a key without
        `WEB_SCRAPE`, answers the whole request with its status. `country`,
        `render`, `rawHtml`, `jsonLd`, a webhook and asynchronous submission
        belong to `POST /v1/async/task` with `WEB_SCRAPE`.
      operationId: scrape
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScrapeRequest'
            examples:
              text:
                summary: Two pages as text
                value:
                  urls:
                    - https://www.energy.gov/energysaver/air-source-heat-pumps
                    - https://www.example.com/missing
                  text:
                    maxCharacters: 2000
              highlights:
                summary: The passages that answer a question, with the page's links
                value:
                  urls:
                    - https://www.energy.gov/energysaver/air-source-heat-pumps
                  highlights:
                    query: how do heat pumps work in cold climates
                    maxCharacters: 500
                  extras:
                    links: 5
                  maxAgeHours: 0
      responses:
        '200':
          description: >-
            The answer for the URLs, also when some of them could not be read:
            those are in `statuses`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScrapeResponse'
              example:
                requestId: 3b0f6a54-9a2e-4c0d-8f61-5d7e1c2a9b40
                results:
                  - id: https://www.energy.gov/energysaver/air-source-heat-pumps
                    url: https://www.energy.gov/energysaver/air-source-heat-pumps
                    title: Air-Source Heat Pumps
                    publishedDate: '2026-09-12T07:36:36Z'
                    text: >-
                      Cold-climate air-source heat pumps keep heating
                      efficiently at outdoor temperatures well below freezing.
                statuses:
                  - id: https://www.energy.gov/energysaver/air-source-heat-pumps
                    status: success
                    source: crawled
                  - id: https://www.example.com/missing
                    status: error
                    error:
                      tag: CRAWL_NOT_FOUND
                      httpStatusCode: 404
                searchTime: 2310
        '400':
          description: >-
            `INVALID_REQUEST_BODY`: the body is not a JSON object, sends no
            `urls` or more than 100, sends a field this endpoint does not take
            or does not support, or sends a value out of range. `error` names
            the field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScrapeError'
              example:
                requestId: 3b0f6a54-9a2e-4c0d-8f61-5d7e1c2a9b40
                error: 'Invalid request body | unsupported field: summary'
                tag: INVALID_REQUEST_BODY
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          description: >-
            `INSUFFICIENT_CREDITS` in `tag`: the balance is below the price of
            the first page.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScrapeError'
        '403':
          description: >-
            `KEY_SCOPE_DENIED` in `tag`: the key's Allowed engines leave out
            `WEB_SCRAPE`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScrapeError'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '429':
          description: >-
            Retry after the `Retry-After` header (seconds). `tag` is
            `QUEUE_LIMIT_EXCEEDED`, `KEY_DAILY_CREDIT_LIMIT` or
            `SUB_ACCOUNT_CREDIT_LIMIT`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScrapeError'
        '503':
          description: >-
            Retry after the `Retry-After` header (seconds). `tag` is
            `QUEUE_BACKPRESSURE`, `SERVER_OVERLOADED`, `DB_UNAVAILABLE` or
            `ENGINE_UNAVAILABLE`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScrapeError'
components:
  schemas:
    ScrapeRequest:
      type: object
      additionalProperties: false
      anyOf:
        - required:
            - urls
        - required:
            - ids
      not:
        required:
          - maxAgeHours
          - livecrawl
      description: A field sent as `null` counts as not sent.
      properties:
        urls:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: string
            minLength: 1
            maxLength: 2048
          description: >-
            The pages to read: 1 to 100 public `http` or `https` URLs of at most
            2,048 characters. A URL sent twice is read once. When `ids` is sent
            too, `urls` is used.
        ids:
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: string
            minLength: 1
            maxLength: 2048
          description: Another name for `urls`.
        text:
          oneOf:
            - type: boolean
              description: >-
                Each page's text, up to 1,000,000 characters: its Markdown
                without link addresses, images and leftover HTML tags. A request
                that sends none of `text`, `markdown` and `highlights` gets
                `text`; once it sends `markdown` or `highlights`, `text` comes
                only when asked for.
            - type: object
              additionalProperties: false
              properties:
                maxCharacters:
                  type: integer
                  minimum: 1
                  maximum: 1000000
                  default: 1000000
                  description: The most characters of text one page carries.
                includeHtmlTags:
                  type: boolean
                  enum:
                    - false
                  description: Only `false` is supported.
        markdown:
          type: boolean
          description: >-
            `true` returns each page's Markdown as `WEB_SCRAPE` gives it, with
            its links and images.
        highlights:
          oneOf:
            - type: boolean
              description: >-
                The passages of each page that best answer `query`, in
                `highlights` with their `highlightScores`.
            - type: object
              additionalProperties: false
              properties:
                query:
                  type: string
                  description: >-
                    The question the passages answer. Without it, the page's
                    title is used.
                maxCharacters:
                  type: integer
                  minimum: 1
                  maximum: 1000000
                  default: 2000
                  description: >-
                    The most characters of passages one page carries. The best
                    passage is cut to fit; a later one that does not fit ends
                    the list.
                numSentences:
                  description: Accepted and ignored.
                highlightsPerUrl:
                  description: Accepted and ignored.
        context:
          oneOf:
            - type: boolean
              description: >-
                Also returns `context`, the pages read as one string for a
                prompt: the title, URL and text of each page.
            - type: object
              additionalProperties: false
              properties:
                maxCharacters:
                  type: integer
                  minimum: 1
                  maximum: 1000000
                  default: 1000000
                  description: The most characters of `context`.
        extras:
          type: object
          additionalProperties: false
          description: What else to return of each page.
          properties:
            links:
              type: integer
              minimum: 0
              maximum: 1000
              default: 0
              description: >-
                How many of the page's link addresses to return in
                `extras.links`.
            imageLinks:
              type: integer
              minimum: 0
              maximum: 1000
              default: 0
              description: >-
                How many of the page's image addresses to return in
                `extras.imageLinks`.
        livecrawlTimeout:
          type: integer
          minimum: 1
          maximum: 90000
          default: 10000
          description: >-
            How long to wait for the pages, in milliseconds. A page still being
            read then is answered with `CRAWL_LIVECRAWL_TIMEOUT`.
        maxAgeHours:
          type: integer
          minimum: 0
          maximum: 720
          description: >-
            The age of a cached read you accept, in hours. `0` reads the page
            now. Reads are cached for 7 days, so a larger value changes nothing
            beyond that; without this field a cached read up to 7 days old is
            used. Send it or `livecrawl`, not both.
        livecrawl:
          type: string
          enum:
            - always
            - fallback
            - preferred
            - auto
          description: >-
            `always` reads the page now, like `maxAgeHours: 0`. The others take
            a cached read up to 7 days old. Send it or `maxAgeHours`, not both.
        userIdentifier:
          type: string
          description: Accepted and ignored.
        country:
          type: string
          pattern: ^[A-Za-z]{2}$
          description: >-
            The language and region the pages are requested for, a two-letter
            country code. Without it, a `.kr` address and domestic Coupang and
            Olive Young storefronts use `KR` and every other page uses `US`.
        render:
          type: boolean
          description: >-
            `true` reads each page in a browser after its script ran, even when
            a plain request already gets it. A page no browser can read is not
            read.
        screenshot:
          type: boolean
          description: >-
            `true` also returns `screenshot` and `shown`: each page as a person
            sees it in a 1366 x 900 browser, scrolled to the end. Implies
            `render` and often takes 20 to 60 seconds; raise `livecrawlTimeout`
            with it.
        rawHtml:
          type: boolean
          description: '`true` also returns `rawHtml`, the HTML that was read.'
        contentHtml:
          type: boolean
          description: '`true` also returns `contentHtml`, the main content as HTML.'
        jsonLd:
          type: boolean
          description: '`true` also returns `jsonLd`, the page''s schema.org JSON-LD blocks.'
    ScrapeResponse:
      type: object
      required:
        - requestId
        - results
        - statuses
        - searchTime
      properties:
        requestId:
          type: string
        results:
          type: array
          items:
            type: object
            required:
              - id
              - url
              - title
            properties:
              id:
                type: string
                description: The URL as sent.
              url:
                type: string
                description: The page's address after redirects.
              title:
                type:
                  - string
                  - 'null'
              statusCode:
                type: integer
                description: The HTTP status of the page that was read.
              description:
                type: string
                description: When the page declares it.
              siteName:
                type: string
                description: When the page declares it.
              language:
                type: string
                description: When the page declares it.
              publishedDate:
                type: string
                description: When the page declares it.
              author:
                type: string
                description: When the page declares it.
              image:
                type: string
                description: The page's main image, when it declares one.
              text:
                type: string
                description: With `text`.
              markdown:
                type: string
                description: 'With `markdown: true`.'
              highlights:
                type: array
                items:
                  type: string
                description: 'With `highlights`: the best passage first.'
              highlightScores:
                type: array
                items:
                  type: number
                  minimum: 0
                  maximum: 1
                description: 'With `highlights`: each passage''s relevance, 1 for the best.'
              extras:
                type: object
                description: With `extras`.
                properties:
                  links:
                    type: array
                    items:
                      type: string
                  imageLinks:
                    type: array
                    items:
                      type: string
              rawHtml:
                type: string
                description: >-
                  With `rawHtml: true`: the HTML that was read, cut at 2,000,000
                  characters. An empty string for PDFs and plain-text pages.
              rawHtmlTruncated:
                type: boolean
                description: 'With `rawHtml: true`: `true` when `rawHtml` was cut.'
              contentHtml:
                type: string
                description: >-
                  With `contentHtml: true`: the main content as HTML, links and
                  image addresses made absolute, cut at 2,000,000 characters.
              contentHtmlTruncated:
                type: boolean
                description: 'With `contentHtml: true`: `true` when `contentHtml` was cut.'
              jsonLd:
                type: array
                items: {}
                description: >-
                  With `jsonLd: true`: each schema.org JSON-LD block of the
                  page, parsed, in page order.
              screenshot:
                type: object
                description: >-
                  With `screenshot: true`: a JPEG of the page's first four
                  screens. Absent when the picture could not be stored.
                properties:
                  url:
                    type: string
                  expiresAt:
                    type: string
                    description: Kept 30 days.
                  width:
                    type: integer
                  height:
                    type: integer
              shown:
                type: object
                description: >-
                  With `screenshot: true`: what the browser showed: `text`,
                  `frames`, `images`, `outline` and `html`.
          description: >-
            The pages that were read, in the order the URLs were sent. A page
            that was not read is not here; see `statuses`.
        context:
          type: string
          description: With `context`.
        statuses:
          type: array
          items:
            type: object
            required:
              - id
              - status
            properties:
              id:
                type: string
                description: The URL as sent.
              status:
                type: string
                enum:
                  - success
                  - error
              source:
                type: string
                enum:
                  - cached
                  - crawled
                description: >-
                  On success: whether the page came from a cached read or was
                  read now.
              error:
                type: object
                required:
                  - tag
                  - httpStatusCode
                description: 'On error: why the page was not read.'
                properties:
                  tag:
                    type: string
                    enum:
                      - CRAWL_NOT_FOUND
                      - SOURCE_NOT_AVAILABLE
                      - CRAWL_TIMEOUT
                      - CRAWL_LIVECRAWL_TIMEOUT
                      - UNSUPPORTED_URL
                      - CRAWL_UNKNOWN_ERROR
                    description: >-
                      `CRAWL_NOT_FOUND`: the page does not exist (404, 410).
                      `SOURCE_NOT_AVAILABLE`: the site refused the read, with a
                      bot check, a sign-in page or an error status.
                      `CRAWL_TIMEOUT`: the read took too long.
                      `CRAWL_LIVECRAWL_TIMEOUT`: the page was still being read
                      when `livecrawlTimeout` ended; its task keeps running and
                      is charged. `UNSUPPORTED_URL`: the URL is not a public
                      `http` or `https` page. `CRAWL_UNKNOWN_ERROR`: any other
                      failure.
                  httpStatusCode:
                    type: integer
                    description: >-
                      The site's status when it gave one, otherwise the status
                      the tag stands for.
          description: One entry per URL, in the order sent.
        searchTime:
          type: integer
          description: How long the request took, in milliseconds.
    ScrapeError:
      type: object
      required:
        - requestId
        - error
        - tag
      properties:
        requestId:
          type: string
        error:
          type: string
          description: What was wrong.
        tag:
          type: string
          description: The code a client switches on.
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable, safe to branch on. See the Errors guide for the full list.
        message:
          type: string
          description: For humans. May change.
        details:
          description: >-
            Context for the error. An array of `{field, message}` on most
            `VALIDATION_ERROR`s; an object elsewhere (for example `{id}` on
            `RESOURCE_NOT_FOUND`, `retryAfterSec` on 429 and 503 codes). Omitted
            when there is nothing to add.
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
            - type: object
              additionalProperties: true
        timestamp:
          type: string
          format: date-time
  responses:
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: MISSING_API_KEY
              message: Missing or invalid API key
              timestamp: '2026-07-09T04:12:00.000Z'
    PayloadTooLarge:
      description: '`PAYLOAD_TOO_LARGE`: the body exceeds 1 MiB. Rejected before parsing.'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: PAYLOAD_TOO_LARGE
              message: request body exceeds 1 MiB
              timestamp: '2026-07-09T04:12:00.000Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as `Authorization: Bearer <key>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.