---
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-hourly

カウンター：読み取り

# 時間別の取得

今の送信状況を見るための1時間ごと（UTC）の数値。送信があった時間だけが表示されます。

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

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

1コマンドで最大7日。

## 引数

- `from` string 必須
開始（RFC 3339）。その時刻を含む1時間も対象です。
例： `"2026-10-17T00:00:00Z"`
- `to` string 必須
終了（RFC 3339）。その時刻を含む1時間も対象です。
例： `"2026-10-17T23:59:59Z"`

## クイックスタート

```
import axios from 'axios';

const response = await axios.post(
  'https://g.sendcorex.com/v1/counters',
  {
    commands: [
      {
        command: "get_hourly",
        args: {
          from: "2026-10-17T00:00:00Z",
          to: "2026-10-17T23:59:59Z"
        }
      }
    ]
  },
  { 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_hourly",
      "id": "0",
      "type": "SUCCESS",
      "took_ms": 18,
      "data": {
        "hourly": [
          {
            "hour": "2026-10-17T06:00:00Z",
            "delivered": 182,
            "bounced": 3,
            "blocked": 1,
            "complaints": 0,
            "rate_limited": 0
          }
        ]
      }
    }
  ]
}
```

### レスポンスの項目

- `hourly`
送信があった時間ごとに1件、古い順。
- `hourly[].hour`
その時間の開始時刻（RFC 3339、UTC）。
- `hourly[].delivered / bounced / blocked / complaints / rate_limited`
その時間のカウンター（totalと割合はありません）。

## エラー

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`
サーバーエラー。詳細はサーバーのログにのみ記録されます。
