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

# Query Sentiment

Per-brand sentiment as positive/negative percentages (0–100). `asset` is
**required** (sentiment is per-brand). Add `comparison_start_date` /
`comparison_end_date` to get a `previous` block on each row for
period-over-period deltas in a single call.

* **Metrics:** `positive_sentiment`, `negative_sentiment` (sum to 100 per row), and `occurrence` (opt-in; needs `theme`/`claim` grouping or filtering).
* **`group_by`:** up to two of `topic`, `region`, `model`, `prompt`, `persona`, `tag`, `theme`, `claim`, `run`, `competitor` (plus `date`).
* **Entity filters:** `theme` / `claim` accept `is`/`in`, single value, name or id.
* `include_cited_websites: true` adds `cited_websites` per row (with `theme`/`claim` grouping).

<Note>
  New to the v2 reports? See [Filtering & concepts](/rest-api/reports/reports-v2-overview) for the shared request shape, filter tree, grouping, and pagination.
</Note>

<Accordion title="Streaming (SSE) variant (same body, /stream)">
  `POST /v2/reports/sentiment/stream` takes the **same request body** and
  returns [Server-Sent Events](https://developer.mozilla.org/docs/Web/API/Server-sent_events):
  one `summary` event (the `info` block), then one `result` event per row.
  `limit`/`cursor` are ignored; it returns everything by default. Pass
  `max_results` to cap.

  ```text Response (text/event-stream) theme={null}
  event: summary
  data: { ...the info block... }

  event: result    ← one per row, same shape as data[] above
  data: {"theme": {"id": "a14e0c2d", "name": "Analytics"}, "rank": 1, "positive_sentiment": 95.4, "negative_sentiment": 4.6}
  ```
</Accordion>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.tryprofound.com/v2/reports/sentiment \
    -H "X-API-Key: <your-api-key>" \
    -H "Content-Type: application/json" \
    -d '{
      "category_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "asset": "Profound",
      "start_date": "2026-06-09",
      "end_date": "2026-06-15"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "info": {
      "total_results": 1,
      "count": 1,
      "next_cursor": null,
      "asset": "Profound",
      "models": ["ChatGPT", "Google Gemini", "Perplexity", "Claude", "..."],
      "metrics": ["positive_sentiment", "negative_sentiment"],
      "start_date": "2026-06-09",
      "end_date": "2026-06-15",
      "filter": null
    },
    "data": [
      {
        "positive_sentiment": 79.1,
        "negative_sentiment": 20.9
      }
    ]
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /v2/reports/sentiment
openapi: 3.1.0
info:
  title: External API
  version: 6c43b49565a0c4e7cb023e22242cc3df28ee7153
servers:
  - url: https://api.tryprofound.com
    description: Production Server
security: []
paths:
  /v2/reports/sentiment:
    post:
      tags:
        - Reports
        - Reports
      summary: Query Sentiment V2
      operationId: query_sentiment_v2_v2_reports_sentiment_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SentimentV2Query'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Query Sentiment V2 V2 Reports Sentiment Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - BearerAuth: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Profound from '@profoundai/client';

            const client = new Profound({
              apiKey: process.env['PROFOUND_API_KEY'], // This is the default and can be omitted
            });

            const response = await client.reports.querySentiment({
              asset: 'asset',
              category_id: 'category_id',
              end_date: 'end_date',
              start_date: 'start_date',
            });

            console.log(response);
        - lang: Python
          source: |-
            import os
            from profound import Profound

            client = Profound(
                api_key=os.environ.get("PROFOUND_API_KEY"),  # This is the default and can be omitted
            )
            response = client.reports.query_sentiment(
                asset="asset",
                category_id="category_id",
                end_date="end_date",
                start_date="start_date",
            )
            print(response)
components:
  schemas:
    SentimentV2Query:
      properties:
        category_id:
          type: string
          title: Category Id
        asset:
          type: string
          title: Asset
          description: The brand name to analyze (sentiment is extracted on name, not id).
        start_date:
          type: string
          title: Start Date
          description: YYYY-MM-DD, ET, inclusive
        end_date:
          type: string
          title: End Date
          description: YYYY-MM-DD, ET, inclusive
        comparison_start_date:
          anyOf:
            - type: string
            - type: 'null'
          title: Comparison Start Date
          description: YYYY-MM-DD, ET, inclusive (with end).
        comparison_end_date:
          anyOf:
            - type: string
            - type: 'null'
          title: Comparison End Date
          description: YYYY-MM-DD, ET, inclusive (with start).
        group_by:
          items:
            type: string
            enum:
              - date
              - model
              - topic
              - region
              - prompt
              - persona
              - tag
              - theme
              - claim
              - run
              - competitor
          type: array
          title: Group By
        metrics:
          anyOf:
            - items:
                type: string
                enum:
                  - positive_sentiment
                  - negative_sentiment
                  - occurrence
              type: array
            - type: 'null'
          title: Metrics
        interval:
          type: string
          enum:
            - day
            - week
            - month
          title: Interval
          default: day
        filter:
          anyOf:
            - $ref: '#/components/schemas/FilterNode'
            - type: 'null'
        sort:
          $ref: >-
            #/components/schemas/app__routes__v2__answer_engine_insights__reports__sentiment__SortSpec
        include_cited_websites:
          type: boolean
          title: Include Cited Websites
          description: >-
            Return cited websites per row (only when grouping by
            `theme`/`claim`).
          default: false
        limit:
          anyOf:
            - type: integer
              maximum: 50
              exclusiveMinimum: 0
            - type: 'null'
          title: Limit
          description: Page size; default 10, max 50.
        max_results:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Max Results
          description: >-
            Stream endpoint only: cap the number of streamed rows (default:
            all).
        cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Cursor
      additionalProperties: false
      type: object
      required:
        - category_id
        - asset
        - start_date
        - end_date
      title: SentimentV2Query
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FilterNode:
      properties:
        and:
          anyOf:
            - items:
                $ref: '#/components/schemas/FilterNode'
              type: array
            - type: 'null'
          title: And
        or:
          anyOf:
            - items:
                $ref: '#/components/schemas/FilterNode'
              type: array
            - type: 'null'
          title: Or
        not:
          anyOf:
            - $ref: '#/components/schemas/FilterNode'
            - type: 'null'
        field:
          anyOf:
            - type: string
            - type: 'null'
          title: Field
        op:
          anyOf:
            - type: string
            - type: 'null'
          title: Op
        value:
          title: Value
      additionalProperties: false
      type: object
      title: FilterNode
      description: A leaf (`field`/`op`/`value`) or an `and`/`or`/`not` group.
    app__routes__v2__answer_engine_insights__reports__sentiment__SortSpec:
      properties:
        field:
          type: string
          enum:
            - occurrence
            - positive_sentiment
            - negative_sentiment
          title: Field
          default: positive_sentiment
        dir:
          type: string
          enum:
            - asc
            - desc
          title: Dir
          default: desc
      type: object
      title: SortSpec
    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
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    BearerAuth:
      type: http
      scheme: bearer

````