# Retrieve metrics

`opensend metrics get`

Volume, delivery and engagement for a period: totals, rates, one row a day and one row a domain.

Needs the scope: `metrics:read`

## Flags

- `--range` (string): The period to count: `today`, `week`, `month`, `year`, `all` or `custom`. Without it you get the last month. One of: `today`, `week`, `month`, `year`, `all`, `custom`.
- `--from` (string): The first day of a `custom` period, as a date such as `2026-11-01`.
- `--to` (string): The last day of a `custom` period, as a date such as `2026-11-30`.
- `--domain` (string): Only mail sent from this domain. Up to 120 characters.

## Returns

The command prints the answer: as JSON when its output goes to a file or another program, and as a table or a list of fields in a terminal. When the API refuses, the error goes to the error stream and the command ends with a code that names the failure. [Output and scripts](https://opensend.sh/docs/scripting) lists the codes.

- `object` ("metrics"): Always `metrics`.
- `from` (string | null): The start of the period, or `null` when it has no start.
- `to` (string): The end of the period.
- `totals` (object): The counts for the whole period.
- `totals.sent` (integer): How many emails were sent.
- `totals.delivered` (integer): How many were delivered.
- `totals.opened` (integer): How many were opened.
- `totals.clicked` (integer): How many had a link clicked.
- `totals.bounced` (integer): How many bounced.
- `totals.complained` (integer): How many were marked as spam by the recipient.
- `rates` (object): The same counts as fractions, from 0 to 1.
- `rates.delivered` (number): Delivered, as a fraction of what was sent.
- `rates.opened` (number): Opened, as a fraction of what was delivered.
- `rates.clicked` (number): Clicked, as a fraction of what was delivered.
- `rates.bounced` (number): Bounced, as a fraction of what was sent.
- `rates.complained` (number): Complaints, as a fraction of what was sent.
- `days` (object[]): One entry for each day of the period, oldest first.
- `days[].sent` (integer): How many emails were sent.
- `days[].delivered` (integer): How many were delivered.
- `days[].opened` (integer): How many were opened.
- `days[].clicked` (integer): How many had a link clicked.
- `days[].bounced` (integer): How many bounced.
- `days[].complained` (integer): How many were marked as spam by the recipient.
- `days[].day` (string): The day, as `YYYY-MM-DD` in UTC.
- `domains` (object[]): One entry for each sending domain.
- `domains[].sent` (integer): How many emails were sent.
- `domains[].delivered` (integer): How many were delivered.
- `domains[].opened` (integer): How many were opened.
- `domains[].clicked` (integer): How many had a link clicked.
- `domains[].bounced` (integer): How many bounced.
- `domains[].complained` (integer): How many were marked as spam by the recipient.
- `domains[].domain` (string): The sending domain.

## Example

CLI:

```bash
opensend metrics get --range week
```

Answer:

```json
{
  "object": "metrics",
  "from": "2026-11-21T00:00:00.000Z",
  "to": "2026-11-27T09:30:00.000Z",
  "totals": {
    "sent": 9913,
    "delivered": 9787,
    "opened": 4708,
    "clicked": 1496,
    "bounced": 126,
    "complained": 7
  },
  "rates": {
    "delivered": 0.9873,
    "opened": 0.481,
    "clicked": 0.1529,
    "bounced": 0.0127,
    "complained": 0.0007
  },
  "days": [
    {
      "sent": 1449,
      "delivered": 1430,
      "opened": 688,
      "clicked": 219,
      "bounced": 19,
      "complained": 1,
      "day": "2026-11-21"
    },
    {
      "sent": 1335,
      "delivered": 1318,
      "opened": 634,
      "clicked": 201,
      "bounced": 17,
      "complained": 1,
      "day": "2026-11-22"
    },
    {
      "sent": 1463,
      "delivered": 1444,
      "opened": 694,
      "clicked": 221,
      "bounced": 19,
      "complained": 1,
      "day": "2026-11-23"
    },
    {
      "sent": 1391,
      "delivered": 1374,
      "opened": 661,
      "clicked": 210,
      "bounced": 17,
      "complained": 1,
      "day": "2026-11-24"
    },
    {
      "sent": 1492,
      "delivered": 1473,
      "opened": 709,
      "clicked": 225,
      "bounced": 19,
      "complained": 1,
      "day": "2026-11-25"
    },
    {
      "sent": 1363,
      "delivered": 1346,
      "opened": 648,
      "clicked": 206,
      "bounced": 17,
      "complained": 1,
      "day": "2026-11-26"
    },
    {
      "sent": 1420,
      "delivered": 1402,
      "opened": 674,
      "clicked": 214,
      "bounced": 18,
      "complained": 1,
      "day": "2026-11-27"
    }
  ],
  "domains": [
    {
      "sent": 7330,
      "delivered": 7271,
      "opened": 3708,
      "clicked": 1236,
      "bounced": 59,
      "complained": 0,
      "domain": "mail.example.com"
    },
    {
      "sent": 2304,
      "delivered": 2237,
      "opened": 827,
      "clicked": 201,
      "bounced": 67,
      "complained": 7,
      "domain": "news.example.com"
    },
    {
      "sent": 279,
      "delivered": 279,
      "opened": 173,
      "clicked": 59,
      "bounced": 0,
      "complained": 0,
      "domain": "example.org"
    }
  ]
}
```
