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

# Get visits per answer fetch

> Returns AI-referred visits per answer fetch for each page and for the whole project, over completed UTC days ending yesterday. An answer fetch is an AI system retrieving the page while building an answer; it is not a citation. A page is covered only when its visits come from GA4 or PostHog and that provider has synced the whole window; snippet-sourced pages and unsynced pages are no_referral_data, with visits and the ratio null, never 0. The project total is returned only when fewer than 100 pages had activity and all are covered; otherwise summary is null and summaryWithheldReason says why. Covered pages are ranked by visits per answer fetch, highest first, with pages that have no ratio after them; pages without complete referral data follow, by answer fetches. Up to 100 pages.



## OpenAPI

````yaml /openapi.json get /projects/{projectId}/traffic/visits-per-answer-fetch
openapi: 3.1.0
info:
  title: DevTune API
  version: 2.0.0
  description: >-
    API for programmatic access to your AI visibility data, webhook
    subscriptions, and automation workflows. Use this API to integrate DevTune
    data into CI/CD pipelines, BI tools, AI agents, and operational systems.
servers:
  - url: https://devtune.ai/api/v2
    description: Production
security:
  - bearerAuth: []
paths:
  /projects/{projectId}/traffic/visits-per-answer-fetch:
    get:
      summary: Get visits per answer fetch
      description: >-
        Returns AI-referred visits per answer fetch for each page and for the
        whole project, over completed UTC days ending yesterday. An answer fetch
        is an AI system retrieving the page while building an answer; it is not
        a citation. A page is covered only when its visits come from GA4 or
        PostHog and that provider has synced the whole window; snippet-sourced
        pages and unsynced pages are no_referral_data, with visits and the ratio
        null, never 0. The project total is returned only when fewer than 100
        pages had activity and all are covered; otherwise summary is null and
        summaryWithheldReason says why. Covered pages are ranked by visits per
        answer fetch, highest first, with pages that have no ratio after them;
        pages without complete referral data follow, by answer fetches. Up to
        100 pages.
      operationId: getVisitsPerAnswerFetch
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: windowDays
          in: query
          schema:
            type: integer
            default: 30
            enum:
              - 7
              - 30
              - 90
          description: >-
            Fixed window of completed UTC days ending yesterday. Supported
            values: 7, 30, 90. Defaults to 30.
        - name: cursor
          in: query
          schema:
            type: string
          description: >-
            Opaque cursor from the previous response; cursors expire after ~48
            hours.
        - name: pageSize
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          description: Results per page. Capped at 100.
      responses:
        '200':
          description: Visits per answer fetch
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/VisitsPerAnswerFetchData'
                  meta:
                    $ref: '#/components/schemas/Meta'
                required:
                  - data
                  - meta
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '429':
          $ref: '#/components/responses/RateLimitExceededError'
