> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-jp/deploy/vision-events/query-events.md).

# Query Events

## イベントをクエリしてフィルタする

Vision Events ダッシュボードのフィルタを使って特定のイベントを見つけるか、REST API でプログラムからクエリできます。

### ダッシュボードでイベントを閲覧

#### Use Case を選択

Vision Events ページから Use Case をクリックすると、そのイベントを表示できます。イベントは新しい順に表示されます。

<figure><img src="/files/7edb5cb53e115468c51a739a7d680c3decb80316" alt="" width="375"><figcaption></figcaption></figure>

#### イベントをフィルタ

イベント一覧の上部にあるフィルタコントロールを使って、次の条件で結果を絞り込みます:

* **日付範囲** — 開始と終了のタイムスタンプ
* **イベントタイプ** — quality\_check, inventory\_count, safety\_alert, custom, operator\_feedback
* **デバイス** — device ID で絞り込む
* **ストリーム** — stream または camera ID で絞り込む
* **Workflow** — イベントを生成した workflow で絞り込む
* **Detection** — 検出されたオブジェクトクラスで絞り込む。必要に応じて confidence threshold を指定できます
* **フィードバックステータス** — correct、incorrect、inconclusive、またはフィードバックなし
* **カスタムメタデータ** — 任意のカスタムメタデータフィールドと値で絞り込む
* **警告** — ingestion warnings があったイベントのみを表示

さらに、イベント詳細のサイドバーにある値（device ID、stream、quality check の結果、カスタムメタデータの値など）をクリックすると、すばやくフィルタとして追加できます。

フィルタチップは編集可能です -- アクティブなフィルタチップをクリックすると、削除して再追加しなくても値や演算子を変更できます。

フィルタが適用されると、 **合計件数** 一致するイベントの件数が結果一覧の上部に表示されます。この件数はイベント一覧とは独立して更新されるため、イベントの読み込み中でもフィルタに一致するイベント数を確認できます。

<figure><img src="/files/00d41330baaf4b32a4e1b3531b87a99a9d4be841" alt="" width="375"><figcaption></figcaption></figure>

#### イベント詳細を表示

一覧の任意のイベントをクリックすると、詳細をすべて表示できます:

* 元画像と出力画像
* すべての元メタデータ（device、stream、workflow）
* オブジェクト検出、分類、セグメンテーションとそれぞれの confidence score
* イベントタイプ固有のデータ（例: pass/fail の結果、アイテム数、アラートの重大度）
* カスタムメタデータの key-value ペア

**Draw Detections**

イベントに予測データ（object detections、instance segmentations、または keypoints）が含まれている場合、画像の上に「Draw Detections」チェックボックスが表示されます。有効にすると、元画像の上に bounding boxes、segmentation polygons、ラベルと confidence scores を重ねて表示できます。

これは、パイプラインが元の入力画像のみを保存し、別の出力画像を保存せずにモデルが検出した内容を可視化したい場合に便利です。

{% hint style="info" %}
個別の出力画像を表示しているときは、その画像にすでに検出結果が描画されているため、このチェックボックスは表示されません。
{% endhint %}

### API でイベントをクエリする

クエリエンドポイントはダッシュボードと同じフィルタに加え、カーソルベースのページネーションもサポートします。パラメータとレスポンスフィールドの完全な一覧については、次を参照してください: [Vision Events API Reference](https://docs.roboflow.com/developer/rest-api/vision-events).

#### 基本クエリ

```bash
curl -X POST "https://api.roboflow.com/vision-events/query" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer YOUR_API_KEY" \\
  -d '{
    "useCaseId": "assembly-line-qa",
    "startTime": "2026-03-01T00:00:00Z",
    "endTime": "2026-03-31T23:59:59Z",
    "limit": 25
  }'
```

**レスポンス:**

```json
{
  "events": [
    {
      "eventId": "evt-789ghi",
      "eventType": "quality_check",
      "timestamp": "2026-03-30T14:30:00.000Z",
      "deviceId": "factory-cam-01",
      "streamId": "line-3",
      "images": [],
      "eventData": { "result": "fail" },
      "customMetadata": {
        "line_id": "line-3",
        "shift": "morning",
        "part_number": "PN-4421"
      }
    }
  ],
  "nextCursor": "eyJ0cyI6IjIwMjYtMDMtMzAifQ==",
  "hasMore": true
}
```

#### ページネーション

結果はカーソルを使ってページ分割されます。レスポンスに `nextCursor` の値が含まれており、 `hasMore` が `true`、次のリクエストでそのカーソルを渡すと次のページを取得できます:

```bash
curl -X POST "https://api.roboflow.com/vision-events/query" \\
  -H "Content-Type: application/json" \\
  -H "Authorization: Bearer YOUR_API_KEY" \\
  -d '{
    "useCaseId": "assembly-line-qa",
    "limit": 25,
    "cursor": "eyJ0cyI6IjIwMjYtMDMtMzAifQ=="
  }'
```

次ページが取得できなくなるまで続けます `hasMore` が `false`.

#### イベントタイプでフィルタ

単一のイベントタイプをクエリします:

```json
{
  "useCaseId": "assembly-line-qa",
  "eventType": "quality_check"
}
```

または複数のイベントタイプ（最大20件）:

```json
{
  "useCaseId": "assembly-line-qa",
  "eventTypes": ["quality_check", "operator_feedback"]
}
```

#### フィードバックステータスでフィルタ

使用する `feedbackStatus` を使って、オペレーターがレビューしたかどうかと評価内容に基づいてイベントを検索します:

```json
{
  "useCaseId": "assembly-line-qa",
  "feedbackStatus": ["incorrect", "none"]
}
```

有効な値: `correct`, `incorrect`, `inconclusive`, `none`。これを使用して `none` まだレビューされていないイベントを見つけるために。

#### カスタムメタデータでフィルタ

使用する `customMetadataFilters` を使って、独自のメタデータフィールドでイベントを絞り込めます:

```json
{
  "useCaseId": "assembly-line-qa",
  "customMetadataFilters": [
    { "key": "line_id", "operator": "eq", "value": "line-3" },
    { "key": "shift", "operator": "eq", "value": "morning" }
  ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-jp/deploy/vision-events/query-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
