> ## 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 a page's Search Console queries

> Returns the Search Console queries one page ranks for in a fixed 30- or 90-day window, filtered to a position band and an impression floor, ordered by impressions. The defaults (positions 8 to 20, at least 20 impressions, 90 days) select queries where the page already ranks and an edit to the page can move it. Each query carries its current clicks, impressions and average position and the prior values when the prior window is measured and Search Console reported the query in it. status is not_connected when no active Search Console connection covers the host and path of the page, and unmeasured when the window is not fully verified at the current publication; queries are returned only when status is measured, so an empty list then means no query qualified. truncated is true when more queries qualified than limit. searchConsole reports the window dates and coverage the queries were read from. Requires the `traffic.read` scope.



## OpenAPI

````yaml /openapi.json get /projects/{projectId}/traffic/page-search-queries
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: []
tags:
  - name: Connection and usage
    description: >-
      The project a credential is bound to, its scopes and features, usage, and
      code-mode receipts.
  - name: Setup
    description: >-
      Brands, domains, brand terms, platforms, content sources and pausing a
      project.
  - name: Prompts and topics
    description: Tracked prompts, their topics, and prompt-set analysis.
  - name: Visibility
    description: >-
      Visibility metrics, AI answers, sentiment, competitive position and the
      project timeline.
  - name: Citations
    description: >-
      Citation statistics, the most-cited domains and pages, and cited lookalike
      sites.
  - name: Positioning
    description: How well AI answers match your positioning statements.
  - name: Accuracy
    description: Claims AI answers make about your brand, and contradictions.
  - name: Content gaps
    description: Topics, sources and brands where competitors are cited.
  - name: AI Traffic
    description: >-
      AI referrals, answer fetches, crawls, 404 Demand, Direct lift and Search
      Console totals.
  - name: Adoption
    description: npm downloads and GitHub stars for project domains.
  - name: Audit and pages
    description: Audit findings, Google eligibility, page metrics, and locked pages.
  - name: Actions
    description: Suggested and accepted work, briefs, drafts and pull requests.
  - name: Results
    description: Content changes, measured results and what works.
  - name: Agents
    description: Managed agents, their schedules and runs.
  - name: Dex
    description: Private Dex conversations, specialist handoffs and memory.
  - name: Agent Picks
    description: Agent Picks setup, tests, schedules and results.
  - name: Library and Knowledge
    description: Library items and the Knowledge Profile.
  - name: Webhooks
    description: Webhook subscriptions and signing secrets.
  - name: Agent registration
    description: Setup drafts for an unclaimed agent registration.
paths:
  /projects/{projectId}/traffic/page-search-queries:
    get:
      tags:
        - AI Traffic
      summary: Get a page's Search Console queries
      description: >-
        Returns the Search Console queries one page ranks for in a fixed 30- or
        90-day window, filtered to a position band and an impression floor,
        ordered by impressions. The defaults (positions 8 to 20, at least 20
        impressions, 90 days) select queries where the page already ranks and an
        edit to the page can move it. Each query carries its current clicks,
        impressions and average position and the prior values when the prior
        window is measured and Search Console reported the query in it. status
        is not_connected when no active Search Console connection covers the
        host and path of the page, and unmeasured when the window is not fully
        verified at the current publication; queries are returned only when
        status is measured, so an empty list then means no query qualified.
        truncated is true when more queries qualified than limit. searchConsole
        reports the window dates and coverage the queries were read from.
        Requires the `traffic.read` scope.
      operationId: getPageSearchQueries
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: pageUrl
          in: query
          required: true
          schema:
            type: string
            format: uri
            maxLength: 2048
          description: >-
            Absolute URL of the page. The host ignores case and a leading www;
            the path must match the page Search Console reports.
        - name: windowDays
          in: query
          schema:
            type: integer
            default: 90
            enum:
              - 30
              - 90
          description: >-
            Fixed rolling window in days. Supported values are 30 and 90.
            Defaults to 90.
        - name: minPosition
          in: query
          schema:
            type: number
            minimum: 1
            maximum: 100
            default: 8
          description: Lowest average position to include, inclusive.
        - name: maxPosition
          in: query
          schema:
            type: number
            minimum: 1
            maximum: 100
            default: 20
          description: Highest average position to include, inclusive.
        - name: minImpressions
          in: query
          schema:
            type: integer
            minimum: 0
            default: 20
          description: Fewest current-period impressions to include.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
          description: Most queries to return.
      responses:
        '200':
          description: The page's queries and the coverage they were read from
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - measured
                          - unmeasured
                          - not_connected
                        description: >-
                          measured when the window is verified at the current
                          publication; unmeasured when it is not; not_connected
                          when no active Search Console connection covers the
                          host and path of the page. Only measured returns
                          queries.
                      generation:
                        type: string
                        description: >-
                          Identifies the Search Console publication the queries
                          were read from.
                      page:
                        type: object
                        properties:
                          domain:
                            type: string
                            description: Host, lowercased, without www.
                          pagePath:
                            type: string
                            description: Page path, starting with /.
                        required:
                          - domain
                          - pagePath
                      filters:
                        type: object
                        description: The filters the read applied.
                        properties:
                          windowDays:
                            type: integer
                            enum:
                              - 30
                              - 90
                          minPosition:
                            type: number
                          maxPosition:
                            type: number
                          minImpressions:
                            type: integer
                          limit:
                            type: integer
                        required:
                          - windowDays
                          - minPosition
                          - maxPosition
                          - minImpressions
                          - limit
                      searchConsole:
                        $ref: '#/components/schemas/GscWindowPeriods'
                      pageQueryCount:
                        type:
                          - integer
                          - 'null'
                        description: >-
                          Queries the page had in the current period before
                          filtering. Null unless status is measured.
                      matchingCount:
                        type:
                          - integer
                          - 'null'
                        description: >-
                          Queries that passed the filters, before limit. Null
                          unless status is measured.
                      truncated:
                        type: boolean
                        description: True when matchingCount is greater than limit.
                      queries:
                        type: array
                        items:
                          type: object
                          properties:
                            query:
                              type: string
                            clicks:
                              type: integer
                            impressions:
                              type: integer
                            position:
                              type: number
                              description: >-
                                Average position, weighted by impressions; 1 is
                                the top result.
                            prior:
                              description: >-
                                The same query on this page in the prior period.
                                Null when the prior window is not measured or
                                Search Console reported none.
                              oneOf:
                                - type: 'null'
                                - type: object
                                  properties:
                                    clicks:
                                      type: integer
                                    impressions:
                                      type: integer
                                    position:
                                      type: number
                                  required:
                                    - clicks
                                    - impressions
                                    - position
                          required:
                            - query
                            - clicks
                            - impressions
                            - position
                            - prior
                    required:
                      - status
                      - generation
                      - page
                      - filters
                      - searchConsole
                      - pageQueryCount
                      - matchingCount
                      - truncated
                      - queries
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '429':
          $ref: '#/components/responses/RateLimitExceededError'
