---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://docs.sendcorex.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://docs.sendcorex.com/llms.txt"
---

Source: https://docs.sendcorex.com/ja/api-reference/counters/reading/get-month

カウンター：読み取り

# 月の取得

暦月1か月分（UTC）。`month`がなければ今月です。

POST `https://g.sendcorex.com/v1/counters` command: get_month

API keyにscope `counters:read`が必要です。

## 引数

- `month` string 任意
月（`YYYY-MM`）。既定はUTCでの今月です。
例： `"2026-10"`

## クイックスタート

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/counters',
  {
    commands: [
      {
        command: "get_month",
        args: {
          month: "2026-10"
        }
      }
    ]
  },
  { headers: { Authorization: process.env.SENDCOREX_API_KEY } },
);

const [result] = response.data.results;
if (result.type !== 'SUCCESS') throw new Error(`${result.code}: ${result.message}`);
console.log(result.data);
```

## レスポンス

```
{
  "type": "SUCCESS",
  "results": [
    {
      "command": "get_month",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 18,
      "data": {
        "month": "2026-10",
        "delivered": 48210,
        "bounced": 612,
        "blocked": 88,
        "complaints": 9,
        "rate_limited": 140,
        "total": 49050,
        "delivered_rate": 98.29,
        "bounce_rate": 1.25,
        "blocked_rate": 0.18,
        "complaint_rate": 0.02,
        "rate_limited_rate": 0.29
      }
    }
  ]
}
```

### レスポンスの項目

- `month`
月（`YYYY-MM`）。
- `delivered`
受信側サーバーが受け付けたメール。
- `bounced`
届かなかったメール：受信側サーバーに拒否された、キューで期限切れになった、または送信前に止められたもの。それぞれの理由は「バウンスと苦情」にあります。
- `blocked`
配信時に受信側サーバーがスパム、ポリシー、レピュテーションを理由に拒否したメール。アドレスに問題はなく、問題は送信のほうです（リストの質、量、認証、内容）。
- `complaints`
メールを受け取ったあとにスパムとして報告した受信者：フィードバックループ（Outlook、Yahooなど）と不正利用の報告。これらのメールはすでに配信済みとしてカウントされているため、`total`には含まれません。
- `rate_limited`
受信側サーバーが受け取りを延期し続け、再試行を使い切ったメール。
- `total`
`delivered` + `bounced` + `blocked` + `rate_limited`：結果が出たすべてのメール。
- `delivered_rate / bounce_rate / blocked_rate / complaint_rate / rate_limited_rate`
各カウンターの`total`に対する割合（小数点以下2桁）。`total`が`0`のときは`0`。

## エラー

HTTPレベルのエラーは`type`、`code`、`message`を返します。CMDと表示されたエラーは、HTTP 200でコマンドの結果内に返ります。

- 401`INVALID_API_KEY`
API keyが存在しないか、取り消されたか、ダッシュボードで無効化されています。
- 429`RATE_LIMITED`
同じIP + API keyで毎秒15リクエストまたは同時15件を超えました。Retry-Afterの秒数だけ待ってください。
- CMD`MISSING_SCOPE`
API keyに`counters:read`がありません。
- CMD`INVALID_ARGS`
引数が無効です：YYYY-MMでない月、YYYY-MM-DDでない日、不明なタイムゾーン、toより後のfrom、長すぎる範囲…
- CMD`INTERNAL`
サーバーエラー。詳細はサーバーのログにのみ記録されます。
