---
name: "getDpLogDays"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.2" }
title: "getDpLogDays - Get Daily DP Report Statistics"
---

## getDpLogDays

> [VERSION] @ray-js/ray >= 1.5.2

### Description

Get daily reporting statistics of DPs within a specified date range

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `IGetDpLogDays` | Yes | Request parameters |

### Return Value

Type: `Promise<IGetDpLogDaysResponse>`

Daily statistics data, including total count, list of dates, and the corresponding values per day

##### IGetDpLogDaysResponse

| Property | Type | Description |
| --- | --- | --- |
| `total` | `string` | Total count |
| `values` | `string[]` | Value per day |
| `days` | `string[]` | List of days |

### Referenced Types

##### `interface` IGetDpLogDays

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `dpId` | `string` | DP ID |
| `type` | `string` | Statistic type: sum, min, or max |
| `startDay` | `string` | Start date in yyyyMMdd format, e.g., 20180529 |
| `endDay` | `string` | End date in yyyyMMdd format, e.g., 20180531 |


### Examples

#### Basic usage

```ts
import { getDpLogDays } from '@ray-js/ray';

getDpLogDays({
  devId: 'vdevo169477319679442',
  dpId: '1',
  startDay: '20240101',
  endDay: '20240131',
  type: 'sum',
}).then((res) => {
  console.log('Daily statistics:', res);
}).catch((error) => {
  console.error(error);
});
```
