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

# Get Royalties grouped by product

> **Get Royalties grouped by product**

<Note>
  This endpoint requires authentication. Include your Bearer token in the Authorization header.
</Note>

## Description

**Get Royalties grouped by product**

This endpoint retrieves royalty data grouped by product (albums, singles, etc.), showing revenue breakdown per product.

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.royalti.io/royalty/product', {
    method: 'GET',
    headers: {
      'Authorization': `Bearer ${token}`,
    },
  });

  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
    'https://api.royalti.io/royalty/product',
    headers={
      'Authorization': f'Bearer {token}'
    },
  )

  data = response.json()
  print(data)
  ```

  ```bash cURL theme={null}
  curl -X GET https://api.royalti.io/royalty/product \
    -H "Authorization: Bearer YOUR_TOKEN" \

  ```
</CodeGroup>


## OpenAPI

````yaml get /royalty/product
openapi: 3.0.0
info:
  title: Royalti.io API
  description: "# Royalti API\r\n\r\nThis is the Royalti music royalty management platform API server.\r\n\r\n## Overview\r\n\r\nThe Royalti API provides comprehensive music royalty management services including:\r\n- Music publishing and writer management\r\n- Royalty processing and analytics\r\n- DDEX integration for music industry standards\r\n- File processing and pattern recognition\r\n- Payment processing and distribution\r\n\r\n## Authentication\r\n\r\nThe API uses JWT-based authentication with multiple protection levels:\r\n- Public endpoints for basic operations\r\n- Protected endpoints requiring valid JWT tokens\r\n- Admin endpoints for administrative functions\r\n\r\n## Features\r\n\r\n- Multi-dimensional royalty analytics\r\n- CWR (Collective Works Registration) support\r\n- DDEX integration for music metadata\r\n- Advanced file processing with pattern recognition\r\n- Real-time data processing with queue system"
  version: 2.6.0
  contact:
    name: Royalti.io Support
    email: support@royalti.io
    url: https://royalti.io
  license:
    name: Proprietary
    url: https://royalti.io/terms
servers:
  - url: https://api.royalti.io
    description: Production server
  - url: https://api-dev.royalti.io
    description: Development server
  - url: http://localhost:8084
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Accounting
    description: Accounting and financial transaction operations
  - name: DDEX
    description: DDEX operations (ERN/MEAD, messages, delivery, providers)
  - name: Label
    description: Label management operations
  - name: Internal Webhooks
    description: Internal system webhooks for royalty processing and downloads
  - name: Payment Webhooks
    description: Payment processor webhook endpoints
  - name: Billing Webhooks
    description: Stripe billing and subscription webhooks
  - name: Infrastructure Webhooks
    description: Cloudflare domain and SSL webhooks
  - name: Distribution Webhooks
    description: Digital distribution platform webhooks (FUGA)
paths:
  /royalty/product:
    get:
      tags:
        - Royalties
      summary: Get Royalties grouped by product
      description: >-
        **Get Royalties grouped by product**


        This endpoint retrieves royalty data grouped by product (albums,
        singles, etc.), showing revenue breakdown per product.
      parameters:
        - name: artists
          in: query
          required: false
          description: Filters the data by artist. Comma-separated list of artist IDs
          schema:
            type: string
        - name: user
          in: query
          required: false
          description: Filters the data by user. Specifies a user ID
          schema:
            type: string
            format: uuid
        - name: country
          in: query
          required: false
          description: Filter the data by country. Comma-separated values
          schema:
            type: string
        - name: dsp
          in: query
          required: false
          description: Filters by DSP (Digital Service Provider). Comma-separated values
          schema:
            type: string
        - name: start
          in: query
          required: false
          description: Start date of the period (YYYY-MM-DD format)
          schema:
            type: string
            format: date
        - name: end
          in: query
          required: false
          description: End date of the period (YYYY-MM-DD format)
          schema:
            type: string
            format: date
        - name: type
          in: query
          required: false
          description: Filters by sale type. Comma-separated values
          schema:
            type: string
        - name: aggregator
          in: query
          required: false
          description: Filters by aggregator. Comma-separated values
          schema:
            type: string
        - name: table_name
          in: query
          required: false
          description: >-
            Filters by data source table name. Comma-separated values for
            multiple tables
          schema:
            type: string
          example: africori_202411,symphonic_202304
        - name: isrc
          in: query
          required: false
          description: >-
            Filters by ISRC (International Standard Recording Code).
            Comma-separated values
          schema:
            type: string
        - name: periodFilterType
          in: query
          required: false
          description: Filters by either 'accounting' or 'sale' period
          schema:
            type: string
            enum:
              - accounting
              - sale
        - name: page
          in: query
          required: false
          description: Page number for pagination
          schema:
            type: integer
            minimum: 1
        - name: size
          in: query
          required: false
          description: Number of items per page
          schema:
            type: integer
            minimum: 1
            maximum: 100
      responses:
        '200':
          description: Successfully retrieved royalty data by product
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/ProductAnalytics'
                  totalItems:
                    type: integer
                    description: Total number of items (when paginated)
                  totalPages:
                    type: integer
                    description: Total number of pages (when paginated)
                  currentPage:
                    type: integer
                    description: Current page number (when paginated)
                  filteredItems:
                    type: integer
                    description: Number of items in current page (when paginated)
              example:
                results:
                  - id: 1
                    Release_Name: Greatest Hits Album
                    displayArtist: Main Artist
                    type: Album
                    Royalty: 3256.75
                    Count: 325000
                    RoyaltyPercentage: 15.2
                    CountPercentage: 10.5
                    RatePer1K: 10.02
                    PreviousRoyalty: 2826.15
                    PreviousCount: 293850
                  - id: 2
                    Release_Name: Latest Single
                    displayArtist: Artist Feature
                    type: Single
                    Royalty: 1756.5
                    Count: 175000
                    RoyaltyPercentage: 6.8
                    CountPercentage: 4.2
                    RatePer1K: 10.03
                    PreviousRoyalty: 1644.25
                    PreviousCount: 168000
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    ProductAnalytics:
      type: object
      properties:
        id:
          type: integer
          description: Product ID from database
        Release_Name:
          type: string
          description: Product title/release name
        displayArtist:
          type: string
          description: Display artist name
        type:
          type: string
          description: Product type
        Royalty:
          type: number
          description: Total royalty for this product
        Count:
          type: integer
          description: Total plays/sales for this product
        RoyaltyPercentage:
          type: number
          description: Percentage change in royalty
        CountPercentage:
          type: number
          description: Percentage change in count
        RatePer1K:
          type: number
          description: Rate per 1000 plays
        PreviousRoyalty:
          type: number
          description: Previous period royalty
        PreviousCount:
          type: integer
          description: Previous period count
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            details:
              type: array
              items:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Authorization header using the Bearer scheme. Format: "Bearer
        {token}"

````