components:
  schemas:
    VisitsPerAnswerFetchData:
      type: object
      additionalProperties: false
      properties:
        items:
          type: array
          maxItems: 100
          items:
            type: object
            additionalProperties: false
            properties:
              domain:
                type:
                  - string
                  - 'null'
              pagePath:
                type: string
              answerFetches:
                type: integer
                minimum: 0
                description: >-
                  Requests from AI answer fetchers retrieving the page while
                  building an answer. An answer fetch is not a citation.
              aiReferralVisits:
                type:
                  - integer
                  - 'null'
                minimum: 0
                description: >-
                  Visits that arrived from an AI answer, from the analytics
                  provider in referralSource. Null when coverage is
                  no_referral_data, never 0.
              visitsPerAnswerFetch:
                type:
                  - number
                  - 'null'
                minimum: 0
                description: >-
                  aiReferralVisits divided by answerFetches, rounded to 4
                  decimal places. Null when coverage is no_referral_data or
                  answerFetches is 0.
              coverage:
                type: string
                enum:
                  - covered
                  - no_referral_data
                description: >-
                  covered only when visits come from GA4 or PostHog and its sync
                  covers the whole window. Snippet-sourced visits, and pages
                  whose provider has not synced the window, are
                  no_referral_data: no complete referral data for this window.
              referralSource:
                type: string
                description: 'Where visits were counted from: ga4, posthog or snippet.'
            required:
              - domain
              - pagePath
              - answerFetches
              - aiReferralVisits
              - visitsPerAnswerFetch
              - coverage
              - referralSource
        summary:
          description: >-
            Project total over every page, returned only when fewer than 100
            pages had activity and every one is covered. Otherwise null, with
            summaryWithheldReason.
          oneOf:
            - type: object
              additionalProperties: false
              properties:
                aiReferralVisits:
                  type: integer
                  minimum: 0
                answerFetches:
                  type: integer
                  minimum: 0
                referralSource:
                  type: string
                  description: ga4, posthog, or analytics for both.
                visitsPerAnswerFetch:
                  type:
                    - number
                    - 'null'
                  minimum: 0
                  description: Null when answerFetches is 0.
              required:
                - aiReferralVisits
                - answerFetches
                - referralSource
                - visitsPerAnswerFetch
            - type: 'null'
        summaryWithheldReason:
          type:
            - string
            - 'null'
          enum:
            - partial_coverage
            - page_limit
            - no_activity
            - null
          description: >-
            Why summary is null: partial_coverage when some pages have no
            complete referral data; page_limit when the 100-page cap was
            reached, so not every page can be checked; no_activity when no page
            had answer fetches or visits. Null when summary is returned.
        excludedAnswerFetches:
          type:
            - integer
            - 'null'
          minimum: 0
          description: >-
            With partial_coverage, the answer fetches on pages without complete
            referral data. Exact, because the list holds every page below the
            cap. Null otherwise.
        pageLimit:
          type: integer
          enum:
            - 100
          description: Most pages ranked per window.
        pageLimitReached:
          type: boolean
          description: >-
            True when pageLimit pages were returned, so lower-ranked pages may
            be omitted and summary is withheld.
        pagination:
          type: object
          additionalProperties: false
          properties:
            hasMore:
              type: boolean
            nextCursor:
              type:
                - string
                - 'null'
            pageSize:
              type: integer
              minimum: 1
              maximum: 100
            totalCount:
              type: integer
              minimum: 0
              maximum: 100
              description: Ranked pages available to page through.
          required:
            - hasMore
            - nextCursor
            - pageSize
            - totalCount
        window:
          type: object
          additionalProperties: false
          properties:
            dateFrom:
              type: string
              format: date
            dateTo:
              type: string
              format: date
              description: Last completed UTC day in the window.
          required:
            - dateFrom
            - dateTo
        windowDays:
          type: integer
          enum:
            - 7
            - 30
            - 90
      required:
        - items
        - summary
        - summaryWithheldReason
        - excludedAnswerFetches
        - pageLimit
        - pageLimitReached
        - pagination
        - window
        - windowDays
    Meta:
      type: object
      properties:
        timestamp:
          type: string
          format: date-time
        projectId:
          type: string
          format: uuid
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        reason:
          type: string
          description: >-
            Why the request was refused, for an error with more than one cause,
            such as a refused content-draft start.
        details:
          type: object
          additionalProperties: true
          description: >-
            Machine-readable facts about the refusal, such as shortfall_credits
            when an Agent Picks start is refused for insufficient_credits.
        status:
          type: integer
      required:
        - error
        - message
        - status
  responses:
    BadRequestError:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnauthorizedError:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ForbiddenError:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFoundError:
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimitExceededError:
      description: Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  headers:
    X-RateLimit-Limit:
      description: Maximum requests per window
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in current window
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp when the window resets
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key with dtk_live_ prefix. Obtain it from API Keys in the account
        sidebar. New keys start with all supported scopes selected for the
        chosen project, and you can narrow them to specific read/write scopes as
        needed.

````

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