# Get unique users per service
URL: https://musicapi.com/docs/reference/usage-users-per-type.md

`GET https://api.musicapi.com/public/analytics/users-per-type`

Section: Billing and usage.
Product: MusicAPI Core and MusicAPI Managed Transfers.
Auth: Basic, DocsSession (any one of them). Use Basic with your Client ID and Client Secret from your server only.

The number of connected users of each music service that made at least one request in the range. Requires Client Secret authentication. Not billed.

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `startDate` | string | yes | The first day of the range (UTC), for example `2026-10-01`. The day counts. |
| `endDate` | string | yes | The last day of the range (UTC). The day counts, so `startDate` = `endDate` is one day. The range may hold at most 366 days, or 31 days for an `hourly` series. |

## Response 200

The service with the most users first.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | object[] | yes |  |
| `data[].integration_type` | string | yes | The music service. |
| `data[].unique_users` | string | yes | Connected users of this service that made at least one request. A decimal string, so a large count stays exact. |
| `totalUniqueUsers` | number | yes | The sum of `unique_users` over all services. |

```json
{
  "data": [
    {
      "integration_type": "string",
      "unique_users": "string"
    }
  ],
  "totalUniqueUsers": 0
}
```

## Errors

- 400: A date is missing or not valid, `endDate` is before `startDate`, or the range is too long.
- 401: The request has no credentials.
- 403: The request does not use Client Secret authentication.
- 429: Your account sent more calls this minute than its rate limit allows.

## Example

```bash
curl https://api.musicapi.com/public/analytics/users-per-type \
  -u "$MUSICAPI_CLIENT_ID:$MUSICAPI_CLIENT_SECRET"
```
