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

# Sources (Category Distribution)

> Returns the distribution of cited source categories for a single brand across the requested date range, along with total source and response counts.



## OpenAPI

````yaml /openapi.json get /api/v1/projects/{project}/sources-data/category-distribution
openapi: 3.1.0
info:
  title: Surfacd Public API
  version: 1.0.0
  description: >-
    Public API for Surfacd. Team-scoped operations live under
    `/api/v1/team/...`; project collections live under `/api/v1/projects`;
    project-scoped operations live under `/api/v1/projects/{project}/...`. All
    endpoints require a Bearer team API key created in Team Settings. The API
    key selects the team for team-level and collection endpoints.
servers:
  - url: https://app.surfacd.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: Project management endpoints. Reads only in this version.
  - name: Prompts
    description: Prompt management endpoints. Reads only in this version.
  - name: Team
    description: Team settings and plan details for the current team.
  - name: Reporting
    description: >-
      Read-only reporting endpoints for projects (brand rankings, mentions,
      visibility, matrix analysis, source data).
  - name: Reference
    description: Reference data used by create, update, and reporting filters.
  - name: Tags
    description: Project tag management endpoints.
paths:
  /api/v1/projects/{project}/sources-data/category-distribution:
    parameters:
      - $ref: '#/components/parameters/ProjectUuid'
    get:
      tags:
        - Reporting
      summary: Sources (Category Distribution)
      description: >-
        Returns the distribution of cited source categories for a single brand
        across the requested date range, along with total source and response
        counts.
      operationId: v1ProjectsSourcesDataCategoryDistribution
      parameters:
        - name: brands
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
              format: uuid
            minItems: 1
            maxItems: 1
          description: Exactly one brand UUID. Pass as `brands[]=...`.
          style: form
          explode: true
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            format: date
        - name: tags
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
              format: uuid
          description: >-
            Tag UUID filters. Discover tag UUIDs with `GET
            /api/v1/projects/{project}/tags`.
          style: form
          explode: true
        - name: services
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
          description: >-
            AI platform provider filters such as `chatgpt` or `perplexity`.
            Discover providers with `GET /api/v1/platforms`.
          style: form
          explode: true
        - name: countries
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
          description: >-
            Country code filters such as `US` or `GB`. Discover codes with `GET
            /api/v1/countries`.
          style: form
          explode: true
        - name: prompt
          in: query
          required: false
          schema:
            type: string
            format: uuid
          description: Prompt UUID filter.
        - name: topics
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
          description: >-
            Topic UUID filters. Use `no_topic` for prompts without a topic.
            Discover topic UUIDs with `GET /api/v1/projects/{project}/topics`.
          style: form
          explode: true
      responses:
        '200':
          description: Category distribution payload.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceCategoryDistributionResponse'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  parameters:
    ProjectUuid:
      name: project
      in: path
      required: true
      description: Project UUID.
      schema:
        type: string
        format: uuid
  schemas:
    SourceCategoryDistributionResponse:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/SourceCategoryDistribution'
        total_sources:
          type: integer
        total_responses:
          type: integer
      required:
        - data
        - total_sources
        - total_responses
    SourceCategoryDistribution:
      type: object
      properties:
        category:
          oneOf:
            - $ref: '#/components/schemas/DomainCategory'
            - type: 'null'
        label:
          type: string
        count:
          type: integer
        percentage:
          type: number
          format: float
        responses_count:
          type: integer
        response_percentage:
          type: number
          format: float
        total_responses:
          type: integer
      required:
        - category
        - label
        - count
        - percentage
        - responses_count
        - response_percentage
        - total_responses
    ValidationError:
      type: object
      description: Returned when one or more request parameters fail validation.
      properties:
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - message
        - errors
    DomainCategory:
      type: string
      enum:
        - ugc
        - editorial
        - corporate
        - reference
        - academic
        - analyst
        - institutional
        - other
  responses:
    ValidationError:
      description: Validation failed.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: token
      description: >-
        Team API key created in Team Settings. Use it with URLs for the same
        team.

````