Get run results
/runs/{run_id}/resultsReturns what a succeeded run produced: an indicator's points, a definition's events or a study's result blocks. The shape follows the run's kind.
Scope | Heavy call | Long poll | CLI |
|---|---|---|---|
| No | No |
|
Guidance
Call it only after Get a run says
succeeded. A run still going answers409 run_not_finished, and so does one that failed or was cancelled, since it has no results.Narrow before you page:
outputsfor an indicator,eventfor a definition, andfromandtofor both. For an indicator,limitapplies to each output, andnext_cursoris set while any output has more points.A study answers in one response, capped at 1 MB. Metrics come back inline; other blocks come back with
omitted: trueuntil you name them inkeys, or ask for all withfull=true. Iftruncatedistrue, ask for fewer keys at once.For a large study table, fetch it alone as CSV:
keys=<key>&format=csv. Study CSV needs exactly one key, and its data must be a list of rows.A CSV answer carries no
next_cursor. To page indicator or definition CSV, pass the number of rows already read ascursor, and stop at a page shorter thanlimit.Indicator and definition results are kept for 7 days, then this answers
410. Run it again, or save what you need before then. Study results do not expire.A
fromortothat is not RFC 3339 is ignored, not refused, so check the format when a filter seems to do nothing.
Path parameters
Name | Type | Description |
|---|---|---|
| string | A run id, |
Query parameters
Name | Type | Required | Default | Description |
|---|---|---|---|---|
| string | No | All | Indicator only. Comma-separated output ids |
| string | No | All | Definition only. One event id |
| string | No | None | Study only. Comma-separated result keys to return in full |
| boolean | No |
| Study only. |
| string | No | None | Indicator and definition. RFC 3339; keeps points and events at or after it |
| string | No | None | Indicator and definition. RFC 3339; keeps points and events before it |
| string | No |
|
|
| integer | No | 5,000 | Indicator and definition. Most 50,000. For an indicator it applies to each output |
| string | No | None | Indicator and definition. From the previous page's |
Response
200 with a body that follows the run's kind. With format=csv, the answer is text/csv.
Indicator
Field | Type | Description |
|---|---|---|
| string |
|
| string | The run id |
| array of object | One per output, sorted by id: |
| string or null | Set when any output has more points past this page |
Output kind is line, area, baseline, histogram, fill, markers, labels, hlines, ranges or trendlines. Every point has t in Unix seconds, and the rest follows the kind:
Output kind | Point |
|---|---|
|
|
|
|
|
|
|
|
As CSV: one row per time with a time column, one column per line, area, baseline or histogram output, and id.top and id.bottom for a fill. Markers, labels, hlines, ranges and trendlines are left out.
Definition
Field | Type | Description |
|---|---|---|
| string |
|
| string | The run id |
| array of Event | This page of events |
| string or null | Pass it back as |
As CSV: the same columns as List events.
Study
Field | Type | Description |
|---|---|---|
| string |
|
| string | The run id |
| array of object | One block per result. Fields below |
| boolean |
|
Each block:
Field | Type | Description |
|---|---|---|
| string | The result key |
| string | The block kind, such as |
| string | The block title, or |
| any | The block's data. Always present for |
| boolean |
|
| integer | The number of rows in the full data, when the data is a list |
As CSV: exactly one key in keys, whose data must be a list of rows, with one column per field, sorted. Results and stats says what each block kind holds.
Status codes
Status | Code | Meaning |
|---|---|---|
| - | The results, in the shape of the run's kind |
|
| Study CSV without exactly one key, or the key's data is not a list of rows |
|
| You have no run with that id, or study CSV named a key the study does not have |
|
| The run is still |
|
| The indicator or definition run's results are more than 7 days old. Run it again |
