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

# Get ad impressions (synchronous)

> Returns ad impression data immediately using the api_ads mart view.



## OpenAPI

````yaml https://emerge-openapi-specs.s3.eu-central-1.amazonaws.com/query/1.21.0/openapi.json get /v1/sync/get_ads
openapi: 3.1.0
info:
  title: Emerge Query API
  description: >-
    Privacy-first API for retrieving consented user data. Query provides
    asynchronous and synchronous endpoints for accessing search, browsing,
    YouTube, ads, and receipt data.
  contact:
    name: Emerge Support
    email: account@emergedata.ai
  version: 1.21.0
servers:
  - url: https://query.emergedata.ai
    description: Query API - Data retrieval
security: []
tags:
  - name: Query Async
    description: Asynchronous data queries with job polling
  - name: Query Sync
    description: Synchronous data queries with immediate response
  - name: Jobs
    description: Job status and management
paths:
  /v1/sync/get_ads:
    get:
      tags:
        - Query Sync
      summary: Get ad impressions (synchronous)
      description: Returns ad impression data immediately using the api_ads mart view.
      operationId: endpoint_v1_sync_get_ads_get
      parameters:
        - name: begin
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter by event timestamp (start)
            title: Begin
          description: Filter by event timestamp (start)
        - name: end
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter by event timestamp (end)
            title: End
          description: Filter by event timestamp (end)
        - name: ingested_begin
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter by ingestion timestamp (start)
            title: Ingested Begin
          description: Filter by ingestion timestamp (start)
        - name: ingested_end
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Filter by ingestion timestamp (end), defaults to now()
            title: Ingested End
          description: Filter by ingestion timestamp (end), defaults to now()
        - name: uid
          in: query
          required: true
          schema:
            type: string
            description: Your user reference
            examples:
              - alice@yourcompany.com
            title: Uid
          description: Your user reference
        - name: category
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Category subtree to filter by
            examples:
              - /Shopping
              - /Finance/Investing
            title: Category
          description: Category subtree to filter by
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 10000
            minimum: 1
            description: Maximum number of rows to return
            default: 1000
            title: Limit
          description: Maximum number of rows to return
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Pagination cursor from previous response
            title: Cursor
          description: Pagination cursor from previous response
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdsDataResponse'
              examples:
                default:
                  summary: Example response
                  value:
                    data:
                      - user_id: psub_d4e5f6789012345678901234abcdef01
                        event_id: 402938
                        timestamp: '2026-02-10T09:30:11Z'
                        ingested_at: '2026-02-10T09:31:40Z'
                        source_domain: google.com
                        landing_domain: nike.com
                        url: https://www.nike.com/running
                        title: 20% Off Running Shoes
                        category: /Shopping/Apparel/Footwear
                        brands:
                          - Nike
                        ad_network: Google Ads
                    count: 1
                    next_cursor: null
                    has_more: false
                    applied_ingested_end: '2026-02-12T09:10:11Z'
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                detail: Invalid token
        '404':
          description: >-
            User Not Found – the provided UID has no mapping for the requesting
            client.
          content:
            application/json:
              example:
                detail: user_not_found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    AdsDataResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/AdsEvent'
          type: array
          title: Data
        count:
          type: integer
          title: Count
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
        has_more:
          type: boolean
          title: Has More
        applied_ingested_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Applied Ingested End
      type: object
      title: AdsDataResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AdsEvent:
      properties:
        user_id:
          type: string
          title: User Id
        event_id:
          type: integer
          title: Event Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        ingested_at:
          type: string
          format: date-time
          title: Ingested At
        source_domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Domain
        landing_domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Landing Domain
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
        category:
          anyOf:
            - type: string
            - type: 'null'
          title: Category
        brands:
          items:
            anyOf:
              - type: string
              - type: 'null'
          type: array
          title: Brands
        ad_network:
          anyOf:
            - type: string
            - type: 'null'
          title: Ad Network
      type: object
      title: AdsEvent
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      title: ValidationError
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        API token from the Control Room. Include as `Authorization: Bearer
        <token>`
      scheme: bearer

````