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

# Get AI Traffic Analytics

> Visits and crawls from AI assistants and search engines: totals, a daily trend, breakdowns by source, route, country, and product, and recent events. Matches the AI Traffic page. Requires `analytics:read`.

A range covers at most 365 days; a longer one is shortened to the last 365 days. Read the applied range from `data.filters`.



## OpenAPI

````yaml /openapi.json get /api/v1/analytics/ai-traffic
openapi: 3.1.0
info:
  title: OmniCommerce API
  version: 1.0.0
  license:
    name: Proprietary
    url: https://omnicommerce.sg/terms
  description: >-
    OmniCommerce API surface for agents and developer integrations. Includes
    public endpoints (merchant discovery, product search, compare, catalog, ACO
    retrieval) and authenticated endpoints (product management via API key
    Bearer tokens).
servers:
  - url: https://omnicommerce.sg
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags:
  - name: agentic-checkout
    description: Merchant-fulfilled agentic checkout
    x-group: Agentic Checkout
  - name: agents
    description: agents
    x-group: Agents
  - name: analytics
    description: Sales performance across marketplaces
    x-group: Analytics
  - name: aops
    description: Agent operating procedures
    x-group: AOPs
  - name: campaigns
    description: Campaign briefs, offer windows, and marketplace runs
    x-group: Campaigns
  - name: developer-platform
    description: Authenticated developer platform APIs
    x-group: Developer Platform
  - name: looks
    description: AI-styled product looks
    x-group: Looks
  - name: oauth
    description: OAuth token endpoints
    x-group: OAuth
  - name: orders
    description: Workspace and agentic orders
    x-group: Orders
  - name: organizations
    description: Organization management
    x-group: Organizations
  - name: price-books
    description: Marketplace list-price markup rules
    x-group: Price Books
  - name: products
    description: Product CRUD, bulk import, enrichment, publish, and delist
    x-group: Products
  - name: promotions
    description: Central promotions and marketplace sync
    x-group: Promotions
  - name: public-agent
    description: Public agent discovery and catalog APIs
    x-group: Public Agent
  - name: returns
    description: returns
    x-group: Returns
  - name: reviews
    description: Marketplace product reviews and seller replies
    x-group: Reviews
  - name: settlements
    description: settlements
    x-group: Settlements
  - name: ucp
    description: Universal Commerce Protocol
    x-group: UCP
