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

# Get Shopping Trend

> Return a product or brand shopping time series over a date range. Requires bucket and exactly one of product_ids or brand_ids.



## OpenAPI

````yaml https://api.peec.ai/customer/v1/openapi/json post /products/trend
openapi: 3.0.3
info:
  title: Peec AI Customer API
  description: Development documentation
  version: 1.0.0
  contact:
    name: Peec AI Team
    email: support@peec.ai
servers:
  - url: https://api.peec.ai/customer/v1
security: []
paths:
  /products/trend:
    post:
      tags:
        - Products
      summary: Get Shopping Trend
      description: >-
        Return a product or brand shopping time series over a date range.
        Requires bucket and exactly one of product_ids or brand_ids.
      operationId: postProductsTrend
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                project_id:
                  description: Required if using a company api key
                  example: or_f45b94ba-5e35-4982-93ed-285e72ee14eb
                  type: string
                start_date:
                  default: '2026-01-01'
                  description: >-
                    full-date notation as defined by RFC 3339, section 5.6, for
                    example, 2017-07-21
                  example: '2025-09-22'
                  type: string
                  format: date
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                end_date:
                  default: '2026-01-01'
                  description: >-
                    full-date notation as defined by RFC 3339, section 5.6, for
                    example, 2017-07-21
                  example: '2025-09-22'
                  type: string
                  format: date
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                category_ids:
                  description: >-
                    Filter by shopping categories. Parent categories include
                    descendants.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                country_codes:
                  type: array
                  items:
                    type: string
                model_channel_ids:
                  type: array
                  items:
                    type: string
                    enum:
                      - openai-0
                      - openai-1
                      - qwen-0
                      - openai-2
                      - perplexity-0
                      - perplexity-1
                      - google-0
                      - google-1
                      - google-2
                      - google-3
                      - anthropic-0
                      - anthropic-1
                      - deepseek-0
                      - meta-0
                      - xai-0
                      - xai-1
                      - microsoft-0
                      - amazon-0
                topic_ids:
                  type: array
                  items:
                    type: string
                tag_ids:
                  type: array
                  items:
                    type: string
                tag_operator:
                  type: string
                  enum:
                    - and
                    - or
                merchant_ids:
                  description: Filter to products sold through these merchants.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                bucket:
                  type: string
                  enum:
                    - day
                    - week
                    - month
                  description: Time-bucket granularity.
                brand_ids:
                  description: Global brands to chart.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                product_ids:
                  description: Products to chart.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                chat_scope:
                  description: >-
                    Which chats the visibility denominator counts: every
                    in-scope chat ('all') or only product-gallery ('shopping')
                    chats. Defaults to 'shopping'.
                  type: string
                  enum:
                    - all
                    - shopping
              required:
                - bucket
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                project_id:
                  description: Required if using a company api key
                  example: or_f45b94ba-5e35-4982-93ed-285e72ee14eb
                  type: string
                start_date:
                  default: '2026-01-01'
                  description: >-
                    full-date notation as defined by RFC 3339, section 5.6, for
                    example, 2017-07-21
                  example: '2025-09-22'
                  type: string
                  format: date
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                end_date:
                  default: '2026-01-01'
                  description: >-
                    full-date notation as defined by RFC 3339, section 5.6, for
                    example, 2017-07-21
                  example: '2025-09-22'
                  type: string
                  format: date
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                category_ids:
                  description: >-
                    Filter by shopping categories. Parent categories include
                    descendants.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                country_codes:
                  type: array
                  items:
                    type: string
                model_channel_ids:
                  type: array
                  items:
                    type: string
                    enum:
                      - openai-0
                      - openai-1
                      - qwen-0
                      - openai-2
                      - perplexity-0
                      - perplexity-1
                      - google-0
                      - google-1
                      - google-2
                      - google-3
                      - anthropic-0
                      - anthropic-1
                      - deepseek-0
                      - meta-0
                      - xai-0
                      - xai-1
                      - microsoft-0
                      - amazon-0
                topic_ids:
                  type: array
                  items:
                    type: string
                tag_ids:
                  type: array
                  items:
                    type: string
                tag_operator:
                  type: string
                  enum:
                    - and
                    - or
                merchant_ids:
                  description: Filter to products sold through these merchants.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                bucket:
                  type: string
                  enum:
                    - day
                    - week
                    - month
                  description: Time-bucket granularity.
                brand_ids:
                  description: Global brands to chart.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                product_ids:
                  description: Products to chart.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                chat_scope:
                  description: >-
                    Which chats the visibility denominator counts: every
                    in-scope chat ('all') or only product-gallery ('shopping')
                    chats. Defaults to 'shopping'.
                  type: string
                  enum:
                    - all
                    - shopping
              required:
                - bucket
          multipart/form-data:
            schema:
              type: object
              properties:
                project_id:
                  description: Required if using a company api key
                  example: or_f45b94ba-5e35-4982-93ed-285e72ee14eb
                  type: string
                start_date:
                  default: '2026-01-01'
                  description: >-
                    full-date notation as defined by RFC 3339, section 5.6, for
                    example, 2017-07-21
                  example: '2025-09-22'
                  type: string
                  format: date
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                end_date:
                  default: '2026-01-01'
                  description: >-
                    full-date notation as defined by RFC 3339, section 5.6, for
                    example, 2017-07-21
                  example: '2025-09-22'
                  type: string
                  format: date
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))$
                category_ids:
                  description: >-
                    Filter by shopping categories. Parent categories include
                    descendants.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                country_codes:
                  type: array
                  items:
                    type: string
                model_channel_ids:
                  type: array
                  items:
                    type: string
                    enum:
                      - openai-0
                      - openai-1
                      - qwen-0
                      - openai-2
                      - perplexity-0
                      - perplexity-1
                      - google-0
                      - google-1
                      - google-2
                      - google-3
                      - anthropic-0
                      - anthropic-1
                      - deepseek-0
                      - meta-0
                      - xai-0
                      - xai-1
                      - microsoft-0
                      - amazon-0
                topic_ids:
                  type: array
                  items:
                    type: string
                tag_ids:
                  type: array
                  items:
                    type: string
                tag_operator:
                  type: string
                  enum:
                    - and
                    - or
                merchant_ids:
                  description: Filter to products sold through these merchants.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                bucket:
                  type: string
                  enum:
                    - day
                    - week
                    - month
                  description: Time-bucket granularity.
                brand_ids:
                  description: Global brands to chart.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                product_ids:
                  description: Products to chart.
                  type: array
                  items:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                chat_scope:
                  description: >-
                    Which chats the visibility denominator counts: every
                    in-scope chat ('all') or only product-gallery ('shopping')
                    chats. Defaults to 'shopping'.
                  type: string
                  enum:
                    - all
                    - shopping
              required:
                - bucket
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  entity_type:
                    type: string
                    enum:
                      - product
                      - brand
                  series:
                    type: array
                    items:
                      type: object
                      properties:
                        entity_id:
                          type: string
                        points:
                          type: array
                          items:
                            type: object
                            properties:
                              date:
                                type: string
                              visibility:
                                type: number
                              win_rate:
                                type: number
                              avg_position:
                                nullable: true
                                type: number
                              sov:
                                type: number
                              has_data:
                                type: boolean
                            required:
                              - date
                              - visibility
                              - win_rate
                              - avg_position
                              - sov
                              - has_data
                      required:
                        - entity_id
                        - points
                required:
                  - entity_type
                  - series
                description: Success
      security:
        - APIKeyHeader: []
        - APIKeyQuery: []
        - BearerAuth: []
components:
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    APIKeyQuery:
      type: apiKey
      in: query
      name: api_key
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````