> ## 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.

# Citation Analysis

> Enfileira uma análise da correspondência entre uma resposta de IA concluída e as fontes citadas.



## OpenAPI

````yaml post /v1/citation-analysis
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/citation-analysis:
    post:
      tags:
        - Research
      summary: Analyze answer claims and cited sources
      description: >-
        Analyzes an answer against its cited pages and returns a version 4
        result: the searches the engine ran, the pages it retrieved and cited
        and who controls each, the brands the answer names and the pages naming
        them, the brand's visibility stage and prioritized actions with steps
        (with brand), the paragraphs of each cited page mapped to UTF-16 answer
        ranges with explanations, and short summaries of what the pages add up
        to. Post-hoc correspondence, not causal attribution. The retired
        analysis.version=1 opt-in is rejected with 400 because insights are
        automatic. Tasks stored with the older v2 result stay readable as-is.
        Size is not a failure mode: anything the request contract accepts (an
        answer up to 200,000 characters with up to 100 citations) is analyzed,
        with long answers, large source sets and very long pages handled by
        splitting the work. Depth follows the answer rather than the page, so a
        large or repetitive page yields its strongest corresponding passages
        instead of every occurrence, and markup-only pages such as sitemaps or
        link indexes contribute no links.
      operationId: createCitationAnalysis
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CitationAnalysisRequest'
            examples:
              answerAndCitations:
                summary: Answer and citations
                value:
                  answer: >-
                    Teams plan starts at $19.95 per month for up to 10 users.
                    The Business plan adds audit logs.
                  prompt: Which plan fits a small team?
                  citations:
                    - url: https://example.com/pricing
                    - url: https://review.example.com/note
              taskId:
                summary: A completed answer task
                value:
                  taskId: 7c1f0b2e-5d0a-4a8e-9f3b-2c1d6e7a8b90
                  brand: Acme
                  competitors:
                    - Beta
      responses:
        '200':
          description: >-
            Queued; poll /v1/async/task/{id}. Its response follows
            CitationAnalysisResult.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncResponse'
        '400':
          description: >-
            Request rejected. Supplying the retired analysis opt-in is a 400
            because insights are automatic.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Request rejected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            taskId does not name a task you can read (unknown, another
            account's, or past retention).
        '409':
          description: Request rejected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Request rejected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Request rejected, including brandDomains or brandAliases sent
            without brand, and an input that exceeds a processing limit.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Request rejected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Request rejected.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    CitationAnalysisRequest:
      type: object
      properties:
        taskId:
          type: string
          maxLength: 128
          description: >-
            Instead of answer and citations: the id of one of your COMPLETED
            answer tasks that is still readable through GET /v1/async/task/{id}.
            Its answer Markdown (text when there is none) becomes answer, and
            its cited URLs become citations in the engine's order (first 100, at
            most 10 discussion threads). Its prompt, country and engine are used
            unless you send them. Sending taskId together with answer or
            citations is a 400; an unknown or expired id is a 404. For CHATGPT
            the task's searches become queries and every retrieved page becomes
            a citation with cited, position, citedText, publishedAt and query;
            for Google AI Overview, organic results outside the overview's
            sources are added as non-cited pages. include.citationAnalysis fills
            them the same way.
        answer:
          type: string
          minLength: 1
          maxLength: 200000
          description: >-
            Required unless taskId is sent. The AI answer to analyze, as raw
            markdown (keep link fragments intact). 1-200,000 characters at
            submission; the analysis itself has a smaller per-answer processing
            budget, and an answer above it fails explicitly instead of being
            truncated.
        citations:
          type: array
          maxItems: 150
          items:
            $ref: '#/components/schemas/CitationAnalysisCitation'
          description: >-
            Required unless taskId is sent. Cited pages (1-100, at least one)
            plus optional retrieved-but-not-cited pages (cited: false, at most
            50); at most 10 discussion-thread URLs. Total HTTP body <=1 MiB.
        prompt:
          type: string
          maxLength: 200000
          description: The original question.
        country:
          type: string
        engine:
          type: string
          maxLength: 64
          description: The AI engine that produced the answer.
        brand:
          type: string
          maxLength: 200
          description: Your brand name. With it, the result adds visibility and actions.
        competitors:
          type: array
          maxItems: 25
          items:
            type: string
            maxLength: 200
          description: Up to 25 competitor names, reported in brands with role competitor.
        brandDomains:
          type: array
          maxItems: 10
          items:
            type: string
            maxLength: 253
            pattern: ^[a-zA-Z0-9.-]{1,253}$
          description: >-
            Hostnames of your brand's own sites (e.g. coway.com): bare hostnames
            without scheme or path. Requires brand; sent without it, the request
            is rejected with 422. Without brandDomains, a host whose name
            contains the brand name counts as the brand's own site.
        brandAliases:
          type: array
          maxItems: 10
          items:
            type: string
            maxLength: 200
          description: >-
            Other names of your brand (product lines, local spellings). Requires
            brand; sent without it, the request is rejected with 422.
        queries:
          type: array
          maxItems: 20
          items:
            type: string
            maxLength: 500
          description: Searches the engine ran for this answer.
        idempotencyKey:
          type: string
        priority:
          type: integer
        webhook:
          type: object
          properties:
            url:
              type: string
              format: uri
          required:
            - url
      anyOf:
        - required:
            - answer
            - citations
        - required:
            - taskId
    AsyncResponse:
      type: object
      required:
        - success
        - task
        - credits
      properties:
        success:
          type: boolean
          const: true
        task:
          $ref: '#/components/schemas/TaskMeta'
        credits:
          $ref: '#/components/schemas/Credits'
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    CitationAnalysisCitation:
      type: object
      required:
        - url
      additionalProperties: false
      properties:
        url:
          type: string
          format: uri
          maxLength: 2048
        body:
          type: string
          maxLength: 300000
          description: >-
            Exact source snapshot (markdown or plain text). A supplied body is
            analyzed as-is and never replaced with a current fetch. Strongly
            recommended: a cited page we cannot read is reported on that source
            with error and empty paragraphs. Max 300,000 characters per
            citation; the whole request body is at most 1 MiB.
        title:
          type: string
          description: Optional source title; kept for existing integrations.
        kind:
          type: string
          enum:
            - inline
            - panel
          description: >-
            How the answer cites this source: inline (linked from the answer
            text) or panel (listed as a source only). Auto-detected from the
            answer’s links when omitted.
        cited:
          type: boolean
          default: true
          description: >-
            false marks a page the engine retrieved (a search result) but did
            not cite. At least one citation must be cited; at most 100 cited and
            50 non-cited.
        position:
          type: integer
          minimum: 1
          description: The engine's own rank for the page in its search results.
        query:
          type: string
          maxLength: 500
          description: The search that found the page; added to queries if missing.
        citedText:
          type: array
          maxItems: 20
          items:
            type: string
            maxLength: 2000
          description: Passages the engine itself reported citing.
        publishedAt:
          type: string
          maxLength: 64
          description: Publication date as the engine reported it.
    TaskMeta:
      type: object
      required:
        - id
        - taskType
        - status
        - priority
        - createdAt
      properties:
        id:
          type: string
          format: uuid
        taskType:
          $ref: '#/components/schemas/TaskType'
        status:
          $ref: '#/components/schemas/TaskStatus'
        priority:
          type: integer
        createdAt:
          type: string
          format: date-time
        idempotencyKey:
          type: string
          description: >-
            Echoed back verbatim. **Omitted** — not null — when the caller
            supplied none.
    Credits:
      type: object
      description: >-
        Credits, with up to two decimals (for example `1.25`). The submit
        response always shows `0`: a hold is placed on your balance, but nothing
        is charged yet. Polling shows `0` until the task is terminal, then the
        settled charge: the task's price for COMPLETED, `0` for FAILED. A task
        webhook reports the same charge in `creditsCharged`; on a FAILED task it
        reports the task's price in `creditsToCharge` and `0` in
        `creditsCharged`. CITATION_ANALYSIS and WEB_CRAWL are charged by usage,
        up to the hold placed at submit.
      properties:
        creditsToCharge:
          type: number
        creditsCharged:
          type:
            - number
            - 'null'
    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
    TaskType:
      type: string
      description: >-
        The engine to query. `NAVER` is a deprecated alias for `NAVER_AI_BRIEF`.
        GOOGLE_AIO and GOOGLE_AIMODE are the unified names for GOOGLE and
        AIMODE; both spellings are accepted and responses echo the canonical
        GOOGLE / AIMODE. `NAVER_AI_MODE` is accepted as an earlier spelling of
        `NAVER_AI_TAB`. `GOOGLE_SERP` returns the Google results page without
        the AI Overview; `payload.page` selects pages 1-10. `NAVER_SERP` returns
        Naver's web results, 15 per page (`payload.page` 1-10), and with
        `payload.action` `page` reads one naver.com page by `payload.url`.
        `REDDIT` searches Reddit posts by `query` (optionally within one
        `subreddit`), reads one post with its first page of comments by `url`,
        or lists posts with `action` `feed` or `user_posts`. `WEB_SCRAPE` reads
        one web page by `payload.url` and returns its main content as Markdown
        with its images. `WEB_MAP` lists a site's addresses from its start page
        links and sitemaps. `WEB_CRAWL` reads a site's pages under a start
        address, each as WEB_SCRAPE reads it, at 1 credit per page returned.
        `KEYWORD_VOLUME` returns the monthly search volume of `payload.keywords`
        (1-100) in `payload.country`: Naver for KR and Google for 216 other
        countries. `META_AI` returns the meta.ai chat answer with its cited
        sources, search queries and the products it shows (`shoppingCards`,
        `inlineProducts`); a prompt Meta refuses completes with an empty text
        and a `notice` quoting Meta. `QWEN` returns the answer of Qwen's China
        web chat (qianwen.com) with its web search, sources and search queries;
        `payload.country` sets the exit and the answer locale. `DOUBAO` returns
        the answer of Doubao's China web chat (doubao.com) with its web search,
        sources and search queries; it always asks from mainland China, whatever
        `payload.country` is. `BING` and `BING_COPILOT_SEARCH` are accepted as
        earlier spellings of `BING_SEARCH`, and `COPILOT` as the earlier
        spelling of `BING_COPILOT`; responses echo the new names. Private
        engines (for example CLAUDE) are rejected with 403 ENGINE_PRIVATE.
        CITATION_ANALYSIS, PROMPT_RESEARCH and GEO_SCORE tasks are created
        through their own endpoints (POST /v1/citation-analysis, POST
        /v1/prompt-research, POST /v1/geo-score) and are rejected here with 400
        USE_DEDICATED_ENDPOINT; they appear in this list because their tasks
        report them. GEO_AUDIT, SOURCE_INFLUENCE and CITATION_ATTRIBUTION are
        accepted as earlier names of CITATION_ANALYSIS; responses echo
        CITATION_ANALYSIS.
      enum:
        - CHATGPT
        - PERPLEXITY
        - GEMINI
        - AIMODE
        - GOOGLE_AIMODE
        - GOOGLE
        - GOOGLE_AIO
        - GOOGLE_SERP
        - NAVER_AI_BRIEF
        - NAVER_AI_TAB
        - NAVER_AI_MODE
        - NAVER
        - NAVER_SERP
        - COMMERCE_SERP
        - COMMERCE_PRODUCT
        - BING_SEARCH
        - BING
        - BING_COPILOT_SEARCH
        - BING_COPILOT
        - COPILOT
        - META_AI
        - QWEN
        - DOUBAO
        - REDDIT
        - WEB_SCRAPE
        - WEB_MAP
        - WEB_CRAWL
        - KEYWORD_VOLUME
        - CITATION_ANALYSIS
        - GEO_AUDIT
        - SOURCE_INFLUENCE
        - CITATION_ATTRIBUTION
        - PROMPT_RESEARCH
        - GEO_SCORE
    TaskStatus:
      type: string
      description: >-
        `PROCESSING` means a worker holds the task. `COMPLETED` and `FAILED` are
        terminal.
      enum:
        - QUEUED
        - PROCESSING
        - COMPLETED
        - FAILED
  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.