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

# Obtenir une veille publicitaire

> Lisez une veille avec sa dernière exécution.



## OpenAPI

````yaml GET /v1/ad-watches/{id}
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/ad-watches/{id}:
    get:
      tags:
        - Ad watches
      summary: Get an ad watch
      description: One watch with its schedule state, counters and last run.
      operationId: getAdWatch
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Watch id from GET /v1/ad-watches.
      responses:
        '200':
          description: The watch and its last run.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdWatchDetailResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/AdWatchNotFound'
components:
  schemas:
    AdWatchDetailResponse:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          const: true
        data:
          type: object
          properties:
            watch:
              $ref: '#/components/schemas/AdWatchDetail'
          required:
            - watch
    AdWatchDetail:
      allOf:
        - $ref: '#/components/schemas/AdWatch'
        - type: object
          properties:
            lastRun:
              oneOf:
                - $ref: '#/components/schemas/AdWatchRun'
                - type: 'null'
              description: The most recent run, or null before the first run starts.
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    AdWatch:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        platform:
          $ref: '#/components/schemas/AdWatchPlatform'
        search:
          $ref: '#/components/schemas/AdWatchSearch'
        maxAds:
          type: integer
          minimum: 1
          maximum: 1000
        intervalHours:
          type: integer
          const: 24
          description: Hours between runs. 24 is the only value.
        stopAfterRuns:
          type: integer
          minimum: 1
          maximum: 10
          description: >-
            Meta and LinkedIn: consecutive COMPLETE runs that must miss an ad
            before it counts as stopped.
        archiveMedia:
          type: boolean
        enabled:
          type: boolean
        disabledReason:
          type:
            - string
            - 'null'
          description: >-
            Why the watch was disabled, for example after five failed runs in a
            row.
        webhookUrl:
          type:
            - string
            - 'null'
        nextRunAt:
          type:
            - string
            - 'null'
          format: date-time
        lastRunAt:
          type:
            - string
            - 'null'
          format: date-time
        lastRunStatus:
          type:
            - string
            - 'null'
          enum:
            - RUNNING
            - COMPLETE
            - PARTIAL
            - SUSPECT
            - FAILED
            - null
        runCount:
          type: integer
        activeAdCount:
          type: integer
        stoppedAdCount:
          type: integer
        estimatedCreditsPerRun:
          type: number
          description: >-
            Upper bound for a full run of maxAds: 0.5 credits for every 30 ads,
            plus 0.5 for every 5 ads read in detail when search.details is true.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    AdWatchRun:
      type: object
      properties:
        id:
          type: string
        runNumber:
          type: integer
          description: >-
            1 is the baseline run, which records the starting state and sends no
            events.
        window:
          type: string
          format: date-time
          description: The scheduled start of the run.
        status:
          type: string
          enum:
            - RUNNING
            - COMPLETE
            - PARTIAL
            - SUSPECT
            - FAILED
          description: >-
            COMPLETE: the library listed every ad. PARTIAL: the run stopped at
            maxAds while the library listed more. SUSPECT: a complete run that
            would stop more than half of 10 or more active ads, or that returned
            nothing while ads were active; ignored for stop counting. FAILED: a
            search page failed after retries. Only COMPLETE runs stop ads on the
            disappearance rule.
        adsSeen:
          type: integer
        totalCount:
          type:
            - integer
            - 'null'
          description: The library's own count of ads for the search, when it reports one.
        truncated:
          type: boolean
          description: True when the run stopped at maxAds with more ads listed.
        newCount:
          type: integer
        stoppedCount:
          type: integer
        changedCount:
          type: integer
        startedAt:
          type:
            - string
            - 'null'
          format: date-time
        finishedAt:
          type:
            - string
            - 'null'
          format: date-time
        error:
          type:
            - string
            - '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
    AdWatchPlatform:
      type: string
      enum:
        - meta_ad_library
        - google_ads_transparency
        - linkedin_ad_library
        - tiktok_ad_library
      description: >-
        The ad library a watch reads. tiktok_creative_center is a ranked sample
        of top ads and is rejected with 400 VALIDATION_ERROR.
    AdWatchSearch:
      type: object
      additionalProperties: true
      description: >-
        The ADS search fields of the watch platform, such as pageId, pageIds,
        advertiserId, advertiserIds, domain, query, advertiserName, payer,
        country, mediaType, publisherPlatforms and startDate, and details: true
        to read each ad's detail. The watch sets action, limit and cursor
        itself, and sets activeStatus to active on Meta and TikTok. Fixed for
        the life of the watch.
      examples:
        - pageId: '123456789012345'
          country: US
  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'
    AdWatchNotFound:
      description: >-
        No ad watch, ad, event or archived file with that id for this key. A
        watch owned by another account is reported the same way rather than as a
        403.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            error:
              code: NOT_FOUND
              message: No ad watch with that id
              timestamp: '2026-11-23T09:00: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.