paths:
  /api/v1/analytics/ai-traffic:
    get:
      tags:
        - analytics
      summary: Get AI Traffic Analytics
      description: >-
        Visits and crawls from AI assistants and search engines: totals, a daily
        trend, breakdowns by source, route, country, and product, and recent
        events. Matches the AI Traffic page. Requires `analytics:read`.


        A range covers at most 365 days; a longer one is shortened to the last
        365 days. Read the applied range from `data.filters`.
      operationId: get_v1_analytics_ai_traffic
      parameters:
        - name: organizationId
          in: query
          required: false
          description: >-
            Required for session auth. API keys already belong to one
            organization.
          schema:
            type: string
            maxLength: 160
        - name: from
          in: query
          required: false
          description: >-
            First day of the range (YYYY-MM-DD). Defaults to 29 days before
            `to`.
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
        - name: to
          in: query
          required: false
          description: Last day of the range, inclusive (YYYY-MM-DD). Defaults to today.
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
        - name: timeZone
          in: query
          required: false
          description: >-
            IANA time zone that defines each day, for example
            `Asia/Kuala_Lumpur`. Defaults to Asia/Singapore.
          schema:
            type: string
            maxLength: 80
        - name: source
          in: query
          required: false
          description: One AI source id from `data.filterOptions.sources`.
          schema:
            type: string
            maxLength: 120
        - name: trafficType
          in: query
          required: false
          schema:
            type: string
            enum:
              - indexing
              - click_through
              - page_view
              - assistant
        - name: route
          in: query
          required: false
          description: One route key from `data.filterOptions.routes`.
          schema:
            type: string
            maxLength: 120
        - name: country
          in: query
          required: false
          description: ISO country code of the visit.
          schema:
            type: string
            maxLength: 8
      responses:
        '200':
          description: Get AI Traffic Analytics
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                  apiVersion:
                    type: string
                    const: developer_v1
                  operationId:
                    type: string
                  status:
                    type: string
                    enum:
                      - accepted
                      - completed
                      - failed
                  jobId:
                    type: string
                  productId:
                    type: string
                  warnings:
                    type: array
                    items:
                      type: string
                  recommendations:
                    type: array
                    items:
                      type: string
                  links:
                    type: object
                    propertyNames:
                      type: string
                    additionalProperties:
                      type: string
                  data:
                    type: object
                    properties:
                      filters:
                        type: object
                        properties:
                          from:
                            type: string
                          to:
                            type: string
                          source:
                            type: string
                          trafficType:
                            type: string
                          route:
                            type: string
                          country:
                            type: string
                          timeZone:
                            type: string
                        required:
                          - from
                          - to
                          - source
                          - trafficType
                          - route
                          - country
                          - timeZone
                      filterOptions:
                        type: object
                        properties:
                          sources:
                            type: array
                            items:
                              type: object
                              properties:
                                value:
                                  type: string
                                label:
                                  type: string
                              required:
                                - value
                                - label
                          routes:
                            type: array
                            items:
                              type: object
                              properties:
                                value:
                                  type: string
                                label:
                                  type: string
                              required:
                                - value
                                - label
                          countries:
                            type: array
                            items:
                              type: object
                              properties:
                                value:
                                  type: string
                                label:
                                  type: string
                              required:
                                - value
                                - label
                        required:
                          - sources
                          - routes
                          - countries
                      summary:
                        type: object
                        properties:
                          totalEvents:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          totalHits:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          pageViews:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          productPageViews:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          productsViewed:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          referredSessions:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          indexingHits:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          assistantHits:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          clickThroughs:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          productsRequested:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          productsWithReferrals:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          attributableHits:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          uniqueSources:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          uniqueRoutes:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          uniqueProducts:
                            type: integer
                            minimum: -9007199254740991
                            maximum: 9007199254740991
                          topSource:
                            anyOf:
                              - type: string
                              - type: 'null'
                          topRoute:
                            anyOf:
                              - type: string
                              - type: 'null'
                          topCountry:
                            anyOf:
                              - type: string
                              - type: 'null'
                          lastSeenAt:
                            anyOf:
                              - type: string
                              - type: 'null'
                        required:
                          - totalEvents
                          - totalHits
                          - pageViews
                          - productPageViews
                          - productsViewed
                          - referredSessions
                          - indexingHits
                          - assistantHits
                          - clickThroughs
                          - productsRequested
                          - productsWithReferrals
                          - attributableHits
                          - uniqueSources
                          - uniqueRoutes
                          - uniqueProducts
                          - topSource
                          - topRoute
                          - topCountry
                          - lastSeenAt
                      trend:
                        type: array
                        items:
                          type: object
                          properties:
                            date:
                              type: string
                            label:
                              type: string
                            hits:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            attributableHits:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                            uniqueSources:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - date
                            - label
                            - hits
                            - attributableHits
                            - uniqueSources
                      sourceBreakdown:
                        type: array
                        items:
                          type: object
                          properties:
                            value:
                              type: string
                            label:
                              type: string
                            count:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - value
                            - label
                            - count
                      routeBreakdown:
                        type: array
                        items:
                          type: object
                          properties:
                            value:
                              type: string
                            label:
                              type: string
                            count:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - value
                            - label
                            - count
                      countryBreakdown:
                        type: array
                        items:
                          type: object
                          properties:
                            value:
                              type: string
                            label:
                              type: string
                            count:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - value
                            - label
                            - count
                      productBreakdown:
                        type: array
                        items:
                          type: object
                          properties:
                            productId:
                              type: string
                            productName:
                              type: string
                            count:
                              type: integer
                              minimum: -9007199254740991
                              maximum: 9007199254740991
                          required:
                            - productId
                            - productName
                            - count
                      recentEvents:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                            occurredAt:
                              type: string
                            sourceLabel:
                              type: string
                            trafficType:
                              type: string
                            operator:
                              type: string
                            routeLabel:
                              type: string
                            path:
                              type: string
                            countryCode:
                              anyOf:
                                - type: string
                                - type: 'null'
                            referrer:
                              anyOf:
                                - type: string
                                - type: 'null'
                            inferredKeyword:
                              anyOf:
                                - type: string
                                - type: 'null'
                            inferredIntent:
                              anyOf:
                                - type: object
                                  properties:
                                    label:
                                      type: string
                                    source:
                                      type: string
                                    confidence:
                                      anyOf:
                                        - type: number
                                        - type: 'null'
                                  required:
                                    - label
                                    - source
                                    - confidence
                                - type: 'null'
                            productId:
                              anyOf:
                                - type: string
                                - type: 'null'
                            productName:
                              anyOf:
                                - type: string
                                - type: 'null'
                          required:
                            - id
                            - occurredAt
                            - sourceLabel
                            - trafficType
                            - operator
                            - routeLabel
                            - path
                            - countryCode
                            - referrer
                            - inferredKeyword
                            - inferredIntent
                            - productId
                            - productName
                      dataFreshness:
                        type: object
                        properties:
                          metricsAvailable:
                            type: boolean
                          notes:
                            type: array
                            items:
                              type: string
                        required:
                          - metricsAvailable
                          - notes
                    required:
                      - filters
                      - filterOptions
                      - summary
                      - trend
                      - sourceBreakdown
                      - routeBreakdown
                      - countryBreakdown
                      - productBreakdown
                      - recentEvents
                      - dataFreshness
                required:
                  - ok
                  - apiVersion
                  - operationId
                  - status
                  - warnings
                  - recommendations
                  - links
                  - data
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '403':
          description: Missing the `analytics:read` scope
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal Server Error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Bearer API key for server-to-server access. Session auth is also
        supported in first-party UI flows.

````

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