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



## OpenAPI

````yaml https://app.stainless.com/api/spec/documented/profound/openapi.documented.yml post /v1/reports/query-fanouts
openapi: 3.1.0
info:
  title: External API
  version: aba5aaa2ef33ad3764bec321dee68f74d19b7c15
servers:
  - url: https://api.tryprofound.com
    description: Production Server
security: []
paths:
  /v1/reports/query-fanouts:
    post:
      tags:
        - Reports
      summary: Query Fanouts
      operationId: query_fanouts_v1_reports_query_fanouts_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/QueryFanoutsQuery'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Response'
        '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 reportResponse = await client.reports.queryFanouts({
              category_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
              end_date: '2019-12-27T18:11:19.117Z',
              metrics: ['fanouts_per_execution'],
              start_date: '2019-12-27T18:11:19.117Z',
            });

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

            client = Profound(
                api_key=os.environ.get("PROFOUND_API_KEY"),  # This is the default and can be omitted
            )
            report_response = client.reports.query_fanouts(
                category_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                end_date=datetime.fromisoformat("2019-12-27T18:11:19.117"),
                metrics=["fanouts_per_execution"],
                start_date=datetime.fromisoformat("2019-12-27T18:11:19.117"),
            )
            print(report_response.data)
components:
  schemas:
    QueryFanoutsQuery:
      properties:
        date_interval:
          type: string
          enum:
            - hour
            - day
            - week
            - month
            - quarter
            - year
            - relative_week
          title: Date Interval
          description: Date interval for the report. (only used with date dimension)
          default: day
        dimensions:
          items:
            type: string
            enum:
              - prompt
              - query
              - model
              - region
              - date
          type: array
          title: Dimensions
          description: Dimensions to group the report by.
          default: []
        metrics:
          items:
            type: string
            enum:
              - fanouts_per_execution
              - total_fanouts
              - share
              - query_variations
          type: array
          title: Metrics
        order_by:
          additionalProperties:
            type: string
            enum:
              - asc
              - desc
          propertyNames:
            enum:
              - fanouts_per_execution
              - total_fanouts
              - share
              - query_variations
              - date
          type: object
          title: Order By
          description: >-
            Custom ordering. Keys must be a requested metric or the ``date``
            dimension. Values are ``asc`` or ``desc``. Defaults to first metric
            descending.
          default: {}
          examples:
            - fanouts_per_execution: desc
        pagination:
          $ref: '#/components/schemas/Pagination'
          description: Pagination settings for the report results.
        category_id:
          type: string
          format: uuid
          title: Category Id
        start_date:
          type: string
          format: date-time
          title: Start Date
          description: Start date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
        end_date:
          type: string
          format: date-time
          title: End Date
          description: End date. Accepts YYYY-MM-DD, YYYY-MM-DD HH:MM, or ISO timestamp.
        filters:
          items:
            oneOf:
              - $ref: '#/components/schemas/RegionIdFilter'
              - $ref: '#/components/schemas/RegionNameFilter'
              - $ref: '#/components/schemas/ModelIdFilter'
              - $ref: '#/components/schemas/TopicIdFilter'
              - $ref: '#/components/schemas/TagIdFilter'
              - $ref: '#/components/schemas/PromptIdFilter'
              - $ref: '#/components/schemas/PersonaIdFilter'
              - $ref: '#/components/schemas/AnalysisTypeFilter'
              - $ref: '#/components/schemas/PromptTypeFilter'
            discriminator:
              propertyName: field
              mapping:
                analysis_type:
                  $ref: '#/components/schemas/AnalysisTypeFilter'
                model:
                  $ref: '#/components/schemas/ModelIdFilter'
                model_id:
                  $ref: '#/components/schemas/ModelIdFilter'
                persona_id:
                  $ref: '#/components/schemas/PersonaIdFilter'
                prompt_id:
                  $ref: '#/components/schemas/PromptIdFilter'
                prompt_type:
                  $ref: '#/components/schemas/PromptTypeFilter'
                region:
                  $ref: '#/components/schemas/RegionIdFilter'
                region_id:
                  $ref: '#/components/schemas/RegionIdFilter'
                region_name:
                  $ref: '#/components/schemas/RegionNameFilter'
                tag:
                  $ref: '#/components/schemas/TagIdFilter'
                tag_id:
                  $ref: '#/components/schemas/TagIdFilter'
                topic:
                  $ref: '#/components/schemas/TopicIdFilter'
                topic_id:
                  $ref: '#/components/schemas/TopicIdFilter'
          type: array
          title: Filters
          description: Filters to apply to the query fanout report.
      type: object
      required:
        - metrics
        - category_id
        - start_date
        - end_date
      title: QueryFanoutsQuery
    Response:
      properties:
        info:
          $ref: '#/components/schemas/Info'
        data:
          items:
            $ref: '#/components/schemas/Result'
          type: array
          title: Data
      type: object
      required:
        - info
        - data
      title: Response
      description: Base response model for reports.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Pagination:
      properties:
        limit:
          type: integer
          maximum: 50000
          exclusiveMinimum: 0
          title: Limit
          description: >-
            Maximum number of results to return. Default is 10,000, maximum is
            50,000.
          default: 10000
        offset:
          type: integer
          minimum: 0
          title: Offset
          description: Offset for the results. Used for pagination.
          default: 0
      type: object
      title: Pagination
      description: Offset-based pagination parameters.
    RegionIdFilter:
      properties:
        field:
          anyOf:
            - type: string
              const: region_id
            - type: string
              const: region
              deprecated: true
          title: Field
        operator:
          type: string
          enum:
            - is
            - not_is
            - in
            - not_in
          title: Operator
        value:
          anyOf:
            - type: string
              format: uuid
            - items:
                type: string
                format: uuid
              type: array
          title: Value
      type: object
      required:
        - field
        - operator
        - value
      title: RegionIdFilter
      description: Filter by region UUID.
    RegionNameFilter:
      properties:
        field:
          type: string
          const: region_name
          title: Field
        operator:
          type: string
          enum:
            - is
            - not_is
            - in
            - not_in
            - contains
            - not_contains
            - matches
            - contains_case_insensitive
            - not_contains_case_insensitive
          title: Operator
        value:
          anyOf:
            - type: string
            - items:
                type: string
              type: array
          title: Value
      type: object
      required:
        - field
        - operator
        - value
      title: RegionNameFilter
      description: Filter by region name.
    ModelIdFilter:
      properties:
        field:
          anyOf:
            - type: string
              const: model_id
            - type: string
              const: model
              deprecated: true
          title: Field
        operator:
          type: string
          enum:
            - is
            - not_is
            - in
            - not_in
          title: Operator
        value:
          anyOf:
            - type: string
              format: uuid
            - items:
                type: string
                format: uuid
              type: array
          title: Value
      type: object
      required:
        - field
        - operator
        - value
      title: ModelIdFilter
      description: Filter by AI model/platform UUID.
    TopicIdFilter:
      properties:
        field:
          anyOf:
            - type: string
              const: topic_id
            - type: string
              const: topic
              deprecated: true
          title: Field
        operator:
          type: string
          enum:
            - is
            - not_is
            - in
            - not_in
          title: Operator
        value:
          anyOf:
            - type: string
              format: uuid
            - items:
                type: string
                format: uuid
              type: array
          title: Value
      type: object
      required:
        - field
        - operator
        - value
      title: TopicIdFilter
      description: Filter by topic UUID.
    TagIdFilter:
      properties:
        field:
          anyOf:
            - type: string
              const: tag_id
            - type: string
              const: tag
              deprecated: true
          title: Field
        operator:
          type: string
          enum:
            - is
            - not_is
            - in
            - not_in
          title: Operator
        value:
          anyOf:
            - type: string
              format: uuid
            - items:
                type: string
                format: uuid
              type: array
          title: Value
      type: object
      required:
        - field
        - operator
        - value
      title: TagIdFilter
      description: Filter by tag (prompt group) UUID.
    PromptIdFilter:
      properties:
        field:
          type: string
          const: prompt_id
          title: Field
        operator:
          type: string
          enum:
            - is
            - not_is
            - in
            - not_in
          title: Operator
        value:
          anyOf:
            - type: string
              format: uuid
            - items:
                type: string
                format: uuid
              type: array
          title: Value
      type: object
      required:
        - field
        - operator
        - value
      title: PromptIdFilter
      description: Filter by prompt UUID.
    PersonaIdFilter:
      properties:
        field:
          type: string
          const: persona_id
          title: Field
        operator:
          type: string
          enum:
            - is
            - not_is
            - in
            - not_in
          title: Operator
        value:
          anyOf:
            - type: string
              format: uuid
            - items:
                type: string
                format: uuid
              type: array
          title: Value
      type: object
      required:
        - field
        - operator
        - value
      title: PersonaIdFilter
      description: Filter by persona UUID.
    AnalysisTypeFilter:
      properties:
        field:
          type: string
          const: analysis_type
          title: Field
        operator:
          type: string
          enum:
            - is
            - not_is
            - in
            - not_in
            - contains
            - not_contains
            - matches
            - contains_case_insensitive
            - not_contains_case_insensitive
          title: Operator
        value:
          anyOf:
            - type: string
              enum:
                - visibility
                - sentiment
                - sentiment_v2
                - accuracy
            - items:
                type: string
                enum:
                  - visibility
                  - sentiment
                  - sentiment_v2
                  - accuracy
              type: array
          title: Value
      type: object
      required:
        - field
        - operator
        - value
      title: AnalysisTypeFilter
      description: Filter by analysis type (visibility, sentiment, or accuracy).
    PromptTypeFilter:
      properties:
        field:
          type: string
          const: prompt_type
          title: Field
        operator:
          type: string
          enum:
            - is
            - not_is
            - in
            - not_in
            - contains
            - not_contains
            - matches
            - contains_case_insensitive
            - not_contains_case_insensitive
          title: Operator
        value:
          anyOf:
            - type: string
              enum:
                - visibility
                - sentiment
            - items:
                type: string
                enum:
                  - visibility
                  - sentiment
              type: array
          title: Value
      type: object
      required:
        - field
        - operator
        - value
      title: PromptTypeFilter
      description: |-
        Filter by prompt type (visibility or sentiment).

        .. deprecated::
            Use :class:`AnalysisTypeFilter` instead. ``prompt_type`` is normalised
            to ``analysis_type`` at parse time.
    Info:
      properties:
        total_rows:
          type: integer
          title: Total Rows
        query:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Query
      type: object
      required:
        - total_rows
      title: Info
      description: Base model for report information.
    Result:
      properties:
        metrics:
          items:
            anyOf:
              - type: integer
              - type: number
              - type: string
          type: array
          title: Metrics
        dimensions:
          items:
            anyOf:
              - type: string
              - type: string
                format: uuid
          type: array
          title: Dimensions
      type: object
      required:
        - metrics
        - dimensions
      title: Result
      description: Base model for report results.
    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

````