---
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://segmentstream.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# segmentstream ontology query-metrics

Query metrics of the deployed ontology from a JSON document.

## Usage

Command syntax

```
segmentstream ontology query-metrics [OPTIONS] [ENTITY]
```

Query metrics of the deployed ontology from a JSON document.  The query names metrics as entity.metric, or a metric of the model by its bare name, and dimensions as entity.property. With ENTITY, it queries that entity with names relative to it. It is sent as written; the platform checks it.  Example, with query.json: {"metrics": \["order.orders"], "dimensions": \["customer.segment"], "orderBy": \[{"metric": "order.orders", "direction": "desc"}]} segmentstream ontology query-metrics --query query.json --output csv

## Options

- `--query FILE|-`

  Read the query JSON from a file or stdin with '-' \[required]

- `--output [table|json|csv]`

  \[default: table]

- `--workspace TEXT`

  Override the linked workspace

- `--api-url TEXT`

  SegmentStream control-plane origin

- `--organization ORG-ID`

  Organization for this command

- `--help`

  Show this message and exit.

[Read as Markdown ↗](https://segmentstream.com/docs/cli/ontology/query-metrics.md)