components:
  schemas:
    GscWindowPeriods:
      type: object
      required:
        - current
        - prior
        - delta
      description: >-
        Search Console totals for the current period and the same-length period
        before it.
      properties:
        current:
          $ref: '#/components/schemas/GscWindowPeriod'
        prior:
          $ref: '#/components/schemas/GscWindowPeriod'
        delta:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                clicks:
                  type: integer
                  description: Current clicks minus prior clicks.
                impressions:
                  type: integer
                  description: Current impressions minus prior impressions.
          description: >-
            Change in project totals from prior to current. Null unless both
            periods are measured.
    GscWindowPeriod:
      type: object
      description: 'One Search Console period: its totals and its dates.'
      required:
        - aggregates
        - window
      properties:
        aggregates:
          type: object
          description: Search Console totals for the project's properties.
          properties:
            clicks:
              type:
                - integer
                - 'null'
              description: >-
                Clicks from Google Search in the period. Null when no verified
                total has been published for the period. While
                measurement.status is unmeasured, a value here is from the last
                published totals, not current ones.
            impressions:
              type:
                - integer
                - 'null'
              description: >-
                Impressions in Google Search in the period. Null when no
                verified total has been published for the period. While
                measurement.status is unmeasured, a value here is from the last
                published totals, not current ones.
            ctr:
              type:
                - number
                - 'null'
              description: >-
                Clicks over impressions, from 0 to 1; 0 when there were no
                impressions. Null when no verified total has been published for
                the period. While measurement.status is unmeasured, a value here
                is from the last published totals, not current ones.
            avgPosition:
              type:
                - number
                - 'null'
              description: >-
                Average ranking position, weighted by impressions; 1 is the top
                result, and 0 means there were no impressions. Null when no
                verified total has been published for the period. While
                measurement.status is unmeasured, a value here is from the last
                published totals, not current ones.
            measurement:
              $ref: '#/components/schemas/GscMeasurement'
        window:
          type: object
          description: The period, in Pacific-time Search Console days.
          properties:
            days:
              type: integer
              enum:
                - 7
                - 30
                - 90
            dateFrom:
              type: string
              format: date
              description: First day of the period.
            dateTo:
              type: string
              format: date
              description: Last day of the period, included.
    Error:
      type: object
      properties:
        error:
          type: string
          description: >-
            Machine-readable error code, such as bad_request, unauthorized,
            forbidden, not_found, conflict, payment_required,
            rate_limit_exceeded or internal_error. Some endpoints return their
            own codes, listed in their descriptions.
        message:
          type: string
          description: >-
            What went wrong, for a person to read. Do not parse it; use error
            and reason.
        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 failure or refusal, such as
            retryable or shortfall_credits.
          properties:
            retryable:
              type: boolean
              description: >-
                Read this field before retrying. Present on every 5xx and 429
                response: true when another attempt may succeed, false for a
                permanent refusal even on a 5xx. Other refusals may also provide
                this field.
            retryAfterSeconds:
              type: integer
              minimum: 1
              description: >-
                Seconds to wait when retryable is true on a 429 or 503 response,
                also sent in Retry-After. Uses the provider retry time or
                limiter reset when available; otherwise 60 seconds for 429 and
                GitHub throttles or 30 seconds for other 503 responses. GitHub
                secondary limits wait at least 60 seconds.
        status:
          type: integer
          description: The HTTP status code, repeated in the body.
      required:
        - error
        - message
        - status
    GscMeasurement:
      type: object
      description: Whether the Search Console totals are verified and current.
      required:
        - availability
        - status
        - isCurrent
        - asOfDate
        - explanation
        - contributors
        - coveredRanges
        - storedEvidence
        - sourceDateFrom
        - sourceDateTo
        - finalityBoundary
      properties:
        availability:
          type: string
          enum:
            - unavailable
            - partial
            - verified_zero
            - measured
          description: >-
            measured: the totals are verified for the whole source window.
            verified_zero: verified, and clicks and impressions are both 0.
            partial: some days are verified or DevTune holds unverified data for
            the window, or the totals are earlier ones, not current.
            unavailable: nothing is verified or stored; report the period as
            unmeasured.
        status:
          type: string
          enum:
            - unmeasured
            - measured
          description: >-
            measured when availability is measured or verified_zero. Use
            availability instead when reporting evidence.
        isCurrent:
          type: boolean
          description: >-
            False when these are earlier totals rather than current ones, or
            when no totals have been published yet.
        asOfDate:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the Search Console totals were published. Null when none have
            been.
        explanation:
          type: string
          description: >-
            A sentence describing availability, for a person to read. Do not
            parse it.
        coverageFrom:
          type:
            - string
            - 'null'
          format: date
          description: >-
            First day every contributing Search Console connection has verified
            data for. Null when any of them has none, or when no totals have
            been published.
        coverageThrough:
          type:
            - string
            - 'null'
          format: date
          description: >-
            Last day every contributing Search Console connection has verified
            data for. Null when any of them has none, or when no totals have
            been published.
        sourceDateFrom:
          type:
            - string
            - 'null'
          format: date
          description: First day of the Search Console window, in Pacific time.
        sourceDateTo:
          type:
            - string
            - 'null'
          format: date
          description: Last day of the Search Console window, in Pacific time.
        finalityBoundary:
          type:
            - string
            - 'null'
          format: date
          description: >-
            The last day whose Search Console data is final, in Pacific time,
            for both the current and prior periods.
        contributors:
          type: array
          description: >-
            One entry for each Search Console connection behind the totals, with
            the days it covers, followed by a storedData entry for the data
            DevTune holds and a publication entry. Only the publication entry is
            present when no totals have been published.
          items:
            type: object
            additionalProperties: true
        coveredRanges:
          type: array
          description: >-
            Each contributing connection's verified days, clipped to the window.
            Ranges that overlap do not show that the whole project is covered.
          items:
            type: object
            properties:
              connectionId:
                type:
                  - string
                  - 'null'
                description: >-
                  The contributing Search Console connection. Null when it was
                  not recorded.
              dateFrom:
                type: string
                format: date
                description: First verified day in the window.
              dateTo:
                type: string
                format: date
                description: Last verified day in the window.
        storedEvidence:
          type: array
          description: >-
            The first and last days DevTune holds any data for. It does not mean
            every day between them is covered, and it is not part of the
            verified totals.
          items:
            type: object
            additionalProperties: true
  responses:
    BadRequestError:
      description: >-
        The request is invalid: a parameter or body field is missing, has the
        wrong type or is out of range, or a cursor doesn't match this list. The
        message says which; reason, where present, is listed in the endpoint's
        description. Fix the request before retrying, and restart a list without
        its cursor. See [Errors](/api-reference/errors).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnauthorizedError:
      description: >-
        The request has no valid credential: the Authorization header is missing
        or malformed, or the API key or OAuth token is invalid, expired or
        revoked. Send `Authorization: Bearer <API key>` with an active key, or
        sign in again to get a new OAuth token. See
        [Errors](/api-reference/errors).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ForbiddenError:
      description: >-
        The credential is valid but can't make this request. The message says
        which cause applies: the key or sign-in lacks the scope this endpoint
        requires (named in the message), it belongs to another project, the plan
        doesn't include API access or this feature, the project is paused (a
        paused project keeps only read scopes and setup.write), or the member a
        write acts as no longer has the role it needs. Read `GET
        /projects/{projectId}/connection` for the credential's current scopes
        and features, then use a key that has the scope, sign in again and
        approve it, or upgrade the plan. See [Errors](/api-reference/errors).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimitExceededError:
      description: >-
        Too many requests from this credential in the current window. The
        request was refused before it took effect, so it is safe to retry: wait
        the seconds in Retry-After, then send it again. Endpoints that start
        agent runs have a stricter limit. See [Rate
        limits](/api-reference/rate-limits).
      headers:
        Retry-After:
          description: Seconds to wait before retrying a 429 or retryable 503 response.
          schema:
            type: integer
            minimum: 1
        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.