> ## 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 month (Accounting period)

> **Get Royalties grouped by month (Accounting period)**

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

## Description

**Get Royalties grouped by month (Accounting period)**

This endpoint retrieves royalty data grouped by accounting period months, providing insights into revenue patterns over time.

## Code Examples

<CodeGroup>
  ```javascript Node.js theme={null}
  const response = await fetch('https://api.royalti.io/royalty/accountingperiod', {
    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/accountingperiod',
    headers={
      'Authorization': f'Bearer {token}'
    },
  )

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

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

  ```
</CodeGroup>


## OpenAPI

````yaml get /royalty/accountingperiod
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/accountingperiod:
    get:
      tags:
        - Royalties
      summary: Get Royalties grouped by month (Accounting period)
      description: >-
        **Get Royalties grouped by month (Accounting period)**


        This endpoint retrieves royalty data grouped by accounting period
        months, providing insights into revenue patterns over time.
      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: upc
          in: query
          required: false
          description: Filters by UPC (Universal Product Code). Comma-separated values
          schema:
            type: string
        - 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: Filter by accounting period or sale period (default accounting)
          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 accounting period
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/MonthAnalytics'
                  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:
                  - Month: 2023-01
                    Royalty: 1254.5
                    Count: 125000
                    RoyaltyPercentage: 5.2
                    CountPercentage: -2.1
                    RatePer1K: 10.03
                    PreviousRoyalty: 1192.4
                    PreviousCount: 127650
                  - Month: 2023-02
                    Royalty: 1456.75
                    Count: 135000
                    RoyaltyPercentage: 16.1
                    CountPercentage: 7.4
                    RatePer1K: 10.79
                    PreviousRoyalty: 1254.5
                    PreviousCount: 125000
        '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:
    MonthAnalytics:
      type: object
      properties:
        Month:
          type: string
          description: Month (YYYY-MM format)
        Royalty:
          type: number
          description: Total royalty for the month
        Count:
          type: integer
          description: Total plays/sales for the month
        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}"

````